diff --git a/software/control/gui_hcs.py b/software/control/gui_hcs.py index ac024c55..b99ad209 100644 --- a/software/control/gui_hcs.py +++ b/software/control/gui_hcs.py @@ -853,7 +853,10 @@ def makeConnections(self): self.movement_updater.position_after_move.connect(self.navigationViewer.draw_fov_current_location) if WELLPLATE_FORMAT == "glass slide": # TODO(imo): This well place logic is duplicated below in onWellPlateChanged. We should change it to only exist in 1 location. - self.movement_updater.sent_after_stopped.connect(self.wellplateMultiPointWidget.set_live_scan_coordinates) + # self.movement_updater.sent_after_stopped.connect(self.wellplateMultiPointWidget.set_live_scan_coordinates) + self.movement_updater.position_after_move.connect( + self.wellplateMultiPointWidget.update_live_coordinates + ) self.is_live_scan_grid_on = True self.multipointController.signal_register_current_fov.connect(self.navigationViewer.register_fov) self.multipointController.signal_current_configuration.connect(self.liveControlWidget.set_microscope_mode) @@ -1163,10 +1166,9 @@ def onWellplateChanged(self, format_): if isinstance(format_, QVariant): format_ = format_.value() - # TODO(imo): Not sure why glass slide is so special here? It seems like it's just a "1 well plate". Also why is the objective forced to inverted for all non-glass slide, and not inverted for glass slide? + # TODO(imo): Not sure why glass slide is so special here? It seems like it's just a "1 well plate". if format_ == "glass slide": self.toggleWellSelector(False) - self.multipointController.inverted_objective = False if not self.is_live_scan_grid_on: # connect live scan grid for glass slide self.movement_updater.position_after_move.connect( self.wellplateMultiPointWidget.update_live_coordinates @@ -1176,7 +1178,6 @@ def onWellplateChanged(self, format_): self.setupSlidePositionController(is_for_wellplate=False) else: self.toggleWellSelector(True) - self.multipointController.inverted_objective = True if self.is_live_scan_grid_on: # disconnect live scan grid for wellplate self.movement_updater.position_after_move.disconnect( self.wellplateMultiPointWidget.update_live_coordinates @@ -1267,7 +1268,7 @@ def toggleAcquisitionStart(self, acquisition_started): self.is_live_scan_grid_on = False else: self.log.info("FINISHED ACQUISITION") - if not self.is_live_scan_grid_on: # reconnect live scan grid if was on before acqusition + if not self.is_live_scan_grid_on and "glass slide" in self.wellplateFormatWidget.wellplate_format: self.movement_updater.position_after_move.connect( self.wellplateMultiPointWidget.update_live_coordinates ) diff --git a/software/control/widgets.py b/software/control/widgets.py index a9b3e2eb..38324060 100644 --- a/software/control/widgets.py +++ b/software/control/widgets.py @@ -3619,7 +3619,7 @@ def update_coordinates(self): elif "glass slide" in self.navigationViewer.sample: pos = self.stage.get_pos() - self.scanCoordinates.set_live_scan_coordinates(pos.x_mm, pos.y_mm) + self.scanCoordinates.set_live_scan_coordinates(pos.x_mm, pos.y_mm, scan_size_mm, overlap_percent, shape) else: if self.scanCoordinates.has_regions(): self.scanCoordinates.clear_regions() @@ -3636,13 +3636,15 @@ def update_well_coordinates(self, selected): elif self.scanCoordinates.has_regions(): self.scanCoordinates.clear_regions() - def update_live_coordinates(self, x, y): + def update_live_coordinates(self, pos: squid.abc.Pos): + x_mm = pos.x_mm + y_mm = pos.y_mm if hasattr(self.parent, "recordTabWidget") and self.parent.recordTabWidget.currentWidget() != self: return scan_size_mm = self.entry_scan_size.value() overlap_percent = self.entry_overlap.value() shape = self.combobox_shape.currentText() - self.scanCoordinates.set_live_scan_coordinates(x, y, scan_size_mm, overlap_percent, shape) + self.scanCoordinates.set_live_scan_coordinates(x_mm, y_mm, scan_size_mm, overlap_percent, shape) def toggle_acquisition(self, pressed): if not self.base_path_is_set: