MockMTDomeController

class lsst.ts.MTDome.MockMTDomeController(port)

Bases: object

Mock MTDome Controller that talks over TCP/IP.

Parameters:
port : int

TCP/IP port

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

Methods Summary

close_louvers() Close all louvers.
close_shutter() Close the shutter.
cmd_loop(reader, writer) Execute commands and output replies.
config(system, settings) Configure the lower level components.
crawl_az(velocity) Crawl the dome.
crawl_el(velocity) Crawl the light and wind screen.
determine_current_tai() Determine the current TAI time.
fans(action) Enable or disable the fans in the dome.
inflate(action) Inflate or deflate the inflatable seal.
move_az(position, velocity) Move the dome.
move_el(position) Move the light and wind screen.
open_shutter() Open the shutter.
park() Park the dome.
request_and_send_status(llc, llc_name) Request the status of the given Lower Level Component and write it to the requester.
set_louvers(position) Set the positions of the louvers.
set_temperature(temperature) Set the preferred temperature in the dome.
start([keep_running]) Start the TCP/IP server.
status_amcs() Request the status from the AMCS lower level component and write it in reply.
status_apscs() Request the status from the ApSCS lower level component and write it in reply.
status_lcs() Request the status from the LCS lower level component and write it in reply.
status_lwscs() Request the status from the LWSCS lower level component and write it in reply.
status_moncs() Request the status from the MonCS lower level component and write it in reply.
status_thcs() Request the status from the ThCS lower level component and write it in reply.
stop() Stop the mock lower level components and the TCP/IP server.
stop_az() Stop all dome motion.
stop_el() Stop all light and wind screen motion.
stop_llc() Move all lower level components.
stop_louvers() Stop the motion of all louvers.
stop_shutter() Stop the motion of the shutter.
write(**data) Write the data appended with a newline character.

Methods Documentation

close_louvers()

Close all louvers.

close_shutter()

Close the shutter.

cmd_loop(reader, writer)

Execute commands and output replies.

Parameters:
reader: stream reader

The stream reader to read from.

writer: stream writer

The stream writer to write to.

config(system, settings)

Configure the lower level components.

Parameters:
system: `str`

The name of the system to configure.

settings: `list` of `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.

crawl_az(velocity)

Crawl the dome.

Parameters:
velocity: `float`

The velocity, in rad/sec, to crawl at.

Returns:
`float`

The estimated duration of the execution of the command.

crawl_el(velocity)

Crawl the light and wind screen.

Parameters:
velocity: `float`

The velocity, in rad/sec, to crawl at.

Returns:
`float`

The estimated duration of the execution of the command.

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.

fans(action)

Enable or disable the fans in the dome.

Parameters:
action: `str`

ON means fans on and OFF fans off.

inflate(action)

Inflate or deflate the inflatable seal.

Parameters:
action: `str`

ON means inflate and OFF deflate the inflatable seal.

move_az(position, velocity)

Move the dome.

Parameters:
position: `float`

Desired azimuth, in radians, in range [0, 2 pi)

velocity: `float`

The velocity, in rad/sec, to start crawling at once the position has been reached.

Returns:
`float`

The estimated duration of the execution of the command.

move_el(position)

Move the light and wind screen.

Parameters:
position: `float`

Desired elevation, in radians, in range [0, pi/2)

Returns:
duration: `float`

The estimated duration of the execution of the command.

open_shutter()

Open the shutter.

park()

Park the dome.

Returns:
`float`

The estimated duration of the execution of the command.

request_and_send_status(llc, llc_name)

Request the status of the given Lower Level Component and write it to the requester.

Parameters:
llc: mock_llc

The Lower Level Component to request the status for.

llc_name: LlcName

The name of the Lower Level Component.

set_louvers(position)

Set the positions of the louvers.

Parameters:
position: array of float

An array of positions, in percentage with 0 meaning closed and 100 fully open, for each louver. A position of -1 means “do not move”.

set_temperature(temperature)

Set the preferred temperature in the dome.

Parameters:
temperature: `float`

The temperature, in degrees Celsius, to set.

start(keep_running=False)

Start the TCP/IP server.

Start the command loop and make sure to keep running when instructed to
do so.
Parameters:
keep_running : bool

Used for command line testing and should generally be left to False.

status_amcs()

Request the status from the AMCS lower level component and write it in reply.

status_apscs()

Request the status from the ApSCS lower level component and write it in reply.

status_lcs()

Request the status from the LCS lower level component and write it in reply.

status_lwscs()

Request the status from the LWSCS lower level component and write it in reply.

status_moncs()

Request the status from the MonCS lower level component and write it in reply.

status_thcs()

Request the status from the ThCS lower level component and write it in reply.

stop()

Stop the mock lower level components and the TCP/IP server.

stop_az()

Stop all dome motion.

Returns:
`float`

The estimated duration of the execution of the command.

stop_el()

Stop all light and wind screen motion.

Returns:
`float`

The estimated duration of the execution of the command.

stop_llc()

Move all lower level components.

stop_louvers()

Stop the motion of all louvers.

stop_shutter()

Stop the motion of the shutter.

write(**data)

Write the data appended with a newline character.

Parameters:
data:

The data to write.