From 81674ca082976950034b2478496a361000c7f02b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 11 Aug 2022 19:18:01 +0200 Subject: [PATCH] add command to request TCS HK set --- pus_tc/system/tcs.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/pus_tc/system/tcs.py b/pus_tc/system/tcs.py index 9fd1c3b..676cf42 100644 --- a/pus_tc/system/tcs.py +++ b/pus_tc/system/tcs.py @@ -1,8 +1,15 @@ +import enum + from tmtccmd.tc import DefaultPusQueueHelper from tmtccmd.tc.pus_200_fsfw_modes import Modes +from tmtccmd.tc.pus_3_fsfw_hk import ( + make_sid, + generate_one_diag_command, + generate_one_hk_command, +) from .common import command_mode -from config.object_ids import TCS_BOARD_ASS_ID +from config.object_ids import TCS_BOARD_ASS_ID, TCS_CONTROLLER class OpCodes: @@ -12,14 +19,22 @@ class OpCodes: class Info: - REQUEST_ALL_TEMP_SET = "Request HK set of all temperatures" + REQUEST_SENSOR_TEMP_SET = "Request HK set of primary sensor temperatures" TCS_BOARD_ASS_NORMAL = "Switching TCS board assembly on" TCS_BOARD_ASS_OFF = "Switching TCS board assembly off" +class SetIds(enum.IntEnum): + PRIMARY_SENSORS = 0 + DEVICE_SENSORS = 1 + SUS_TEMP_SENSORS = 2 + + def pack_tcs_sys_commands(q: DefaultPusQueueHelper, op_code: str): if op_code in OpCodes.REQUEST_ALL_TEMP_HK: - pass + sensor_set_sid = make_sid(TCS_CONTROLLER, SetIds.PRIMARY_SENSORS) + q.add_log_cmd(Info.REQUEST_SENSOR_TEMP_SET) + q.add_pus_tc(generate_one_hk_command(sensor_set_sid)) if op_code in OpCodes.TCS_BOARD_ASS_NORMAL: command_mode( object_id=TCS_BOARD_ASS_ID,