From ab7beb99de0a070b250c63df113e6c8cd5cba33a Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 7 Jul 2022 00:28:21 -0700 Subject: [PATCH] FW query debug script: print version brand (#25058) * test_fw_query_on_routes: print brand * dynamic paddign old-commit-hash: 30cb9ac962395a86464fdfc079b5f0030c7b9b9d --- selfdrive/debug/test_fw_query_on_routes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/selfdrive/debug/test_fw_query_on_routes.py b/selfdrive/debug/test_fw_query_on_routes.py index 789baeca4b..8c8c631c38 100755 --- a/selfdrive/debug/test_fw_query_on_routes.py +++ b/selfdrive/debug/test_fw_query_on_routes.py @@ -126,9 +126,10 @@ if __name__ == "__main__": print("New style (exact):", exact_matches) print("New style (fuzzy):", fuzzy_matches) - for version in car_fw: + padding = max([len(fw.brand) for fw in car_fw]) + for version in sorted(car_fw, key=lambda fw: fw.brand): subaddr = None if version.subAddress == 0 else hex(version.subAddress) - print(f" (Ecu.{version.ecu}, {hex(version.address)}, {subaddr}): [{version.fwVersion}],") + print(f" Brand: {version.brand:{padding}} - (Ecu.{version.ecu}, {hex(version.address)}, {subaddr}): [{version.fwVersion}],") print("Mismatches") found = False