M2 Common Code¶
Overview¶
This module contains the common code for the main telescope M2 commandable SAL component (CSC) and graphical user interface (GUI) to operate the M2 mirror control system. The eups is used as the package manager. This package also supports the conda package manager.
The badges above navigate to the GitHub repository for the common code and Jira issues.
Dependencies¶
JSON String¶
The JSON string is used in the TCP/IP communication between the M2 CSC/GUI and hardware. The design here takes the following documents as references: TS JSON Message Format Proposal and TS JSON Message Format Proposal.
Architecture¶
The classes and files for each module are listed below.
m2com¶
Figure 1 Class diagram of M2 common code¶
Controller has the business logic to communicate with hardware by TCP/IP interface.
TcpClient is a TCP/IP client.
ControllerCell is a high-level class to integrate with the controller class to communicate with the M2 cell controller.
m2com.mock¶
Figure 2 Class diagram of mock module in M2 common code¶
MockServer is a mock server of M2 to support the simulation mode.
MockModel simulates the hardware behavior to be used by MockServer.
MockScriptEngine simulates the execution of binary script.
MockControlOpenLoop simulates the open-loop control.
MockControlClosedLoop simulates the closed-loop control.
MockCommand simulates the execution of command in real hardware.
MockMessageEvent simulates the message of event from real hardware.
MockMessageTelemetry simulates the message of telemetry from real hardware.
APIs¶
This section is autogenerated from docstrings.
lsst.ts.m2com Package¶
Functions¶
|
Check the size of queue and log the information if needed. |
|
Collect the specific messages in queue. |
|
Get the directory of configuration files. |
|
Get the latest message in queue. |
|
Input function is a coroution or not. |
|
Read the yaml file. |
|
Write the json packet. |
Classes¶
|
Unit of the actuator displacement. |
|
Action to command the actuators. |
|
Action to command the script execution. |
|
Command status. |
|
Controller class. |
|
Cell controller class. |
|
Detailed substates of the Offline state. |
|
Bit of digital input. |
|
Bit of digital output. |
|
Mock command to simulate the execution of command in real hardware. |
Mock closed-loop control. |
|
Mock open-loop control. |
|
|
Mock message of event to simulate the message from real hardware. |
|
Mock message of telemetry to simulate the message from real hardware. |
|
Mock Model class. |
Mock script engine class to simulate the execution of binary script. |
|
|
Mock server of M2. |
|
Message type to the cell controller. |
|
Type of the power. |
|
TCP/IP client. |
Build and Test¶
Using docker is highly recommended. The built docker image is develop_env.
To setup and test the code using Docker, enter:
docker run -it --rm -v ${repo_location}:/home/saluser/ts_m2com lsstts/develop-env:${tag}
cd ts_m2com
setup -k -r .
The environment shall be setup either from /home/saluser/.setup_dev.sh.
Version History¶
The version history is at the following link.
The released version is here.
Contributing¶
To contribute, please start a new pull request on GitHub. Feature requests shall be filled in JIRA with the ts_m2com or M2 label. In all cases, reaching out to the contacts for this CSC is recommended.
Contact Personnel¶
For questions not covered in the documentation, emails should be addressed to the developers: Tiago Ribeiro <tribeiro@lsst.org> and Te-Wei Tsai <ttsai@lsst.org>. The product owner is Sandrine Thomas <sthomas@lsst.org>.
This page was last modified 2022-09-22.