summaryrefslogtreecommitdiff
path: root/ui/windows
diff options
context:
space:
mode:
Diffstat (limited to 'ui/windows')
-rw-r--r--ui/windows/__pycache__/__init__.cpython-312.pycbin148 -> 0 bytes
-rw-r--r--ui/windows/__pycache__/__init__.cpython-314.pycbin150 -> 0 bytes
-rw-r--r--ui/windows/__pycache__/controls_window.cpython-312.pycbin3269 -> 0 bytes
-rw-r--r--ui/windows/__pycache__/devices_window.cpython-312.pycbin24793 -> 0 bytes
-rw-r--r--ui/windows/__pycache__/devices_window.cpython-314.pycbin26153 -> 0 bytes
-rw-r--r--ui/windows/__pycache__/plot_window.cpython-312.pycbin44632 -> 0 bytes
-rw-r--r--ui/windows/__pycache__/plot_window.cpython-314.pycbin46224 -> 0 bytes
-rw-r--r--ui/windows/__pycache__/settings_window.cpython-312.pycbin15906 -> 0 bytes
-rw-r--r--ui/windows/__pycache__/settings_window.cpython-314.pycbin13698 -> 0 bytes
-rw-r--r--ui/windows/__pycache__/signals_window.cpython-312.pycbin56462 -> 0 bytes
-rw-r--r--ui/windows/__pycache__/signals_window.cpython-314.pycbin59737 -> 0 bytes
-rw-r--r--ui/windows/channels_window.py2
-rw-r--r--ui/windows/plot_window.py43
13 files changed, 42 insertions, 3 deletions
diff --git a/ui/windows/__pycache__/__init__.cpython-312.pyc b/ui/windows/__pycache__/__init__.cpython-312.pyc
deleted file mode 100644
index 66495c5..0000000
--- a/ui/windows/__pycache__/__init__.cpython-312.pyc
+++ /dev/null
Binary files differ
diff --git a/ui/windows/__pycache__/__init__.cpython-314.pyc b/ui/windows/__pycache__/__init__.cpython-314.pyc
deleted file mode 100644
index 873ff5b..0000000
--- a/ui/windows/__pycache__/__init__.cpython-314.pyc
+++ /dev/null
Binary files differ
diff --git a/ui/windows/__pycache__/controls_window.cpython-312.pyc b/ui/windows/__pycache__/controls_window.cpython-312.pyc
deleted file mode 100644
index d3d59fc..0000000
--- a/ui/windows/__pycache__/controls_window.cpython-312.pyc
+++ /dev/null
Binary files differ
diff --git a/ui/windows/__pycache__/devices_window.cpython-312.pyc b/ui/windows/__pycache__/devices_window.cpython-312.pyc
deleted file mode 100644
index dc62b48..0000000
--- a/ui/windows/__pycache__/devices_window.cpython-312.pyc
+++ /dev/null
Binary files differ
diff --git a/ui/windows/__pycache__/devices_window.cpython-314.pyc b/ui/windows/__pycache__/devices_window.cpython-314.pyc
deleted file mode 100644
index 9f819dd..0000000
--- a/ui/windows/__pycache__/devices_window.cpython-314.pyc
+++ /dev/null
Binary files differ
diff --git a/ui/windows/__pycache__/plot_window.cpython-312.pyc b/ui/windows/__pycache__/plot_window.cpython-312.pyc
deleted file mode 100644
index d3a1583..0000000
--- a/ui/windows/__pycache__/plot_window.cpython-312.pyc
+++ /dev/null
Binary files differ
diff --git a/ui/windows/__pycache__/plot_window.cpython-314.pyc b/ui/windows/__pycache__/plot_window.cpython-314.pyc
deleted file mode 100644
index 9782293..0000000
--- a/ui/windows/__pycache__/plot_window.cpython-314.pyc
+++ /dev/null
Binary files differ
diff --git a/ui/windows/__pycache__/settings_window.cpython-312.pyc b/ui/windows/__pycache__/settings_window.cpython-312.pyc
deleted file mode 100644
index d596487..0000000
--- a/ui/windows/__pycache__/settings_window.cpython-312.pyc
+++ /dev/null
Binary files differ
diff --git a/ui/windows/__pycache__/settings_window.cpython-314.pyc b/ui/windows/__pycache__/settings_window.cpython-314.pyc
deleted file mode 100644
index f732521..0000000
--- a/ui/windows/__pycache__/settings_window.cpython-314.pyc
+++ /dev/null
Binary files differ
diff --git a/ui/windows/__pycache__/signals_window.cpython-312.pyc b/ui/windows/__pycache__/signals_window.cpython-312.pyc
deleted file mode 100644
index 9872798..0000000
--- a/ui/windows/__pycache__/signals_window.cpython-312.pyc
+++ /dev/null
Binary files differ
diff --git a/ui/windows/__pycache__/signals_window.cpython-314.pyc b/ui/windows/__pycache__/signals_window.cpython-314.pyc
deleted file mode 100644
index 2027f59..0000000
--- a/ui/windows/__pycache__/signals_window.cpython-314.pyc
+++ /dev/null
Binary files differ
diff --git a/ui/windows/channels_window.py b/ui/windows/channels_window.py
index 01b798c..4f0860d 100644
--- a/ui/windows/channels_window.py
+++ b/ui/windows/channels_window.py
@@ -105,7 +105,7 @@ class ChannelPickerDialog(QDialog):
cl.addWidget(chk)
if not any_available:
- cl.addWidget(QLabel("No additional channels available."))
+ cl.addWidget(QLabel("No additional signals available."))
cl.addStretch()
scroll.setWidget(cont)
diff --git a/ui/windows/plot_window.py b/ui/windows/plot_window.py
index bc8823f..9edf046 100644
--- a/ui/windows/plot_window.py
+++ b/ui/windows/plot_window.py
@@ -355,7 +355,6 @@ class PaneBlock(QFrame):
self._x_cb.addItem("⏱ Time (elapsed s)", userData="time")
for dev in self.registry.all_instances():
for ch in dev.info.channels:
- if not ch.enabled: continue
self._x_cb.addItem(f"{dev.info.device_id}/{ch.channel_id} ({ch.name})",
userData=f"{dev.info.device_id}/{ch.channel_id}")
for dc in self.processor.get_derived():
@@ -418,7 +417,6 @@ class PaneBlock(QFrame):
cb = QComboBox(); cb.setObjectName("channelPickerCb")
for dev in self.registry.all_instances():
for ch in dev.info.channels:
- if not ch.enabled: continue
cb.addItem(f"{dev.info.device_id} / {ch.channel_id} ({ch.name})",
userData=(dev.info.device_id, ch.channel_id, ch.name, ch.color))
for dc in self.processor.get_derived():
@@ -1026,6 +1024,47 @@ 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"
+ }
+ 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)
+ if len(p.traces) == 1
+ and p.traces[0].device_id == "derived"
+ and p.traces[0].channel_id not in current_ids
+ ]
+ for i in reversed(removed):
+ self.cfg.panes.pop(i)
+ if self.cfg.tree:
+ self.cfg.tree = _tree_remove(self.cfg.tree, i)
+ if self.cfg.tree:
+ self.cfg.tree = _tree_equalize_ratios(_tree_reindex(self.cfg.tree, i))
+
self._populate()
def closeEvent(self, e: QCloseEvent):