This commit is contained in:
2023-11-22 10:17:05 +01:00
parent 07b13c153d
commit b3920524ab
33 changed files with 731 additions and 616 deletions

View File

@ -27,15 +27,15 @@ from eive_tmtc.config.object_ids import P60_DOCK_HANDLER
from tmtccmd.util import ObjectIdU32
class P60OpCode:
STACK_3V3_ON = ["stack_3v3_on", "1"]
STACK_3V3_OFF = ["stack_3v3_off", "2"]
STACK_5V_ON = ["stack_5v_on", "3"]
STACK_5V_OFF = ["stack_5v_off", "4"]
TEST = ["test", "0"]
class CmdString:
STACK_3V3_ON = "stack_3v3_on"
STACK_3V3_OFF = "stack_3v3_off"
STACK_5V_ON = "stack_5v_on"
STACK_5V_OFF = "stack_5v_off"
TEST = "test"
class P60Info:
class CmdInfo:
PREFIX = "P60 Dock"
STACK_3V3_ON = f"{PREFIX}: Turn Stack 3V3 on"
STACK_3V3_OFF = f"{PREFIX}: Turn Stack 3V3 off"
@ -99,14 +99,14 @@ class P60DockHkTable:
def pack_p60dock_cmds( # noqa C901: Complexity okay here.
object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str
object_id: ObjectIdU32, q: DefaultPusQueueHelper, cmd_str: str
):
objb = object_id.as_bytes
pack_common_power_cmds("P60 Dock", object_id, q, op_code)
pack_common_gomspace_cmds("P60 Dock", object_id, q, op_code)
p60_dock_req_hk_cmds(q, op_code)
if op_code in P60OpCode.STACK_3V3_ON:
q.add_log_cmd(P60Info.STACK_3V3_ON)
pack_common_power_cmds("P60 Dock", object_id, q, cmd_str)
pack_common_gomspace_cmds("P60 Dock", object_id, q, cmd_str)
p60_dock_req_hk_cmds(q, cmd_str)
if cmd_str == CmdString.STACK_3V3_ON:
q.add_log_cmd(CmdInfo.STACK_3V3_ON)
q.add_pus_tc(
pack_set_u8_param_command(
objb,
@ -114,8 +114,8 @@ def pack_p60dock_cmds( # noqa C901: Complexity okay here.
Channel.on,
)
)
if op_code in P60OpCode.STACK_3V3_OFF:
q.add_log_cmd(P60Info.STACK_3V3_OFF)
if cmd_str == CmdString.STACK_3V3_OFF:
q.add_log_cmd(CmdInfo.STACK_3V3_OFF)
q.add_pus_tc(
pack_set_u8_param_command(
objb,
@ -123,8 +123,8 @@ def pack_p60dock_cmds( # noqa C901: Complexity okay here.
Channel.off,
)
)
if op_code in P60OpCode.STACK_5V_ON:
q.add_log_cmd(P60Info.STACK_5V_ON)
if cmd_str == CmdString.STACK_5V_ON:
q.add_log_cmd(CmdInfo.STACK_5V_ON)
q.add_pus_tc(
pack_set_u8_param_command(
objb,
@ -132,8 +132,8 @@ def pack_p60dock_cmds( # noqa C901: Complexity okay here.
Channel.on,
)
)
if op_code in P60OpCode.STACK_5V_OFF:
q.add_log_cmd(P60Info.STACK_5V_OFF)
if cmd_str == CmdString.STACK_5V_OFF:
q.add_log_cmd(CmdInfo.STACK_5V_OFF)
q.add_pus_tc(
pack_set_u8_param_command(
objb,