some improvements

This commit is contained in:
Robin Müller 2022-12-02 16:13:18 +01:00
parent 15f7b23ac2
commit 56d163f710
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -5,6 +5,20 @@ from eive_tmtc.pus_tm.defs import PrintWrapper
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
HEADER_LIST = [
"Charge Current",
"Discharge Current",
"Heater Current",
"Battery Voltage",
"Batt Temp 1",
"Batt Temp 2",
"Batt Temp 3",
"Batt Temp 4",
"Reboot Counter",
"Boot Cause",
]
def handle_bpx_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes): def handle_bpx_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
pw = PrintWrapper(printer) pw = PrintWrapper(printer)
if set_id == BpxSetIds.GET_HK_SET: if set_id == BpxSetIds.GET_HK_SET:
@ -22,18 +36,6 @@ def handle_bpx_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
reboot_cntr, reboot_cntr,
boot_cause, boot_cause,
) = struct.unpack(fmt_str, hk_data[0:inc_len]) ) = struct.unpack(fmt_str, hk_data[0:inc_len])
header_list = [
"Charge Current",
"Discharge Current",
"Heater Current",
"Battery Voltage",
"Batt Temp 1",
"Batt Temp 2",
"Batt Temp 3",
"Batt Temp 4",
"Reboot Counter",
"Boot Cause",
]
content_list = [ content_list = [
charge_current, charge_current,
discharge_current, discharge_current,
@ -47,7 +49,7 @@ def handle_bpx_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
boot_cause, boot_cause,
] ]
validity_buffer = hk_data[inc_len:] validity_buffer = hk_data[inc_len:]
pw.dlog(str(header_list)) pw.dlog(str(HEADER_LIST))
pw.dlog(str(content_list)) pw.dlog(str(content_list))
printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=10) printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=10)
elif set_id == BpxSetIds.GET_CFG_SET: elif set_id == BpxSetIds.GET_CFG_SET: