diff options
Diffstat (limited to 'ui')
30 files changed, 48 insertions, 5 deletions
diff --git a/ui/__pycache__/__init__.cpython-312.pyc b/ui/__pycache__/__init__.cpython-312.pyc Binary files differdeleted file mode 100644 index 8dc1c2f..0000000 --- a/ui/__pycache__/__init__.cpython-312.pyc +++ /dev/null diff --git a/ui/__pycache__/__init__.cpython-314.pyc b/ui/__pycache__/__init__.cpython-314.pyc Binary files differdeleted file mode 100644 index 15d71d0..0000000 --- a/ui/__pycache__/__init__.cpython-314.pyc +++ /dev/null diff --git a/ui/__pycache__/add_device_dialog.cpython-312.pyc b/ui/__pycache__/add_device_dialog.cpython-312.pyc Binary files differdeleted file mode 100644 index 1e970d6..0000000 --- a/ui/__pycache__/add_device_dialog.cpython-312.pyc +++ /dev/null diff --git a/ui/__pycache__/add_device_dialog.cpython-314.pyc b/ui/__pycache__/add_device_dialog.cpython-314.pyc Binary files differdeleted file mode 100644 index 687bc1e..0000000 --- a/ui/__pycache__/add_device_dialog.cpython-314.pyc +++ /dev/null diff --git a/ui/__pycache__/config_dialog.cpython-312.pyc b/ui/__pycache__/config_dialog.cpython-312.pyc Binary files differdeleted file mode 100644 index 91921e5..0000000 --- a/ui/__pycache__/config_dialog.cpython-312.pyc +++ /dev/null diff --git a/ui/__pycache__/config_dialog.cpython-314.pyc b/ui/__pycache__/config_dialog.cpython-314.pyc Binary files differdeleted file mode 100644 index 91d6b9b..0000000 --- a/ui/__pycache__/config_dialog.cpython-314.pyc +++ /dev/null diff --git a/ui/__pycache__/control_editor.cpython-312.pyc b/ui/__pycache__/control_editor.cpython-312.pyc Binary files differdeleted file mode 100644 index 3a53377..0000000 --- a/ui/__pycache__/control_editor.cpython-312.pyc +++ /dev/null diff --git a/ui/__pycache__/control_editor.cpython-314.pyc b/ui/__pycache__/control_editor.cpython-314.pyc Binary files differdeleted file mode 100644 index d3904f7..0000000 --- a/ui/__pycache__/control_editor.cpython-314.pyc +++ /dev/null diff --git a/ui/__pycache__/control_panel.cpython-312.pyc b/ui/__pycache__/control_panel.cpython-312.pyc Binary files differdeleted file mode 100644 index 1c101a8..0000000 --- a/ui/__pycache__/control_panel.cpython-312.pyc +++ /dev/null diff --git a/ui/__pycache__/control_panel.cpython-314.pyc b/ui/__pycache__/control_panel.cpython-314.pyc Binary files differdeleted file mode 100644 index a5b859f..0000000 --- a/ui/__pycache__/control_panel.cpython-314.pyc +++ /dev/null diff --git a/ui/__pycache__/main_window.cpython-312.pyc b/ui/__pycache__/main_window.cpython-312.pyc Binary files differdeleted file mode 100644 index ffd6e12..0000000 --- a/ui/__pycache__/main_window.cpython-312.pyc +++ /dev/null diff --git a/ui/__pycache__/main_window.cpython-314.pyc b/ui/__pycache__/main_window.cpython-314.pyc Binary files differdeleted file mode 100644 index 709972c..0000000 --- a/ui/__pycache__/main_window.cpython-314.pyc +++ /dev/null diff --git a/ui/__pycache__/profile_manager_ui.cpython-312.pyc b/ui/__pycache__/profile_manager_ui.cpython-312.pyc Binary files differdeleted file mode 100644 index 97cbe3a..0000000 --- a/ui/__pycache__/profile_manager_ui.cpython-312.pyc +++ /dev/null diff --git a/ui/__pycache__/profile_manager_ui.cpython-314.pyc b/ui/__pycache__/profile_manager_ui.cpython-314.pyc Binary files differdeleted file mode 100644 index ea12b21..0000000 --- a/ui/__pycache__/profile_manager_ui.cpython-314.pyc +++ /dev/null diff --git a/ui/__pycache__/strip_chart.cpython-312.pyc b/ui/__pycache__/strip_chart.cpython-312.pyc Binary files differdeleted file mode 100644 index 33e713b..0000000 --- a/ui/__pycache__/strip_chart.cpython-312.pyc +++ /dev/null diff --git a/ui/__pycache__/strip_chart.cpython-314.pyc b/ui/__pycache__/strip_chart.cpython-314.pyc Binary files differdeleted file mode 100644 index ef745d3..0000000 --- a/ui/__pycache__/strip_chart.cpython-314.pyc +++ /dev/null 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 ───────────────────────────────────────────────────────── diff --git a/ui/windows/__pycache__/__init__.cpython-312.pyc b/ui/windows/__pycache__/__init__.cpython-312.pyc Binary files differdeleted file mode 100644 index 66495c5..0000000 --- a/ui/windows/__pycache__/__init__.cpython-312.pyc +++ /dev/null diff --git a/ui/windows/__pycache__/__init__.cpython-314.pyc b/ui/windows/__pycache__/__init__.cpython-314.pyc Binary files differdeleted file mode 100644 index 873ff5b..0000000 --- a/ui/windows/__pycache__/__init__.cpython-314.pyc +++ /dev/null diff --git a/ui/windows/__pycache__/controls_window.cpython-312.pyc b/ui/windows/__pycache__/controls_window.cpython-312.pyc Binary files differdeleted file mode 100644 index d3d59fc..0000000 --- a/ui/windows/__pycache__/controls_window.cpython-312.pyc +++ /dev/null diff --git a/ui/windows/__pycache__/devices_window.cpython-312.pyc b/ui/windows/__pycache__/devices_window.cpython-312.pyc Binary files differdeleted file mode 100644 index dc62b48..0000000 --- a/ui/windows/__pycache__/devices_window.cpython-312.pyc +++ /dev/null diff --git a/ui/windows/__pycache__/devices_window.cpython-314.pyc b/ui/windows/__pycache__/devices_window.cpython-314.pyc Binary files differdeleted file mode 100644 index 9f819dd..0000000 --- a/ui/windows/__pycache__/devices_window.cpython-314.pyc +++ /dev/null diff --git a/ui/windows/__pycache__/plot_window.cpython-312.pyc b/ui/windows/__pycache__/plot_window.cpython-312.pyc Binary files differdeleted file mode 100644 index d3a1583..0000000 --- a/ui/windows/__pycache__/plot_window.cpython-312.pyc +++ /dev/null diff --git a/ui/windows/__pycache__/plot_window.cpython-314.pyc b/ui/windows/__pycache__/plot_window.cpython-314.pyc Binary files differdeleted file mode 100644 index 9782293..0000000 --- a/ui/windows/__pycache__/plot_window.cpython-314.pyc +++ /dev/null diff --git a/ui/windows/__pycache__/settings_window.cpython-312.pyc b/ui/windows/__pycache__/settings_window.cpython-312.pyc Binary files differdeleted file mode 100644 index d596487..0000000 --- a/ui/windows/__pycache__/settings_window.cpython-312.pyc +++ /dev/null diff --git a/ui/windows/__pycache__/settings_window.cpython-314.pyc b/ui/windows/__pycache__/settings_window.cpython-314.pyc Binary files differdeleted file mode 100644 index f732521..0000000 --- a/ui/windows/__pycache__/settings_window.cpython-314.pyc +++ /dev/null diff --git a/ui/windows/__pycache__/signals_window.cpython-312.pyc b/ui/windows/__pycache__/signals_window.cpython-312.pyc Binary files differdeleted file mode 100644 index 9872798..0000000 --- a/ui/windows/__pycache__/signals_window.cpython-312.pyc +++ /dev/null diff --git a/ui/windows/__pycache__/signals_window.cpython-314.pyc b/ui/windows/__pycache__/signals_window.cpython-314.pyc Binary files differdeleted file mode 100644 index 2027f59..0000000 --- a/ui/windows/__pycache__/signals_window.cpython-314.pyc +++ /dev/null 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): |
