PI stage: connected only after a full initialize, a reset id, a wait for the controller, and fake-GCS2 tests - #73
Merged
Merged
Conversation
No behaviour change: each inline @CCall moves into pi_stage/gcs2.jl unchanged, so a test can replace the wrappers. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Id defaults to -1 and shutdown resets it; connectionstatus is set once, after every step past the connect; initialize waits for PI_IsControllerReady before PI_qFRF; the stage panels' initialize buttons log a failed initialize; stale TODOs and docstrings corrected. Adds test/pi_stage_fake_sdk.jl and test/pi_stage.jl. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Decision 0033: after X.Y.Z, main carries X.Y.(Z+1)-DEV. TagOnMerge skips a -DEV version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…istage-fixes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # CHANGELOG.md # test/runtests.jl
…e motion-stop wait, reclaim own connection on retry, one GUI initialize guard Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ze, as in 0.2.5 (#73 Q1) gui_initialize still logs the failure. 0.2.5 opened the panel when initialize returned without connecting (MCL_InitHandle == 0), with its callbacks refusing while connectionstatus is false; the P5 guard's '|| return' stopped that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
kalidke
added a commit
that referenced
this pull request
Sep 30, 2026
… PI and DCAM4 claims, drop a blank line Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The PI stage (
PIStage, C-867) fixes from the #69 review, as one PR intomain. They are for 0.2.6 and were kept out of 0.2.5.This branch carries #72 (the 0.2.6-DEV bump) merged in, because a PR into a released
mainmust otherwise raise the version. Until #72 merges, its one commit shows here too.Fixed
shutdowncould close another object's connection.iddefaulted to0, a valid GCS id, and was never reset. It now defaults to-1, andshutdownresets it; a failed close keeps the id so a latershutdowncan retry.initializereported the stage connected before it was (review F2).connectionstatuswas set before the connect, and a failed close after a failed reference left ittrue, so a retry answered "already initialized". It is now set only after the whole sequence succeeds, and every step after the connect is inside the cleanup, which closes the connection and rethrows.initializeand return, instead of throwing out of the Makie click callback (review F4). They also skip the position read wheninitializereturned without connecting.Changed
initializewaits forPI_IsControllerReadyafter the reference move, before pollingPI_qFRF, as PI's samples do (review F3). Both waits shareREFERENCE_TIMEOUT_S(60 s). Not yet run on hardware; this needs a rig check on the C-867.initializesays what it does;referencemoveis thePI_FRFstart. The stale TODOs are gone, and so is the "1 mm/s" comment (review F6).Tests (F7)
pi_stage/gcs2.jlwraps each of the 19 GCS2 calls PIStage makes as a function, sotest/pi_stage_fake_sdk.jl(FakePIStage) replaces every one. Calls the tests don't model (PI_MOV,PI_HLT,PI_STP) throw, so no test can reach a DLL. No call's types changed.test/pi_stage.jlhas 8 cases:shutdownbeforeinitialize;connectionstatusstill false during the reference;shutdown's id reset.Not yet run on hardware. MicroscopeAdapt's rig builds
PIStage().🤖 Generated with Claude Code