From 1a27ea9674ee03bbb9d617440522e571767a4501 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 11 Aug 2022 19:12:27 +0200 Subject: [PATCH] add controller obj IDs --- config/object_ids.py | 6 +++++- pus_tc/system/controllers.py | 12 +++++++++--- pus_tc/system/tcs.py | 4 ++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/config/object_ids.py b/config/object_ids.py index 98da0c9..c430253 100644 --- a/config/object_ids.py +++ b/config/object_ids.py @@ -15,7 +15,6 @@ __OBJECT_ID_DICT = None # Core Object IDs -CORE_CONTROLLER_ID = bytes([0x43, 0x00, 0x00, 0x03]) SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x41, 0x00, 0xA2]) # Power Object IDs @@ -128,6 +127,11 @@ SUS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x02]) TCS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x03]) RW_ASSEMBLY = bytes([0x73, 0x00, 0x00, 0x04]) +# Controllers +TCS_CONTROLLER = bytes([0x43, 0x40, 0x00, 0x01]) +ACS_CONTROLLER = bytes([0x43, 0x40, 0x00, 0x02]) +CORE_CONTROLLER_ID = bytes([0x43, 0x00, 0x00, 0x03]) + def get_object_ids() -> ObjectIdDictT: global __OBJECT_ID_DICT diff --git a/pus_tc/system/controllers.py b/pus_tc/system/controllers.py index 9b0d895..f02a907 100644 --- a/pus_tc/system/controllers.py +++ b/pus_tc/system/controllers.py @@ -1,6 +1,8 @@ +from typing import Union + from tmtccmd.tc import DefaultPusQueueHelper from tmtccmd.tc.pus_200_fsfw_modes import Modes -from tmtccmd.util import ObjectIdU32 +from tmtccmd.util import ObjectIdU32, ObjectIdBase from .common import command_mode import config.object_ids as obj_ids @@ -43,7 +45,9 @@ def pack_cmd_ctrl_to_prompted_mode( ) -def pack_cmd_ctrl_to_off(q: DefaultPusQueueHelper, object_id: ObjectIdU32): +def pack_cmd_ctrl_to_off( + q: DefaultPusQueueHelper, object_id: Union[ObjectIdBase, ObjectIdU32] +): command_mode( object_id=object_id.as_bytes, mode=Modes.OFF, @@ -63,7 +67,9 @@ def pack_cmd_ctrl_to_on(q: DefaultPusQueueHelper, object_id: ObjectIdU32): ) -def pack_cmd_ctrl_to_nml(q: DefaultPusQueueHelper, object_id: ObjectIdU32): +def pack_cmd_ctrl_to_nml( + q: DefaultPusQueueHelper, object_id: Union[ObjectIdBase, ObjectIdU32] +): command_mode( object_id=object_id.as_bytes, mode=Modes.NORMAL, diff --git a/pus_tc/system/tcs.py b/pus_tc/system/tcs.py index e8686c4..9fd1c3b 100644 --- a/pus_tc/system/tcs.py +++ b/pus_tc/system/tcs.py @@ -8,14 +8,18 @@ from config.object_ids import TCS_BOARD_ASS_ID class OpCodes: TCS_BOARD_ASS_NORMAL = ["0", "tcs-normal"] TCS_BOARD_ASS_OFF = ["1", "tcs-off"] + REQUEST_ALL_TEMP_HK = ["temp-hk"] class Info: + REQUEST_ALL_TEMP_SET = "Request HK set of all temperatures" TCS_BOARD_ASS_NORMAL = "Switching TCS board assembly on" TCS_BOARD_ASS_OFF = "Switching TCS board assembly off" def pack_tcs_sys_commands(q: DefaultPusQueueHelper, op_code: str): + if op_code in OpCodes.REQUEST_ALL_TEMP_HK: + pass if op_code in OpCodes.TCS_BOARD_ASS_NORMAL: command_mode( object_id=TCS_BOARD_ASS_ID,