added a few more commands

This commit is contained in:
Robin Mueller 2022-03-02 15:06:50 +01:00
parent b0cfe20a77
commit 54b319a487
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
3 changed files with 69 additions and 4 deletions

View File

@ -109,6 +109,36 @@ def add_pl_pcdu_cmds(cmd_dict: ServiceOpCodeDictT):
keys=OpCodes.UPDATE_DRO_TO_X8_WAIT,
info="Update DRO to X8 wait time",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.INJECT_SSR_TO_DRO_FAILURE,
info="Inject failure SSR to DRO transition"
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.INJECT_DRO_TO_X8_FAILURE,
info="Inject failure in DRO to X8 transition"
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.INJECT_X8_TO_TX_FAILURE,
info="Inject failure in X8 to TX transition"
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.INJECT_TX_TO_MPA_FAILURE,
info="Inject failure in TX to MPA transition"
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.INJECT_MPA_TO_HPA_FAILURE,
info="Inject failure in MPA to HPA transition"
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.INJECT_ALL_ON_FAILURE,
info="Inject failure in all on mode"
)
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
name=CustomServiceList.PL_PCDU.value,

View File

@ -7,6 +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
)
from tmtccmd.utility.logger import get_console_logger
from spacepackets.ecss.tc import PusTelecommand
@ -20,8 +21,8 @@ class OpCodes:
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"]
UPDATE_TX_TO_MPA_WAIT_TIME = ["4", "tx-to-mpa-wait"]
UPDATE_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"]
@ -100,7 +101,29 @@ def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
print_str="DRO to X8",
)
if op_code in OpCodes.UPDATE_X8_TO_TX_WAIT_TIME:
pass
pack_wait_time_cmd(
tc_queue=tc_queue,
param_id=ParamIds.X8_TO_TX_WAIT_TIME,
print_str="X8 to TX",
)
if op_code in OpCodes.UPDATE_TX_TO_MPA_WAIT_TIME:
pack_wait_time_cmd(
tc_queue=tc_queue,
param_id=ParamIds.TX_TO_MPA_WAIT_TIME,
print_str="TX to MPA",
)
if op_code in OpCodes.UPDATE_MPA_TO_HPA_WAIT_TIME:
pack_wait_time_cmd(
tc_queue=tc_queue,
param_id=ParamIds.MPA_TO_HPA_WAIT_TIME,
print_str="MPA to HPA",
)
if op_code in OpCodes.INJECT_ALL_ON_FAILURE:
pack_failure_injection_cmd(
tc_queue=tc_queue,
param_id=ParamIds.INJECT_ALL_ON_FAILURE,
print_str="All On"
)
def request_wait_time() -> Optional[float]:
@ -134,3 +157,15 @@ def pack_wait_time_cmd(tc_queue: TcQueueT, param_id: int, print_str: str):
)
cmd = pack_fsfw_load_param_cmd(ssc=0, app_data=param_data)
tc_queue.appendleft(cmd.pack_command_tuple())
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
)
cmd = pack_fsfw_load_param_cmd(ssc=0, app_data=param_data)
tc_queue.appendleft(cmd.pack_command_tuple())

@ -1 +1 @@
Subproject commit 92ddfd607f19903adee7e3dfd3e88de20a09bfab
Subproject commit 81a88435a52c8115a9f4349e307b252ebb2ebb85