Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
95427b1
Add EvidentIX85 device adapter for Evident IX85 microscope
nicost Nov 5, 2025
462e3c3
Fix build errors in EvidentIX85
nicost Nov 5, 2025
2725601
EvidentIX85: Build with C++14, add dependency on MMDevice
nicost Nov 5, 2025
a03dde8
EvidentIX85: Fix compile problems related to MMTime.
nicost Nov 5, 2025
b343184
EvidentI85: Devices are now correctly registered.
nicost Nov 6, 2025
746fe17
Clear Busy state when Focus/Nosepiece reach target position
nicost Nov 6, 2025
a4e1997
Fix race condition between command and monitoring threads
nicost Nov 6, 2025
4c22a3c
Fix notification filtering to not skip acknowledgment responses
nicost Nov 6, 2025
cf3bc91
Refactor to single-threaded serial port reading architecture
nicost Nov 6, 2025
4217748
Make parameter parsing functions robust to prevent crashes
nicost Nov 6, 2025
d83ab49
Fix notification detection to distinguish acknowledgments from data
nicost Nov 6, 2025
34b28d0
Fix Focus Busy state with tolerance-based position comparison
nicost Nov 6, 2025
49e959e
Set target position and busy state before sending command
nicost Nov 6, 2025
28fbe7e
Convert EvidentMagnification to use CMagnifierBase
nicost Nov 6, 2025
d5e2a7d
Fix build errors and runtime issues in Magnification device
nicost Nov 6, 2025
fb67c43
Add OnMagnifierChanged callback for magnification changes
nicost Nov 6, 2025
c1bb0a6
Fix shutdown timeout by stopping monitoring thread last
nicost Nov 6, 2025
2636fe0
EvidentIX85: Add SafeNosepieceChange feature
nicost Nov 6, 2025
aa85806
EvidentIX85: Implement all remaining device classes
nicost Nov 6, 2025
41c71f8
EvidentIX85: Fix MirrorUnit1 to use query-based position tracking
nicost Nov 6, 2025
b64f44f
EvidentIX85: Fix missing SetNumPositions calls in Query functions
nicost Nov 6, 2025
d47c9cb
EvidentIX85: Remove incorrect EnableNotifications calls
nicost Nov 6, 2025
52f15de
EvidentIX85: Restore EnableNotifications with correct CondenserTurret…
nicost Nov 6, 2025
16b9b34
EvidentIX85: Fix CondenserTurret timeout by clearing busy after TR+ ack
nicost Nov 7, 2025
e2d70d6
EvidentIX85: Fixes bug in DiaShutter detection.
nicost Nov 7, 2025
c7d1c44
EvidentIX85: Fix multiple device bugs found during hardware testing
nicost Nov 7, 2025
100465d
EvidentIX85: Use V command for device detection and add firmware vers…
nicost Nov 7, 2025
4d49d15
EvidentIX85: Add MirrorUnit2, EPIShutter2, and Manual Control Unit in…
nicost Nov 8, 2025
380ac7e
EvidentIX85: Add encoder support, MCU indicators I4/I5, and stage cal…
nicost Nov 9, 2025
5692211
EvidentIX85: Add focus jog controls and fix DIA brightness display
nicost Nov 10, 2025
d24ba18
EvidentIX85: Convert CorrectionCollar to Stage device with linking su…
nicost Nov 10, 2025
3a9a890
EvidentIX85: add orphaned addition of DeviceType_DIABrightness
nicost Nov 10, 2025
0cde5ba
EvidentIX85: Add initialization robustness and serial port auto-detec…
nicost Nov 11, 2025
d3a413b
EvidentIX85: Fix CorrectionCollar linking failure due to double termi…
nicost Nov 11, 2025
d5e956e
EvidentIX85: bug fixes.
nicost Nov 15, 2025
2d4eca5
EvidentIX5SSA - XYStage - first version.
nicost Nov 15, 2025
9636eb6
IX85XYSTage: fixed limits, renamed device.
nicost Nov 16, 2025
ebda167
EvidentIX85: rename IX5SSA to IX85XYStage
nicost Nov 17, 2025
ff15b3b
EvidentIX85: Fixed bug: MIRROR_UNIT_MAX_POS equals 8 rather than 6.
nicost Nov 17, 2025
a7093f9
EvidentIX85Win: start.
nicost Nov 18, 2025
8a50c07
EvidentIX85Win: Progress.
nicost Nov 18, 2025
e589f05
EvidentIX85Win: more progress
nicost Nov 18, 2025
129ae10
EvidenIX85Win: ZDC somewhat working, several fixes to other devices.
nicost Nov 19, 2025
a443222
EvidentIX85Win: Add Tracking Mode property for ZDC autofocus
nicost Nov 20, 2025
fc3851a
EvidentIX85Win: Add Focus Near Limit properties to Nosepiece
nicost Nov 20, 2025
90eb428
EvidentIX85Win: Add parfocal settings and escape distance, switch to …
nicost Nov 20, 2025
75ca5ab
EvidentIX85Win: Implement ZDC autofocus workflow modes
nicost Nov 21, 2025
45c14b7
EvidentIX85Win: Add ObjectiveSetup device for microscope configuration
nicost Nov 21, 2025
e990379
EvidenIX85Win-ObjectiveSetup - remove rednundant FinalSpecs property.
nicost Nov 21, 2025
28f884c
EvidentIX85Win: Refactor ObjectiveSetup handlers to use CPropertyActi…
nicost Nov 21, 2025
18271aa
EvidentIX85Win AF: FinFocusWithOffset no longer needs the offset to b…
nicost Nov 22, 2025
d84bd6d
EvidentIX85Win: Add PropertyChanged callbacks for AF Status updates
nicost Nov 24, 2025
99d6cab
EvidentIX85Win: Adds Serial port detection so that available
nicost Nov 25, 2025
67a26d5
EvidentIX85: removed files that should not have been included.
nicost Nov 25, 2025
293c574
EvidentIX85Win: ZDCVirtualOffset. WIP.
nicost Nov 27, 2025
6edd6fe
EvidentIX85Win: Added ZDCVirtualOffset. Needs testing with hardware.
nicost Nov 27, 2025
c8fd768
VS SOlution cleanup.
nicost Dec 1, 2025
6d58efd
EvidentIX85Win: changed default path to SDK dll to be relative to the…
nicost Dec 3, 2025
5455595
EvidentIX85Win: fix not waiting for focus drive to move into the corr…
nicost Dec 4, 2025
c647311
EvidentIX85Win: make sure that ZDC is busy whenever the focus drive i…
nicost Dec 4, 2025
2459485
EvidentIX85Win: adds neede header from secret repo.
nicost Dec 5, 2025
152542f
EvidentIX85Win: Change autofocus mode default to Find-Focus-With-Offset.
nicost Dec 8, 2025
aab3f86
EvidentIX85Win: made debug mode compile correcyly.
nicost Dec 17, 2025
4d04d9f
EvidentIX85Win: handles busy error message from SDK by trying the com…
nicost Dec 17, 2025
f88e213
EvidentIX85WIN: Provide a mechanism to Execute Commands
nicost Dec 18, 2025
a855616
EvidentIX85Win: formatting only.
nicost Dec 18, 2025
336dfb8
EvidentIX85Win: Made parfocal settings work.
nicost Dec 19, 2025
f08c4df
EvidentIX85Win: Ensure default serial oirt tiomeout is correct.
nicost Dec 19, 2025
b30cb96
EvidentIX85: Hardcoded path to the default micro-manager installation…
nicost Dec 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 173 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
# CLAUDE.md

