From 8891908afa411591547d8e866d7cc22864967462 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 10 May 2022 18:00:56 +0200 Subject: [PATCH] some include fixes --- pus_tc/cmd_definitions.py | 1 + pus_tm/defs.py | 15 +++++++++++++++ pus_tm/devs/reaction_wheels.py | 4 ++-- pus_tm/hk_handling.py | 17 ++--------------- 4 files changed, 20 insertions(+), 17 deletions(-) create mode 100644 pus_tm/defs.py diff --git a/pus_tc/cmd_definitions.py b/pus_tc/cmd_definitions.py index 2a3dffb..3db7e9d 100644 --- a/pus_tc/cmd_definitions.py +++ b/pus_tc/cmd_definitions.py @@ -8,6 +8,7 @@ from tmtccmd.config import ( ) from config.definitions import CustomServiceList from pus_tc.devs.heater import add_heater_cmds +from pus_tc.devs.reaction_wheels import add_rw_cmds from pus_tc.devs.bpx_batt import BpxOpCodes diff --git a/pus_tm/defs.py b/pus_tm/defs.py new file mode 100644 index 0000000..218e2d0 --- /dev/null +++ b/pus_tm/defs.py @@ -0,0 +1,15 @@ +from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter + + +class PrintWrapper: + def __init__(self, printer: FsfwTmTcPrinter): + self.printer = printer + + def dlog(self, string: str): + print(string) + self.printer.file_logger.info(string) + + +def log_to_both(printer: FsfwTmTcPrinter, string: str): + print(string) + printer.file_logger.info(string) diff --git a/pus_tm/devs/reaction_wheels.py b/pus_tm/devs/reaction_wheels.py index e5a8487..25dbb86 100644 --- a/pus_tm/devs/reaction_wheels.py +++ b/pus_tm/devs/reaction_wheels.py @@ -1,7 +1,7 @@ import struct -from pus_tm.hk_handling import FsfwTmTcPrinter, PrintWrapper -from tmtccmd.pus.obj_id import ObjectId +from pus_tm.defs import PrintWrapper, FsfwTmTcPrinter +from tmtccmd.utility.obj_id import ObjectId def handle_rw_hk_data( diff --git a/pus_tm/hk_handling.py b/pus_tm/hk_handling.py index 951dc50..a7c3e5b 100644 --- a/pus_tm/hk_handling.py +++ b/pus_tm/hk_handling.py @@ -18,25 +18,12 @@ from pus_tc.devs.imtq import ImtqSetIds from tmtccmd.utility.obj_id import ObjectId, ObjectIdDictT import config.object_ids as obj_ids -from pus_tc.devs.reaction_wheels import handle_rw_hk_data +from pus_tm.devs.reaction_wheels import handle_rw_hk_data +from pus_tm.defs import PrintWrapper, FsfwTmTcPrinter LOGGER = get_console_logger() -class PrintWrapper: - def __init__(self, printer: FsfwTmTcPrinter): - self.printer = printer - - def dlog(self, string: str): - print(string) - self.printer.file_logger.info(string) - - -def log_to_both(printer: FsfwTmTcPrinter, string: str): - print(string) - printer.file_logger.info(string) - - def handle_hk_packet( raw_tm: bytes, obj_id_dict: ObjectIdDictT,