From 02848468678535f84e886b90f986da6a72edf1a7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 25 Feb 2022 19:25:14 +0100 Subject: [PATCH] added PL PCDU tcs --- config/cmd_definitions.py | 13 +++++++++++++ config/definitions.py | 1 + config/hook_implementations.py | 2 ++ pus_tc/tc_packer_hook.py | 3 +++ 4 files changed, 19 insertions(+) diff --git a/config/cmd_definitions.py b/config/cmd_definitions.py index 3402dfa..63b10b1 100644 --- a/config/cmd_definitions.py +++ b/config/cmd_definitions.py @@ -90,6 +90,19 @@ def add_core_controller_definitions(cmd_dict: ServiceOpCodeDictT): ) +def add_pl_pcdu_cmds(cmd_dict: ServiceOpCodeDictT): + from pus_tc.plpcdu import OpCodes + op_code_dict = dict() + add_op_code_entry(op_code_dict=op_code_dict, keys=OpCodes.SWITCH_ADC_ON, info="Switch PL PCDU ADC on") + add_op_code_entry(op_code_dict=op_code_dict, keys=OpCodes.SWITCH_ALL_ON, info="Switch all PL PCDU modules on") + add_service_op_code_entry( + srv_op_code_dict=cmd_dict, + name=CustomServiceList.PL_PCDU.value, + info="PL PCDU", + op_code_entry=op_code_dict, + ) + + def add_pcdu_cmds(cmd_dict: ServiceOpCodeDictT): from pus_tc.p60dock import P60OpCodes, GomspaceOpCodes from pus_tc.pdu1 import Pdu1OpCodes diff --git a/config/definitions.py b/config/definitions.py index 3a104aa..d1a2cdf 100644 --- a/config/definitions.py +++ b/config/definitions.py @@ -24,6 +24,7 @@ class CustomServiceList(enum.Enum): IMTQ = "imtq" PLOC = "ploc" PCDU = "pcdu" + PL_PCDU = "plpcdu" SA_DEPLYOMENT = "sa_depl" REACTION_WHEEL_1 = "reaction_wheel_1" REACTION_WHEEL_2 = "reaction_wheel_2" diff --git a/config/hook_implementations.py b/config/hook_implementations.py index 9fa73ef..2090cc0 100644 --- a/config/hook_implementations.py +++ b/config/hook_implementations.py @@ -114,11 +114,13 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT): add_bpx_cmd_definitions, add_core_controller_definitions, add_pcdu_cmds, + add_pl_pcdu_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) op_code_dict = { GpsOpCodes.RESET_GNSS.value: ("Reset GPS", {OpCodeDictKeys.TIMEOUT: 2.0}) diff --git a/pus_tc/tc_packer_hook.py b/pus_tc/tc_packer_hook.py index 0989deb..40a2fb7 100644 --- a/pus_tc/tc_packer_hook.py +++ b/pus_tc/tc_packer_hook.py @@ -31,6 +31,7 @@ from pus_tc.star_tracker import pack_star_tracker_commands from pus_tc.syrlinks_hk_handler import pack_syrlinks_command from pus_tc.gps import pack_gps_command from pus_tc.acs import pack_acs_command +from pus_tc.plpcdu import pack_pl_pcdu_commands from pus_tc.str_img_helper import pack_str_img_helper_command from config.definitions import CustomServiceList from config.object_ids import ( @@ -192,6 +193,8 @@ def pack_service_queue_user( return pack_syrlinks_command( object_id=SYRLINKS_HANDLER_ID, tc_queue=service_queue, op_code=op_code ) + if service == CustomServiceList.PL_PCDU.value: + return pack_pl_pcdu_commands(tc_queue=service_queue, op_code=op_code) LOGGER.warning("Invalid Service !")