summaryrefslogtreecommitdiff
path: root/ui/main_window.py
diff options
context:
space:
mode:
authorChristian Kolset <christian.kolset@gmail.com>2026-06-03 17:11:41 -0600
committerChristian Kolset <christian.kolset@gmail.com>2026-06-03 17:11:41 -0600
commita3ff221496f58d67ac962bfa6d011cc3e9d6ad3d (patch)
treea1cd6d27d61abef12f3d2727aecf3f17e7d583cc /ui/main_window.py
parent7f80e836029dfd3d81ffe92593d6ccb7769298e3 (diff)
Fix virtual channels not appearing in Plot Builder
Root cause: PlotWindow deepcopied _chart._cfg on init, so refresh_channels() operated on a stale copy. Also, when _win_plot was None, _on_derived_changed did nothing to prepare the config for when it opened. Fix: - refresh_channels() now owns the derived-pane sync: adds panes for new virtual channels (updating BSP tree), removes panes for deleted ones - _open_plot always passes current _chart._cfg reference then calls refresh_channels() so derived panes sync on every open - _on_derived_changed syncs cfg reference before calling refresh_channels() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'ui/main_window.py')
-rw-r--r--ui/main_window.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/main_window.py b/ui/main_window.py
index 5078a60..ebc7463 100644
--- a/ui/main_window.py
+++ b/ui/main_window.py
@@ -352,9 +352,10 @@ class MainWindow(QMainWindow):
self._chart._cfg, self)
self._win_plot.layout_applied.connect(self._chart.apply_layout)
self._win_plot.closed.connect(lambda: self._btn_plot.setChecked(False))
+ self._win_plot.refresh_channels() # sync any derived channels
else:
self._win_plot.cfg = self._chart._cfg
- self._win_plot._populate()
+ self._win_plot.refresh_channels()
self._show_win(self._win_plot, "below")
def _open_settings(self):
@@ -507,7 +508,10 @@ class MainWindow(QMainWindow):
def _on_derived_changed(self):
self._chart.refresh()
- if self._win_plot: self._win_plot.refresh_channels()
+ if self._win_plot:
+ # Ensure plot window works on current chart cfg, then sync derived panes
+ self._win_plot.cfg = self._chart._cfg
+ self._win_plot.refresh_channels()
# ── Run / Log ─────────────────────────────────────────────────────────