From b0c0a186a07875d479f9a7268abb34299a7c1ac5 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Wed, 15 Sep 2021 14:16:44 +0200 Subject: [PATCH 1/3] commands to switch on/off sus nominal, sus redundant and reaction wheels --- config/hook_implementations.py | 10 ++++++++-- pus_tc/pdu1.py | 12 ++++++++++++ pus_tc/pdu2.py | 24 ++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/config/hook_implementations.py b/config/hook_implementations.py index fa1fd53..c0a8e1f 100644 --- a/config/hook_implementations.py +++ b/config/hook_implementations.py @@ -61,13 +61,19 @@ class EiveHookObject(TmTcHookBase): "5": ("PDU1: Turn SUS nominal off", {OpCodeDictKeys.TIMEOUT: 2.0}), "6": ("PDU1: Turn ACS Side A on", {OpCodeDictKeys.TIMEOUT: 2.0}), "7": ("PDU1: Turn ACS Side A off", {OpCodeDictKeys.TIMEOUT: 2.0}), + "8": ("PDU1: Turn SUS nominal on", {OpCodeDictKeys.TIMEOUT: 2.0}), + "9": ("PDU1: Turn SUS nominal off", {OpCodeDictKeys.TIMEOUT: 2.0}), } service_pdu1_tuple = ("PDU1 Device", op_code_dict_srv_pdu1) op_code_dict_srv_pdu2 = { "0": ("PDU2 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}), - "1": ("PDU1: Turn ACS Side B on", {OpCodeDictKeys.TIMEOUT: 2.0}), - "2": ("PDU1: Turn ACS Side B off", {OpCodeDictKeys.TIMEOUT: 2.0}), + "1": ("PDU1: Turn ACS Side A on", {OpCodeDictKeys.TIMEOUT: 2.0}), + "2": ("PDU1: Turn ACS Side A off", {OpCodeDictKeys.TIMEOUT: 2.0}), + "3": ("PDU1: Turn SUS redundant on", {OpCodeDictKeys.TIMEOUT: 2.0}), + "4": ("PDU1: Turn SUS redundant off", {OpCodeDictKeys.TIMEOUT: 2.0}), + "5": ("PDU1: Turn reaction wheels on", {OpCodeDictKeys.TIMEOUT: 2.0}), + "6": ("PDU1: Turn reaction wheels off", {OpCodeDictKeys.TIMEOUT: 2.0}), } service_pdu2_tuple = ("PDU2 Device", op_code_dict_srv_pdu2) diff --git a/pus_tc/pdu1.py b/pus_tc/pdu1.py index 503849c..a34cbfe 100644 --- a/pus_tc/pdu1.py +++ b/pus_tc/pdu1.py @@ -70,6 +70,18 @@ def pack_pdu1_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) PDUConfigTable.out_en_7.parameter_size, Channel.off) command = PusTelecommand(service=8, subservice=128, ssc=35, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) + if op_code == "8": + tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal on")) + command = pack_set_param_command(object_id, PDUConfigTable.out_en_4.parameter_address, + PDUConfigTable.out_en_4.parameter_size, Channel.on) + command = PusTelecommand(service=8, subservice=128, ssc=36, app_data=command) + tc_queue.appendleft(command.pack_command_tuple()) + if op_code == "9": + tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal off")) + command = pack_set_param_command(object_id, PDUConfigTable.out_en_4.parameter_address, + PDUConfigTable.out_en_4.parameter_size, Channel.off) + command = PusTelecommand(service=8, subservice=128, ssc=36, app_data=command) + tc_queue.appendleft(command.pack_command_tuple()) if PDU1TestProcedure.all or PDU1TestProcedure.ping: tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test")) diff --git a/pus_tc/pdu2.py b/pus_tc/pdu2.py index ca7123f..b40c071 100644 --- a/pus_tc/pdu2.py +++ b/pus_tc/pdu2.py @@ -53,6 +53,30 @@ def pack_pdu2_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) return tc_queue + if op_code == "3": + tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn SUS redundant on")) + command = pack_set_param_command(object_id, PDUConfigTable.out_en_4.parameter_address, + PDUConfigTable.out_en_4.parameter_size, Channel.on) + command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command) + tc_queue.appendleft(command.pack_command_tuple()) + if op_code == "4": + tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn SUS redundant off")) + command = pack_set_param_command(object_id, PDUConfigTable.out_en_4.parameter_address, + PDUConfigTable.out_en_4.parameter_size, Channel.off) + command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command) + tc_queue.appendleft(command.pack_command_tuple()) + if op_code == "5": + tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn reaction wheels on")) + command = pack_set_param_command(object_id, PDUConfigTable.out_en_2.parameter_address, + PDUConfigTable.out_en_2.parameter_size, Channel.on) + command = PusTelecommand(service=8, subservice=128, ssc=34, app_data=command) + tc_queue.appendleft(command.pack_command_tuple()) + if op_code == "6": + tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn reaction wheels off")) + command = pack_set_param_command(object_id, PDUConfigTable.out_en_2.parameter_address, + PDUConfigTable.out_en_2.parameter_size, Channel.off) + command = PusTelecommand(service=8, subservice=128, ssc=35, app_data=command) + tc_queue.appendleft(command.pack_command_tuple()) if PDU2TestProcedure.all or PDU2TestProcedure.reboot: tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Reboot")) From b3bc1fe28c73d51f0b8319cf67705807596e5518 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 15 Sep 2021 18:48:28 +0200 Subject: [PATCH 2/3] fixes for new commands --- pus_tc/pdu2.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pus_tc/pdu2.py b/pus_tc/pdu2.py index 5353644..32786fb 100644 --- a/pus_tc/pdu2.py +++ b/pus_tc/pdu2.py @@ -63,25 +63,23 @@ def pack_pdu2_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn SUS redundant on")) command = pack_set_param_command(object_id, PDUConfigTable.out_en_4.parameter_address, PDUConfigTable.out_en_4.parameter_size, Channel.on) - command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if op_code == "4": tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn SUS redundant off")) command = pack_set_param_command(object_id, PDUConfigTable.out_en_4.parameter_address, PDUConfigTable.out_en_4.parameter_size, Channel.off) - command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if op_code == "5": tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn reaction wheels on")) - command = pack_set_param_command(object_id, PDUConfigTable.out_en_2.parameter_address, - PDUConfigTable.out_en_2.parameter_size, Channel.on) - command = PusTelecommand(service=8, subservice=128, ssc=34, app_data=command) + command = pack_set_param_command( + object_id, PDUConfigTable.out_en_2.parameter_address, PDUConfigTable.out_en_2.parameter_size, Channel.on + ) tc_queue.appendleft(command.pack_command_tuple()) if op_code == "6": tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn reaction wheels off")) command = pack_set_param_command(object_id, PDUConfigTable.out_en_2.parameter_address, PDUConfigTable.out_en_2.parameter_size, Channel.off) - command = PusTelecommand(service=8, subservice=128, ssc=35, app_data=command) + tc_queue.appendleft(command.pack_command_tuple()) if op_code == Pdu2OpCodes.PRINT_SWITCH_STATE.value: tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Print Switch Status")) command = generate_action_command( From 9d1cae0809a7784f0dceb01359f723975a5903e7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 16 Sep 2021 11:50:25 +0200 Subject: [PATCH 3/3] minor fix --- pus_tc/pdu1.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pus_tc/pdu1.py b/pus_tc/pdu1.py index 3e3c851..59aefeb 100644 --- a/pus_tc/pdu1.py +++ b/pus_tc/pdu1.py @@ -85,15 +85,17 @@ def pack_pdu1_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str): tc_queue.appendleft(command.pack_command_tuple()) if op_code == "8": tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal on")) - command = pack_set_param_command(object_id, PDUConfigTable.out_en_4.parameter_address, - PDUConfigTable.out_en_4.parameter_size, Channel.on) - command = PusTelecommand(service=8, subservice=128, ssc=36, app_data=command) + command = pack_set_param_command( + object_id, PDUConfigTable.out_en_4.parameter_address, + PDUConfigTable.out_en_4.parameter_size, Channel.on + ) tc_queue.appendleft(command.pack_command_tuple()) if op_code == "9": tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal off")) - command = pack_set_param_command(object_id, PDUConfigTable.out_en_4.parameter_address, - PDUConfigTable.out_en_4.parameter_size, Channel.off) - command = PusTelecommand(service=8, subservice=128, ssc=36, app_data=command) + command = pack_set_param_command( + object_id, PDUConfigTable.out_en_4.parameter_address, + PDUConfigTable.out_en_4.parameter_size, Channel.off + ) tc_queue.appendleft(command.pack_command_tuple()) if PDU1TestProcedure.all or PDU1TestProcedure.ping: