From 2bd6caa3c21255f2ab5a2773eb83d2fca78c2234 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 15:21:48 +0100 Subject: [PATCH] add tm store module --- eive_tmtc/config/definitions.py | 1 + eive_tmtc/tmtc/acs/acs_ctrl.py | 16 ++++++++-------- eive_tmtc/tmtc/tm_store.py | 8 ++++++++ 3 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 eive_tmtc/tmtc/tm_store.py diff --git a/eive_tmtc/config/definitions.py b/eive_tmtc/config/definitions.py index 6b2fc6c..803f086 100644 --- a/eive_tmtc/config/definitions.py +++ b/eive_tmtc/config/definitions.py @@ -73,3 +73,4 @@ class CustomServiceList(str, enum.Enum): TVTTESTPROCEDURE = "tvtestproc" CONTROLLERS = "controllers" SCEX = "scex" + TM_STORE = "tm_store" diff --git a/eive_tmtc/tmtc/acs/acs_ctrl.py b/eive_tmtc/tmtc/acs/acs_ctrl.py index 379aa11..6e6a901 100644 --- a/eive_tmtc/tmtc/acs/acs_ctrl.py +++ b/eive_tmtc/tmtc/acs/acs_ctrl.py @@ -528,40 +528,40 @@ def handle_mgm_data_processed(pw: PrintWrapper, hk_data: bytes): current_idx = 0 fmt_str = "!fff" inc_len = struct.calcsize(fmt_str) - mgm_0 = struct.unpack(fmt_str, hk_data[current_idx: current_idx + inc_len]) + mgm_0 = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len]) mgm_0_str = [f"{val:8.3f}" for val in mgm_0] pw.dlog(f"MGM 0 Vec: {mgm_0_str}") current_idx += inc_len - mgm_1 = struct.unpack(fmt_str, hk_data[current_idx: current_idx + inc_len]) + mgm_1 = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len]) mgm_1_str = [f"{val:8.3f}" for val in mgm_1] pw.dlog(f"MGM 1 Vec: {mgm_1_str}") current_idx += inc_len - mgm_2 = struct.unpack(fmt_str, hk_data[current_idx: current_idx + inc_len]) + mgm_2 = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len]) mgm_2_str = [f"{val:8.3f}" for val in mgm_2] pw.dlog(f"MGM 2 Vec: {mgm_2_str}") current_idx += inc_len - mgm_3 = struct.unpack(fmt_str, hk_data[current_idx: current_idx + inc_len]) + mgm_3 = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len]) mgm_3_str = [f"{val:8.3f}" for val in mgm_3] pw.dlog(f"MGM 3 Vec: {mgm_3_str}") current_idx += inc_len - mgm_4 = struct.unpack(fmt_str, hk_data[current_idx: current_idx + inc_len]) + mgm_4 = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len]) mgm_4_str = [f"{val:8.3f}" for val in mgm_4] pw.dlog(f"MGM 4 Vec: {mgm_4_str}") current_idx += inc_len fmt_str = "!ddd" inc_len = struct.calcsize(fmt_str) - mgm_vec_tot = struct.unpack(fmt_str, hk_data[current_idx: current_idx + inc_len]) + mgm_vec_tot = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len]) mgm_vec_tot = [f"{val:8.3f}" for val in mgm_vec_tot] current_idx += inc_len pw.dlog(f"MGM Total Vec: {mgm_vec_tot}") mgm_vec_tot_deriv = struct.unpack( - fmt_str, hk_data[current_idx: current_idx + inc_len] + fmt_str, hk_data[current_idx : current_idx + inc_len] ) mgm_vec_tot_deriv = [f"{val:8.3f}" for val in mgm_vec_tot_deriv] pw.dlog(f"MGM Total Vec Deriv: {mgm_vec_tot_deriv}") current_idx += inc_len mag_igrf_model = struct.unpack( - fmt_str, hk_data[current_idx: current_idx + inc_len] + fmt_str, hk_data[current_idx : current_idx + inc_len] ) mag_igrf_model = [f"{val:8.3f}" for val in mag_igrf_model] pw.dlog(f"MAG IGRF Model: {mag_igrf_model}") diff --git a/eive_tmtc/tmtc/tm_store.py b/eive_tmtc/tmtc/tm_store.py new file mode 100644 index 0000000..0f2b6c1 --- /dev/null +++ b/eive_tmtc/tmtc/tm_store.py @@ -0,0 +1,8 @@ +from eive_tmtc.config.definitions import CustomServiceList +from tmtccmd.tc import service_provider +from tmtccmd.tc.decorator import ServiceProviderParams + + +@service_provider(CustomServiceList.TM_STORE) +def pack_tm_store_commands(p: ServiceProviderParams): + pass