diff options
| author | Christian Kolset <ckolset@colostate.edu> | 2026-07-29 14:22:46 -0600 |
|---|---|---|
| committer | Christian Kolset <ckolset@colostate.edu> | 2026-07-29 14:22:46 -0600 |
| commit | 34c8b0950398c07e84777479f3534615907f4f58 (patch) | |
| tree | 5050896bbd5c2a4fab0239c6456637ca22306156 /ui/main_window.py | |
| parent | c98885f503a8a2eb4b691b41404231da8d2aeda5 (diff) | |
| parent | ad7f1c39ef473a327ca3b467b579be0099377f55 (diff) | |
Merge branch 'fix/run-stop-log-master-switch'
Diffstat (limited to 'ui/main_window.py')
| -rw-r--r-- | ui/main_window.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/ui/main_window.py b/ui/main_window.py index d585a83..90294ac 100644 --- a/ui/main_window.py +++ b/ui/main_window.py @@ -203,6 +203,9 @@ class MainWindow(QMainWindow): self._clock = QTimer(self); self._clock.setInterval(1000) self._clock.timeout.connect(self._tick) + self._rec_blink = QTimer(self); self._rec_blink.setInterval(600) + self._rec_blink.timeout.connect(self._tick_rec_blink) + def _connect_signals(self): self.engine.new_data.connect(self.processor.on_raw_data) self.processor.processed_data.connect(self._chart.on_new_data) @@ -595,9 +598,12 @@ class MainWindow(QMainWindow): self._run_btn.setText("⏹ STOP"); self._log_btn.setEnabled(True) self._clock.start(); self._status.setText("Acquiring…") else: + self._ctrl.safe_stop_all() # master switch — stop outputs before halting acquisition self.engine.stop() self._run_btn.setText("▶ RUN") - if self._log_btn.isChecked(): self._log_btn.setChecked(False) + if self._log_btn.isChecked(): + self._log_btn.setChecked(False) + self._toggle_log(False) # setChecked() alone won't fire clicked — stop blink/logging explicitly self._log_btn.setEnabled(False); self._clock.stop() self._status.setText("Stopped") @@ -613,8 +619,18 @@ class MainWindow(QMainWindow): os.path.join(self._settings.get("log_dir", "logs"), "")) self._log_btn.setText("⏹ LOGGING") self._status.setText(f"Logging → {p}") + self._rec_blink.start() else: self.engine.stop_logging(); self._log_btn.setText("⬤ LOG") + self._rec_blink.stop() + self._log_btn.setProperty("recording", False) + self._log_btn.style().unpolish(self._log_btn); self._log_btn.style().polish(self._log_btn) + + def _tick_rec_blink(self): + """Pulse the Log button's background while a recording is active.""" + on = not self._log_btn.property("recording") + self._log_btn.setProperty("recording", on) + self._log_btn.style().unpolish(self._log_btn); self._log_btn.style().polish(self._log_btn) # ── Theme / settings ────────────────────────────────────────────────── |
