Skip to content

make sure that the primary camera is always active, even with > 1 camera#431

Merged
bls337 merged 2 commits into
micro-manager:mainfrom
bls337:main
Jul 4, 2026
Merged

make sure that the primary camera is always active, even with > 1 camera#431
bls337 merged 2 commits into
micro-manager:mainfrom
bls337:main

Conversation

@bls337

@bls337 bls337 commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

It looks like the old code to make sure the primary camera is active only worked for systems that have 1 camera.

On systems with more than 1 camera, the default state for all cameras would be false.

I also added a try/catch to deal with some NPEs when the camera is "Undefined".

Old code:
// Note: there is no ui control to change the active state of the
// camera when there is only 1 camera, so make sure it's active.
cameras.add(new CameraData(name, cameraNames.length == 1));

New code:
// the first camera is always the default primary camera, so make sure it's active
cameras.add(new CameraData(cameraNames[i], i == 0));

@bls337 bls337 merged commit 6b11064 into micro-manager:main Jul 4, 2026
1 check failed
@bls337

bls337 commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

Fixes #377

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.

1 participant