From 47fef53ac1208ef214366abcbbb46234532d70e0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 26 Feb 2023 14:53:01 +0100 Subject: [PATCH] corrections and improvements for ACS code --- eive_tmtc/tmtc/acs/acs_ctrl.py | 2 +- eive_tmtc/tmtc/acs/gyros.py | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/eive_tmtc/tmtc/acs/acs_ctrl.py b/eive_tmtc/tmtc/acs/acs_ctrl.py index ce39d4d..c7717ac 100644 --- a/eive_tmtc/tmtc/acs/acs_ctrl.py +++ b/eive_tmtc/tmtc/acs/acs_ctrl.py @@ -273,7 +273,7 @@ def pack_acs_ctrl_command(p: ServiceProviderParams): elif op_code in OpCodes.REQUEST_RAW_GYR_HK: q.add_log_cmd(Info.REQUEST_RAW_GYR_HK) q.add_pus_tc( - generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET)) + create_request_one_diag_command(make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET)) ) elif op_code in OpCodes.ENABLE_RAW_GYR_HK: q.add_log_cmd(Info.ENABLE_RAW_GYR_HK) diff --git a/eive_tmtc/tmtc/acs/gyros.py b/eive_tmtc/tmtc/acs/gyros.py index 9ac60e0..612b37b 100644 --- a/eive_tmtc/tmtc/acs/gyros.py +++ b/eive_tmtc/tmtc/acs/gyros.py @@ -5,6 +5,7 @@ import struct from tmtccmd.tc import DefaultPusQueueHelper import eive_tmtc.config.object_ids as obj_ids +from tmtccmd.tc.pus_200_fsfw_mode import create_mode_command, Mode from tmtccmd.tc.pus_3_fsfw_hk import create_request_one_hk_command, make_sid from tmtccmd.config.tmtc import ( tmtc_definitions_provider, @@ -25,6 +26,8 @@ from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter class OpCode: + NML = "normal" + OFF = "off" CORE_HK = "core_hk" CFG_HK = "cfg_hk" @@ -66,7 +69,13 @@ def handle_gyr_cmd(q: DefaultPusQueueHelper, op_code: str): core_hk_id = AdisGyroSetId.CORE_HK else: core_hk_id = L3gGyroSetId.CORE_HK - if op_code == OpCode.CORE_HK: + if op_code == OpCode.NML: + q.add_log_cmd(f"Gyro {gyr_info[0]} NORMAL mode") + q.add_pus_tc(create_mode_command(gyr_obj_id, Mode.NORMAL, 0)) + if op_code == OpCode.OFF: + q.add_log_cmd(f"Gyro {gyr_info[0]} OFF mode") + q.add_pus_tc(create_mode_command(gyr_obj_id, Mode.OFF, 0)) + elif op_code == OpCode.CORE_HK: q.add_log_cmd(f"Gyro {gyr_info[0]} Core HK") q.add_pus_tc(create_request_one_hk_command(make_sid(gyr_obj_id, core_hk_id))) elif op_code == OpCode.CFG_HK: @@ -166,4 +175,6 @@ def add_gyr_cmd_defs(defs: TmtcDefinitionWrapper): oce = OpCodeEntry() oce.add(keys=OpCode.CORE_HK, info="Request Core HK") oce.add(keys=OpCode.CFG_HK, info="Request CFG HK") + oce.add(keys=OpCode.NML, info="Normal Mode") + oce.add(keys=OpCode.OFF, info="Off Mode") defs.add_service(CustomServiceList.GYRO, info="Gyro", op_code_entry=oce)