MockErrorHandler#

class lsst.ts.m2com.MockErrorHandler(filepath: str | Path | None = None)#

Bases: ErrorHandler

Mock Error Handler class to manage the errors.

Parameters#

filepathstr or pathlib.PosixPath or None

Error list file path. (the default is None)

Attributes#

enabled_faults_maskint

Enabled faults mask.

Methods Summary

add_new_error(code)

Add the new error code.

add_new_limit_switch(actuator_id, ...)

Add the new triggered limit switch.

add_new_warning(code)

Add the new warning code.

clear()

Clear all errors.

exists_limit_switch(limit_switch_type)

Exists the triggered limit switch (new or reported) or not.

exists_new_limit_switch(limit_switch_type)

Exists the new triggered limit switch (not reported) or not.

get_limit_switches_to_report(limit_switch_type)

Get the limit switches that are not reported yet.

Methods Documentation

add_new_error(code: int) None#

Add the new error code.

Parameters#

codeint

Error code.

add_new_limit_switch(actuator_id: int, limit_switch_type: LimitSwitchType) None#

Add the new triggered limit switch.

Parameters#

actuator_idint

Actuator ID: [0, NUM_ACTUATOR).

limit_switch_typeenum LimitSwitchType

Limit switch type.

Raises#

ValueError

When the actuator ID is not in the range.

add_new_warning(code: int) None#

Add the new warning code.

Parameters#

codeint

Warning code.

clear() None#

Clear all errors.

exists_limit_switch(limit_switch_type: LimitSwitchType) bool#

Exists the triggered limit switch (new or reported) or not.

Parameters#

limit_switch_typeenum LimitSwitchType

Limit switch type.

Returns#

bool

True if there is the triggered limit switch. Otherwise, False.

exists_new_limit_switch(limit_switch_type: LimitSwitchType) bool#

Exists the new triggered limit switch (not reported) or not.

Parameters#

limit_switch_typeenum LimitSwitchType

Limit switch type.

Returns#

bool

True if there is the new trigged limit switch. Otherwise, False.

get_limit_switches_to_report(limit_switch_type: LimitSwitchType) Set[int]#

Get the limit switches that are not reported yet.

Parameters#

limit_switch_typeenum LimitSwitchType

Limit switch type.

Returns#

set

Limit switches to report.