From 8a1b503762490671b10bff3138076c3b61f6d02b Mon Sep 17 00:00:00 2001 From: Furtif Date: Thu, 7 Nov 2024 00:53:24 +0100 Subject: [PATCH] revert 65d4a308 , ca03afd2 , 4fd0a79d, bbcc5703 , 0ff90a7d, 0d9088c3 , 9eae438f add conditional other. try fix https://github.com/cedricp/ddt4all/issues/1259 --- ecu.py | 13 ++----------- parameters.py | 9 +++++++-- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/ecu.py b/ecu.py index 60dea77..bade3a0 100644 --- a/ecu.py +++ b/ecu.py @@ -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("" + error + "") - # 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): diff --git a/parameters.py b/parameters.py index 2d83faf..a3beb57 100644 --- a/parameters.py +++ b/parameters.py @@ -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("" + error + "") + return + logdict[dataitem.name] = newval if not elm_data_stream: