M2 Developer Guide

This CSC is a ts_salobj based control system integrating the middleware layer and the high-level state machine.

Dependencies

Architecture

The classes in module are listed below.

classDiagram namespace m2com { class ControllerCell } M2 *-- ControllerCell M2 *-- Translator

Figure 1 Class diagram of M2

  • M2 is a CSC class. It inherits from the ts_salobj’s ConfigurableCsc. ts_salobj provides interfaces for the SAL communication.

  • Translator translates the message from component to have the correct format for M2 to use to communicate among components by SAL.

Only the M2 instance has the knowledge of high-level control logic and middleware layer provided by ConfigurableCsc. The simulation mode is supported by mock classes in ts_m2com.

The M2 CSC communicates with the M2 engineering user interface (EUI, ts_mtm2) deployed in a Linux server at this moment. It will be upgraded to communiate with the M2 cell control system (ts_mtm2_cell) deployed in a NI cRIO controller in the near future. There are two state machines defined in the M2 EUI. One is used in the manual local mode and the other one is used in the remote control. For the latter, the original developer in vendor used the LSST state machine defined in LTS-307, TCS Software Component Interface. Therefore, to simplify the implementation, the state machine in M2 CSC is designed to decouple the controller’s state machine with the state machine in ts_salobj. The detail can follow State Machine.

APIs

This section is autogenerated from docstrings.

lsst.ts.m2 Package

Functions

run_mtm2()

Run the MTM2 CSC.

Classes

ErrorCode(value[, names, module, qualname, ...])

M2([host, port_command, port_telemetry, ...])

M2 commandable SAL component (CSC) class.

Translator()

Translator class to translate the message from component.

Build and Test

Using docker is highly recommended. The Docker files of development can follow: develop-env. The built docker image is here.

To setup and test the CSC using Docker, enter:

docker run -it --rm -v ${repo_location}:/home/saluser/ts_m2 lsstts/develop-env:${tag}
cd ts_m2
setup -k -r .

The environment shall be setup either from /home/saluser/.setup_dev.sh.

Usage

To start the M2 CSC, enter the following command:

bin/run_mtm2

You can use the argument of -s to run the simulation mode or -h to get all available argument details. Stopping the CSC is done by SIG-INTing the process, usually by ctrl + c.

Contributing

To contribute, please start a new pull request on GitHub. Feature requests shall be filled in JIRA with the ts_m2 or M2 label. In all cases, reaching out to the contacts for this CSC is recommended.