includes were not updated..

This commit is contained in:
Robin Mueller
2022-03-04 10:44:55 +01:00
parent 0d7b0d0184
commit ea5f384f72
7 changed files with 56 additions and 59 deletions

View File

@ -7,7 +7,7 @@ from tmtccmd.tc.service_200_mode import pack_mode_data, Modes, Subservices
from tmtccmd.tc.service_20_parameter import (
pack_scalar_double_param_app_data,
pack_fsfw_load_param_cmd,
pack_boolean_parameter_app_data
pack_boolean_parameter_app_data,
)
from tmtccmd.utility.logger import get_console_logger
from spacepackets.ecss.tc import PusTelecommand
@ -80,24 +80,22 @@ class ParamIds(enum.IntEnum):
def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
if op_code in OpCodes.SWITCH_ON:
tc_queue.appendleft((QueueCommands.PRINT, "Switching PL PCDU on"))
mode_data = pack_mode_data(
object_id=PL_PCDU_ID, mode=Modes.ON, submode=0
)
mode_data = pack_mode_data(object_id=PL_PCDU_ID, mode=Modes.ON, submode=0)
mode_cmd = PusTelecommand(
service=200, subservice=Subservices.SWITCH_MODE, app_data=mode_data
)
tc_queue.appendleft(mode_cmd.pack_command_tuple())
if op_code in OpCodes.SWITCH_OFF:
tc_queue.appendleft((QueueCommands.PRINT, "Switching PL PCDU off"))
mode_data = pack_mode_data(
object_id=PL_PCDU_ID, mode=Modes.OFF, submode=0
)
mode_data = pack_mode_data(object_id=PL_PCDU_ID, mode=Modes.OFF, submode=0)
mode_cmd = PusTelecommand(
service=200, subservice=Subservices.SWITCH_MODE, app_data=mode_data
)
tc_queue.appendleft(mode_cmd.pack_command_tuple())
if op_code in OpCodes.SWITCH_ADC_NORMAL:
tc_queue.appendleft((QueueCommands.PRINT, "Switching PL PCDU ADC module normal, submode ADC ON"))
tc_queue.appendleft(
(QueueCommands.PRINT, "Switching PL PCDU ADC module normal, submode ADC ON")
)
mode_data = pack_mode_data(
object_id=PL_PCDU_ID, mode=Modes.NORMAL, submode=Submodes.ADC_ON
)
@ -106,7 +104,12 @@ def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
)
tc_queue.appendleft(mode_cmd.pack_command_tuple())
if op_code in OpCodes.SWITCH_ALL_NORMAL:
tc_queue.appendleft((QueueCommands.PRINT, "Switching all PL PCDU modules normal, submode ALL ON"))
tc_queue.appendleft(
(
QueueCommands.PRINT,
"Switching all PL PCDU modules normal, submode ALL ON",
)
)
mode_data = pack_mode_data(
object_id=PL_PCDU_ID, mode=Modes.NORMAL, submode=Submodes.ALL_ON
)
@ -142,7 +145,7 @@ def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
pack_failure_injection_cmd(
tc_queue=tc_queue,
param_id=ParamIds.INJECT_ALL_ON_FAILURE,
print_str="All On"
print_str="All On",
)
@ -182,10 +185,7 @@ def pack_wait_time_cmd(tc_queue: TcQueueT, param_id: int, print_str: str):
def pack_failure_injection_cmd(tc_queue: TcQueueT, param_id: int, print_str: str):
tc_queue.appendleft((QueueCommands.PRINT, f"Inserting {print_str} error"))
param_data = pack_boolean_parameter_app_data(
object_id=PL_PCDU_ID,
domain_id=0,
unique_id=param_id,
parameter=True
object_id=PL_PCDU_ID, domain_id=0, unique_id=param_id, parameter=True
)
cmd = pack_fsfw_load_param_cmd(ssc=0, app_data=param_data)
tc_queue.appendleft(cmd.pack_command_tuple())