MockErrorHandler#
- class lsst.ts.m2com.MockErrorHandler(filepath: str | Path | None = None)#
Bases:
ErrorHandlerMock Error Handler class to manage the errors.
Parameters#
- filepath
strorpathlib.PosixPathor None Error list file path. (the default is None)
Attributes#
- enabled_faults_mask
int 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_limit_switch(actuator_id: int, limit_switch_type: LimitSwitchType) None#
Add the new triggered limit switch.
Parameters#
- actuator_id
int Actuator ID: [0, NUM_ACTUATOR).
- limit_switch_typeenum
LimitSwitchType Limit switch type.
Raises#
ValueErrorWhen the actuator ID is not in the range.
- actuator_id
- 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#
boolTrue if there is the triggered limit switch. Otherwise, False.
- limit_switch_typeenum
- 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#
boolTrue if there is the new trigged limit switch. Otherwise, False.
- limit_switch_typeenum
- 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#
setLimit switches to report.
- limit_switch_typeenum
- filepath