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

MovementUpdater: update FOV position and position_after_move signals and slots #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
13 changes: 5 additions & 8 deletions software/control/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3389,17 +3389,14 @@ def update_wellplate_settings(
self.update_display_properties(sample)
self.draw_current_fov(self.x_mm, self.y_mm)

def draw_fov_current_location(self, pos: squid.abc.Pos):
def draw_fov_current_position(self, pos: squid.abc.Pos):
if not pos:
if self.x_mm is None and self.y_mm is None:
if self.x_mm is None or self.y_mm is None:
return
self.draw_current_fov(self.x_mm, self.y_mm)
else:
x_mm = pos.x_mm
y_mm = pos.y_mm
self.draw_current_fov(x_mm, y_mm)
self.x_mm = x_mm
self.y_mm = y_mm
self.x_mm = pos.x_mm
self.y_mm = pos.y_mm
self.draw_current_fov(self.x_mm, self.y_mm)

def get_FOV_pixel_coordinates(self, x_mm, y_mm):
if self.sample == "glass slide":
Expand Down
35 changes: 15 additions & 20 deletions software/control/gui_hcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,14 @@ def __init__(self, is_simulation=False, live_only_mode=False, *args, **kwargs):

self.microscope = control.microscope.Microscope(self.stage, self, is_simulation=is_simulation)

# TODO(imo): Why is moving to the cached position after boot hidden behind homing?
if HOMING_ENABLED_X and HOMING_ENABLED_Y and HOMING_ENABLED_Z:
if cached_pos := squid.stage.utils.get_cached_position():
self.stage.move_x_to(cached_pos.x_mm)
self.stage.move_y_to(cached_pos.y_mm)
self.stage.move_z_to(cached_pos.z_mm)

if ENABLE_WELLPLATE_MULTIPOINT:
self.wellplateMultiPointWidget.init_z()
if cached_pos := squid.stage.utils.get_cached_position():
self.stage.move_x_to(cached_pos.x_mm)
self.stage.move_y_to(cached_pos.y_mm)
self.stage.move_z_to(cached_pos.z_mm)

if ENABLE_WELLPLATE_MULTIPOINT:
self.wellplateMultiPointWidget.init_z()
if ENABLE_FLEXIBLE_MULTIPOINT:
self.flexibleMultiPointWidget.init_z()

# Create the menu bar
Expand Down Expand Up @@ -844,7 +843,7 @@ def makeConnections(self):
if ENABLE_FLEXIBLE_MULTIPOINT:
self.objectivesWidget.signal_objective_changed.connect(self.flexibleMultiPointWidget.update_fov_positions)
# TODO(imo): Fix position updates after removal of navigation controller
self.movement_updater.position_after_move.connect(self.navigationViewer.draw_fov_current_location)
self.movement_updater.position.connect(self.navigationViewer.draw_fov_current_position)
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)
Expand Down Expand Up @@ -1204,27 +1203,23 @@ def connectSlidePositionController(self):
self.slidePositionController.signal_slide_loading_position_reached.connect(
self.navigationWidget.slot_slide_loading_position_reached
)
if ENABLE_FLEXIBLE_MULTIPOINT:
self.slidePositionController.signal_slide_loading_position_reached.connect(
self.flexibleMultiPointWidget.disable_the_start_aquisition_button
)
if ENABLE_WELLPLATE_MULTIPOINT:
self.slidePositionController.signal_slide_loading_position_reached.connect(
self.wellplateMultiPointWidget.disable_the_start_aquisition_button
)

self.slidePositionController.signal_slide_scanning_position_reached.connect(
self.navigationWidget.slot_slide_scanning_position_reached
)
if ENABLE_FLEXIBLE_MULTIPOINT:
self.slidePositionController.signal_slide_loading_position_reached.connect(
self.flexibleMultiPointWidget.disable_the_start_aquisition_button
)
self.slidePositionController.signal_slide_scanning_position_reached.connect(
self.flexibleMultiPointWidget.enable_the_start_aquisition_button
)
if ENABLE_WELLPLATE_MULTIPOINT:
self.slidePositionController.signal_slide_loading_position_reached.connect(
self.wellplateMultiPointWidget.disable_the_start_aquisition_button
)
self.slidePositionController.signal_slide_scanning_position_reached.connect(
self.wellplateMultiPointWidget.enable_the_start_aquisition_button
)

self.slidePositionController.signal_clear_slide.connect(self.navigationViewer.clear_slide)

def replaceWellSelectionWidget(self, new_widget):
Expand Down
Loading