added sus board cmds
This commit is contained in:
parent
07b76dc39c
commit
e4caa77068
@ -621,6 +621,24 @@ def add_system_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
info="Switch off ACS board",
|
||||
options=default_opts,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=AcsOpCodes.SUS_ASS_NOM_SIDE,
|
||||
info="Switch SUS board to nominal side",
|
||||
options=default_opts,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=AcsOpCodes.SUS_ASS_RED_SIDE,
|
||||
info="Switch SUS board to redundant side",
|
||||
options=default_opts,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=AcsOpCodes.SUS_ASS_OFF,
|
||||
info="Switch off SUS board",
|
||||
options=default_opts,
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.ACS_ASS.value,
|
||||
|
@ -6,16 +6,20 @@ from config.object_ids import ACS_BOARD_ASS_ID
|
||||
|
||||
|
||||
class AcsOpCodes:
|
||||
ACS_ASS_A_SIDE = ["0", "a"]
|
||||
ACS_ASS_B_SIDE = ["1", "b"]
|
||||
ACS_ASS_DUAL_MODE = ["2", "d"]
|
||||
ACS_ASS_OFF = ["3", "off"]
|
||||
ACS_ASS_A_ON = ["4", "ao"]
|
||||
ACS_ASS_B_ON = ["5", "bo"]
|
||||
ACS_ASS_DUAL_ON = ["6", "do"]
|
||||
ACS_ASS_A_SIDE = ["0", "acs-a"]
|
||||
ACS_ASS_B_SIDE = ["1", "acs-b"]
|
||||
ACS_ASS_DUAL_MODE = ["2", "acs-d"]
|
||||
ACS_ASS_OFF = ["3", "acs-off"]
|
||||
ACS_ASS_A_ON = ["4", "acs-ao"]
|
||||
ACS_ASS_B_ON = ["5", "acs-bo"]
|
||||
ACS_ASS_DUAL_ON = ["6", "acs-do"]
|
||||
SUS_ASS_NOM_SIDE = ["10", "sus-nom"]
|
||||
SUS_ASS_RED_SIDE = ["11", "sus-red"]
|
||||
SUS_ASS_DUAL_MODE = ["12", "sus-d"]
|
||||
SUS_ASS_OFF = ["13", "sus-off"]
|
||||
|
||||
|
||||
class AcsBoardSubmodes(enum.IntEnum):
|
||||
class DualSideSubmodes(enum.IntEnum):
|
||||
A_SIDE = 0
|
||||
B_SIDE = 1
|
||||
DUAL_SIDE = 2
|
||||
@ -23,55 +27,79 @@ class AcsBoardSubmodes(enum.IntEnum):
|
||||
|
||||
def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
if op_code in AcsOpCodes.ACS_ASS_A_SIDE:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Switching to ACS board assembly A side")
|
||||
)
|
||||
command_acs_board(
|
||||
mode=Modes.NORMAL, submode=AcsBoardSubmodes.A_SIDE, tc_queue=tc_queue
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.A_SIDE,
|
||||
tc_queue=tc_queue,
|
||||
info="Switching to ACS board assembly A side",
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_B_SIDE:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Switching to ACS board assembly B side")
|
||||
)
|
||||
command_acs_board(
|
||||
mode=Modes.NORMAL, submode=AcsBoardSubmodes.B_SIDE, tc_queue=tc_queue
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.B_SIDE,
|
||||
tc_queue=tc_queue,
|
||||
info="Switching to ACS board assembly B side",
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_DUAL_MODE:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Switching to ACS board assembly dual mode")
|
||||
)
|
||||
command_acs_board(
|
||||
mode=Modes.NORMAL, submode=AcsBoardSubmodes.DUAL_SIDE, tc_queue=tc_queue
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.DUAL_SIDE,
|
||||
tc_queue=tc_queue,
|
||||
info="Switching to ACS board assembly dual mode",
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_A_ON:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Switching ACS board assembly A side on")
|
||||
)
|
||||
command_acs_board(
|
||||
mode=Modes.ON, submode=AcsBoardSubmodes.A_SIDE, tc_queue=tc_queue
|
||||
mode=Modes.ON,
|
||||
submode=DualSideSubmodes.A_SIDE,
|
||||
tc_queue=tc_queue,
|
||||
info="Switching ACS board assembly A side on",
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_B_ON:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Switching ACS board assembly B side on")
|
||||
)
|
||||
command_acs_board(
|
||||
mode=Modes.ON, submode=AcsBoardSubmodes.B_SIDE, tc_queue=tc_queue
|
||||
mode=Modes.ON,
|
||||
submode=DualSideSubmodes.B_SIDE,
|
||||
tc_queue=tc_queue,
|
||||
info="Switching ACS board assembly B side on",
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_DUAL_ON:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Switching ACS board assembly dual side on")
|
||||
)
|
||||
command_acs_board(
|
||||
mode=Modes.ON, submode=AcsBoardSubmodes.B_SIDE, tc_queue=tc_queue
|
||||
mode=Modes.ON,
|
||||
submode=DualSideSubmodes.B_SIDE,
|
||||
tc_queue=tc_queue,
|
||||
info="Switching ACS board assembly dual side on",
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_OFF:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Switching to ACS board assembly off")
|
||||
command_acs_board(
|
||||
mode=Modes.OFF,
|
||||
submode=0,
|
||||
tc_queue=tc_queue,
|
||||
info="Switching to ACS board assembly off",
|
||||
)
|
||||
if op_code in AcsOpCodes.SUS_ASS_NOM_SIDE:
|
||||
command_acs_board(
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.A_SIDE,
|
||||
tc_queue=tc_queue,
|
||||
info="Switching to SUS board to nominal side",
|
||||
)
|
||||
if op_code in AcsOpCodes.SUS_ASS_RED_SIDE:
|
||||
command_acs_board(
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.B_SIDE,
|
||||
tc_queue=tc_queue,
|
||||
info="Switching to SUS board to redundant side",
|
||||
)
|
||||
if op_code in AcsOpCodes.SUS_ASS_OFF:
|
||||
command_acs_board(
|
||||
mode=Modes.OFF,
|
||||
submode=0,
|
||||
tc_queue=tc_queue,
|
||||
info="Switching SUS board off",
|
||||
)
|
||||
command_acs_board(mode=Modes.OFF, submode=0, tc_queue=tc_queue)
|
||||
|
||||
|
||||
def command_acs_board(mode: Modes, submode: int, tc_queue: TcQueueT):
|
||||
def command_acs_board(mode: Modes, submode: int, tc_queue: TcQueueT, info: str):
|
||||
tc_queue.appendleft((QueueCommands.PRINT, info))
|
||||
mode_data = pack_mode_data(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=mode,
|
||||
|
2
tmtccmd
2
tmtccmd
@ -1 +1 @@
|
||||
Subproject commit a31723786f4d85e82ba8e685f1652cb59cdb707b
|
||||
Subproject commit 315109e4c0af301c40dd3b0081613fd41313a295
|
Loading…
Reference in New Issue
Block a user