From 91101126e9d044adb8afa635cca1ab5d5a4c51a6 Mon Sep 17 00:00:00 2001 From: Christian Kolset Date: Wed, 22 Apr 2026 12:21:28 -0600 Subject: Fixed saving profile to include devices and their configuration --- ui/main_window.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ui/main_window.py') diff --git a/ui/main_window.py b/ui/main_window.py index 9df7ef7..d4bb203 100644 --- a/ui/main_window.py +++ b/ui/main_window.py @@ -92,6 +92,12 @@ class MainWindow(QMainWindow): self._log_btn.setEnabled(False); self._log_btn.clicked.connect(self._toggle_log) tb.addWidget(self._log_btn) + self._clear_btn = QPushButton("⌫ Clear") + self._clear_btn.setObjectName("toolbarSectionBtn") + self._clear_btn.setToolTip("Clear plot history") + self._clear_btn.clicked.connect(self._clear_history) + tb.addWidget(self._clear_btn) + tb.addWidget(_sep()) dev_btn = QPushButton("⊞ Devices") @@ -265,12 +271,15 @@ class MainWindow(QMainWindow): processor=self.processor, control_panel=self._ctrl, settings_ref=self._settings, + engine=self.engine, ) if plot_cfg: self._chart.apply_layout(plot_cfg) else: self._chart.refresh() # Refresh open windows + if self._win_devices: + self._win_devices.refresh() if self._win_plot: self._win_plot.refresh_channels() self._status.setText(f"Profile loaded: {profile.name}") @@ -309,6 +318,11 @@ class MainWindow(QMainWindow): self._log_btn.setEnabled(False); self._clock.stop() self._status.setText("Stopped") + def _clear_history(self): + self.engine.clear_history() + self._chart.refresh() + self._status.setText("History cleared.") + def _toggle_log(self, c: bool): if c: p = self.engine.start_logging( -- cgit v1.2.3