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

Add optional status array unpacking #25

Open
GDYendell opened this issue Aug 16, 2024 · 0 comments
Open

Add optional status array unpacking #25

GDYendell opened this issue Aug 16, 2024 · 0 comments
Assignees

Comments

@GDYendell
Copy link
Contributor

GDYendell commented Aug 16, 2024

Currently status arrays (i.e. arrays that are read-only) are left as a single parameter and formatted as a string. This is useful in cases where the list will change at at runtime, e.g. the the error parameter of a frame processor. In cases where the array is static, it could be useful to unpack the array into individually indexed attributes, for example so that PV clients can read individual integers rather than a string that needs parsing.

The formatting as a string (here) is done too early to be able to change the logic because we don't even know what plugins are loaded at this point. I think the best thing do is search for array OdinParameters in _process_parameters and replace them with individual parameters. There should be a function (suggest unpack_status_arrays) in odin_fastcs.util that takes a list[OdinParameter] and a (list of uris) (list[list[str]]) to search for and replace. It will insert the new indexed OdinParameters into the list and remove the original. Then in a specific OdinAdapterController this function can be called with whatever parameter uris it wants to be split.

This can be tested in FrameProcessorController._process_parameters to split ["status", "plugins", "names"], although possibly we don't actually want it on this. Let's see. Or it could be tested on xspress if a controller is made for that, this was the original use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Current Sprint
Development

No branches or pull requests

2 participants