Skip to content

Commit

Permalink
Fixed bug where sync 4 lengths would be loaded and not all values wer…
Browse files Browse the repository at this point in the history
…e displayed correctly for sync 3
  • Loading branch information
consp committed Feb 5, 2022
1 parent 6fdf6c3 commit bf2e6ad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/asbuilt.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def __init__(self, filename):
s1_len = [sum(self.fieldsizes_s1[0:i]) for i in range(1, len(self.fieldsizes_s1) + 1)]
s3_len = [sum(self.fieldsizes_s3[0:i]) for i in range(1, len(self.fieldsizes_s3) + 1)]
s4_len = [sum(self.fieldsizes_s4[0:i]) for i in range(1, len(self.fieldsizes_s4) + 1)]
print(s4_len)
if length in s1_len and length not in s3_len and length not in s4_len:
self.s4 = False
self.fieldsizes = self.fieldsizes_s1
Expand Down Expand Up @@ -99,7 +98,7 @@ def decode_bytes(self, data):
self.blocks.append(data[:self.fieldsizes_s4[i]])
data = data[self.fieldsizes_s4[i]:]
else:
self.blocks.append(data[:self.fieldsizes_s4[i]])
self.blocks.append(data[:self.fieldsizes[i]])
data = data[self.fieldsizes[i]:]
i += 1
except:
Expand Down
8 changes: 4 additions & 4 deletions src/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,9 @@ def QtItemList(self, block, asbuilt, bitfields, themechange):
#print(bitfields)
try:
option.currentIndexChanged.connect(partial(combo_change, option, item, bitfields[item['byte']]))
except:
except Exception as e:
print("out of range", item)


elif item['type'] == 'ascii':
option = QLineEdit()
Expand All @@ -528,9 +528,9 @@ def QtItemList(self, block, asbuilt, bitfields, themechange):
option.setCurrentIndex(value)
try:
option.currentIndexChanged.connect(partial(combo_change, option, item, bitfields[item['byte']]))
except:
except Exception as e:
print("out of range", item)

if 'theme' in item:
option.currentIndexChanged.connect(partial(themechange))
layout.addWidget(label)
Expand Down
11 changes: 5 additions & 6 deletions src/statics.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class JumpTables(object):
BAPI = [ # Bluetooth audi profile index
"Profile %d"
]

_BAPI = [
"Profile 1",
"U502 - Ford Explorer (Ext Amp)",
Expand Down Expand Up @@ -1876,12 +1876,11 @@ def block(cls, block):
'bit': 0,
'size': 4,
'type': 'mul',
'table': '__AP',
'offset': 0,
'multiplier': 1,
'unit': 'seconds',
'min': 0,
'max': 255,
'max': 64,
},
{
'name': 'Audio Player (this setting might have additional options starting 3.2)',
Expand Down Expand Up @@ -5183,7 +5182,7 @@ def block(cls, block):
'0': 'Disabled',
'1': 'Enabled',
},

{
'name': 'Advanced HUD',
'index': 69,
Expand Down Expand Up @@ -5360,7 +5359,7 @@ def block(cls, block):
'0': 'Disabled',
'1': 'Enabled',
},

{
'name': 'Number of Bladders Continued',
'index': 69,
Expand Down Expand Up @@ -6196,7 +6195,7 @@ def block(cls, block):
'type': 'table',
'table': 'BVNI',
},
{
{
'name': 'LIN 11-X',
'index': 225,
'byte': 9,
Expand Down

0 comments on commit bf2e6ad

Please sign in to comment.