DeviceAdapters: Add 3Z light source controller support#954
DeviceAdapters: Add 3Z light source controller support#954TheSilencerPang wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Windows device adapter module to support a 3Z Optics light source controller in the Micro-Manager DeviceAdapters collection, wiring it into the Visual Studio solution so it builds as a standard mmgr_dal_* adapter.
Changes:
- Added a new
3Z_Opticsdevice adapter project (VC++ project + filters) and registered it inmicromanager.sln. - Implemented a Modbus/serial-based shutter device with per-channel on/off + intensity properties, plus a polling thread for status refresh.
- Added adapter-specific configuration loading logic (via a
models.jsonsearch) to determine channel list and brightness range.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| micromanager.sln | Adds the new 3Z_Optics device adapter project to the solution and build configurations. |
| DeviceAdapters/3Z_Optics/3Z_Optics.vcxproj | New VS project for building mmgr_dal_3Z_Optics (adapter build settings/configurations). |
| DeviceAdapters/3Z_Optics/3Z_Optics.vcxproj.filters | VS filters for organizing the adapter source/header in Solution Explorer. |
| DeviceAdapters/3Z_Optics/3Z_Optics.h | Declares the shutter controller, Modbus I/O helpers, and polling thread. |
| DeviceAdapters/3Z_Optics/3Z_Optics.cpp | Implements module exports, Modbus protocol, device properties/actions, and polling behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // 1. Try current working directory | ||
| possiblePaths.push_back("models.json"); | ||
| possiblePaths.push_back("3z/models.json"); | ||
|
|
||
| // 2. Try user Documents folder using Windows API |
There was a problem hiding this comment.
The purpose of introducing models.json is to facilitate the addition of more device models in the future. This allows for model-specific optimizations to enhance the user experience in umanager, such as the display of channel labels for light sources. Even without this file, basic functionalities can still be utilized.
|
Looks very good! Could you have a look at the CoPilot comments and apply fixes as you see fit? I or @marktsuchida will then merge. Also, can you add a page describing the light source on https://micro-manager.org? |
- Added MMThreadGuard to all property action handlers - Protected ReadDeviceStateByMode, ReadCurrentDeviceState, etc. - Fixed potential data race between polling thread and core thread
|
The newly submitted code has been optimized based on the comments from CoPilot. |
|
Thank you for the updates. I'll merge this soon after some minor changes to the Visual Studio project files. |
Description
This PR adds support for the 3Z light source (model: 3Z_Optics) to Micro-Manager 2.0.
Features supported
Hardware
Testing
Additional information
DeviceAdapters/3Z_Opticsmmgr_dal_3Z_Optics.dllNote to reviewers:
I have followed the existing device adapter style. Please let me know if any changes are needed.