Skip to content

Commit

Permalink
fix parse_a2l so it works on both old and new a2l files
Browse files Browse the repository at this point in the history
  • Loading branch information
SpieringsAE committed Mar 12, 2024
1 parent c78bd1f commit 750a06a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions usr/moduline/python/parse_a2l.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@
#get name
if "Name" in line:
if reading_parameter:
name = line.split(" ")[-3]
name = line.strip().split(" ")[-1]
else:
name = line.split(" ")[-1][:-1]
name = line.strip().split(" ")[-1]
continue

#get address
elif "ECU" in line:
if reading_parameter:
address = int(line.split(" ")[-2],16)
address = int(line.strip().split(" ")[-1],16)
else:
address = int(line.split(" ")[-1][:-1],16)
address = int(line.strip().split(" ")[-1],16)
continue

#get datatype
Expand Down Expand Up @@ -96,7 +96,7 @@

#get arraysize
elif "NUMBER" in line or "ARRAY_SIZE" in line:
size = int(line.split(" ")[-1][:-1])
size = int(line.strip().split(" ")[-1])
continue

#save information
Expand Down

0 comments on commit 750a06a

Please sign in to comment.