fixes in TM handling

This commit is contained in:
Robin Müller 2022-08-26 13:42:32 +02:00
parent 5c0def704f
commit 079a0f9472
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
2 changed files with 6 additions and 6 deletions

View File

@ -6,7 +6,7 @@
@date 13.12.2020 @date 13.12.2020
""" """
from tmtccmd.tc import DefaultPusQueueHelper from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid, generate_one_diag_command
from gomspace.gomspace_common import ( from gomspace.gomspace_common import (
GsInfo, GsInfo,
GomspaceOpCodes, GomspaceOpCodes,
@ -142,7 +142,7 @@ def pack_p60dock_cmds(object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code:
if op_code in GomspaceOpCodes.REQUEST_CORE_HK_ONCE: if op_code in GomspaceOpCodes.REQUEST_CORE_HK_ONCE:
q.add_log_cmd("P60 Dock: Requesting HK Core HK Once") q.add_log_cmd("P60 Dock: Requesting HK Core HK Once")
hk_sid = make_sid(object_id=P60_DOCK_HANDLER, set_id=SetIds.P60_CORE) hk_sid = make_sid(object_id=P60_DOCK_HANDLER, set_id=SetIds.P60_CORE)
q.add_pus_tc(generate_one_hk_command(sid=hk_sid)) q.add_pus_tc(generate_one_diag_command(sid=hk_sid))
if op_code in GomspaceOpCodes.REQUEST_AUX_HK_ONCE: if op_code in GomspaceOpCodes.REQUEST_AUX_HK_ONCE:
q.add_log_cmd("P60 Dock: Requesting HK Aux HK Once") q.add_log_cmd("P60 Dock: Requesting HK Aux HK Once")
hk_sid = make_sid(object_id=P60_DOCK_HANDLER, set_id=SetIds.P60_AUX) hk_sid = make_sid(object_id=P60_DOCK_HANDLER, set_id=SetIds.P60_AUX)

View File

@ -244,7 +244,7 @@ def handle_p60_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
f"{voltage_list[idx]:05} | {current_list[idx]:04}" f"{voltage_list[idx]:05} | {current_list[idx]:04}"
) )
pw.dlog(content_line) pw.dlog(content_line)
fmt_str = "!IBhHhh" fmt_str = "!IBhHff"
inc_len = struct.calcsize(fmt_str) inc_len = struct.calcsize(fmt_str)
( (
boot_count, boot_count,
@ -259,7 +259,7 @@ def handle_p60_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
f"Batt: Mode {batt_mode} | Boot Count {boot_count} | " f"Batt: Mode {batt_mode} | Boot Count {boot_count} | "
f"Charge current {batt_current} | Voltage {batt_voltage}" f"Charge current {batt_current} | Voltage {batt_voltage}"
) )
temps = f"In C: Temp 0 {temp_0 / 10.0} | Temp 1 {temp_1 / 10.0} | " temps = f"In C: Temp 0 {temp_0} | Temp 1 {temp_1} | "
pw.dlog(temps) pw.dlog(temps)
pw.dlog(batt_info) pw.dlog(batt_info)
printer.print_validity_buffer(validity_buffer=hk_data[current_idx:], num_vars=9) printer.print_validity_buffer(validity_buffer=hk_data[current_idx:], num_vars=9)
@ -361,7 +361,7 @@ def handle_acu_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
current_idx, powers = gen_six_entry_u16_list( current_idx, powers = gen_six_entry_u16_list(
hk_data=hk_data, current_idx=current_idx hk_data=hk_data, current_idx=current_idx
) )
fmt_str = "!HHHIIHH" fmt_str = "!fffIIHH"
inc_len = struct.calcsize(fmt_str) inc_len = struct.calcsize(fmt_str)
(tmp0, tmp1, tmp2, bootcnt, uptime, mppt_time, mppt_period) = struct.unpack( (tmp0, tmp1, tmp2, bootcnt, uptime, mppt_time, mppt_period) = struct.unpack(
fmt_str, hk_data[current_idx : current_idx + inc_len] fmt_str, hk_data[current_idx : current_idx + inc_len]
@ -379,7 +379,7 @@ def handle_acu_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
f"{str(vboosts[i]).ljust(4)} | {str(powers[i]).ljust(2)}" f"{str(vboosts[i]).ljust(4)} | {str(powers[i]).ljust(2)}"
) )
pw.dlog( pw.dlog(
f"Temperatures in C: Ch0 {tmp0/10.0} | Ch1 {tmp1/10.0} | Ch2 {tmp2/10.0}" f"Temperatures in C: Ch0 {tmp0} | Ch1 {tmp1} | Ch2 {tmp2}"
) )
pw.dlog( pw.dlog(
f"Boot Count {bootcnt} | Uptime {uptime} sec | " f"Boot Count {bootcnt} | Uptime {uptime} sec | "