MTDomeCsc#
- class lsst.ts.mtdome.MTDomeCsc(config_dir=None, initial_state=State.STANDBY, simulation_mode=ValidSimulationMode.NORMAL_OPERATIONS, override='', start_periodic_tasks=True)#
Bases:
ConfigurableCscUpper level Commandable SAL Component to interface with the Simonyi Survey Telescope Dome lower level components.
- Parameters:
config_dir (
string) – The configuration directoryinitial_state (
salobj.State) – The initial state of the CSCsimulation_mode (
int) – Simulation mode.override (
str, optional) – Override of settings ifinitial_stateisState.DISABLEDorState.ENABLED.start_periodic_tasks (
bool) – Start the periodic tasks or not. Defaults toTrue. Unit tests may set this toFalse.
Notes
Simulation Modes
Supported simulation modes:
0: regular operation
1: simulation mode: start a mock TCP/IP MTDome controller and talk to it
2: simulation mode: talk to a running TCP/IP MTDome controller
In simulation mode 0, the site specific configuration will be sent to the MTDome controller. In both simulation modes 1 and 2, a configuration with mock devices will be sent to the MTDome controller. This allows for testing and/or debugging the MTDome CSC.
Attributes Summary
Methods Summary
call_method(method, **kwargs)Generic method for error handling when calling a method.
Disconnect from the TCP/IP controller, if connected, and stop the mock controller, if running.
configure(config)Configure the CSC.
connect()Connect to the dome controller's TCP/IP port.
Disconnect from the TCP/IP controller, if connected, and stop the mock controller, if running.
do_closeLouvers(data)Close Louvers.
do_closeShutter(data)Close Shutter.
do_crawlAz(data)Crawl AZ.
do_crawlEl(data)Crawl El.
do_exitFault(data)Indicate that all hardware errors, leading to fault state, have been resolved.
do_fans(data)Set the speed of the fans.
do_home(data)Search the home position of the Aperture Shutter indicated by the value of
directionindata.do_inflate(data)Inflate or deflate the inflatable seal.
do_moveAz(data)Move AZ.
do_moveEl(data)Move El.
do_openShutter(data)Open Shutter.
do_park(data)Park, meaning stop all motion and engage the brakes and locking pins.
do_resetDrivesAz(data)Reset one or more AZ drives.
do_resetDrivesShutter(data)Reset one or more Aperture Shutter drives.
do_setLouvers(data)Set the louver positions.
do_setOperationalMode(data)Indicate that one or more sub_systems need to operate in degraded (true) or normal (false) state.
Set the power management mode.
do_setTemperature(data)Set Temperature.
do_setZeroAz(data)Take the current position of the dome as zero.
do_stop(data)Stop all motion and engage the brakes if indicated in the data.
end_enable(data)End do_enable; called after state changes but before command acknowledged.
Get the name of the configuration package, e.g. "ts_config_ocs".
go_fault(method)Convenience method to go to FAULT state.
Override of the handle_summary_state function to connect or disconnect to the lower level components (or the mock_controller) when needed.
log_status_exception(status)Generic method for publishing the telemetry and events of a lower level component.
set_brakes_engaged_bit(motion_state, index)Set a bit on the brakes engaged bitmask.
status_amcs(status)AMCS status command.
status_apscs(status)ApSCS status command.
status_cbcs(status)CBCS status command.
status_cscs(status)CSCS status command.
status_lcs(status)LCS status command.
status_llc(status)LLC status command.
status_lwscs(status)LWSCS status command.
status_moncs(status)MonCS status command.
status_rad(status)RAD status command.
status_thcs(status)ThCS status command.
Attributes Documentation
- connected#
- enable_cmdline_state = True#
- valid_simulation_modes: Sequence[int] = {0, 1, 2}#
- version = '2.2.5'#
Methods Documentation
- async call_method(method, **kwargs)#
Generic method for error handling when calling a method.
- Parameters:
method (
typing.Callable) – The method that needs generic error handling.kwargs (
typing.Any) – The arguments for the method.
- Raises:
ValuesError – This is an expected error when calling the method fails. All other errors will lead to the CSC going to FAULT state.
- Return type:
- async close_tasks()#
Disconnect from the TCP/IP controller, if connected, and stop the mock controller, if running.
- Return type:
- async configure(config)#
Configure the CSC.
- Parameters:
config (
object) – The configuration, as described by the config schema, as a struct-like object.- Return type:
Notes
Called when running the
startcommand, just before changing summary state fromState.STANDBYtoState.DISABLED.
- async connect()#
Connect to the dome controller’s TCP/IP port.
Start the mock controller, if simulating.
- Return type:
- async disconnect()#
Disconnect from the TCP/IP controller, if connected, and stop the mock controller, if running.
- Return type:
- async do_closeLouvers(data)#
Close Louvers.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async do_closeShutter(data)#
Close Shutter.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async do_crawlAz(data)#
Crawl AZ.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async do_crawlEl(data)#
Crawl El.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async do_exitFault(data)#
Indicate that all hardware errors, leading to fault state, have been resolved.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async do_fans(data)#
Set the speed of the fans.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async do_home(data)#
Search the home position of the Aperture Shutter indicated by the value of
directionindata.This is necessary in case the ApSCS (Aperture Shutter Control system) was shutdown with the Aperture Shutter not fully open or fully closed.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async do_inflate(data)#
Inflate or deflate the inflatable seal.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async do_moveAz(data)#
Move AZ.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async do_moveEl(data)#
Move El.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async do_openShutter(data)#
Open Shutter.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async do_park(data)#
Park, meaning stop all motion and engage the brakes and locking pins.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async do_resetDrivesAz(data)#
Reset one or more AZ drives. This is necessary when exiting from FAULT state without going to Degraded Mode since the drives don’t reset themselves.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async do_resetDrivesShutter(data)#
Reset one or more Aperture Shutter drives. This is necessary when exiting from FAULT state without going to Degraded Mode since the drives don’t reset themselves.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async do_setLouvers(data)#
Set the louver positions.
This method checks if all commanded louvers are enabled and will reject the command if any are not.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async do_setOperationalMode(data)#
Indicate that one or more sub_systems need to operate in degraded (true) or normal (false) state.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async do_setPowerManagementMode(data)#
Set the power management mode.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Raises:
salobj.ExpectedError – In case data.mode is equal to NO_POWER_MANAGEMENT.
- Return type:
Notes
In case data.mode is equal to the current mode, a warning is logged and the new mode is ignored.
- async do_setTemperature(data)#
Set Temperature.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async do_setZeroAz(data)#
Take the current position of the dome as zero. This is necessary as long as the racks and pinions on the drives have not been installed yet to compensate for slippage of the drives.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async do_stop(data)#
Stop all motion and engage the brakes if indicated in the data. Also disengage the locking pins if engaged.
- Parameters:
data (
salobj.BaseMsgType) – Contains the data as defined in the SAL XML file.- Return type:
- async end_enable(data)#
End do_enable; called after state changes but before command acknowledged.
- Parameters:
data (
salobj.BaseMsgType) – Command data.- Return type:
- static get_config_pkg()#
Get the name of the configuration package, e.g. “ts_config_ocs”.
- Return type:
- async go_fault(method)#
Convenience method to go to FAULT state.
- async handle_summary_state()#
Override of the handle_summary_state function to connect or disconnect to the lower level components (or the mock_controller) when needed.
- Return type:
- async send_llc_status_telemetry_and_events(llc_name, status, topic)#
Generic method for publishing the telemetry and events of a lower level component.
- Parameters:
llc_name (
LlcName) – The name of the lower level component.status (
dict[str,typing.Any]) – The status.topic (SAL topic) – The SAL topic to publish the telemetry to.
- Return type:
- async set_brakes_engaged_bit(motion_state, index)#
Set a bit on the brakes engaged bitmask.
- async status_amcs(status)#
AMCS status command.
- Parameters:
status (
dict[str,typing.Any]) – The status.- Return type:
- async status_apscs(status)#
ApSCS status command.
- Parameters:
status (
dict[str,typing.Any]) – The status.- Return type:
- async status_cbcs(status)#
CBCS status command.
- Parameters:
status (
dict[str,typing.Any]) – The status.- Return type:
- async status_cscs(status)#
CSCS status command.
- Parameters:
status (
dict[str,typing.Any]) – The status.- Return type:
- async status_lcs(status)#
LCS status command.
- Parameters:
status (
dict[str,typing.Any]) – The status.- Return type:
- async status_llc(status)#
LLC status command.
- Parameters:
status (
dict[str,typing.Any]) – The status.- Return type:
- async status_lwscs(status)#
LWSCS status command.
- Parameters:
status (
dict[str,typing.Any]) – The status.- Return type:
- async status_moncs(status)#
MonCS status command.
- Parameters:
status (
dict[str,typing.Any]) – The status.- Return type:
- async status_rad(status)#
RAD status command.
- Parameters:
status (
dict[str,typing.Any]) – The status.- Return type:
- async status_thcs(status)#
ThCS status command.
- Parameters:
status (
dict[str,typing.Any]) – The status.- Return type: