something not working

This commit is contained in:
Robin Müller 2022-05-23 14:04:34 +02:00
parent e033609177
commit b9de13ffe7
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 19 additions and 11 deletions

View File

@ -89,11 +89,13 @@ class WdtInfo:
class DevicesInfoParser:
def __int__(self):
self.dev_types = []
self.dev_statuses = []
def __init__(self):
self.dev_types = None
self.dev_statuses = None
def parse(self, hk_data: bytes, current_idx: int) -> int:
self.dev_types = []
self.dev_statuses = []
for idx in range(8):
self.dev_types.append(hk_data[current_idx])
current_idx += 1
@ -356,7 +358,8 @@ def handle_acu_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
pw.dlog(header_str)
for i in range(6):
pw.dlog(
f"{i} | {str(voltages[i]).ljust(4)} | {str(currents[i]).ljust(4)} | {str(vboosts[i]).ljust(4)} | {str(powers[i]).ljust(2)}"
f"{i} | {str(voltages[i]).ljust(4)} | {str(currents[i]).ljust(4)} | "
f"{str(vboosts[i]).ljust(4)} | {str(powers[i]).ljust(2)}"
)
pw.dlog(
f"Temperatures in C: Ch0 {tmp0/10.0} | Ch1 {tmp1/10.0} | Ch2 {tmp2/10.0}"
@ -370,7 +373,7 @@ def handle_acu_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
)
if set_id == SetIds.ACU_AUX:
current_idx = 0
fmt_str = "!IBhHhh"
fmt_str = "!HHH"
inc_len = struct.calcsize(fmt_str)
(dac_enb0, dac_enb1, dac_enb2) = struct.unpack(
fmt_str, hk_data[current_idx : current_idx + inc_len]

View File

@ -48,12 +48,17 @@ def handle_hk_packet(
set_id=tm_packet.set_id,
hk_data=hk_data,
)
handle_regular_hk_print(
printer=printer,
object_id=named_obj_id,
hk_packet=tm_packet,
hk_data=hk_data,
)
try:
handle_regular_hk_print(
printer=printer,
object_id=named_obj_id,
hk_packet=tm_packet,
hk_data=hk_data,
)
except ValueError as e:
LOGGER.exception(
f"{e} error when parsing HK data coming from {named_obj_id}"
)
if tm_packet.subservice == 10 or tm_packet.subservice == 12:
LOGGER.warning("HK definitions printout not implemented yet")