additional pl pcdu commands

This commit is contained in:
Robin Müller 2022-03-03 18:24:17 +01:00
parent 37c1a68da1
commit 2ef8f5a32e
3 changed files with 36 additions and 21 deletions

View File

@ -92,17 +92,22 @@ def add_core_controller_definitions(cmd_dict: ServiceOpCodeDictT):
def add_pl_pcdu_cmds(cmd_dict: ServiceOpCodeDictT): def add_pl_pcdu_cmds(cmd_dict: ServiceOpCodeDictT):
from pus_tc.plpcdu import OpCodes from pus_tc.plpcdu import OpCodes
op_code_dict = dict() op_code_dict = dict()
add_op_code_entry( add_op_code_entry(
op_code_dict=op_code_dict, op_code_dict=op_code_dict,
keys=OpCodes.SWITCH_ADC_ON, keys=OpCodes.SWITCH_ON,
info="Switch PL PCDU ADC on", info="Switch PL PCDU on"
) )
add_op_code_entry( add_op_code_entry(
op_code_dict=op_code_dict, op_code_dict=op_code_dict,
keys=OpCodes.SWITCH_ALL_ON, keys=OpCodes.SWITCH_ADC_NORMAL,
info="Switch all PL PCDU modules on", info="Switch PL PCDU ADC normal, submode ADC ON"
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.SWITCH_ALL_NORMAL,
info="Switch all PL PCDU modules normal, submode ALL ON",
options={OpCodeDictKeys.ENTER_LISTENER_MODE: True}
) )
add_op_code_entry( add_op_code_entry(
op_code_dict=op_code_dict, op_code_dict=op_code_dict,

View File

@ -17,19 +17,20 @@ LOGGER = get_console_logger()
class OpCodes: class OpCodes:
SWITCH_ADC_ON = ["0", "switch-adc-on"] SWITCH_ON = ["0", "switch-adc-on"]
SWITCH_ALL_ON = ["1", "switch-all-on"] SWITCH_ADC_NORMAL = ["1", "switch-adc-normal"]
UPDATE_DRO_TO_X8_WAIT = ["2", "dro-to-x8-wait"] SWITCH_ALL_NORMAL = ["2", "switch-all-normal"]
UPDATE_X8_TO_TX_WAIT_TIME = ["3", "x8-to-tx-wait"] UPDATE_DRO_TO_X8_WAIT = ["3", "dro-to-x8-wait"]
UPDATE_TX_TO_MPA_WAIT_TIME = ["4", "tx-to-mpa-wait"] UPDATE_X8_TO_TX_WAIT_TIME = ["4", "x8-to-tx-wait"]
UPDATE_MPA_TO_HPA_WAIT_TIME = ["5", "mpa-to-hpa-wait"] UPDATE_TX_TO_MPA_WAIT_TIME = ["5", "tx-to-mpa-wait"]
UPDATE_MPA_TO_HPA_WAIT_TIME = ["6", "mpa-to-hpa-wait"]
INJECT_SSR_TO_DRO_FAILURE = ["6", "inject-ssr-dro-fault"] INJECT_SSR_TO_DRO_FAILURE = ["10", "inject-ssr-dro-fault"]
INJECT_DRO_TO_X8_FAILURE = ["7", "inject-dro-x8-fault"] INJECT_DRO_TO_X8_FAILURE = ["11", "inject-dro-x8-fault"]
INJECT_X8_TO_TX_FAILURE = ["8", "inject-x8-tx-fault"] INJECT_X8_TO_TX_FAILURE = ["12", "inject-x8-tx-fault"]
INJECT_TX_TO_MPA_FAILURE = ["9", "inject-tx-mpa-fault"] INJECT_TX_TO_MPA_FAILURE = ["13", "inject-tx-mpa-fault"]
INJECT_MPA_TO_HPA_FAILURE = ["10", "inject-mpa-hpa-fault"] INJECT_MPA_TO_HPA_FAILURE = ["14", "inject-mpa-hpa-fault"]
INJECT_ALL_ON_FAILURE = ["11", "inject-all-on-fault"] INJECT_ALL_ON_FAILURE = ["15", "inject-all-on-fault"]
class Submodes(enum.IntEnum): class Submodes(enum.IntEnum):
@ -76,8 +77,17 @@ class ParamIds(enum.IntEnum):
def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str): def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
if op_code in OpCodes.SWITCH_ADC_ON: if op_code in OpCodes.SWITCH_ON:
tc_queue.appendleft((QueueCommands.PRINT, "Switching PL PCDU ADC module on")) tc_queue.appendleft((QueueCommands.PRINT, "Switching PL PCDU ADC module on"))
mode_data = pack_mode_data(
object_id=PL_PCDU_ID, mode=Modes.ON, submode=Submodes.ADC_ON
)
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"))
mode_data = pack_mode_data( mode_data = pack_mode_data(
object_id=PL_PCDU_ID, mode=Modes.NORMAL, submode=Submodes.ADC_ON object_id=PL_PCDU_ID, mode=Modes.NORMAL, submode=Submodes.ADC_ON
) )
@ -85,8 +95,8 @@ def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
service=200, subservice=Subservices.SWITCH_MODE, app_data=mode_data service=200, subservice=Subservices.SWITCH_MODE, app_data=mode_data
) )
tc_queue.appendleft(mode_cmd.pack_command_tuple()) tc_queue.appendleft(mode_cmd.pack_command_tuple())
if op_code in OpCodes.SWITCH_ALL_ON: if op_code in OpCodes.SWITCH_ALL_NORMAL:
tc_queue.appendleft((QueueCommands.PRINT, "Switching all PL PCDU modules on")) tc_queue.appendleft((QueueCommands.PRINT, "Switching all PL PCDU modules normal, submode ALL ON"))
mode_data = pack_mode_data( mode_data = pack_mode_data(
object_id=PL_PCDU_ID, mode=Modes.NORMAL, submode=Submodes.ALL_ON object_id=PL_PCDU_ID, mode=Modes.NORMAL, submode=Submodes.ALL_ON
) )

@ -1 +1 @@
Subproject commit 81a88435a52c8115a9f4349e307b252ebb2ebb85 Subproject commit 02440987a06395803e8e679dd5c491eb8578a8df