Comment on lines +1 to +2
Copy link
Member

Choose a reason for hiding this comment

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

Having looked at this -- could we (discuss whether to) add CLAUDE.md in a separate PR?

I'm not sure I agree with everything that's in here (there are some outright mistakes), or whether or not to tell certain things to Claude. I, for one, would not be able to use Claude Code comfortably without first deleting this file each time. There might be a version of a CLAUDE.md that I would be comfortable including in the repo, but it looks like it would take at least a bit of work to produce such a thing (and even then, I'm not sure how confident I'd be about imposing it on others). So I think it would be better to decouple it from merging the IX85 adapter.

Copy link

Choose a reason for hiding this comment

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

I'd concur with @marktsuchida here. Beyond the issues already described, it's unfortunate to push a document pertaining specifically to Claude Code. All of the major AI user interfaces seem to have their own document - if we add one, is it okay to add others? (🤮)

Most AI tools (except, ironically, Claude Code 😅) now support an AGENTS.md if it's available in addition to their own proprietary documents, so I'd vote for one of those to be pushed to the repository, if we decide that we want an agent guidance document in the repo.

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Repository Overview

Micro-Manager is Open Source software for microscope control. This repository contains the C++ core components:

- **MMCore**: Device abstraction layer providing the top-level API for applications to control microscope hardware (see `MMCore/MMCore.h`)
- **MMDevice**: Device API defining the interface that device adapters must implement (see `MMDevice/MMDevice.h` and `MMDevice/DeviceBase.h`)
- **MMCoreJ_wrap**: SWIG-generated Java wrapper for MMCore
- **DeviceAdapters/**: Publicly accessible device adapter source code
- **SecretDeviceAdapters/**: Non-public device adapters (separate private repository referenced via git submodule)

### Architecture

MMCore implements two APIs:
- **Top API** (`MMCore/MMCore.h`): Used by applications to control abstracted microscope hardware. Public methods use lowercase naming (e.g., `getConfiguration()`) to be language-agnostic for SWIG wrapping.
- **Bottom API** (`MMDevice/MMDevice.h`): Implemented by device adapters to communicate with physical devices.

Both APIs maintain a pure C-interface for cross-platform compatibility and dynamic loading.

Device adapters are compiled into dynamically loadable libraries (`.dll`/`.so`/`.dylib`) that MMCore loads at runtime.

## Build Commands

### Windows (Visual Studio)

Primary solution file: `micromanager.sln`

Build using MSBuild or Visual Studio. MSBuild properties can be overridden via `/property:name=value`:
- `MM_3RDPARTYPUBLIC`: Path to public 3rd party dependencies (default: `../../3rdpartypublic`)
- `MM_3RDPARTYPRIVATE`: Path to private 3rd party dependencies (default: `../../3rdparty`)
- `MM_BOOST_INCLUDEDIR`: Boost include directory
- `MM_BOOST_LIBDIR`: Boost lib directory
- `MM_BUILDDIR`: Build artifacts directory

See `buildscripts/VisualStudio/MMCommon.props` for default values.

### macOS and Linux (Autotools)

Standard GNU Autotools workflow:

```bash
# From repository root
./configure # Configure build (detects available SDKs)
make # Build all components
make install # Install (may require sudo)
```

Build only MMCore and device adapters (skip Java components):
```bash
./configure --without-java
make
```

The build system auto-detects which device adapters can be built based on available vendor SDKs and headers.

### Experimental Meson Build (justfile)

Requires: `just`, `meson`, `ninja`

```bash
just # List available commands
just build-mmdevice # Build MMDevice
just build-mmcore # Build MMCore (depends on MMDevice)
just test-mmdevice # Test MMDevice
just test-mmcore # Test MMCore
just test # Run all tests
just clean # Clean build artifacts
```

Quick one-liner with uv:
```bash
uvx --from rust-just --with meson --with ninja just test
```

## Testing

Tests use Catch2 framework and are located in `unittest/` subdirectories:
- `MMCore/unittest/` - Core tests
- `MMDevice/unittest/` - Device API tests
- Some device adapters have their own tests (e.g., `DeviceAdapters/HamiltonMVP/unittest/`)

Run tests via meson (see justfile commands above) or through IDE test runners.

## Device Adapter Development

### Base Classes

Device adapters inherit from specialized base classes in `MMDevice/DeviceBase.h`:
- `CCameraBase<T>` - Cameras
- `CShutterBase<T>` - Shutters
- `CStageBase<T>` - Z-stages
- `CXYStageBase<T>` - XY stages
- `CStateDeviceBase<T>` - Filter wheels, turrets
- `CGenericBase<T>` - Generic devices
- `CAutoFocusBase<T>` - Autofocus devices
- `CImageProcessorBase<T>` - Image processors
- `CHubBase<T>` - Device hubs (multi-device controllers)

All base classes use the CRTP pattern: `class MyDevice : public CCameraBase<MyDevice>`

### Property System

Device configuration uses a property-based system. Properties are created in `Initialize()`:
```cpp
// Create action handler
CPropertyAction* pAct = new CPropertyAction(this, &MyDevice::OnProperty);
// Create property with allowed values
CreateProperty("PropertyName", "DefaultValue", MM::String, false, pAct);
AddAllowedValue("PropertyName", "Value1");
AddAllowedValue("PropertyName", "Value2");
```

### Vendor SDK Integration

Many device adapters depend on proprietary vendor SDKs:
- SDK headers/libraries are in `../../3rdpartypublic/` (public) or `../../3rdparty/` (private)
- Build system automatically disables adapters when SDKs are unavailable
- Each adapter's `configure.ac` or `.vcxproj` specifies SDK requirements

Example adapters to study:
- `DemoCamera` - Full-featured reference implementation without hardware dependencies
- `Arduino` - Simple serial communication pattern
- `PVCAM` - Camera with vendor SDK integration
- `ASITiger` - Multi-device hub pattern

### Threading Considerations

Camera adapters typically use separate threads for image acquisition:
- Implement proper locking around shared state
- Use MMDevice threading primitives (`MMThreadLock` in `DeviceThreads.h`)
- Circular buffers handle asynchronous image streaming (see `MMCore/CircularBuffer.h`)

### Error Handling

Use standard error codes from `MMDevice/MMDeviceConstants.h`:
- `DEVICE_OK` - Success
- `DEVICE_ERR` - Generic error
- Define adapter-specific error codes starting at 100+

Common error message constants are defined in `MMDevice/DeviceBase.h` (e.g., `g_Msg_SERIAL_TIMEOUT`).

## Key Files for Understanding the System

- `MMCore/MMCore.h` - Main public API
- `MMDevice/MMDevice.h` - Device interface definitions
- `MMDevice/DeviceBase.h` - Base classes and utility templates
- `DeviceAdapters/DemoCamera/DemoCamera.cpp` - Reference implementation
- `buildscripts/VisualStudio/MMCommon.props` - Windows build configuration defaults

## Coding style
- All indents are 3 spaces (no tab characters).
- Curly braces open in the same line in Java and in a new line in C++ (see examples).
- Class names begin with uppercase, and with each word capitalized, e.g. MyFirstClass.
- Function names use the same convention except that in Java they begin with lowercase and in C++ with uppercase, e.g. MyFunc() in C++ and myFunc() in Java.
- All variables begin with lower case, e.g. myVar.
- Class member variables begin with lowercase and end with underscore, e.g. memberVar_.
- Do not use this->memberVar_ idiom unless it is absolutely necessary to avoid confusion.
- Static constants in C++: const char* const g_Keyword_Description.
- Static constants in Java: static final String METADATA_FILE_NAME.
- if/else, for, and while statements should include curly braces, even if they are only followed by a single line.

## CRITICAL: File Editing on Windows
MANDATORY: Always use Backslashes on Windows for File Paths
When using Edit or MultiEdit on WIndows, you MUST use backslashes (\) in the file paths, NOT forward slashes (/).
WRONG:
Edit(file_path: "D:/repos/project/file.tsx", ...)
MultiEdit(file_path: "D:/repos/project/file.tsx", ...)
CORRECT:
Edit(file_path: "D:\repos\project\file.tsx", ...)
MultiEdit(file_path: "D:\repos\project\file.tsx", ...)
Loading