MockCommand¶
- class lsst.ts.m2com.MockCommand¶
Bases:
object
Mock command to simulate the execution of command in real hardware.
Methods Summary
apply_forces
(message, model, message_event)Apply the forces in addtional to the LUT force.
clear_errors
(message, model, message_event)Clear the system errors.
enable_open_loop_max_limit
(message, model, ...)Enable the maximum limit in open-loop control.
get_inner_loop_control_mode
(message, model, ...)get the inner-loop control mode.
load_configuration
(message, model, message_event)Load the configuration.
move_actuators
(message, model, message_event)Move the actuators.
position_mirror
(message, model, message_event)Position the mirror.
power
(message, model, message_event)Power on/off the motor/communication system.
reboot_controller
(message, model, message_event)Reboot the cell controller.
report_interlock
(model, message_event)Report the interlock status.
reset_actuator_steps
(message, model, ...)Reset the actuator steps.
reset_breakers
(message, model, message_event)Reset the breakers.
reset_force_offsets
(message, model, ...)Reset the actuator force offsets (not LUT force).
run_script
(message, model, message_event)Run the binary script used in the engineering user interface (EUI).
save_mirror_position
(message, model, ...)Save the position of mirror.
set_closed_loop_control_mode
(message, model, ...)Set the closed-loop control mode.
set_configuration_file
(message, model, ...)Set the configuration file.
set_control_parameters
(message, model, ...)Set the closed-loop controller (CLC) control parameters.
set_enabled_faults_mask
(message, model, ...)Set the enabled faults mask.
set_hardpoint_list
(message, model, message_event)Set the hardpoint list.
set_inner_loop_control_mode
(message, model, ...)Set the inner-loop control mode.
set_mirror_home
(message, model, message_event)Set the home of mirror.
set_temperature_offset
(message, model, ...)Set the temperature offset used in the calculation of LUT force.
switch_command_source
(message, model, ...)Switch the command source to be the commandable SAL component (CSC) or engineering user interface (EUI).
switch_digital_output
(message, model, ...)Switch the digital output.
switch_force_balance_system
(message, model, ...)Switch the force balance system.
Methods Documentation
- async apply_forces(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Apply the forces in addtional to the LUT force.
LUT: look-up table.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async clear_errors(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Clear the system errors.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async enable_open_loop_max_limit(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Enable the maximum limit in open-loop control.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async get_inner_loop_control_mode(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
get the inner-loop control mode.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async load_configuration(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Load the configuration.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async move_actuators(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Move the actuators.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async position_mirror(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Position the mirror.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async power(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Power on/off the motor/communication system.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async reboot_controller(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Reboot the cell controller.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async report_interlock(model: MockModel, message_event: MockMessageEvent) None ¶
Report the interlock status.
Parameters¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_eventMockMessageEvent
Instance of MockMessageEvent to write the event.
- model
- async reset_actuator_steps(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Reset the actuator steps.
Notes¶
This will reset the internal state of actuator steps in the cell controller. No intention to simulate this in MockControlOpenLoop class, which will make it too complex.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async reset_breakers(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Reset the breakers.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async reset_force_offsets(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Reset the actuator force offsets (not LUT force).
LUT: look-up table.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async run_script(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Run the binary script used in the engineering user interface (EUI).
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async save_mirror_position(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Save the position of mirror.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async set_closed_loop_control_mode(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Set the closed-loop control mode.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async set_configuration_file(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Set the configuration file.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async set_control_parameters(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Set the closed-loop controller (CLC) control parameters.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async set_enabled_faults_mask(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Set the enabled faults mask.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async set_hardpoint_list(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Set the hardpoint list.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async set_inner_loop_control_mode(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Set the inner-loop control mode.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async set_mirror_home(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Set the home of mirror.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async set_temperature_offset(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Set the temperature offset used in the calculation of LUT force.
LUT: look-up table.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async switch_command_source(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Switch the command source to be the commandable SAL component (CSC) or engineering user interface (EUI).
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async switch_digital_output(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Switch the digital output.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message
- async switch_force_balance_system(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[lsst.ts.m2com.mock.mock_model.MockModel, lsst.ts.m2com.enum.CommandStatus] ¶
Switch the force balance system.
Parameters¶
- message
dict
Command message.
- model
MockModel
Mock model to simulate the M2 hardware behavior.
- message_event
MockMessageEvent
Instance of MockMessageEvent to write the event.
Returns¶
- model
MockModel
Mock model to simulate the M2 hardware behavior.
CommandStatus
Status of command execution.
- message