kill all the duplication

This commit is contained in:
2022-05-25 15:21:50 +02:00
parent 6db60f9238
commit 01e91bffcd
5 changed files with 89 additions and 125 deletions

View File

@ -44,7 +44,7 @@ def handle_eng_set(printer: FsfwTmTcPrinter, hk_data: bytes):
coil_x_temperature,
coil_y_temperature,
coil_z_temperature,
mcu_temperature
mcu_temperature,
]
num_of_vars = len(header_list)
pw.dlog(str(header_list))
@ -58,19 +58,14 @@ def handle_calibrated_mtm_measurement(printer: FsfwTmTcPrinter, hk_data: bytes):
"Calibrated MTM X [nT]",
"Calibrated MTM Y [nT]",
"Calibrated MTM Z [nT]",
"Coild actuation status"
"Coild actuation status",
]
mtm_x = struct.unpack("!I", hk_data[0:4])[0]
mtm_y = struct.unpack("!I", hk_data[4:8])[0]
mtm_z = struct.unpack("!I", hk_data[8:12])[0]
coil_actuation_status = hk_data[12]
validity_buffer = hk_data[12:]
content_list = [
mtm_x,
mtm_y,
mtm_z,
coil_actuation_status
]
content_list = [mtm_x, mtm_y, mtm_z, coil_actuation_status]
num_of_vars = len(header_list)
pw.dlog(str(header_list))
pw.dlog(str(content_list))
@ -83,19 +78,14 @@ def handle_raw_mtm_measurement(printer: FsfwTmTcPrinter, hk_data: bytes):
"Raw MTM X [nT]",
"Raw MTM Y [nT]",
"Raw MTM Z [nT]",
"Coild actuation status"
"Coild actuation status",
]
mtm_x = struct.unpack("!f", hk_data[0:4])[0]
mtm_y = struct.unpack("!f", hk_data[4:8])[0]
mtm_z = struct.unpack("!f", hk_data[8:12])[0]
coil_actuation_status = hk_data[12]
validity_buffer = hk_data[12:]
content_list = [
mtm_x,
mtm_y,
mtm_z,
coil_actuation_status
]
content_list = [mtm_x, mtm_y, mtm_z, coil_actuation_status]
num_of_vars = len(header_list)
pw.dlog(str(header_list))
pw.dlog(str(content_list))