rework it

This commit is contained in:
2023-05-23 09:54:51 +02:00
committed by Robin Mueller
parent 736c12a2f8
commit b333ffe707
17 changed files with 106 additions and 94 deletions

View File

@ -524,8 +524,7 @@ def get_sequence_file() -> str:
return file
def handle_ploc_mpsoc_hk_data(printer: FsfwTmTcPrinter, hk_data: bytes, set_id: int):
pw = PrintWrapper(printer)
def handle_ploc_mpsoc_hk_data(pw: PrintWrapper, hk_data: bytes, set_id: int):
if set_id == SetId.HK_ID:
fmt_str = "!IBBBBBBB"
current_idx = 0
@ -640,10 +639,7 @@ class DirElement:
size: int
def handle_mpsoc_data_reply(
action_id: int, printer: FsfwTmTcPrinter, custom_data: bytearray
):
pw = PrintWrapper(printer)
def handle_mpsoc_data_reply(action_id: int, pw: PrintWrapper, custom_data: bytearray):
if action_id == ActionId.TM_MEM_READ_RPT:
header_list = [
"PLOC Memory Address",
@ -655,20 +651,16 @@ def handle_mpsoc_data_reply(
struct.unpack("!H", custom_data[4:6])[0],
"0x" + custom_data[6:10].hex(),
]
print(header_list)
print(content_list)
printer.file_logger.info(header_list)
printer.file_logger.info(content_list)
pw.dlog(f"{header_list}")
pw.dlog(f"{content_list}")
elif action_id == ActionId.TM_CAM_CMD_RPT:
header_list = ["Camera reply string", "ACK"]
content_list = [
custom_data[: len(custom_data) - 1].decode("utf-8"),
hex(custom_data[-1]),
]
print(header_list)
print(content_list)
printer.file_logger.info(header_list)
printer.file_logger.info(content_list)
pw.dlog(f"{header_list}")
pw.dlog(f"{content_list}")
elif action_id == ActionId.TM_FLASH_DIRECTORY_CONTENT:
if len(custom_data) < 16:
_LOGGER.warning(