MockMTDomeController#
- class lsst.ts.mtdomecom.MockMTDomeController(port, log, connect_callback=None, communication_error=False, timeout_error=False, keep_running=False)#
Bases:
OneClientReadLoopServerMock MTDome Controller that talks over TCP/IP.
- Parameters:
port (
int) – TCP/IP portlog (
logging.Logger) – The logger to use.connect_callback (
callable, optional) – The callback to use when a client connects.communication_error (
bool, optional) – Is there a communication error with the rotating part (True) or not (False)? This is for unit tests only. The default is False.timeout_error (
bool, optional) – Do command replies timeout of not? The default is False.keep_running (
bool, optional) – Make the server run forever? This is for unit tests only. The default is False.
Notes
There are six sub-systems that are under control:
AMCS: Azimuth Motion Control System
ApSCS: Aperture Shutter Control System
LCS: Louvers Control System
LWSCS: Light and Wind Screen Control System
- MonCS: Monitoring Control System, which interfaces with the MTDome
Interlock System
- ThCS: Thermal Control System, which interfaces with the MTDome
Environment Control System
To start the server:
ctrl = MockMTDomeController(…) await ctrl.start()
To stop the server:
await ctrl.stop()
Known Limitations:
Just a framework that needs to be implemented properly.
Attributes Summary
Methods Summary
Close all louvers.
Close the shutter.
config(system, settings)Configure the lower level components.
crawl_az(velocity)Crawl the dome.
crawl_el(velocity)Crawl the light and windscreen.
Determine the current TAI time.
Exit AMCS from fault state.
Exit LWSCS from fault state.
Exit LCS from fault state.
Exit ApSCS from fault state.
Exit ThCS from fault state.
fans(speed)Enable or disable the fans in the dome.
Stop azimuth motion and engage the brakes.
Stop elevation motion and engage the brakes.
Stop louvers motion and engage the brakes.
Stop shutter motion and engage the brakes.
home(direction)Home the Aperture Shutter, which is the closed position.
inflate(action)Inflate or deflate the inflatable seal.
move_az(position, velocity)Move the dome.
move_el(position)Move the light and windscreen.
Open the shutter.
park()Park the dome.
Read, parse, and dispatch one item of data.
request_and_send_status(llc, llc_name)Request the status of the given Lower Level Component and write it to the requester.
reset_drives_az(reset)Reset one or more AZ drives.
reset_drives_louvers(reset)Reset one or more Louver drives.
reset_drives_shutter(reset)Reset one or more Aperture Shutter drives.
restore()Restore the default configuration of the lower level components.
Set az operational mode to degraded (as opposed to normal).
Set el operational mode to degraded (as opposed to normal).
Set louvers operational mode to degraded (as opposed to normal).
Set monitoring operational mode to degraded (as opposed to normal).
Set shutter operational mode to degraded (as opposed to normal).
Set thermal operational mode to degraded (as opposed to normal).
set_louvers(position)Set the positions of the louvers.
Set az operational mode to normal (as opposed to degraded).
Set el operational mode to normal (as opposed to degraded).
Set louvers operational mode to normal (as opposed to degraded).
Set monitoring operational mode to normal (as opposed to degraded).
Set shutter operational mode to normal (as opposed to degraded).
Set thermal operational mode to normal (as opposed to degraded).
set_temperature(temperature)Set the preferred temperature in the dome.
Take the current position of the dome as zero.
start(**kwargs)Start the TCP/IP server.
Request the status from the AMCS lower level component and write it in reply.
Request the status from the ApSCS lower level component and write it in reply.
Request the status from the CBCS lower level component and write it in reply.
Request the status from the Calibration Screen and write it in reply.
Request the status from the LCS lower level component and write it in reply.
Request the status from the LLC system and write it in reply.
Request the status from the LWSCS lower level component and write it in reply.
Request the status from the MonCS lower level component and write it in reply.
Request the status from the RAD lower level component and write it in reply.
Request the status from the ThCS lower level component and write it in reply.
stop_az()Stop all dome motion.
stop_el()Stop all light and windscreen motion.
Stop the motion of all louvers.
Stop the motion of the shutter.
write_reply(**data)Write the data appended with the commandId.
Attributes Documentation
- LONG_DURATION = 20#
- SLOW_NETWORK_SLEEP = 10.0#
Methods Documentation
- async close_shutter()#
Close the shutter.
- Returns:
The estimated duration of the execution of the command.
- Return type:
- async config(system, settings)#
Configure the lower level components.
- Parameters:
system (
str) – The name of the system to configure.settings (
dict) –An array containing a single dict with key,value pairs for all the parameters that need to be configured. The structure is:
[ { "Parameter1_name": Value, "Parameter2_name": Value, ... } ]
It is assumed that the values of the configuration parameters are validated to lie within the limits before being passed on to this function. It is assumed that all configuration parameters are present and that their values represent the value to set even unchanged.
- Return type:
- async crawl_az(velocity)#
Crawl the dome.
- async crawl_el(velocity)#
Crawl the light and windscreen.
- async determine_current_tai()#
Determine the current TAI time.
This is done in a separate method so a mock method can replace it in unit tests.
- Return type:
- async fans(speed)#
Enable or disable the fans in the dome.
- async go_stationary_az()#
Stop azimuth motion and engage the brakes. Also disengage the locking pins if engaged.
- Returns:
The estimated duration of the execution of the command.
- Return type:
- async go_stationary_el()#
Stop elevation motion and engage the brakes. Also disengage the locking pins if engaged.
- Returns:
The estimated duration of the execution of the command.
- Return type:
- async go_stationary_shutter()#
Stop shutter motion and engage the brakes.
- Returns:
The estimated duration of the execution of the command.
- Return type:
- async home(direction)#
Home the Aperture Shutter, which is the closed position.
This is necessary in case the ApSCS (Aperture Shutter Control System) was shutdown with the Aperture Shutter not fully open or fully closed.
- Parameters:
direction (
OpenClose) – The direction to home the aperture shutter to.- Returns:
The estimated duration of the execution of the command.
- Return type:
- async inflate(action)#
Inflate or deflate the inflatable seal.
- async move_az(position, velocity)#
Move the dome.
- async move_el(position)#
Move the light and windscreen.
- async open_shutter()#
Open the shutter.
- Returns:
The estimated duration of the execution of the command.
- Return type:
- async park()#
Park the dome.
- Returns:
The estimated duration of the execution of the command.
- Return type:
- async read_and_dispatch()#
Read, parse, and dispatch one item of data.
Subclasses need to implement this method such that it reads and parses data and then dispatches handling the data to a method suitable for the subclass. Methods that might be helpful include: :rtype:
Noneread_jsonto read json-encoded dataread_strto read terminated stringsread_intoto read binary structs
- async request_and_send_status(llc, llc_name)#
Request the status of the given Lower Level Component and write it to the requester.
- async reset_drives_az(reset)#
Reset one or more AZ drives.
- Parameters:
reset (
list`[`int]) – Desired reset action to execute on each AZ drive: 0 means don’t reset, 1 means reset.- Returns:
The estimated duration of the execution of the command.
- Return type:
Notes
This is necessary when exiting from FAULT state without going to Degraded Mode since the drives don’t reset themselves. The number of values in the reset parameter is not validated.
- async reset_drives_louvers(reset)#
Reset one or more Louver drives.
- Parameters:
reset (
list`[`int]) – Desired reset action to execute on each Louver drive: 0 means don’t reset, 1 means reset.- Return type:
Notes
This is necessary when exiting from FAULT state without going to Degraded Mode since the drives don’t reset themselves. The number of values in the reset parameter is not validated.
- async reset_drives_shutter(reset)#
Reset one or more Aperture Shutter drives.
- Parameters:
reset (
list`[`int]) – Desired reset action to execute on each Aperture Shutter drive: 0 means don’t reset, 1 means reset.- Return type:
Notes
This is necessary when exiting from FAULT state without going to Degraded Mode since the drives don’t reset themselves. The number of values in the reset parameter is not validated.
- async set_degraded_az()#
Set az operational mode to degraded (as opposed to normal).
- Return type:
- async set_degraded_el()#
Set el operational mode to degraded (as opposed to normal).
- Return type:
- async set_degraded_louvers()#
Set louvers operational mode to degraded (as opposed to normal).
- Return type:
- async set_degraded_monitoring()#
Set monitoring operational mode to degraded (as opposed to normal).
- Return type:
- async set_degraded_shutter()#
Set shutter operational mode to degraded (as opposed to normal).
- Return type:
- async set_degraded_thermal()#
Set thermal operational mode to degraded (as opposed to normal).
- Return type:
- async set_louvers(position)#
Set the positions of the louvers.
- async set_normal_az()#
Set az operational mode to normal (as opposed to degraded).
- Return type:
- async set_normal_el()#
Set el operational mode to normal (as opposed to degraded).
- Return type:
- async set_normal_louvers()#
Set louvers operational mode to normal (as opposed to degraded).
- Return type:
- async set_normal_monitoring()#
Set monitoring operational mode to normal (as opposed to degraded).
- Return type:
- async set_normal_shutter()#
Set shutter operational mode to normal (as opposed to degraded).
- Return type:
- async set_normal_thermal()#
Set thermal operational mode to normal (as opposed to degraded).
- Return type:
- async set_temperature(temperature)#
Set the preferred temperature in the dome.
- async set_zero_az()#
Take the current position of the dome as zero. This is necessary as long as the racks, pinions and encoders on the drives have not been installed yet to compensate for slippage of the drives.
- Returns:
The estimated duration of the execution of the command.
- Return type:
- async start(**kwargs)#
Start the TCP/IP server.
- Parameters:
**kwargs (
dict[str,typing.Any]) – Additional keyword arguments forasyncio.start_server, beyond host and port.- Return type:
- async status_amcs()#
Request the status from the AMCS lower level component and write it in reply.
- Return type:
- async status_apscs()#
Request the status from the ApSCS lower level component and write it in reply.
- Return type:
- async status_cbcs()#
Request the status from the CBCS lower level component and write it in reply.
- Return type:
- async status_cscs()#
Request the status from the Calibration Screen and write it in reply.
- Return type:
- async status_lcs()#
Request the status from the LCS lower level component and write it in reply.
- Return type:
- async status_lwscs()#
Request the status from the LWSCS lower level component and write it in reply.
- Return type:
- async status_moncs()#
Request the status from the MonCS lower level component and write it in reply.
- Return type:
- async status_rad()#
Request the status from the RAD lower level component and write it in reply.
- Return type:
- async status_thcs()#
Request the status from the ThCS lower level component and write it in reply.
- Return type:
- async stop_az()#
Stop all dome motion.
- Returns:
The estimated duration of the execution of the command.
- Return type:
- async stop_el()#
Stop all light and windscreen motion.
- Returns:
The estimated duration of the execution of the command.
- Return type:
- async stop_shutter()#
Stop the motion of the shutter.
- Returns:
The estimated duration of the execution of the command.
- Return type: