set IMTQ set HK handling

This commit is contained in:
2023-02-19 13:25:12 +01:00
parent 802757ba72
commit a2d04b28fd
2 changed files with 20 additions and 12 deletions

View File

@ -5,6 +5,7 @@
@author J. Meier
@date 25.03.2021
"""
import logging
import struct
from typing import List
@ -302,6 +303,23 @@ ENG_HK_HEADERS = [
]
def handle_imtq_hk(printer: FsfwTmTcPrinter, hk_data: bytes, set_id: int):
if (set_id >= ImtqSetId.POSITIVE_X_TEST) and (set_id <= ImtqSetId.NEGATIVE_Z_TEST):
return handle_self_test_data(printer, hk_data)
elif set_id == ImtqSetId.ENG_HK_NO_TORQUE:
return handle_eng_set(printer, hk_data)
elif set_id == ImtqSetId.CAL_MTM_SET:
return handle_calibrated_mtm_measurement(printer, hk_data)
elif set_id == ImtqSetId.RAW_MTM_NO_TORQUE:
return handle_raw_mtm_measurement(printer, hk_data)
elif set_id == ImtqSetId.STATUS_SET:
return handle_status_set(printer, hk_data)
else:
logging.getLogger(__name__).info(
"Service 3 TM: IMTQ handler reply with unknown set id"
)
def unpack_status_set(hk_data: bytes) -> List:
status_mode = hk_data[0]
status_error = hk_data[1]