imtq parsing fixes

This commit is contained in:
Robin Müller 2023-06-09 18:53:11 +02:00 committed by Robin Mueller
parent acc58ebef1
commit 8927949c4b

View File

@ -432,17 +432,17 @@ def handle_imtq_hk(pw: PrintWrapper, hk_data: bytes, set_id: int):
elif set_id == ImtqSetId.ENG_HK_NO_TORQUE:
return handle_eng_set(pw, hk_data, False)
elif set_id == ImtqSetId.ENG_HK_SET_WITH_TORQUE:
return handle_eng_set(printer, hk_data, True)
return handle_eng_set(pw, hk_data, True)
elif set_id == ImtqSetId.CAL_MTM_SET:
return handle_calibrated_mtm_measurement(printer, hk_data)
return handle_calibrated_mtm_measurement(pw, hk_data)
elif set_id == ImtqSetId.RAW_MTM_NO_TORQUE:
return handle_raw_mtm_measurement(printer, hk_data, False)
return handle_raw_mtm_measurement(pw, hk_data, False)
elif set_id == ImtqSetId.RAW_MTM_WITH_TORQUE:
return handle_raw_mtm_measurement(printer, hk_data, True)
return handle_raw_mtm_measurement(pw, hk_data, True)
elif set_id == ImtqSetId.DIPOLES:
return handle_dipole_set(printer, hk_data)
return handle_dipole_set(pw, hk_data)
elif set_id == ImtqSetId.STATUS_SET:
return handle_status_set(printer, hk_data)
return handle_status_set(pw, hk_data)
else:
pw.wlog(
_LOGGER,
@ -458,8 +458,7 @@ def unpack_status_set(hk_data: bytes) -> List:
return [status_mode, status_error, status_conf, status_uptime]
def handle_dipole_set(printer: FsfwTmTcPrinter, hk_data: bytes):
pw = PrintWrapper(printer)
def handle_dipole_set(pw: PrintWrapper, hk_data: bytes):
pw.dlog("Received iMTQ dipole set")
fmt_str = "!hhhH"
fmt_len = struct.calcsize(fmt_str)
@ -470,7 +469,7 @@ def handle_dipole_set(printer: FsfwTmTcPrinter, hk_data: bytes):
pw.dlog(f"Dipole Y: {dipole_y}")
pw.dlog(f"Dipole Z: {dipole_z}")
pw.dlog(f"Current torque duration: {current_torque_duration}")
pw.printer.get_validity_buffer(hk_data[fmt_len:], 2)
FsfwTmTcPrinter.get_validity_buffer(hk_data[fmt_len:], 2)
def unpack_eng_hk(hk_data: bytes) -> List: