-
Notifications
You must be signed in to change notification settings - Fork 9
fix: Stage controller objects that batch repeated relative/absolute calls and emit moveFinished when done #423
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
…er and StageWidget
hey @fdrgsp, would you mind banging on this for a little bit and trying to break it? |
this now uses pymmcore-plus v0.14 with pymmcore-plus/pymmcore-plus#462 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #423 +/- ##
==========================================
- Coverage 90.52% 90.47% -0.05%
==========================================
Files 89 90 +1
Lines 9791 9816 +25
==========================================
+ Hits 8863 8881 +18
- Misses 928 935 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…mproved stage control
this is looking pretty good. here's a real scope (it's a bit extra laggy, because this was also over remove desktop): Untitled.mov |
This is an attempt to fix #410 ... it's still a WIP, but it introduces a
_ValueBatcher
object, a generic object that knows how to get/set and add values, and check device busy state. It manages repeated calls toadd_relative
and/orset_absolute
, and, maintains an internal awareness of whether we're "done" or not.That all sounds rather abstract, and it is, but the goal is to have one object that we can share (across, say, the stage controller widget, and the stage explorer widget #400 ... that coordinates all of the attempts to control and move the stage, and, importantly, lets them all know when the job is done so they can, for example, snap an image.
The value batcher itself doesn't manage an event loop, and could be moved into pymmcore-plus. It is wrapped here with a small QObject that does have the timer, polls the controller, and emits the signal when needed.
Here is a concrete example of what it enables (there's still one little glitch that can be seen in the movie... and I'm not yet sure if that's a bug in this code, or the demo stage device adapter). Note that you can press the relative move button twice (before it's done) and it still makes a 2x movement.
Untitled.mov