summaryrefslogtreecommitdiff
path: root/ui/main_window.py
diff options
context:
space:
mode:
Diffstat (limited to 'ui/main_window.py')
-rw-r--r--ui/main_window.py14
1 files changed, 14 insertions, 0 deletions
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(