Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tickets/dm 36031 #10

Merged
merged 4 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ m2com

* **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.

.. _lsst.ts.m2com-modules_m2com_mock:

Expand Down
1 change: 1 addition & 0 deletions doc/uml/class_m2com.uml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@startuml
Controller "1" *-- "2" TcpClient
Controller <|-- ControllerCell
@enduml
5 changes: 5 additions & 0 deletions doc/version_history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Version History
===============

v0.4.5
teweitsai marked this conversation as resolved.
Show resolved Hide resolved
------

* Add the **ControllerCell** class.

v0.4.4
------

Expand Down
1 change: 1 addition & 0 deletions python/lsst/ts/m2com/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@
from .mock import *
from .tcp_client import *
from .controller import *
from .controller_cell import *
11 changes: 6 additions & 5 deletions python/lsst/ts/m2com/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ class Controller:
Last command status.
timeout : `float`
Time limit for reading data from the TCP/IP interface (sec).
is_csc : `bool`
Is CSC or not. Remove this after the state machines in cell controller
are unified.
controller_state: enum `lsst.ts.salobj.State`
Controller's state.
"""
Expand All @@ -87,13 +90,11 @@ def __init__(

self.timeout = timeout_in_second

# Is CSC or not. Remove this after the state machines in cell
# controller are unified.
self._is_csc = is_csc
self.is_csc = is_csc

# In EUI, there is no OFFLINE state.
self.controller_state = (
salobj.State.OFFLINE if self._is_csc else salobj.State.STANDBY
salobj.State.OFFLINE if self.is_csc else salobj.State.STANDBY
)

# Start the connection task or not
Expand Down Expand Up @@ -382,7 +383,7 @@ async def clear_errors(self):

# In EUI, there is no OFFLINE state.
controller_state_expected = (
salobj.State.OFFLINE if self._is_csc else salobj.State.STANDBY
salobj.State.OFFLINE if self.is_csc else salobj.State.STANDBY
)
await self.write_command_to_server(
"clearErrors", controller_state_expected=controller_state_expected
Expand Down