small fixes

pull/36045/head
Quantizr (Jimmy) 2 weeks ago
parent 9a9a6586d4
commit 1cfa906201
  1. 2
      tools/jotpluggler/data.py
  2. 3
      tools/jotpluggler/pluggle.py
  3. 6
      tools/jotpluggler/views.py

@ -266,7 +266,7 @@ class DataManager:
pbar.update(1)
if segment_result:
self._add_segment(segment_result, start_time, end_time)
except Exception as e:
except Exception:
cloudlog.exception(f"Error loading route {route}:")
finally:
self._finalize_loading()

@ -5,6 +5,7 @@ import pyautogui
import subprocess
import dearpygui.dearpygui as dpg
import threading
import numpy as np
from openpilot.common.basedir import BASEDIR
from openpilot.tools.jotpluggler.data import DataManager
from openpilot.tools.jotpluggler.views import DataTreeView
@ -48,7 +49,7 @@ def calculate_avg_char_width(font):
def format_and_truncate(value, available_width: float, avg_char_width: float) -> str:
s = str(value)
s = f"{value:.5f}" if np.issubdtype(type(value), np.floating) else str(value)
max_chars = int(available_width / avg_char_width) - 3
if len(s) > max_chars:
return s[: max(0, max_chars)] + "..."

@ -75,8 +75,8 @@ class TimeSeriesPanel(ViewPanel):
value = value_array[position]
if value is not None:
if isinstance(value, float):
formatted_value = f"{value:.4f}" if abs(value) < 1000 else f"{value:.3e}"
if np.issubdtype(type(value), np.floating):
formatted_value = f"{value:.5f}"
else:
formatted_value = str(value)
@ -228,7 +228,7 @@ class DataTreeView:
def update_frame(self):
items_processed = 0
while self.ui_render_queue and items_processed < self.MAX_ITEMS_PER_FRAME: # process up to MAX_ITEMS_PER_FRAME to maintain perforamnce
while self.ui_render_queue and items_processed < self.MAX_ITEMS_PER_FRAME: # process up to MAX_ITEMS_PER_FRAME to maintain performance
node, parent_tag, search_term, is_leaf = self.ui_render_queue.popleft()
if is_leaf:
self._create_leaf_ui(node, parent_tag)

Loading…
Cancel
Save