Reimplement CoaXPress write guard locally (drop rogue addPreWriteListener)#1431
Open
ruck314 wants to merge 1 commit into
Open
Reimplement CoaXPress write guard locally (drop rogue addPreWriteListener)#1431ruck314 wants to merge 1 commit into
ruck314 wants to merge 1 commit into
Conversation
942a7ab to
82be716
Compare
…ener) rogue is removing addPreWriteListener()/pr.WriteBlockedError (PR #1248 reverts PR #1229), which the CoaXPress write guard depended on. Reimplement the guard locally so the drivers work on both current and future rogue. - Add _WriteGuard.py: local WriteBlockedError plus WriteGuardMixin, which restores the addPreWriteListener API by overriding Device.writeBlocks (the funnel for interactive RemoteVariable.set writes). - Bootstrap, PhantomS641, PhantomS991 inherit the mixin; the _write_guard bodies and addPreWriteListener calls are unchanged. PhantomS711 inherits via PhantomS641. - Drop rogue.Version.minVersion('6.13.0') and the now-unused import rogue. Behavior matches addPreWriteListener + rogue v6.13.0: only single interactive writes are guarded; bulk writeAll/setYaml and posted acquisition commands pass.
82be716 to
58fba0e
Compare
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.
Context
rogue is removing
addPreWriteListener()/pr.WriteBlockedErrorin the next tag cycle (rogue#1248 reverts rogue#1229). The CoaXPress Phantom write guard (#1417) depends on that API, so it would break (AttributeErrorat device construction) on the upcoming rogue.This PR reimplements the guard locally inside
python/surf/protocols/coaxpress/so it works on both current and future rogue, with no behavior change versusaddPreWriteListener+ rogue v6.13.0.What changed
_WriteGuard.py: a localWriteBlockedErrorplusWriteGuardMixin, which restores theaddPreWriteListener(cb, stateVars=...)API by overridingDevice.writeBlocks()— the funnel through which interactiveRemoteVariable.set(write=True)routes (self._parent.writeBlocks(..., variable=self)).Bootstrap,PhantomS641,PhantomS991now inheritWriteGuardMixin; the_write_guard(path, value, state)bodies andaddPreWriteListener(...)calls are unchanged.PhantomS711inherits viaPhantomS641.rogue.Version.minVersion('6.13.0')(it gated the now-removed feature) and the orphanedimport rogue.pr.WriteBlockedError→ localWriteBlockedError.Behavior parity (matches addPreWriteListener + rogue v6.13.0)
var.set(), non-whitelisted, acquiringvariable is not None)AcquisitionStart/AcquisitionStop(posted)writeBlocks)IsAcquiring(LocalVariable)writeBlocks)writeAll/setYaml, acquiring