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[MockModel, CommandStatus]#

Apply the forces in addtional to the LUT force.

LUT: look-up table.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async clear_errors(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Clear the system errors.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async enable_open_loop_max_limit(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Enable the maximum limit in open-loop control.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async get_inner_loop_control_mode(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

get the inner-loop control mode.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async load_configuration(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Load the configuration.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async move_actuators(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Move the actuators.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async position_mirror(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Position the mirror.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async power(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Power on/off the motor/communication system.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async reboot_controller(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Reboot the cell controller.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async report_interlock(model: MockModel, message_event: MockMessageEvent) None#

Report the interlock status.

Parameters#

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

async reset_actuator_steps(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, 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#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async reset_breakers(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Reset the breakers.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async reset_force_offsets(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Reset the actuator force offsets (not LUT force).

LUT: look-up table.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async run_script(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Run the binary script used in the engineering user interface (EUI).

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async save_mirror_position(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Save the position of mirror.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async set_closed_loop_control_mode(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Set the closed-loop control mode.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async set_configuration_file(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Set the configuration file.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async set_control_parameters(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Set the closed-loop controller (CLC) control parameters.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async set_enabled_faults_mask(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Set the enabled faults mask.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async set_hardpoint_list(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Set the hardpoint list.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async set_inner_loop_control_mode(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Set the inner-loop control mode.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async set_mirror_home(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Set the home of mirror.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async set_temperature_offset(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Set the temperature offset used in the calculation of LUT force.

LUT: look-up table.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async switch_command_source(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Switch the command source to be the commandable SAL component (CSC) or engineering user interface (EUI).

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async switch_digital_output(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Switch the digital output.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.

async switch_force_balance_system(message: dict, model: MockModel, message_event: MockMessageEvent) tuple[MockModel, CommandStatus]#

Switch the force balance system.

Parameters#

messagedict

Command message.

modelMockModel

Mock model to simulate the M2 hardware behavior.

message_eventMockMessageEvent

Instance of MockMessageEvent to write the event.

Returns#

modelMockModel

Mock model to simulate the M2 hardware behavior.

CommandStatus

Status of command execution.