Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn live mode off when loading calibration #335

Merged
merged 2 commits into from
Apr 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions recOrder/plugin/main_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ def _promote_slider_offline(self, ui_slider, range_):
ui_slider.setRange(range_[0], range_[1])

def _promote_slider_init(self):

"""
Used to promote the Display Tab sliders from QSlider to QDoubeRangeSlider with superqt
Returns
Expand Down Expand Up @@ -1174,7 +1173,6 @@ def handle_bire_image_update(self, value: NDArray):

@Slot(object)
def handle_phase_image_update(self, value):

name = "Phase2D" if self.acq_mode == "2D" else "Phase3D"

# Add new layer if none exists, otherwise update layer data
Expand Down Expand Up @@ -1845,6 +1843,11 @@ def load_calibration(self):
def update_extinction(extinction):
self.calib.extinction_ratio = float(extinction)

# FIXME: for 1.0.0 we'd like to avoid MM call in the main thread
# Make sure Live Mode is off
if self.calib.snap_manager.getIsLiveModeOn():
self.calib.snap_manager.setLiveModeOn(False)

# initialize worker properties for multi-threading
self.ui.qbutton_stop_calib.clicked.connect(self.worker.quit)
self.worker.yielded.connect(self.ui.le_extinction.setText)
Expand Down Expand Up @@ -1896,6 +1899,7 @@ def run_calibration(self):
self.directory, "calibration_metadata.txt"
)

# FIXME: for 1.0.0 we'd like to avoid MM call in the main thread
# Make sure Live Mode is off
if self.calib.snap_manager.getIsLiveModeOn():
self.calib.snap_manager.setLiveModeOn(False)
Expand Down Expand Up @@ -2290,7 +2294,6 @@ def save_config(self):

@Slot(tuple)
def update_dims(self, dims):

if not self.pause_updates:
self.viewer.dims.set_current_step(0, dims[0])
self.viewer.dims.set_current_step(1, dims[1])
Expand All @@ -2299,7 +2302,6 @@ def update_dims(self, dims):
pass

def _open_file_dialog(self, default_path, type):

return self._open_dialog("select a directory", str(default_path), type)

def _open_dialog(self, title, ref, type):
Expand Down