On shutterOpenChanged callback#697
Conversation
position changed. Need Device and Core interface bump.
addition of OnShutterOpenChanged callback. Hold off until a Device interface bump is needed elsewhere.
and two Utilities Shutter device adapters.
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new callback mechanism to inform the Core when a shutter's open/closed state changes. Device adapters can now call OnShutterOpenChanged to notify the Core about shutter state transitions, enabling better monitoring and synchronization of shutter operations.
- Introduces
OnShutterOpenChangedcallback in the device interface and core system - Updates device interface version from 73 to 74 and core minor version from 9 to 10
- Implements the callback in existing shutter device adapters (MultiShutter, DAShutter, DemoShutter)
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| MMDevice/MMDevice.h | Adds OnShutterOpenChanged method to device interface and increments version |
| MMCore/MMEventCallback.h | Adds onShutterOpenChanged virtual method for external callbacks |
| MMCore/MMCore.cpp | Updates core minor version number |
| MMCore/CoreCallback.h | Declares OnShutterOpenChanged method in CoreCallback class |
| MMCore/CoreCallback.cpp | Implements OnShutterOpenChanged handler to forward events to external callbacks |
| DeviceAdapters/Utilities/MultiShutter.cpp | Adds callback invocation when shutter state changes |
| DeviceAdapters/Utilities/DAShutter.cpp | Adds callback invocation with error handling |
| DeviceAdapters/DemoCamera/DemoCamera.h | Adds callback invocation in DemoShutter SetOpen method |
| DeviceAdapters/DemoCamera/DemoCamera.cpp | Initializes member variables and adds callback in OnState method |
Fix typo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fixed typo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Remove superfluous ; Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
marktsuchida
left a comment
There was a problem hiding this comment.
LGTM provided that this is for best-effort UI updates only (not for timing or control) -- which is probably the case for most of our existing change notifications.
Will wait to merge in case @tlambert03 has any comments.
|
Did you have a chance to look at the @tlambert03 ? OK to merge? |
|
sorry for the delay! Thanks for the ping. I'm totally fine/happy with |
|
Thanks. I'll try to merge this (hopefully today or tomorrow), probably together with one or two items from #642. |
This PR lets Device Adapters inform the Core that the state of the shutter they control has changed. It should be called from code that monitors the state of the shutter. It would also be possible to call from code opening the shutter, but then you should make sure the shutter is really in the state reported (many shutters need some time to open / close).
This PR updated the Device interface version as well as the minor version of the Core. I am fine waiting to merge this PR until there are other reasons to increase the Device Interface version (as there are still a number of 3dparty device adpa\apters that we can not automatically update). @tlambert03