Skip to content

Continuous scan#29

Merged
marktsuchida merged 15 commits into
mainfrom
continuous-scan
Apr 7, 2026
Merged

Continuous scan#29
marktsuchida merged 15 commits into
mainfrom
continuous-scan

Conversation

@marktsuchida
Copy link
Copy Markdown
Member

Closes #15.

Continuously scan multiple frames with no extra gap in between.

Also fix thread synchronization, which was missing.

There are still pauses between unpark/park and the raster scans.

Do not stop and restart the scanning for each frame.

This version is probably broken due to data races; we need to add
mutexes around the data accessed from acquisition threads.

(Assisted by Claude Code; any errors are mine.)
Prevent data races.

(Assisted by Claude Code; any errors are mine.)
(Assisted by Claude Code; any errors are mine.)
That is, fail if the next buffer is not ready when we need to write.

(Assisted by Claude Code; any errors are mine.)
(Assisted by Claude Code; any errors are mine.)
This needed in case previous acquisition was same configuration but
stopped mid-frame.

(Assisted by Claude Code; any errors are mine.)
- Use fewer variables to describe current state, explicitly
- Buffer overflow is always an error

(Assisted by Claude Code; any errors are mine.)
In the Micro-Manager case, this corresponds to stopping if InsertImage()
returns an error.
(Assisted by Claude Code; any errors are mine.)
- missing 'return'
- Avoid 'Wrap' of NULL error

(Analysis/discovery assisted by Claude Code.)
(Assisted by Claude Code; any errors are mine.)
(Assisted by Claude Code; any errors are mine.)
(Assisted by Claude Code; any errors are mine.)
(Assisted by Claude Code; any errors are mine.)
We cannot use FiniteSamps with sample count > INT32_MAX (DAQmx limit),
so don't allow more frames than fit under that limit.

As an exception, use ContSamps for Live mode (frame count >= INT32_MAX,
due to how openscan-mm-adapter currently handles it).

(Assisted by Claude Code; any errors are mine.)
@marktsuchida marktsuchida marked this pull request as ready for review April 3, 2026 21:39
@marktsuchida
Copy link
Copy Markdown
Member Author

Tested with internal and external detector, looks okay.

@marktsuchida marktsuchida merged commit 1b190a2 into main Apr 7, 2026
@marktsuchida marktsuchida deleted the continuous-scan branch April 7, 2026 20:48
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.

Avoid software pause between frames

1 participant