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

[fix] Only check if the stage is in FM Imaging mode when moving to a … #2665

Merged
merged 1 commit into from
Feb 7, 2024
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
15 changes: 9 additions & 6 deletions src/odemis/gui/cont/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,23 @@ def _on_btn_go_to_feature(self, _):
current_label = pm.getCurrentPostureLabel()
logging.debug(f"Current posture: {POSITION_NAMES[current_label]}")

if current_label != FM_IMAGING: # TODO: @patrick remove this once SEM move is supported
logging.info(f"Currently under {POSITION_NAMES[current_label]}, moving to feature position is not yet supported.")
# TODO: @patrick remove this once SEM move is supported
if current_label != FM_IMAGING and self._main_data_model.microscope.role == "meteor":
logging.info(f"Currently under {POSITION_NAMES[current_label]}, "
f"moving to feature position is not yet supported.")
Comment on lines +97 to +100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patrickcleeve2 wanted to tag you to ensure that you have a notification about it and you are indeed aware of this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch thanks

self._display_go_to_feature_warning()
return
return

# move to feature position
logging.info(f"Moving to position: {pos}")
self._main_data_model.stage.moveAbs({'x': pos[0], 'y': pos[1]})
self._main_data_model.focus.moveAbs({'z': pos[2]})

def _display_go_to_feature_warning(self) -> bool:
box = wx.MessageDialog(self._tab.main_frame,
message="The stage is currently in the SEM imaging position. Please move to the FM imaging position first.",
caption="Unable to Move", style=wx.OK | wx.ICON_WARNING| wx.CENTER)
message="The stage is currently in the SEM imaging position. "
"Please move to the FM imaging position first.",
caption="Unable to Move", style=wx.OK | wx.ICON_WARNING | wx.CENTER)
box.SetOKLabel("OK")
ans = box.ShowModal() # Waits for the window to be closed
return ans == wx.ID_OK
Expand Down