set IMTQ set HK handling

This commit is contained in:
Robin Müller 2023-02-19 13:25:12 +01:00
parent 802757ba72
commit a2d04b28fd
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 20 additions and 12 deletions

View File

@ -32,6 +32,7 @@ from eive_tmtc.tmtc.acs.imtq import (
handle_eng_set, handle_eng_set,
handle_calibrated_mtm_measurement, handle_calibrated_mtm_measurement,
handle_raw_mtm_measurement, handle_raw_mtm_measurement,
handle_imtq_hk,
) )
from eive_tmtc.pus_tm.defs import FsfwTmTcPrinter from eive_tmtc.pus_tm.defs import FsfwTmTcPrinter
from eive_tmtc.tmtc.core import handle_core_hk_data from eive_tmtc.tmtc.core import handle_core_hk_data
@ -97,18 +98,7 @@ def handle_regular_hk_print(
elif objb == obj_ids.SYRLINKS_HANDLER_ID: elif objb == obj_ids.SYRLINKS_HANDLER_ID:
return handle_syrlinks_hk_data(printer=printer, hk_data=hk_data, set_id=set_id) return handle_syrlinks_hk_data(printer=printer, hk_data=hk_data, set_id=set_id)
elif objb == obj_ids.IMTQ_HANDLER_ID: elif objb == obj_ids.IMTQ_HANDLER_ID:
if (set_id >= ImtqSetId.POSITIVE_X_TEST) and ( return handle_imtq_hk(printer=printer, hk_data=hk_data, set_id=set_id)
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)
else:
_LOGGER.info("Service 3 TM: IMTQ handler reply with unknown set id")
elif objb == obj_ids.GPS_CONTROLLER: elif objb == obj_ids.GPS_CONTROLLER:
return handle_gps_data(printer=printer, hk_data=hk_data) return handle_gps_data(printer=printer, hk_data=hk_data)
elif objb == obj_ids.PCDU_HANDLER_ID: elif objb == obj_ids.PCDU_HANDLER_ID:

View File

@ -5,6 +5,7 @@
@author J. Meier @author J. Meier
@date 25.03.2021 @date 25.03.2021
""" """
import logging
import struct import struct
from typing import List 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: def unpack_status_set(hk_data: bytes) -> List:
status_mode = hk_data[0] status_mode = hk_data[0]
status_error = hk_data[1] status_error = hk_data[1]