1. modify asotr_csv parser: ASOTR csv files are being supplemented if new data appears. 2. Fix bug in MUP command data parser - now all commands in MUP are decoded.

This commit is contained in:
Danila Gamkov
2025-10-16 11:23:56 +03:00
parent d91039ca21
commit 4968d17d5f
12 changed files with 569 additions and 108 deletions

View File

@@ -75,25 +75,31 @@ def flight_temperature_decode(cmd_string):
def cmd_decode(cmd_string):
decode = load_cmd_decode(fname_json_decode)
asotr_kit = 0;
asotr_kit = 0
msg_decode = ''
out = ''
if 'OK' in cmd_string:
return out
cmd = cmd_string.split()
if len(cmd) > 5:
return out
if '1' in cmd[0]:
asotr_kit = 1
elif '2' in cmd[0]:
asotr_kit = 2
if 'OK' in cmd_string:
return f'АСОТР{asotr_kit}: {cmd_string}'
if len(cmd) > 5:
return f'АСОТР{asotr_kit}: {cmd_string}'
if len(cmd) < 3:
return f'АСОТР{asotr_kit}: {cmd_string}'
msg_ = f'{cmd[1]} {cmd[2]}'
msg_decode = decode[msg_]
try:
msg_decode = f"({msg_}) {decode[msg_]}"
except KeyError as e:
return f'АСОТР{asotr_kit}: {cmd_string}'
if (len(cmd) == 4):
value = ''