Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history


add conditional other.
try fix #1259
  • Loading branch information
Furtif committed Nov 6, 2024
1 parent 65d4a30 commit 8a1b503
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
13 changes: 2 additions & 11 deletions ecu.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,17 +643,8 @@ def setValue(self, value, bytes_list, dataitem, ecu_endian, test_mode=False):

requestasbin = "".join(requestasbin)

# TODO this need review, return empty is not maybe ok.
bytes_list = {}
try:
valueasint = int("0b" + requestasbin, 2)
except ValueError:
error = _("Value error of this stuff need a bypass gateway maybe. Value:") + " %s" % requestasbin
options.main_window.logview.append("<font color='red'>" + error + "</font>")
# raise or return ?
# raise (error)
return bytes_list

requestasbin = "".join(requestasbin)
valueasint = int("0b" + requestasbin, 2)
valueashex = hex(valueasint)[2:].replace("L", "").zfill(numreqbytes * 2).upper()

for i in range(numreqbytes):
Expand Down
9 changes: 7 additions & 2 deletions parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -1153,9 +1153,14 @@ def buttonClicked(self, txt):
newval = combo_value
items_ref = ecu_data.items
input_value = hex(int(items_ref[combo_value]))[2:]

elm_data_stream = ecu_data.setValue(input_value, elm_data_stream, dataitem,
try:
elm_data_stream = ecu_data.setValue(input_value, elm_data_stream, dataitem,
ecu_request.ecu_file.endianness)
except:
error = _("Value error of this stuff need a bypass gateway maybe. Value:") + " %s" % requestasbin
options.main_window.logview.append("<font color='red'>" + error + "</font>")
return

logdict[dataitem.name] = newval

if not elm_data_stream:
Expand Down

0 comments on commit 8a1b503

Please sign in to comment.