some include fixes

This commit is contained in:
Robin Müller 2022-05-10 18:00:56 +02:00
parent 9d105ee97f
commit 8891908afa
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
4 changed files with 20 additions and 17 deletions

View File

@ -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

15
pus_tm/defs.py Normal file
View File

@ -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)

View File

@ -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(

View File

@ -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,