added imtq x axis self test
This commit is contained in:
@ -10,7 +10,7 @@ from typing import Tuple
|
||||
from tmtccmd.pus_tm.service_3_housekeeping import Service3Base
|
||||
from tmtccmd.utility.logger import get_logger
|
||||
from pus_tc.syrlinks_hk_handler import SetIds
|
||||
from config.object_ids import SYRLINKS_HANDLER
|
||||
from config.object_ids import SYRLINKS_HANDLER, IMTQ_HANDLER_ID
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
@ -43,6 +43,12 @@ def handle_user_hk_packet(object_id: bytes, set_id: int, hk_data: bytearray,
|
||||
else:
|
||||
LOGGER.info("Serive 3 TM: Syrlinks handler reply with unknown set id")
|
||||
return [], [], bytearray(), 0
|
||||
if object_id == IMTQ_HANDLER_ID:
|
||||
if set_id == SetIds.RX_REGISTERS_DATASET:
|
||||
return imtq_positive_x_test(hk_data)
|
||||
else:
|
||||
LOGGER.info("Serive 3 TM: Syrlinks handler reply with unknown set id")
|
||||
return [], [], bytearray(), 0
|
||||
else:
|
||||
LOGGER.info("Service 3 TM: Parsing for this SID has not been implemented.")
|
||||
return [], [], bytearray(), 0
|
||||
@ -77,3 +83,30 @@ def handle_syrlinks_tx_registers_dataset(hk_data: bytearray) -> Tuple[list, list
|
||||
tx_agc_value = struct.unpack('!H', hk_data[2:4])
|
||||
hk_content = [tx_status, tx_waveform, tx_agc_value]
|
||||
return hk_header, hk_content, validity_buffer, 3
|
||||
|
||||
|
||||
def imtq_positive_x_test(hk_data: bytearray) -> Tuple[list, list, bytearray, int]:
|
||||
hk_header = []
|
||||
hk_content = []
|
||||
validity_buffer = bytearray()
|
||||
hk_header = ["Init Err", "Init Raw Mag X [T]", "Init Raw Mag Y [T]", "Init Raw Mag Z [T]", "Init Cal Mag X [T]",
|
||||
"Init Cal Mag Y [T]", "Init Cal Mag Z [T]", "Init Coil X Current [A]", "Init Coil Y Current [A]",
|
||||
"Init Coil Z Current [A]", "Init Coil X Temperature [°C]", "Init Coil Y Temperature [°C]",
|
||||
"Init Coil Z Temperature [°C]"]
|
||||
init_err = hk_data[0]
|
||||
init_raw_mag_x = struct.unpack('!f', hk_data[1:5])
|
||||
init_raw_mag_y = struct.unpack('!f', hk_data[5:9])
|
||||
init_raw_mag_z = struct.unpack('!f', hk_data[9:13])
|
||||
init_cal_mag_x = struct.unpack('!f', hk_data[13:17])
|
||||
init_cal_mag_y = struct.unpack('!f', hk_data[17:21])
|
||||
init_cal_mag_z = struct.unpack('!f', hk_data[21:25])
|
||||
init_coil_x_current = struct.unpack('!f', hk_data[25:29])
|
||||
init_coil_y_current = struct.unpack('!f', hk_data[29:33])
|
||||
init_coil_z_current = struct.unpack('!f', hk_data[33:37])
|
||||
init_coil_x_temperature = struct.unpack('!H', hk_data[37:39])
|
||||
init_coil_y_temperature = struct.unpack('!H', hk_data[39:41])
|
||||
init_coil_z_temperature = struct.unpack('!H', hk_data[41:43])
|
||||
hk_content = [init_err, init_raw_mag_x, init_raw_mag_y, init_raw_mag_z, init_cal_mag_x, init_cal_mag_y,
|
||||
init_cal_mag_z, init_coil_x_current, init_coil_y_current, init_coil_z_current,
|
||||
init_coil_x_temperature, init_coil_y_temperature, init_coil_z_temperature]
|
||||
return hk_header, hk_content, len(hk_header)
|
||||
|
Reference in New Issue
Block a user