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