From e617faa4df8ba859f5816f3ab1b8a31ac3aeea7c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Feb 2023 14:49:50 +0100 Subject: [PATCH] some tweaks --- eive_tmtc/config/object_ids.py | 8 ++++++-- eive_tmtc/pus_tc/procedure_packer.py | 3 ++- eive_tmtc/tmtc/tcs/tmp1075.py | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/eive_tmtc/config/object_ids.py b/eive_tmtc/config/object_ids.py index 6103522..4893b79 100644 --- a/eive_tmtc/config/object_ids.py +++ b/eive_tmtc/config/object_ids.py @@ -5,9 +5,10 @@ """ import logging import os.path +from typing import Dict from eive_tmtc import EIVE_TMTC_ROOT -from tmtccmd.util.obj_id import ObjectIdDictT +from tmtccmd.util.obj_id import ObjectIdDictT, ObjectIdU32 from tmtccmd.fsfw import parse_fsfw_objects_csv @@ -141,7 +142,10 @@ ACS_CONTROLLER = bytes([0x43, 0x00, 0x00, 0x02]) CORE_CONTROLLER_ID = bytes([0x43, 0x00, 0x00, 0x03]) -def get_object_ids() -> ObjectIdDictT: +ObjectIdDict = Dict[bytes, ObjectIdU32] + + +def get_object_ids() -> ObjectIdDict: global __OBJECT_ID_DICT if not os.path.exists(DEFAULT_OBJECTS_CSV_PATH): logging.getLogger(__name__).warning( diff --git a/eive_tmtc/pus_tc/procedure_packer.py b/eive_tmtc/pus_tc/procedure_packer.py index 1e42673..14f82f6 100644 --- a/eive_tmtc/pus_tc/procedure_packer.py +++ b/eive_tmtc/pus_tc/procedure_packer.py @@ -116,8 +116,9 @@ def handle_default_procedure( } input_helper = InputHelper(menu_dict) tmp_select = input_helper.get_key() + object_id = obj_id_man.get(menu_dict[tmp_select][1]) return pack_tmp1075_test_into( - object_id=menu_dict[tmp_select][1], q=queue_helper, op_code=op_code + object_id=object_id, q=queue_helper, op_code=op_code ) if service == CustomServiceList.HEATER.value: object_id = HEATER_CONTROLLER_ID diff --git a/eive_tmtc/tmtc/tcs/tmp1075.py b/eive_tmtc/tmtc/tcs/tmp1075.py index 57170d5..dbd1d85 100644 --- a/eive_tmtc/tmtc/tcs/tmp1075.py +++ b/eive_tmtc/tmtc/tcs/tmp1075.py @@ -47,7 +47,7 @@ def pack_tmp1075_test_into( object_id: ObjectIdU32, op_code: str, q: DefaultPusQueueHelper ): q.add_log_cmd( - f"Testing Tmp1075 Temperature Sensor Handler with object id: {object_id.as_hex_string}" + f"Testing Tmp1075 Temperature Sensor Handler with object id: {object_id}" ) obyt = object_id.as_bytes if op_code == OpCode.OFF: