Skip to content

fix the end-of-run save and clean up finish() across both engines - #445

Merged
bls337 merged 7 commits into
micro-manager:mainfrom
bls337:main
Jul 22, 2026
Merged

fix the end-of-run save and clean up finish() across both engines#445
bls337 merged 7 commits into
micro-manager:mainfrom
bls337:main

Conversation

@bls337

@bls337 bls337 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

finish() saved whenever saving was requested, even when the run aborted during
setup or produced no images. On an abort the datastore has no summary metadata,
so save() threw an NPE (surfacing as "Error during acquisition cleanup"), and
every failed acquisition left an empty save folder behind.

Add acquisitionStarted_ to the base AcquisitionEngine: set true only after setup()
succeeds (right before run()) and reset in the innermost finally, so both engines
share one flag with no drift. Gate the save in both finish() methods on
acquisitionStarted_ && datastore_.getNumImages() > 0. getNumImages() is reliable
here because run() calls waitForCompletion() before returning, so all images are
drained before finish() checks the count.

@bls337
bls337 merged commit f95fc3d into micro-manager:main Jul 22, 2026
1 check failed
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