odin-detector / odin-data

DAQ software libraries for capturing and storing data from parallel detector systems
https://odin-detector.github.io/odin-data/
Apache License 2.0
8 stars 11 forks source link

Handling of allowed_values for enums #342

Open jsouter opened 3 months ago

jsouter commented 3 months ago

Putting this here as this is where the most necessary dev changes for interfacing with FastCS is being done, though could arguable be an issue for odin-control/ADOdin.

ADOdin IOCs can use MBBO records with a dropdown to select an enumerated value, and these can be given meaningful labels on EPICS, (e.g. for the detector trigger mode, or bit depth). The actual value sent between the AD driver and the Odin adapters is the integer value of the enum. In practice this means that if we provide the allowed_values metadata field it would have to look like ["0", "1", "2", "3"] for a record with 4 options, which provides no meaning for the values.

Since we want FastCS to generate records/screens directly from a ParameterTree with metadata, it could be helpful if allowed_values could either be reworked to provide a mapping between integer and string values, or if another metadata field could be provided with this mapping. Of course these parameters might be reworked to be strings with specific allowed values, but that would break compatibility with the ADOdin records.