From 95dd88a5679ca241a401251915bc3df92a7efba7 Mon Sep 17 00:00:00 2001 From: You Yan Date: Tue, 25 Feb 2025 18:34:41 -0800 Subject: [PATCH] automatically stop focus camera live when switching to other tabs --- software/control/gui_hcs.py | 5 +++++ software/control/widgets.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/software/control/gui_hcs.py b/software/control/gui_hcs.py index 0002c174..495b5e10 100644 --- a/software/control/gui_hcs.py +++ b/software/control/gui_hcs.py @@ -1269,6 +1269,11 @@ def onDisplayTabChanged(self, index): if hasattr(current_widget, "viewer"): current_widget.activate() + # Stop focus camera live if not on laser focus tab + if SUPPORT_LASER_AUTOFOCUS: + if self.imageDisplayTabs.tabText(index) != "Laser-Based Focus": + self.laserAutofocusSettingWidget.stop_live() + def onWellplateChanged(self, format_): if isinstance(format_, QVariant): format_ = format_.value() diff --git a/software/control/widgets.py b/software/control/widgets.py index 50e1ef9c..16eea937 100644 --- a/software/control/widgets.py +++ b/software/control/widgets.py @@ -529,6 +529,11 @@ def toggle_live(self, pressed): self.liveController.stop_live() self.btn_live.setText("Start Live") self.run_spot_detection_button.setEnabled(True) + + def stop_live(self): + """Used for stopping live when switching to other tabs""" + self.toggle_live(False) + self.btn_live.setChecked(False) def toggle_characterization_mode(self, state): self.laserAutofocusController.characterization_mode = state