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

More publish messages and documentation #2357

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

t-b
Copy link
Collaborator

@t-b t-b commented Feb 25, 2025

Close #2354
Close #2327

@t-b t-b self-assigned this Feb 25, 2025
@t-b t-b force-pushed the feature/2357-more-publish-messages-and-documentation branch from 8ceb3c4 to 1d8ba32 Compare February 26, 2025 19:45
@t-b t-b added the PatchLink label Feb 28, 2025
t-b and others added 27 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.
The default values for whole cell resistance and capacitance are not
valid.

Change the defaults to 1% instead and also add limits for resistance.
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.
Added GetADChannelUnit, GetDAChannelUnit that return the unit string
depending on clamp mode.

Adapted GetChanAmpAssignUnit to use the new functions.
- extended the TPAnalysisInput structure

This is a preparation commit for adding zeromq publishers that include
some of that information.
- the data is published from the TP analysis thread including additional
information available in the thread through the previous commit.
- The additional values are also returned by the thread and collected in
the async buffer as well then in TPResult and in TPStorage.
- The involved waves and their respective getters were adapted with new
elements that the additional data can be stored.
- As most of the elements store the same information, thus a constant
was introduced with a dimension label list that is used as helper for
the wave creation in the getter functions.
- The four publishers publish the same json, just with a different period.
  There is a filter for live, 1s, 5s and 10s publishing interval.

- See PUB_TPResult for JSON description

- publisher is called from TP_TSAnalysis thread
This prevent misleading naming and it more fitting to the functionality
the function actually implements
Added TP_GetStoredTP and TP_GetStoredTPsFromCycle that allow to get
information about a TP by tpMarker or TPs by cycle id and headstage.

- both functions allow to recreate the DA wave for the TPs with the flag includeDAC
- the returned data includes the AD, DA data as well as metadata for
  each returned TP (from TPStorage).

- These TP functions use the same TP utility function.
With a running TP adding zeromq publishing messages for each TP
it appears that we have to look through more than the last 100 messages
after a test to find the requested.

- split logic into two parts: either read out upto 10000 existing messages
  or wait up to 10 seconds (100 trys with 100 ms sleep) if no message
  is available
This prepares for a future commit where we want to sent additional data.
And make all received data available from FetchPublishedMessage.
Add a message type which not only publishes the TP properties but also the
raw AD data.
This prevents a crash as we switched to VS 2022 for the ZeroMQ XOP [1].

[1]: microsoft/STL#4730
* feature/2230-Add_zeromq_pub_filters_for_TP:
  tools/installer/vc_redist.x64.exe: Update it
  Add ZMQ_FILTER_TPRESULT_NOW_WITH_DATA
  tests: Prefer FetchAndParseMessage
  FetchPublishedMessage: Port to zeromq_sub_recv_multi
  PUB_Publish: Port to *multi interface
  XOPs: Update ZeroMQ XOP
  Tests: Adapt FetchPublishedMessage for more tries
  TP: Added two functions that allow to retrieve info about TPs
  TP: Rename TP_GetStoredTPs to TP_GetConsecutiveTPsUptoMarker
  PUB: Add four publishers to publish TP data
  PUB: Preparation to add four zeromq publishers for TP data
  TP: Add more information that is transferred to the TP analysis thread
  Util: Add two conversion function for DA/AD unit string return
* feature/2363-rework-amplifier-interfaces:
  MIES_AmplifierInteraction.ipf: Rework amplifier getting and setting
  DAEphys: Use valid initial values for some amplifier controls
  AI_UpdateAmpModel: Fix typo in documentation
  AI_UpdateAmpModel: Factor out clamp mode into a variable
  AI_UpdateAmpModel: Use rowLabel instead of row numbers or plain names
  AI_SyncAmpStorageToGUI: Allow forcing to write all values
  DAEphys: Sync MIES to MCC on checkbox click
Unused since ce6f656 (IVS_runInitAccessResisQC: Prefer analysis function PSQ_AccessResistance, 2022-05-02).
This message is sent after the JSON configuration for a panel or notebook is
finished.
@t-b t-b force-pushed the feature/2357-more-publish-messages-and-documentation branch from 0d674dc to b8f663e Compare March 3, 2025 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send ZMQ message for configuration start/stop Send ZMQ pub message with changed MCC settings
2 participants