From 55cecdf81c19f1b636a23e007c0f3b29534cfce5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 25 Jan 2023 14:14:22 +0100 Subject: [PATCH] move some modules --- CHANGELOG.md | 10 ++++++++++ eive_tmtc/pus_tc/procedure_packer.py | 4 ++-- eive_tmtc/pus_tc/system/proc.py | 2 +- eive_tmtc/pus_tm/hk_handling.py | 2 +- eive_tmtc/tmtc/com/__init__.py | 0 .../devs => tmtc/com}/ccsds_handler.py | 20 +++++++++---------- .../syrlinks_handler.py} | 0 7 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 eive_tmtc/tmtc/com/__init__.py rename eive_tmtc/{pus_tc/devs => tmtc/com}/ccsds_handler.py (82%) rename eive_tmtc/tmtc/{syrlinks_hk_handler.py => com/syrlinks_handler.py} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91292fb..761aa92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,9 +10,19 @@ list yields a list of all related PRs for each release. # [unreleased] +## Fixed + - Bugfix for CCSDS handler commanding: Pass correct object ID + +## Added + - Added command to request switcher set from PCDU handler. + +## Changed + - Move Star Tracker module to `tmtc` folder and add some set IDs. Rename `SetIds` to `SetId`. +- Move `syrlinks_hk_handler` and `ccsds_handler` module to `tmtc` module. + Rename `syrlinks_hk_handler` to `syrlinks_handler`. # [v2.4.0] and [v2.4.1] 2023-01-23 diff --git a/eive_tmtc/pus_tc/procedure_packer.py b/eive_tmtc/pus_tc/procedure_packer.py index c680c41..f4ac731 100644 --- a/eive_tmtc/pus_tc/procedure_packer.py +++ b/eive_tmtc/pus_tc/procedure_packer.py @@ -36,10 +36,10 @@ from eive_tmtc.tmtc.acs.reaction_wheels import ( ) from eive_tmtc.pus_tc.devs.rad_sensor import pack_rad_sensor_test_into from eive_tmtc.tmtc.payload.ploc_memory_dumper import pack_ploc_memory_dumper_cmd -from eive_tmtc.pus_tc.devs.ccsds_handler import pack_ccsds_handler_test +from eive_tmtc.tmtc.com.ccsds_handler import pack_ccsds_handler_test from eive_tmtc.tmtc.core import pack_core_commands from eive_tmtc.tmtc.star_tracker import pack_star_tracker_commands -from eive_tmtc.tmtc.syrlinks_hk_handler import pack_syrlinks_command +from eive_tmtc.tmtc.com.syrlinks_handler import pack_syrlinks_command from eive_tmtc.pus_tc.devs.gps import pack_gps_command from eive_tmtc.tmtc.acs.acs_board import pack_acs_command from eive_tmtc.pus_tc.devs.plpcdu import pack_pl_pcdu_commands diff --git a/eive_tmtc/pus_tc/system/proc.py b/eive_tmtc/pus_tc/system/proc.py index 363081d..1403b6f 100644 --- a/eive_tmtc/pus_tc/system/proc.py +++ b/eive_tmtc/pus_tc/system/proc.py @@ -26,7 +26,7 @@ from eive_tmtc.pus_tc.devs.mgms import MgmLis3SetId as MgmLis3SetIds_0_2 from eive_tmtc.pus_tc.devs.mgms import MgmRm3100SetId as MgmRm3100SetIds_1_3 from eive_tmtc.pus_tc.devs.gyros import AdisGyroSetId as AdisGyroSetIds_0_2 from eive_tmtc.pus_tc.devs.gyros import L3gGyroSetId as L3gGyroSetIds_1_3 -from eive_tmtc.tmtc.syrlinks_hk_handler import SetId as SyrlinksSetIds +from eive_tmtc.tmtc.com.syrlinks_handler import SetId as SyrlinksSetIds from eive_tmtc.pus_tc.devs.gps import SetId as GpsSetIds from eive_tmtc.tmtc.acs.imtq import ImtqSetId from eive_tmtc.pus_tc.devs.sus import SetId diff --git a/eive_tmtc/pus_tm/hk_handling.py b/eive_tmtc/pus_tm/hk_handling.py index a14de4a..1c5ae4d 100644 --- a/eive_tmtc/pus_tm/hk_handling.py +++ b/eive_tmtc/pus_tm/hk_handling.py @@ -6,7 +6,7 @@ from eive_tmtc.pus_tm.devs.rad_sensor import handle_rad_sensor_data from eive_tmtc.pus_tm.devs.sus import handle_sus_hk from eive_tmtc.tmtc.payload.ploc_supervisor import handle_supv_hk_data from eive_tmtc.tmtc.acs.reaction_wheels import handle_rw_hk_data -from eive_tmtc.tmtc.syrlinks_hk_handler import handle_syrlinks_hk_data +from eive_tmtc.tmtc.com.syrlinks_handler import handle_syrlinks_hk_data from eive_tmtc.tmtc.tcs import handle_thermal_controller_hk_data from tmtccmd.tm.pus_3_fsfw_hk import ( Service3Base, diff --git a/eive_tmtc/tmtc/com/__init__.py b/eive_tmtc/tmtc/com/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/eive_tmtc/pus_tc/devs/ccsds_handler.py b/eive_tmtc/tmtc/com/ccsds_handler.py similarity index 82% rename from eive_tmtc/pus_tc/devs/ccsds_handler.py rename to eive_tmtc/tmtc/com/ccsds_handler.py index 1b09c77..5577aba 100644 --- a/eive_tmtc/pus_tc/devs/ccsds_handler.py +++ b/eive_tmtc/tmtc/com/ccsds_handler.py @@ -13,7 +13,7 @@ from tmtccmd.tc import DefaultPusQueueHelper from tmtccmd.util import ObjectIdU32 -class CommandId(enum.IntEnum): +class ActionId(enum.IntEnum): # Configures input rate of syrlinks to 400 Khz (results in downlink rate of 200 kbps) SET_LOW_RATE = 0 # Configures input rate of syrlinks to 2000 Khz (results in downlink rate of 1000 kbps) @@ -40,42 +40,42 @@ def pack_ccsds_handler_test( q.add_log_cmd(f"Testing CCSDS handler with object id: {object_id.as_hex_string}") if op_code == "0": q.add_log_cmd("CCSDS Handler: Set low rate") - command = obyt + struct.pack("!I", CommandId.SET_LOW_RATE) + command = obyt + struct.pack("!I", ActionId.SET_LOW_RATE) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) if op_code == "1": q.add_log_cmd("CCSDS Handler: Set high rate") - command = obyt + struct.pack("!I", CommandId.SET_HIGH_RATE) + command = obyt + struct.pack("!I", ActionId.SET_HIGH_RATE) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) if op_code == "2": q.add_log_cmd("CCSDS Handler: Enables the transmitter") - command = obyt + struct.pack("!I", CommandId.EN_TRANSMITTER) + command = obyt + struct.pack("!I", ActionId.EN_TRANSMITTER) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) if op_code == "3": q.add_log_cmd("CCSDS Handler: Disables the transmitter") - command = obyt + struct.pack("!I", CommandId.DIS_TRANSMITTER) + command = obyt + struct.pack("!I", ActionId.DIS_TRANSMITTER) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) if op_code == "4": q.add_log_cmd("CCSDS Handler: Set arbitrary bitrate") bitrate = int(input("Specify bit rate (bps): ")) command = ( obyt - + struct.pack("!I", CommandId.ARBITRARY_BITRATE) + + struct.pack("!I", ActionId.ARBITRARY_BITRATE) + struct.pack("!I", bitrate) ) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) if op_code == "5": q.add_log_cmd("CCSDS Handler: Enable tx clock manipulator") - command = obyt + struct.pack("!I", CommandId.ENABLE_TX_CLK_MANIPULATOR) + command = obyt + struct.pack("!I", ActionId.ENABLE_TX_CLK_MANIPULATOR) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) if op_code == "6": q.add_log_cmd("CCSDS Handler: Disable tx clock manipulator") - command = obyt + struct.pack("!I", CommandId.DISABLE_TX_CLK_MANIPULATOR) + command = obyt + struct.pack("!I", ActionId.DISABLE_TX_CLK_MANIPULATOR) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) if op_code == "7": q.add_log_cmd("CCSDS Handler: Update tx data on rising edge of tx clock") - command = obyt + struct.pack("!I", CommandId.UPDATE_ON_RISING_EDGE) + command = obyt + struct.pack("!I", ActionId.UPDATE_ON_RISING_EDGE) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) if op_code == "8": q.add_log_cmd("CCSDS Handler: Update tx data on falling edge of tx clock") - command = obyt + struct.pack("!I", CommandId.UPDATE_ON_FALLING_EDGE) + command = obyt + struct.pack("!I", ActionId.UPDATE_ON_FALLING_EDGE) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) diff --git a/eive_tmtc/tmtc/syrlinks_hk_handler.py b/eive_tmtc/tmtc/com/syrlinks_handler.py similarity index 100% rename from eive_tmtc/tmtc/syrlinks_hk_handler.py rename to eive_tmtc/tmtc/com/syrlinks_handler.py