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

[WIP] Add callbacks to Prior Stage Adapter #190

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ianhi
Copy link
Contributor

@ianhi ianhi commented Apr 28, 2022

Open question is how to best do the relative callbacks?

@marktsuchida
Copy link
Member

Micro-Manager device adapters for motorized stages are supposed to return from the SetPosition functions after just kicking off the movement (and possibly receiving a command acknowledgment). User code then waits for completion of movement by polling Busy(). So the very idea of issuing position callbacks from the SetPosition functions is probably flawed, at least for most stages.

In the case of integrated motorized microscope stages (such as those from the Big 4), the serial (or other) API typically has asynchronous messages to indicate end of motion, at which point callbacks can be generated. But this is not possible with many more traditional stage interfaces, where motion completion can only be detected by polling.

I'm not sure it is possible to do this correctly without a thread that polls the device for motion completion. It is questionable, however, if it is a good idea for each of these device adapters to reinvent such a complex mechanism. In fact, the StageControl window performs some polling for this very reason, IIRC.

(Let's use GitHub's "draft" PR feature for WIP PRs.)

@marktsuchida marktsuchida marked this pull request as draft May 9, 2022 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants