added more ACS ASS commands
This commit is contained in:
parent
e1d43b8de9
commit
e3344cfbd2
@ -77,8 +77,8 @@
|
||||
8901;0x22c5;CLOCK_SET_FAILURE;LOW;;fsfw/src/fsfw/pus/Service9TimeManagement.h
|
||||
9700;0x25e4;TEST;INFO;;fsfw/src/fsfw/pus/Service17Test.h
|
||||
10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;;fsfw/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
|
||||
10800;0x2a30;SWITCH_CMD_SENT;INFO;Indicated that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
|
||||
10801;0x2a31;SWITCH_HAS_CHANGED;INFO;;mission/devices/devicedefinitions/powerDefinitions.h
|
||||
10800;0x2a30;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
|
||||
10801;0x2a31;SWITCH_HAS_CHANGED;INFO;Indicated that a swithc state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
|
||||
10802;0x2a32;SWITCHING_Q7S_DENIED;MEDIUM;;mission/devices/devicedefinitions/powerDefinitions.h
|
||||
10900;0x2a94;GPIO_PULL_HIGH_FAILED;LOW;;mission/devices/HeaterHandler.h
|
||||
10901;0x2a95;GPIO_PULL_LOW_FAILED;LOW;;mission/devices/HeaterHandler.h
|
||||
|
|
@ -515,12 +515,49 @@ def add_ploc_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
|
||||
def add_system_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
from pus_tc.system.acs import AcsOpCodes
|
||||
|
||||
default_opts = generate_op_code_options(enter_listener_mode=True, custom_timeout=8.0)
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=AcsOpCodes.ACS_ASS_A_SIDE,
|
||||
info="Switch to ACS board A side",
|
||||
options=default_opts
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=AcsOpCodes.ACS_ASS_B_SIDE,
|
||||
info="Switch to ACS board B side",
|
||||
options=default_opts
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=AcsOpCodes.ACS_ASS_DUAL_MODE,
|
||||
info="Switch to ACS board dual mode",
|
||||
options=default_opts
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=AcsOpCodes.ACS_ASS_A_ON,
|
||||
info="Switch ACS board A side on",
|
||||
options=default_opts
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=AcsOpCodes.ACS_ASS_B_ON,
|
||||
info="Switch ACS board B side on",
|
||||
options=default_opts
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=AcsOpCodes.ACS_ASS_DUAL_ON,
|
||||
info="Switch ACS board dual mode on",
|
||||
options=default_opts
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=AcsOpCodes.ACS_ASS_OFF,
|
||||
info="Switch off ACS board",
|
||||
options=default_opts
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
|
@ -9,6 +9,10 @@ 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"]
|
||||
|
||||
|
||||
class AcsBoardSubmodes(enum.IntEnum):
|
||||
@ -22,12 +26,46 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Switching to ACS board assembly A side")
|
||||
)
|
||||
mode_data = pack_mode_data(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=AcsBoardSubmodes.A_SIDE,
|
||||
command_acs_board(mode=Modes.NORMAL, submode=AcsBoardSubmodes.A_SIDE, tc_queue=tc_queue)
|
||||
if op_code in AcsOpCodes.ACS_ASS_B_SIDE:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Switching to ACS board assembly B side")
|
||||
)
|
||||
cmd = PusTelecommand(
|
||||
service=200, subservice=Subservices.COMMAND_MODE_COMMAND, app_data=mode_data
|
||||
command_acs_board(mode=Modes.NORMAL, submode=AcsBoardSubmodes.B_SIDE, tc_queue=tc_queue)
|
||||
if op_code in AcsOpCodes.ACS_ASS_DUAL_MODE:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Switching to ACS board assembly dual mode")
|
||||
)
|
||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||
command_acs_board(mode=Modes.NORMAL, submode=AcsBoardSubmodes.DUAL_SIDE, tc_queue=tc_queue)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
|
||||
|
||||
def command_acs_board(mode: Modes, submode: int, tc_queue: TcQueueT):
|
||||
mode_data = pack_mode_data(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=mode,
|
||||
submode=submode,
|
||||
)
|
||||
cmd = PusTelecommand(
|
||||
service=200, subservice=Subservices.COMMAND_MODE_COMMAND, app_data=mode_data
|
||||
)
|
||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||
|
Loading…
Reference in New Issue
Block a user