some refactoring for PCDU cmds

This commit is contained in:
2023-01-12 14:11:30 +01:00
parent 87607aa681
commit ecae444ee3
2 changed files with 117 additions and 28 deletions

View File

@ -273,12 +273,14 @@ def generic_on_cmd(
object_id: bytes, q: DefaultPusQueueHelper, info_str: str, out_idx: int
):
q.add_log_cmd(info_str + " on")
q.add_pus_tc(
pack_set_u8_param_command(
object_id,
OUT_ENABLE_LIST[out_idx].parameter_address,
Channel.on,
)
q.add_pus_tc(create_generic_on_cmd(object_id, out_idx))
def create_generic_on_cmd(object_id: bytes, out_idx: int):
return pack_set_u8_param_command(
object_id,
OUT_ENABLE_LIST[out_idx].parameter_address,
Channel.on,
)
@ -286,12 +288,14 @@ def generic_off_cmd(
object_id: bytes, q: DefaultPusQueueHelper, info_str: str, out_idx: int
):
q.add_log_cmd(info_str + " off")
q.add_pus_tc(
pack_set_u8_param_command(
object_id,
OUT_ENABLE_LIST[out_idx].parameter_address,
Channel.off,
)
q.add_pus_tc(create_generic_off_cmd(object_id, out_idx))
def create_generic_off_cmd(object_id: bytes, out_idx: int):
return pack_set_u8_param_command(
object_id,
OUT_ENABLE_LIST[out_idx].parameter_address,
Channel.off,
)