From a8ea01bb2fced3d7562af4b200080e424468e9c6 Mon Sep 17 00:00:00 2001 From: Martin Zietz Date: Tue, 29 Jun 2021 09:51:54 +0200 Subject: [PATCH] added run configs for reaction wheels --- .idea/runConfigurations/RW1_Test.xml | 24 ++++++++++++++++++++++++ .idea/runConfigurations/RW2_Test_.xml | 24 ++++++++++++++++++++++++ .idea/runConfigurations/RW3_Test_.xml | 24 ++++++++++++++++++++++++ .idea/runConfigurations/RW4_Test_.xml | 24 ++++++++++++++++++++++++ config/definitions.py | 5 ++++- pus_tc/reaction_wheels.py | 10 +++++----- pus_tc/tc_packer_hook.py | 13 +++++++++++-- 7 files changed, 116 insertions(+), 8 deletions(-) create mode 100644 .idea/runConfigurations/RW1_Test.xml create mode 100644 .idea/runConfigurations/RW2_Test_.xml create mode 100644 .idea/runConfigurations/RW3_Test_.xml create mode 100644 .idea/runConfigurations/RW4_Test_.xml diff --git a/.idea/runConfigurations/RW1_Test.xml b/.idea/runConfigurations/RW1_Test.xml new file mode 100644 index 0000000..69a1cd0 --- /dev/null +++ b/.idea/runConfigurations/RW1_Test.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/RW2_Test_.xml b/.idea/runConfigurations/RW2_Test_.xml new file mode 100644 index 0000000..3c8d71d --- /dev/null +++ b/.idea/runConfigurations/RW2_Test_.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/RW3_Test_.xml b/.idea/runConfigurations/RW3_Test_.xml new file mode 100644 index 0000000..f874325 --- /dev/null +++ b/.idea/runConfigurations/RW3_Test_.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/RW4_Test_.xml b/.idea/runConfigurations/RW4_Test_.xml new file mode 100644 index 0000000..eaca002 --- /dev/null +++ b/.idea/runConfigurations/RW4_Test_.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/config/definitions.py b/config/definitions.py index 3ef84d2..a5e094b 100644 --- a/config/definitions.py +++ b/config/definitions.py @@ -23,4 +23,7 @@ class CustomServiceList(enum.Enum): PLOC = "ploc" PCDU = "pcdu", SA_DEPLYOMENT = "sa_depl" - REACTION_WHEEL = "reaction_wheel" + REACTION_WHEEL_1 = "reaction_wheel_1" + REACTION_WHEEL_2 = "reaction_wheel_2" + REACTION_WHEEL_3 = "reaction_wheel_3" + REACTION_WHEEL_4 = "reaction_wheel_4" diff --git a/pus_tc/reaction_wheels.py b/pus_tc/reaction_wheels.py index b407976..3aaa411 100644 --- a/pus_tc/reaction_wheels.py +++ b/pus_tc/reaction_wheels.py @@ -45,14 +45,14 @@ def pack_single_rw_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: if op_code == "0" or op_code == "1": tc_queue.appendleft((QueueCommands.PRINT, "Reaction Wheel: Set speed")) - command = pack_set_speed_command(object_id, -2000, 100) + command = pack_set_speed_command(object_id, 0, 1000) command = PusTelecommand(service=8, subservice=128, ssc=40, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) - tc_queue.appendleft((QueueCommands.PRINT, "Reaction Wheel: Init reaction wheel controller")) - command = object_id + RwCommandIds.INIT_RW_CONTROLLER - command = PusTelecommand(service=8, subservice=128, ssc=41, app_data=command) - tc_queue.appendleft(command.pack_command_tuple()) + # tc_queue.appendleft((QueueCommands.PRINT, "Reaction Wheel: Init reaction wheel controller")) + # command = object_id + RwCommandIds.INIT_RW_CONTROLLER + # command = PusTelecommand(service=8, subservice=128, ssc=41, app_data=command) + # tc_queue.appendleft(command.pack_command_tuple()) return tc_queue diff --git a/pus_tc/tc_packer_hook.py b/pus_tc/tc_packer_hook.py index dce0404..0b60522 100644 --- a/pus_tc/tc_packer_hook.py +++ b/pus_tc/tc_packer_hook.py @@ -25,7 +25,7 @@ from pus_tc.heater import pack_heater_test_into from pus_tc.reaction_wheels import pack_single_rw_test_into from config.definitions import CustomServiceList from config.object_ids import P60_DOCK_HANDLER, PDU_1_HANDLER_ID, PDU_2_HANDLER_ID, ACU_HANDLER_ID, \ - TMP_1075_1_HANDLER_ID, TMP_1075_2_HANDLER_ID, HEATER_ID, IMTQ_HANDLER_ID, PLOC_ID, RW1_ID + TMP_1075_1_HANDLER_ID, TMP_1075_2_HANDLER_ID, HEATER_ID, IMTQ_HANDLER_ID, PLOC_ID, RW1_ID, RW2_ID, RW3_ID, RW4_ID LOGGER = get_logger() @@ -69,9 +69,18 @@ def pack_service_queue_user(service: Union[str, int], op_code: str, service_queu if service == CustomServiceList.PLOC.value: object_id = PLOC_ID return pack_ploc_test_into(object_id=object_id, tc_queue=service_queue) - if service == CustomServiceList.REACTION_WHEEL.value: + if service == CustomServiceList.REACTION_WHEEL_1.value: object_id = RW1_ID return pack_single_rw_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code) + if service == CustomServiceList.REACTION_WHEEL_2.value: + object_id = RW2_ID + return pack_single_rw_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code) + if service == CustomServiceList.REACTION_WHEEL_3.value: + object_id = RW3_ID + return pack_single_rw_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code) + if service == CustomServiceList.REACTION_WHEEL_4.value: + object_id = RW4_ID + return pack_single_rw_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code) LOGGER.warning("Invalid Service !")