diSPIM: update the acq eng to match SCAPE's finish() method, fixes some bugs for both engines along the way#428
Merged
Merged
Conversation
added 7 commits
July 3, 2026 22:29
…SCAPE for demo mode
…t leave ghost events around
…0) is never called when this size of the array is 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ported
finish()lifecycle cleanup fromAcquisitionEngineScapetoAcquisitionEngineDispimfor parity between the two acquisition engines. diSPIM'sfinish()was previously almost a no-op (just polling restart) — the equivalent cleanup already existed, but was inlined at the tail ofrun()using local variables that weren't reachable fromfinish(). Promoted that state to instance fields (controller_,savedExposures_,isShutterOpen_,autoShutter_) and moved the cleanup intofinish()so it now runs reliably regardless of how the acquisition ends.New in diSPIM's
finish()cleanUpControllerAfterAcquisition,stopSPIMStateMachines)INTERNAL+ exposure restoreunregisterForEvents(this)— diSPIM registered for events on every acquisition run but never unregistered (listener leak); now fixedBugs found along the way (fixed in both engines)
finish()calledcontroller_.cleanUpControllerAfterAcquisition(...)with no null check. In demo mode,controller_is never instantiated even when "use PLogic" is enabled in settings — sofinish()would NPE right there and silently skip everything after it (shutter restore, exception check, camera reset). Fixed by guarding withcontroller_ != nullin both engines.savedExposures_had no initial value in either engine, only getting populated near the top ofrun(). Ifrun()threw before reaching that point,finish()would still execute (via the outerfinally) and NPE on `save