From 012a1093e3cb9a1b376fc3beee4df859ccfb8da5 Mon Sep 17 00:00:00 2001 From: Christian Kolset Date: Thu, 13 Aug 2026 10:59:25 -0600 Subject: Fixed loading profiles data retention and display. --- ui/windows/plot_window.py | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) (limited to 'ui/windows/plot_window.py') 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) -- cgit v1.2.3