moved some more commands

This commit is contained in:
Robin Mueller 2022-03-02 11:44:39 +01:00
parent 3c3a5ab03c
commit 847e2a4c15
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
3 changed files with 214 additions and 180 deletions

View File

@ -302,3 +302,174 @@ def add_pcdu_cmds(cmd_dict: ServiceOpCodeDictT):
info="PDU2 Device",
op_code_entry=op_code_dict,
)
def add_imtq_cmds(cmd_dict: ServiceOpCodeDictT):
op_code_dict_srv_imtq = {
"0": ("IMTQ Tests All", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("IMTQ perform pos X self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("IMTQ perform neg X self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("IMTQ perform pos Y self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
"4": ("IMTQ perform neg Y self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": ("IMTQ perform pos Z self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
"6": ("IMTQ perform neg Z self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
"7": ("IMTQ command dipole", {OpCodeDictKeys.TIMEOUT: 2.0}),
"8": ("IMTQ get commanded dipole", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_imtq_tuple = ("IMTQ Device", op_code_dict_srv_imtq)
cmd_dict[CustomServiceList.IMTQ.value] = service_imtq_tuple
def add_rw_cmds(cmd_dict: ServiceOpCodeDictT):
op_code_dict_srv_rw = {
"0": ("Reaction Wheel: Run all commands", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("Reaction Wheel: Set speed", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("Reaction Wheel: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("Reaction Wheel: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"4": ("Reaction Wheel: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": (
"Reaction Wheel: Send get-telemetry-command",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
}
service_rw_tuple = ("Reaction Wheel", op_code_dict_srv_rw)
cmd_dict[CustomServiceList.REACTION_WHEEL_1.value] = service_rw_tuple
cmd_dict[CustomServiceList.REACTION_WHEEL_2.value] = service_rw_tuple
cmd_dict[CustomServiceList.REACTION_WHEEL_3.value] = service_rw_tuple
cmd_dict[CustomServiceList.REACTION_WHEEL_4.value] = service_rw_tuple
def add_rad_sens_cmds(cmd_dict: ServiceOpCodeDictT):
op_code_dict_srv_rad_sensor = {
"0": ("Radiation Sensor: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("Radiation Sensor: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("Radiation Sensor: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_rad_sensor_tuple = ("Radiation Sensor", op_code_dict_srv_rad_sensor)
cmd_dict[CustomServiceList.RAD_SENSOR] = service_rad_sensor_tuple
def add_ploc_cmds(cmd_dict: ServiceOpCodeDictT):
op_code_dict_ploc_mem_dumper = {
"0": ("PLOC Memory Dumper: MRAM dump", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_ploc_memory_dumper_tuple = (
"PLOC Memory Dumper",
op_code_dict_ploc_mem_dumper,
)
op_code_dict_srv_ploc_supv = {
"0": ("PLOC Supervisor: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("PLOC Supervisor: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("PLOC Supervisor: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("PLOC Supervisor: Get HK Report", {OpCodeDictKeys.TIMEOUT: 2.0}),
"4": ("PLOC Supervisor: Restart MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": ("PLOC Supervisor: Start MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
"6": ("PLOC Supervisor: Shutdown MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
"7": (
"PLOC Supervisor: Select MPSoC boot image",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"8": ("PLOC Supervisor: Set max restart tries", {OpCodeDictKeys.TIMEOUT: 2.0}),
"9": ("PLOC Supervisor: Reset MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
"10": ("PLOC Supervisor: Set time reference", {OpCodeDictKeys.TIMEOUT: 2.0}),
"11": ("PLOC Supervisor: Set boot timeout", {OpCodeDictKeys.TIMEOUT: 2.0}),
"12": ("PLOC Supervisor: Disable Hk", {OpCodeDictKeys.TIMEOUT: 2.0}),
"13": (
"PLOC Supervisor: Request boot status report",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"14": ("PLOC Supervisor: Update available", {OpCodeDictKeys.TIMEOUT: 2.0}),
"15": ("PLOC Supervisor: Watchdogs enable", {OpCodeDictKeys.TIMEOUT: 2.0}),
"16": (
"PLOC Supervisor: Watchdog Configure Timeout",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"17": ("PLOC Supervisor: Enable latchup alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
"18": ("PLOC Supervisor: Disable latchup alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
"19": ("PLOC Supervisor: Auto calibrate alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
"20": ("PLOC Supervisor: Set alert limit", {OpCodeDictKeys.TIMEOUT: 2.0}),
"21": ("PLOC Supervisor: Set alert irq filter", {OpCodeDictKeys.TIMEOUT: 2.0}),
"22": ("PLOC Supervisor: Set ADC sweep period", {OpCodeDictKeys.TIMEOUT: 2.0}),
"23": (
"PLOC Supervisor: Set ADC enabled channels",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"24": (
"PLOC Supervisor: Set ADC window and stride",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"25": ("PLOC Supervisor: Set ADC threshold", {OpCodeDictKeys.TIMEOUT: 2.0}),
"26": (
"PLOC Supervisor: Request latchup status report",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"27": ("PLOC Supervisor: Copy ADC data to MRAM", {OpCodeDictKeys.TIMEOUT: 2.0}),
"28": (
"PLOC Supervisor: Enable/Disable NVM0/1/3",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"29": ("PLOC Supervisor: Select NVM", {OpCodeDictKeys.TIMEOUT: 2.0}),
"30": ("PLOC Supervisor: Run auto EM tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
"31": ("PLOC Supervisor: MRAM Wipe", {OpCodeDictKeys.TIMEOUT: 2.0}),
"33": ("PLOC Supervisor: Print CPU stats", {OpCodeDictKeys.TIMEOUT: 2.0}),
"34": ("PLOC Supervisor: Set debug verbosity", {OpCodeDictKeys.TIMEOUT: 2.0}),
"35": ("PLOC Supervisor: Set GPIO", {OpCodeDictKeys.TIMEOUT: 2.0}),
"36": ("PLOC Supervisor: Read GPIO", {OpCodeDictKeys.TIMEOUT: 2.0}),
"37": ("PLOC Supervisor: Restart supervisor", {OpCodeDictKeys.TIMEOUT: 2.0}),
"38": (
"PLOC Supervisor: Factory reset clear all",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"39": (
"PLOC Supervisor: Factory reset clear mirror entries",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"40": (
"PLOC Supervisor: Factory reset clear circular entries",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"41": ("PLOC Supervisor: CAN loopback test", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)
op_code_dict_srv_ploc_updater = {
"0": (
"Ploc Updater: Update uboot on partition A",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"1": (
"Ploc Updater: Update bitstream on partition A",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"2": (
"Ploc Updater: Update linux on partition A",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"3": (
"Ploc Updater: Update application on partition A",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"4": (
"Ploc Updater: Update uboot on partition B",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"5": (
"Ploc Updater: Update bitstream on partition B",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"6": (
"Ploc Updater: Update linux on partition B",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"7": (
"Ploc Updater: Update application on partition B",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
}
service_ploc_updater_tuple = ("Ploc Updater", op_code_dict_srv_ploc_updater)
cmd_dict[CustomServiceList.PLOC_SUPV.value] = service_ploc_supv_tuple
cmd_dict[CustomServiceList.PLOC_UPDATER.value] = service_ploc_updater_tuple
cmd_dict[
CustomServiceList.PLOC_MEMORY_DUMPER.value
] = service_ploc_memory_dumper_tuple

View File

@ -115,12 +115,22 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
add_core_controller_definitions,
add_pcdu_cmds,
add_pl_pcdu_cmds,
add_imtq_cmds,
add_rw_cmds,
add_rad_sens_cmds,
add_ploc_cmds,
)
from pus_tc.gps import GpsOpCodes
add_bpx_cmd_definitions(cmd_dict=service_op_code_dict)
add_core_controller_definitions(cmd_dict=service_op_code_dict)
add_pl_pcdu_cmds(cmd_dict=service_op_code_dict)
add_pcdu_cmds(cmd_dict=service_op_code_dict)
add_imtq_cmds(cmd_dict=service_op_code_dict)
add_rad_sens_cmds(cmd_dict=service_op_code_dict)
add_rw_cmds(cmd_dict=service_op_code_dict)
add_rad_sens_cmds(cmd_dict=service_op_code_dict)
add_ploc_cmds(cmd_dict=service_op_code_dict)
op_code_dict = {
GpsOpCodes.RESET_GNSS.value: ("Reset GPS", {OpCodeDictKeys.TIMEOUT: 2.0})
@ -144,165 +154,11 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
service_tuple = ("TMP1075 2", op_code_dict)
service_op_code_dict[CustomServiceList.TMP1075_2.value] = service_tuple
add_pcdu_cmds(cmd_dict=service_op_code_dict)
op_code_dict_srv_heater = {
"0": ("Heater Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_heater_tuple = ("Heater Device", op_code_dict_srv_heater)
op_code_dict_srv_imtq = {
"0": ("IMTQ Tests All", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("IMTQ perform pos X self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("IMTQ perform neg X self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("IMTQ perform pos Y self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
"4": ("IMTQ perform neg Y self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": ("IMTQ perform pos Z self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
"6": ("IMTQ perform neg Z self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
"7": ("IMTQ command dipole", {OpCodeDictKeys.TIMEOUT: 2.0}),
"8": ("IMTQ get commanded dipole", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_imtq_tuple = ("IMTQ Device", op_code_dict_srv_imtq)
op_code_dict_srv_rw = {
"0": ("Reaction Wheel: Run all commands", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("Reaction Wheel: Set speed", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("Reaction Wheel: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("Reaction Wheel: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"4": ("Reaction Wheel: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": (
"Reaction Wheel: Send get-telemetry-command",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
}
service_rw_tuple = ("Reaction Wheel", op_code_dict_srv_rw)
op_code_dict_srv_rad_sensor = {
"0": ("Radiation Sensor: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("Radiation Sensor: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("Radiation Sensor: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_rad_sensor_tuple = ("Radiation Sensor", op_code_dict_srv_rad_sensor)
op_code_dict_ploc_mem_dumper = {
"0": ("PLOC Memory Dumper: MRAM dump", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_ploc_memory_dumper_tuple = (
"Radiation Sensor",
op_code_dict_ploc_mem_dumper,
)
op_code_dict_srv_ploc_supv = {
"0": ("PLOC Supervisor: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("PLOC Supervisor: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("PLOC Supervisor: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("PLOC Supervisor: Get HK Report", {OpCodeDictKeys.TIMEOUT: 2.0}),
"4": ("PLOC Supervisor: Restart MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": ("PLOC Supervisor: Start MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
"6": ("PLOC Supervisor: Shutdown MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
"7": (
"PLOC Supervisor: Select MPSoC boot image",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"8": ("PLOC Supervisor: Set max restart tries", {OpCodeDictKeys.TIMEOUT: 2.0}),
"9": ("PLOC Supervisor: Reset MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
"10": ("PLOC Supervisor: Set time reference", {OpCodeDictKeys.TIMEOUT: 2.0}),
"11": ("PLOC Supervisor: Set boot timeout", {OpCodeDictKeys.TIMEOUT: 2.0}),
"12": ("PLOC Supervisor: Disable Hk", {OpCodeDictKeys.TIMEOUT: 2.0}),
"13": (
"PLOC Supervisor: Request boot status report",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"14": ("PLOC Supervisor: Update available", {OpCodeDictKeys.TIMEOUT: 2.0}),
"15": ("PLOC Supervisor: Watchdogs enable", {OpCodeDictKeys.TIMEOUT: 2.0}),
"16": (
"PLOC Supervisor: Watchdog Configure Timeout",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"17": ("PLOC Supervisor: Enable latchup alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
"18": ("PLOC Supervisor: Disable latchup alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
"19": ("PLOC Supervisor: Auto calibrate alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
"20": ("PLOC Supervisor: Set alert limit", {OpCodeDictKeys.TIMEOUT: 2.0}),
"21": ("PLOC Supervisor: Set alert irq filter", {OpCodeDictKeys.TIMEOUT: 2.0}),
"22": ("PLOC Supervisor: Set ADC sweep period", {OpCodeDictKeys.TIMEOUT: 2.0}),
"23": (
"PLOC Supervisor: Set ADC enabled channels",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"24": (
"PLOC Supervisor: Set ADC window and stride",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"25": ("PLOC Supervisor: Set ADC threshold", {OpCodeDictKeys.TIMEOUT: 2.0}),
"26": (
"PLOC Supervisor: Request latchup status report",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"27": ("PLOC Supervisor: Copy ADC data to MRAM", {OpCodeDictKeys.TIMEOUT: 2.0}),
"28": (
"PLOC Supervisor: Enable/Disable NVM0/1/3",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"29": ("PLOC Supervisor: Select NVM", {OpCodeDictKeys.TIMEOUT: 2.0}),
"30": ("PLOC Supervisor: Run auto EM tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
"31": ("PLOC Supervisor: MRAM Wipe", {OpCodeDictKeys.TIMEOUT: 2.0}),
"33": ("PLOC Supervisor: Print CPU stats", {OpCodeDictKeys.TIMEOUT: 2.0}),
"34": ("PLOC Supervisor: Set debug verbosity", {OpCodeDictKeys.TIMEOUT: 2.0}),
"35": ("PLOC Supervisor: Set GPIO", {OpCodeDictKeys.TIMEOUT: 2.0}),
"36": ("PLOC Supervisor: Read GPIO", {OpCodeDictKeys.TIMEOUT: 2.0}),
"37": ("PLOC Supervisor: Restart supervisor", {OpCodeDictKeys.TIMEOUT: 2.0}),
"38": (
"PLOC Supervisor: Factory reset clear all",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"39": (
"PLOC Supervisor: Factory reset clear mirror entries",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"40": (
"PLOC Supervisor: Factory reset clear circular entries",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"41": ("PLOC Supervisor: CAN loopback test", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)
op_code_dict_srv_ploc_updater = {
"0": (
"Ploc Updater: Update uboot on partition A",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"1": (
"Ploc Updater: Update bitstream on partition A",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"2": (
"Ploc Updater: Update linux on partition A",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"3": (
"Ploc Updater: Update application on partition A",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"4": (
"Ploc Updater: Update uboot on partition B",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"5": (
"Ploc Updater: Update bitstream on partition B",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"6": (
"Ploc Updater: Update linux on partition B",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"7": (
"Ploc Updater: Update application on partition B",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
}
service_ploc_updater_tuple = ("Ploc Updater", op_code_dict_srv_ploc_updater)
op_code_dict_srv_star_tracker = {
"0": (
"Star Tracker: Mode On, Submode Bootloader",
@ -488,22 +344,9 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
op_code_dict_srv_syrlinks_handler,
)
service_op_code_dict[CustomServiceList.HEATER.value] = service_heater_tuple
service_op_code_dict[CustomServiceList.IMTQ.value] = service_imtq_tuple
service_op_code_dict[CustomServiceList.REACTION_WHEEL_1.value] = service_rw_tuple
service_op_code_dict[CustomServiceList.REACTION_WHEEL_2.value] = service_rw_tuple
service_op_code_dict[CustomServiceList.REACTION_WHEEL_3.value] = service_rw_tuple
service_op_code_dict[CustomServiceList.REACTION_WHEEL_4.value] = service_rw_tuple
service_op_code_dict[CustomServiceList.RAD_SENSOR.value] = service_rad_sensor_tuple
service_op_code_dict[CustomServiceList.PLOC_SUPV.value] = service_ploc_supv_tuple
service_op_code_dict[
CustomServiceList.PLOC_UPDATER.value
] = service_ploc_updater_tuple
service_op_code_dict[
CustomServiceList.STAR_TRACKER.value
] = service_star_tracker_tuple
service_op_code_dict[
CustomServiceList.PLOC_MEMORY_DUMPER.value
] = service_ploc_memory_dumper_tuple
service_op_code_dict[
CustomServiceList.CCSDS_HANDLER.value
] = service_ccsds_handler_tuple

View File

@ -19,6 +19,16 @@ class OpCodes:
SWITCH_ADC_ON = ["0", "switch-adc-on"]
SWITCH_ALL_ON = ["1", "switch-all-on"]
UPDATE_DRO_TO_X8_WAIT = ["2", "dro-to-x8-wait"]
UPDATE_X8_TO_TX_WAIT_TIME = ["3", "x8-to-tx-wait"]
TX_TO_MPA_WAIT_TIME = ["4", "tx-to-mpa-wait"]
MPA_TO_HPA_WAIT_TIME = ["5", "mpa-to-hpa-wait"]
INJECT_SSR_TO_DRO_FAILURE = ["6", "inject-ssr-dro-fault"]
INJECT_DRO_TO_X8_FAILURE = ["7", "inject-dro-x8-fault"]
INJECT_X8_TO_TX_FAILURE = ["8", "inject-x8-tx-fault"]
INJECT_TX_TO_MPA_FAILURE = ["9", "inject-tx-mpa-fault"]
INJECT_MPA_TO_HPA_FAILURE = ["10", "inject-mpa-hpa-fault"]
INJECT_ALL_ON_FAILURE = ["11", "inject-all-on-fault"]
class Submodes(enum.IntEnum):
@ -84,20 +94,13 @@ def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
)
tc_queue.appendleft(mode_cmd.pack_command_tuple())
if op_code in OpCodes.UPDATE_DRO_TO_X8_WAIT:
wait_time = request_wait_time()
tc_queue.appendleft(
(QueueCommands.PRINT, f"Updating DRO to X8 wait time to {wait_time}")
pack_wait_time_cmd(
tc_queue=tc_queue,
param_id=ParamIds.DRO_TO_X8_WAIT_TIME,
print_str="DRO to X8",
)
if wait_time is None:
return
param_data = pack_scalar_double_param_app_data(
object_id=PL_PCDU_ID,
domain_id=0,
unique_id=ParamIds.DRO_TO_X8_WAIT_TIME,
parameter=wait_time,
)
cmd = pack_fsfw_load_param_cmd(ssc=0, app_data=param_data)
tc_queue.appendleft(cmd.pack_command_tuple())
if op_code in OpCodes.UPDATE_X8_TO_TX_WAIT_TIME:
pass
def request_wait_time() -> Optional[float]:
@ -114,3 +117,20 @@ def request_wait_time() -> Optional[float]:
LOGGER.warning("Invalid input")
else:
return wait_time
def pack_wait_time_cmd(tc_queue: TcQueueT, param_id: int, print_str: str):
wait_time = request_wait_time()
tc_queue.appendleft(
(QueueCommands.PRINT, f"Updating {print_str} wait time to {wait_time}")
)
if wait_time is None:
return
param_data = pack_scalar_double_param_app_data(
object_id=PL_PCDU_ID,
domain_id=0,
unique_id=param_id,
parameter=wait_time,
)
cmd = pack_fsfw_load_param_cmd(ssc=0, app_data=param_data)
tc_queue.appendleft(cmd.pack_command_tuple())