sus cmds working now
This commit is contained in:
@ -573,7 +573,7 @@ def add_ploc_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
|
||||
|
||||
def add_system_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
from pus_tc.system.acs import AcsOpCodes
|
||||
from pus_tc.system.acs import AcsOpCodes, SusOpCodes
|
||||
|
||||
default_opts = generate_op_code_options(
|
||||
enter_listener_mode=False, custom_timeout=8.0
|
||||
@ -621,27 +621,35 @@ 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,
|
||||
info="ACS Assemblies",
|
||||
op_code_entry=op_code_dict,
|
||||
)
|
||||
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=SusOpCodes.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=SusOpCodes.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=SusOpCodes.SUS_ASS_OFF,
|
||||
info="Switch off SUS board",
|
||||
options=default_opts,
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.SUS_ASS.value,
|
||||
info="SUS Assembly",
|
||||
op_code_entry=op_code_dict,
|
||||
)
|
||||
|
@ -2,7 +2,7 @@ import enum
|
||||
from tmtccmd.tc.definitions import TcQueueT, QueueCommands
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes, Subservices
|
||||
from config.object_ids import ACS_BOARD_ASS_ID
|
||||
from config.object_ids import ACS_BOARD_ASS_ID, SUS_BOARD_ASS_ID
|
||||
|
||||
|
||||
class AcsOpCodes:
|
||||
@ -13,10 +13,13 @@ class AcsOpCodes:
|
||||
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 SusOpCodes:
|
||||
SUS_ASS_NOM_SIDE = ["0", "sus-nom"]
|
||||
SUS_ASS_RED_SIDE = ["1", "sus-red"]
|
||||
SUS_ASS_DUAL_MODE = ["2", "sus-d"]
|
||||
SUS_ASS_OFF = ["3", "sus-off"]
|
||||
|
||||
|
||||
class DualSideSubmodes(enum.IntEnum):
|
||||
@ -28,6 +31,7 @@ class DualSideSubmodes(enum.IntEnum):
|
||||
def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
if op_code in AcsOpCodes.ACS_ASS_A_SIDE:
|
||||
command_acs_board(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.A_SIDE,
|
||||
tc_queue=tc_queue,
|
||||
@ -35,6 +39,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_B_SIDE:
|
||||
command_acs_board(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.B_SIDE,
|
||||
tc_queue=tc_queue,
|
||||
@ -42,6 +47,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_DUAL_MODE:
|
||||
command_acs_board(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.DUAL_SIDE,
|
||||
tc_queue=tc_queue,
|
||||
@ -49,6 +55,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_A_ON:
|
||||
command_acs_board(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.ON,
|
||||
submode=DualSideSubmodes.A_SIDE,
|
||||
tc_queue=tc_queue,
|
||||
@ -56,6 +63,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_B_ON:
|
||||
command_acs_board(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.ON,
|
||||
submode=DualSideSubmodes.B_SIDE,
|
||||
tc_queue=tc_queue,
|
||||
@ -63,6 +71,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_DUAL_ON:
|
||||
command_acs_board(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.ON,
|
||||
submode=DualSideSubmodes.B_SIDE,
|
||||
tc_queue=tc_queue,
|
||||
@ -70,27 +79,34 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_OFF:
|
||||
command_acs_board(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
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:
|
||||
|
||||
|
||||
def pack_sus_cmds(tc_queue: TcQueueT, op_code: str):
|
||||
if op_code in SusOpCodes.SUS_ASS_NOM_SIDE:
|
||||
command_acs_board(
|
||||
object_id=SUS_BOARD_ASS_ID,
|
||||
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:
|
||||
if op_code in SusOpCodes.SUS_ASS_RED_SIDE:
|
||||
command_acs_board(
|
||||
object_id=SUS_BOARD_ASS_ID,
|
||||
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:
|
||||
if op_code in SusOpCodes.SUS_ASS_OFF:
|
||||
command_acs_board(
|
||||
object_id=SUS_BOARD_ASS_ID,
|
||||
mode=Modes.OFF,
|
||||
submode=0,
|
||||
tc_queue=tc_queue,
|
||||
@ -98,10 +114,10 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
)
|
||||
|
||||
|
||||
def command_acs_board(mode: Modes, submode: int, tc_queue: TcQueueT, info: str):
|
||||
def command_acs_board(object_id: bytes, 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,
|
||||
object_id=object_id,
|
||||
mode=mode,
|
||||
submode=submode,
|
||||
)
|
||||
|
@ -31,7 +31,7 @@ from pus_tc.system.core import pack_core_commands
|
||||
from pus_tc.devs.star_tracker import pack_star_tracker_commands
|
||||
from pus_tc.devs.syrlinks_hk_handler import pack_syrlinks_command
|
||||
from pus_tc.devs.gps import pack_gps_command
|
||||
from pus_tc.system.acs import pack_acs_command
|
||||
from pus_tc.system.acs import pack_acs_command, pack_sus_cmds
|
||||
from pus_tc.devs.plpcdu import pack_pl_pcdu_commands
|
||||
from pus_tc.devs.str_img_helper import pack_str_img_helper_command
|
||||
from config.definitions import CustomServiceList
|
||||
@ -94,7 +94,7 @@ def pack_service_queue_user(
|
||||
object_id=object_id, tc_queue=service_queue, op_code=op_code
|
||||
)
|
||||
if service == CustomServiceList.ACU.value:
|
||||
object_id = ACU_HANDLER_ID
|
||||
object_id = ACU_HANDLER_IDpack_sus_cmds
|
||||
return pack_acu_test_into(
|
||||
object_id=object_id, tc_queue=service_queue, op_code=op_code
|
||||
)
|
||||
@ -199,6 +199,8 @@ def pack_service_queue_user(
|
||||
return pack_solar_array_deployment_test_into(
|
||||
object_id=SOLAR_ARRAY_DEPLOYMENT_ID, tc_queue=service_queue
|
||||
)
|
||||
if service == CustomServiceList.SUS_ASS.value:
|
||||
return pack_sus_cmds(tc_queue=service_queue, op_code=op_code)
|
||||
if service == CustomServiceList.PL_PCDU.value:
|
||||
return pack_pl_pcdu_commands(tc_queue=service_queue, op_code=op_code)
|
||||
if service == CustomServiceList.ACS_ASS.value:
|
||||
|
Reference in New Issue
Block a user