Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework amplifier interfaces #2363

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

t-b
Copy link
Collaborator

@t-b t-b commented Mar 3, 2025

t-b added 6 commits March 3, 2025 15:58
We are currently only syncing MIES to MCC settings when changing the
headstage or clamp mode.

But we forgot to sync initially which is required if we don't change
headstage or clamp mode.

Bug present since forever.
This is needed on the initial MIES->MCC sync as we don't know if our
internal state is correct or not.
* bugfix/2360-mies-mcc-sync-checkbox:
  AI_SyncAmpStorageToGUI: Allow forcing to write all values
  DAEphys: Sync MIES to MCC on checkbox click
In that way we can reuse that string a later commit.
This is for a future commit where we also need the clamp mode.
@t-b t-b self-assigned this Mar 3, 2025
@t-b t-b force-pushed the feature/2363-rework-amplifier-interfaces branch 2 times, most recently from 773e92d to be48333 Compare March 3, 2025 16:26
The default values for whole cell resistance and capacitance are not
valid.

Change the defaults to 1% instead and also add limits for resistance.
@t-b t-b force-pushed the feature/2363-rework-amplifier-interfaces branch from be48333 to b928b73 Compare March 3, 2025 18:11
@t-b t-b mentioned this pull request Mar 3, 2025
8 tasks
The current approach uses AI_SendToAmp with separate getter and setter constants. For setting people should
also prefer AI_UpdateAmpModel but as both functions are non-static it can happen that the wrong function is
called.

We have now reworked the interfaces with the following outcome:
  - One public function to read/write amplifier settings (AI_WriteToAmplifier, AI_ReadFromAmplifier). These functions
  also do the right thing out of the box.
  - Deduplicated getter/setter constants to only denote the type of setting. The access type, read or write,
  is now passed in separately.
  - Public accessible functions now only accept mcc function constants
  - Introduce low level AI_ReadFromMCC/AI_WriteToMCC functions which make AI_SendToAmp remarkable shorter
  - Introduce various helper functions which translate between control names, function constants and human
    readable names.
@t-b t-b force-pushed the feature/2363-rework-amplifier-interfaces branch from b928b73 to ac6a2f7 Compare March 7, 2025 22:24
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.

1 participant