imtq update
This commit is contained in:
parent
742a8a6ae4
commit
15f7b23ac2
@ -6,6 +6,7 @@
|
||||
@date 25.03.2021
|
||||
"""
|
||||
import struct
|
||||
from typing import List
|
||||
|
||||
from eive_tmtc.config.definitions import CustomServiceList
|
||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||
@ -265,9 +266,7 @@ def raise_dipole_error(dipole_str: str, value: int):
|
||||
)
|
||||
|
||||
|
||||
def handle_eng_set(printer: FsfwTmTcPrinter, hk_data: bytes):
|
||||
pw = PrintWrapper(printer)
|
||||
header_list = [
|
||||
ENG_HK_HEADERS = [
|
||||
"Digital Voltage [mV]",
|
||||
"Analog Voltage [mV]",
|
||||
"Digital Current [mA]",
|
||||
@ -279,7 +278,10 @@ def handle_eng_set(printer: FsfwTmTcPrinter, hk_data: bytes):
|
||||
"Coil Y Temperature [°C]",
|
||||
"Coil Z Temperature [°C]",
|
||||
"MCU Temperature [°C]",
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
def unpack_eng_hk(hk_data: bytes) -> List:
|
||||
digital_voltage = struct.unpack("!H", hk_data[0:2])[0]
|
||||
analog_voltage = struct.unpack("!H", hk_data[2:4])[0]
|
||||
digital_current = struct.unpack("!f", hk_data[4:8])[0]
|
||||
@ -291,8 +293,6 @@ def handle_eng_set(printer: FsfwTmTcPrinter, hk_data: bytes):
|
||||
coil_y_temperature = struct.unpack("!h", hk_data[26:28])[0]
|
||||
coil_z_temperature = struct.unpack("!h", hk_data[28:30])[0]
|
||||
mcu_temperature = struct.unpack("!h", hk_data[30:32])[0]
|
||||
|
||||
validity_buffer = hk_data[32:]
|
||||
content_list = [
|
||||
digital_voltage,
|
||||
analog_voltage,
|
||||
@ -306,8 +306,16 @@ def handle_eng_set(printer: FsfwTmTcPrinter, hk_data: bytes):
|
||||
coil_z_temperature,
|
||||
mcu_temperature,
|
||||
]
|
||||
num_of_vars = len(header_list)
|
||||
pw.dlog(str(header_list))
|
||||
return content_list
|
||||
|
||||
|
||||
def handle_eng_set(printer: FsfwTmTcPrinter, hk_data: bytes):
|
||||
pw = PrintWrapper(printer)
|
||||
content_list = unpack_eng_hk(hk_data)
|
||||
validity_buffer = hk_data[32:]
|
||||
|
||||
num_of_vars = len(ENG_HK_HEADERS)
|
||||
pw.dlog(str(ENG_HK_HEADERS))
|
||||
pw.dlog(str(content_list))
|
||||
printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=num_of_vars)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user