some fixes and improvements for parsing of TM
All checks were successful
EIVE/-/pipeline/pr-main This commit looks good

This commit is contained in:
Robin Müller 2023-11-28 15:35:54 +01:00
parent 6ea3312b62
commit af24a95475

View File

@ -510,7 +510,7 @@ def prompt_set_id() -> SetId:
for set_id in SetId: for set_id in SetId:
print(f"{set_id}: {set_id.name}") print(f"{set_id}: {set_id.name}")
while True: 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: try:
set_id_typed = SetId(set_id) set_id_typed = SetId(set_id)
except ValueError: 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]) adc_eng.append(struct.unpack("!H", hk_data[current_idx : current_idx + 2])[0])
current_idx += 2 current_idx += 2
print(f"ADC RAW: {adc_raw}") print(f"{'Index'.ljust(10)} | {'ADC RAW'.ljust(10)} | {'ADC ENG'.ljust(10)}")
print(f"ADC ENG: {adc_eng}") for i in range(16):
print(f"{i: >10} | {adc_raw[i]: >10} | {adc_eng[i]: >10}")
def handle_counters_report(hk_data: bytes): def handle_counters_report(hk_data: bytes):
@ -867,6 +868,7 @@ def handle_counters_report(hk_data: bytes):
latchup_counters.append( latchup_counters.append(
struct.unpack("!I", hk_data[current_idx : current_idx + 4])[0] struct.unpack("!I", hk_data[current_idx : current_idx + 4])[0]
) )
current_idx += 4
fmt_str = "!IIIIIIIIIIIIIIIIIIII" fmt_str = "!IIIIIIIIIIIIIIIIIIII"
inc_len = struct.calcsize(fmt_str) inc_len = struct.calcsize(fmt_str)
( (