Skip to content

Commit

Permalink
optimise console log
Browse files Browse the repository at this point in the history
  • Loading branch information
Furtif committed Mar 4, 2024
1 parent f33ebf8 commit b47d3b0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ecu.py
Original file line number Diff line number Diff line change
Expand Up @@ -1573,15 +1573,17 @@ def scan(self, progress=None, label=None, vehiclefilter=None, canline=0):
continue

if addr not in elm.dnat:
print(_("Warning, address") + " %s " +_("is not mapped") % addr)
print(_("Warning, address") + " %s " + _("is not mapped") % addr)
continue

text = _("Scanning address: ")
print(f"{text + addr:<35} ECU: {self.ecu_database.addr_group_mapping[addr]:<30}")
text1 = _("Skipping CAN extended address (not supported yet)")

if len(elm.dnat[addr]) > 3 and not options.simulation_mode:
print(_("Skipping CAN extended address (not supported yet)"), addr)
print(f"{text + addr:<35} ECU: {self.ecu_database.addr_group_mapping[addr]:<65} [{text1}]")
continue
else:
print(f"{text + addr:<35} ECU: {self.ecu_database.addr_group_mapping[addr]}")

if not options.simulation_mode:
options.elm.init_can()
Expand Down Expand Up @@ -1630,7 +1632,7 @@ def scan_kwp(self, progress=None, label=None, vehiclefilter=None):
self.qapp.processEvents()

text = _("Scanning address: ")
print(f"{text + addr:<35} ECU: {self.ecu_database.addr_group_mapping[addr]:<30}")
print(f"{text + addr:<35} ECU: {self.ecu_database.addr_group_mapping[addr]}")

if not options.simulation_mode:
options.opt_si = True
Expand Down

0 comments on commit b47d3b0

Please sign in to comment.