Skip to content

On shutterOpenChanged callback#697

Merged
marktsuchida merged 7 commits intomicro-manager:mainfrom
nicost:OnShutterCallBack
Aug 15, 2025
Merged

On shutterOpenChanged callback#697
marktsuchida merged 7 commits intomicro-manager:mainfrom
nicost:OnShutterCallBack

Conversation

@nicost
Copy link
Copy Markdown
Member

@nicost nicost commented Jul 17, 2025

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

nicost added 3 commits July 14, 2025 11:46
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.
@nicost nicost requested review from Copilot and marktsuchida July 17, 2025 19:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 OnShutterOpenChanged callback 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

Comment thread MMDevice/MMDevice.h Outdated
Comment thread MMCore/MMEventCallback.h
Comment thread DeviceAdapters/Utilities/DAShutter.cpp Outdated
Comment thread DeviceAdapters/DemoCamera/DemoCamera.cpp Outdated
nicost and others added 4 commits July 17, 2025 12:58
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>
Copy link
Copy Markdown
Member

@marktsuchida marktsuchida left a comment

Choose a reason for hiding this comment

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

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.

@nicost
Copy link
Copy Markdown
Member Author

nicost commented Jul 30, 2025

Did you have a chance to look at the @tlambert03 ? OK to merge?

@tlambert03
Copy link
Copy Markdown
Contributor

sorry for the delay! Thanks for the ping. I'm totally fine/happy with virtual void onShutterOpenChanged(const char* name, bool open)

@marktsuchida
Copy link
Copy Markdown
Member

Thanks. I'll try to merge this (hopefully today or tomorrow), probably together with one or two items from #642.

@marktsuchida marktsuchida merged commit b7d5816 into micro-manager:main Aug 15, 2025
8 checks passed
@nicost nicost deleted the OnShutterCallBack branch October 16, 2025 18:41
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.

4 participants