From af24a95475c44bebf3ed831cb06d2dbb33dfd2a6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 28 Nov 2023 15:35:54 +0100 Subject: [PATCH] some fixes and improvements for parsing of TM --- eive_tmtc/tmtc/payload/ploc_supervisor.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/eive_tmtc/tmtc/payload/ploc_supervisor.py b/eive_tmtc/tmtc/payload/ploc_supervisor.py index face51f..7d68e7f 100644 --- a/eive_tmtc/tmtc/payload/ploc_supervisor.py +++ b/eive_tmtc/tmtc/payload/ploc_supervisor.py @@ -510,7 +510,7 @@ def prompt_set_id() -> SetId: for set_id in SetId: print(f"{set_id}: {set_id.name}") while True: - set_id = int(input("Please select the set ID to request")) + set_id = int(input("Please select the set ID to request: ")) try: set_id_typed = SetId(set_id) except ValueError: @@ -854,8 +854,9 @@ def handle_adc_report(hk_data: bytes): adc_eng.append(struct.unpack("!H", hk_data[current_idx : current_idx + 2])[0]) current_idx += 2 - print(f"ADC RAW: {adc_raw}") - print(f"ADC ENG: {adc_eng}") + print(f"{'Index'.ljust(10)} | {'ADC RAW'.ljust(10)} | {'ADC ENG'.ljust(10)}") + for i in range(16): + print(f"{i: >10} | {adc_raw[i]: >10} | {adc_eng[i]: >10}") def handle_counters_report(hk_data: bytes): @@ -867,6 +868,7 @@ def handle_counters_report(hk_data: bytes): latchup_counters.append( struct.unpack("!I", hk_data[current_idx : current_idx + 4])[0] ) + current_idx += 4 fmt_str = "!IIIIIIIIIIIIIIIIIIII" inc_len = struct.calcsize(fmt_str) (