Skip to content

Commit

Permalink
optimise count of getNumAddr, reset status bar in end
Browse files Browse the repository at this point in the history
  • Loading branch information
Furtif committed Dec 15, 2024
1 parent c2f9fcb commit 0e4fcd9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ecu.py
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,14 @@ def getNumEcuDb(self):
return self.ecu_database.numecu

def getNumAddr(self):
return len(elm.dnat) + len(elm.dnat_ext)
count = []
for k in elm.dnat:
if k not in count:
count.append(k)
for k in elm.dnat_ext:
if k not in count:
count.append(k)
return len(count)

def addTarget(self, target):
self.ecus[target.name] = target
Expand Down Expand Up @@ -1582,7 +1589,6 @@ def scan(self, progress=None, label=None, vehiclefilter=None, canline=0):
if not options.simulation_mode:
options.elm.close_protocol()


def scan_kwp(self, progress=None, label=None, vehiclefilter=None):
if options.simulation_mode:
# Test data..
Expand Down
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,8 @@ def scan_project(self, project):
item.setForeground(core.Qt.red)
self.treeview_ecu.addItem(item)

self.progressstatus.setValue(0)

def scan(self):
msgBox = widgets.QMessageBox()
appIcon = gui.QIcon("ddt4all_data/icons/obd.png")
Expand Down

0 comments on commit 0e4fcd9

Please sign in to comment.