ACS control print fix

This commit is contained in:
Robin Müller 2023-02-08 21:09:24 +01:00
parent 33da498ea8
commit e5bb7f395f
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -436,30 +436,31 @@ def handle_acs_ctrl_sus_processed_data(pw: PrintWrapper, hk_data: bytes):
)
return
current_idx = 0
vec_fmt = "[{:8.3f}, {:8.3f}, {:8.3f}]"
for idx in range(12):
fmt_str = "!fff"
length = struct.calcsize(fmt_str)
sus_list = struct.unpack(fmt_str, hk_data[current_idx : current_idx + length])
sus_list_formatted = [f"{val:8.3f}" for val in sus_list]
sus_list_formatted = vec_fmt.format(*sus_list)
current_idx += length
pw.dlog(f"SUS {idx} CALIB: {sus_list_formatted}")
pw.dlog(f"{f'SUS {idx} CALIB'.ljust(25)}: {sus_list_formatted}")
fmt_str = "!ddd"
inc_len = struct.calcsize(fmt_str)
sus_vec_tot = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
sus_vec_tot = [f"{val:8.3f}" for val in sus_vec_tot]
sus_vec_tot = vec_fmt.format(*sus_vec_tot)
current_idx += inc_len
pw.dlog(f"SUS Vector Total: {sus_vec_tot}")
pw.dlog(f"{'SUS Vector Total'.ljust(25)}: {sus_vec_tot}")
sus_vec_tot_deriv = struct.unpack(
fmt_str, hk_data[current_idx : current_idx + inc_len]
)
sus_vec_tot_deriv = [f"{val:8.3f}" for val in {sus_vec_tot_deriv}]
sus_vec_tot_deriv = vec_fmt.format(*sus_vec_tot_deriv)
current_idx += inc_len
pw.dlog(f"SUS Vector Derivative: {sus_vec_tot_deriv}")
pw.dlog(f"{'SUS Vector Derivative'.ljust(25)}: {sus_vec_tot_deriv}")
sun_ijk_model = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
sun_ijk_model = [f"{val:8.3f}" for val in sun_ijk_model]
sun_ijk_model = vec_fmt.format(*sun_ijk_model)
current_idx += inc_len
pw.dlog(f"SUS ijk Model: {sun_ijk_model}")
pw.dlog(f"{'SUS ijk Model'.ljust(25)}: {sun_ijk_model}")
pw.printer.print_validity_buffer(hk_data[current_idx:], num_vars=15)