summaryrefslogtreecommitdiff
path: root/ui/windows/plot_window.py
diff options
context:
space:
mode:
authorChristian Kolset <ckolset@colostate.edu>2026-08-13 10:59:25 -0600
committerChristian Kolset <ckolset@colostate.edu>2026-08-13 11:04:34 -0600
commit012a1093e3cb9a1b376fc3beee4df859ccfb8da5 (patch)
treeacc261cd944187961c65bafcdea84137f87d0ead /ui/windows/plot_window.py
parentb7b3a84f37cc94494e17ea2098f72d6317090c53 (diff)
Fixed loading profiles data retention and display.
Diffstat (limited to 'ui/windows/plot_window.py')
-rw-r--r--ui/windows/plot_window.py29
1 files changed, 4 insertions, 25 deletions
diff --git a/ui/windows/plot_window.py b/ui/windows/plot_window.py
index 119efab..dc1617b 100644
--- a/ui/windows/plot_window.py
+++ b/ui/windows/plot_window.py
@@ -1092,33 +1092,12 @@ class PlotWindow(QWidget):
QMessageBox.critical(self, "Import failed", str(e))
def refresh_channels(self):
- """Sync virtual channel panes then rebuild UI."""
- existing = {
- tr.channel_id
- for p in self.cfg.panes
- for tr in p.traces if tr.device_id == "derived"
- }
+ """Drop panes whose sole trace is a deleted virtual channel, then rebuild UI.
+ Does NOT auto-add panes for new virtual channels — the operator adds those
+ explicitly via "+ Add Pane" / "+ Add Channel", so the plot layout only ever
+ shows what was deliberately built."""
current_ids = {dc.channel_id for dc in self.processor.get_derived()}
- # Add panes for new virtual channels
- for dc in self.processor.get_derived():
- if dc.channel_id not in existing:
- new_idx = len(self.cfg.panes)
- spec = PaneSpec(title=dc.name, y_label=dc.unit)
- spec.traces.append(TraceSpec(
- device_id="derived", channel_id=dc.channel_id,
- label=dc.name, color=dc.color,
- ))
- self.cfg.panes.append(spec)
- if self.cfg.tree is None:
- self.cfg.tree = {"kind": "leaf", "pane": 0}
- else:
- self.cfg.tree = _tree_equalize_ratios({
- "kind": "vsplit", "ratio": 0.5,
- "first": self.cfg.tree,
- "second": {"kind": "leaf", "pane": new_idx},
- })
-
# Remove panes whose sole trace is a deleted virtual channel
removed = [
i for i, p in enumerate(self.cfg.panes)