Add FFI Functions for Clamp Control#2559
Conversation
|
Let's do your usual appraoch here where Luke/Tim can test the FFI functions before we write the tests. |
2f8e923 to
d5bf06c
Compare
|
If the current clamp mode for the headstage in MIES is different from the specific calmp mode of an amplifier setting (e.g. auto bridge balance that applies only to IC) then it is ignored by MIES. |
|
I gave this a try today:
|
That makes sense for any of the TriggerAuto* functions, but all other parameters I would expect to be settable even when the mode is not active (for example, I should be able to set the auto bias parameters before switching to IC) |
|
I think this is on @MichaelHuth plate again. |
|
@MichaelHuth I'm also taking over this one. |
this was previously done directly in the GUI event handler
d5bf06c to
93afc3b
Compare
There was a problem hiding this comment.
Pull request overview
Adds new Foreign Function Interface (FFI) entry points intended for external (ACQ4/ZeroMQ) control/inspection of amplifier clamp settings, addressing issue #2547 by avoiding direct GUI element access.
Changes:
- Added FFI functions to query clamp state and to set/trigger several clamp-related controls (mode, holding potential, bias current, auto bias, headstage active, and auto clamp actions).
- Introduced
DAP_SetClampModeas a shared helper and wired the clamp-mode checkbox handler to use it. - Exposed
AI_AmpStorageControlToRowLabelfor cross-module use and added a range assertion for the AutoBias Vcom parameter.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| Packages/MIES/MIES_ForeignFunctionInterface.ipf | Adds clamp-control-related FFI functions, including FFI_GetClampState and several setters/triggers. |
| Packages/MIES/MIES_DAEphys.ipf | Refactors clamp-mode setting into DAP_SetClampMode and uses it from the GUI checkbox handler. |
| Packages/MIES/MIES_AmplifierInteraction.ipf | Adds AutoBias Vcom range assertion and makes AI_AmpStorageControlToRowLabel non-static for use by FFI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
In MIES the range is limited through the corresponding GUi element. However, when changed externally through a ZeroMQ function call then the range was not checked.
93afc3b to
f2c45fb
Compare
With AI_GetFunctionConstantForClampMode the relevant function numbers can be retrieved and with AI_MapFunctionConstantToControl the corresponding GUI control names. This gives a list of GUI controls for each clamp mode. In AI_AmpStorageControlToRowLabel the block was incorrectly sorted in the case chain.
f2c45fb to
c4e9cc9
Compare
c4e9cc9 to
ddddce4
Compare
ddddce4 to
3b13ea8
Compare
Added the following functions: FFI_GetCurrentClampState returns a wave with the current clamp control values FFI_GetClampState returns a wave with the all clamp control values FFI_SetClampMode FFI_SetHoldingPotential - allowed only in VC mode FFI_SetBiasCurrent - allowed only in IC mode FFI_SetAutoBias - allowed only in IC mode FFI_SetHeadstageActive - allowed only when no DAQ is running FFI_GetHeadstageActive - returns 1 is the given headstage is active, 0 otherwise FFI_TriggerAutoClampControl - wraps Pipette, Capacitance and Bridge Balance auto setting in a single call
3b13ea8 to
984406a
Compare
|
@campagnola I changed the following:
|
|
@campagnola Friendly ping. |
close #2547