Skip to content

Commit

Permalink
Remove the OfflineSubstate enum in MTHexapod and MTRotator.
Browse files Browse the repository at this point in the history
  • Loading branch information
teweitsai committed Aug 6, 2024
1 parent 9f3c15e commit 5f27b2e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 35 deletions.
1 change: 1 addition & 0 deletions doc/news/interface_changes/DM-45566.mthexapod.rst
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Remove the MTHexapod_logevent_controllerState.offlineSubstate and add the MTHexapod_logevent_configuration.drivesEnabled.
Remove the OfflineSubstate enum in MTHexapod and MTRotator.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
ControllerState_Enabled=2,
ControllerState_Offline=3,
ControllerState_Fault=4
</Enumeration>
<Enumeration>
OfflineSubstate_PublishOnly=0,
OfflineSubstate_Available=1
</Enumeration>
<Enumeration>
EnabledSubstate_Stationary=0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
ControllerState_Enabled=2,
ControllerState_Offline=3,
ControllerState_Fault=4
</Enumeration>
<Enumeration>
OfflineSubstate_PublishOnly=0,
OfflineSubstate_Available=1
</Enumeration>
<Enumeration>
EnabledSubstate_Stationary=0,
Expand Down
5 changes: 2 additions & 3 deletions python/lsst/ts/xml/enums/MTHexapod.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@
"ApplicationStatus",
"ControllerState",
"EnabledSubstate",
"OfflineSubstate",
"SalIndex",
"ErrorCode",
]

import enum

# MTHexapod and MTRotator have the same enum values for
# ControllerState, OfflineSubstate, and EnabledSubstate.
from .MTRotator import ControllerState, EnabledSubstate, OfflineSubstate
# ControllerState and EnabledSubstate.
from .MTRotator import ControllerState, EnabledSubstate


class ApplicationStatus(enum.IntFlag):
Expand Down
31 changes: 7 additions & 24 deletions python/lsst/ts/xml/enums/MTRotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

__all__ = [
"ControllerState",
"OfflineSubstate",
"EnabledSubstate",
"FaultSubstate",
"ApplicationStatus",
Expand All @@ -42,28 +41,12 @@ class ControllerState(enum.IntEnum):
"""

STANDBY = 0
DISABLED = enum.auto() # Deprecated in rotator
DISABLED = enum.auto() # Deprecated in rotator/hexapod
ENABLED = enum.auto()
OFFLINE = enum.auto() # Deprecated in rotator
OFFLINE = enum.auto() # Deprecated in rotator/hexapod
FAULT = enum.auto()


class OfflineSubstate(enum.IntEnum):
"""Controller substate for the OFFLINE state.
Value reported in ``telemetry.offline_substate``.
This is enum ``OfflineSubStates`` in Moog code.
Deprecated in the rotator.
TODO: Remove this after simplifying the state machine in hexapod, DM-39787.
"""

PUBLISH_ONLY = 0
AVAILABLE = enum.auto()


class EnabledSubstate(enum.IntEnum):
"""Controller substate for the ENABLED state.
Expand All @@ -74,11 +57,11 @@ class EnabledSubstate(enum.IntEnum):

STATIONARY = 0
MOVING_POINT_TO_POINT = enum.auto()
SLEWING_OR_TRACKING = enum.auto()
CONTROLLED_STOPPING = enum.auto()
INITIALIZING = enum.auto() # Deprecated in rotator
RELATIVE = enum.auto() # Deprecated in rotator
CONSTANT_VELOCITY = enum.auto()
SLEWING_OR_TRACKING = enum.auto() # hexapod does not have this
CONTROLLED_STOPPING = enum.auto() # hexapod does not have this
INITIALIZING = enum.auto() # Deprecated in rotator/hexapod
RELATIVE = enum.auto() # Deprecated in rotator/hexapod
CONSTANT_VELOCITY = enum.auto() # hexapod does not have this


class FaultSubstate(enum.IntEnum):
Expand Down

0 comments on commit 5f27b2e

Please sign in to comment.