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

Logical indexing for NTTable subfields #989

Open
jakerudolph opened this issue Apr 6, 2023 · 3 comments
Open

Logical indexing for NTTable subfields #989

jakerudolph opened this issue Apr 6, 2023 · 3 comments
Assignees

Comments

@jakerudolph
Copy link

What's the problem this feature will solve?
When indexing into a column of an NTTable subfield (i.e. the second index), I need to know exactly which index my desired object is at.

Describe the solution you'd like
While this is possible to manage on the user end by getting the PV in python code and identifying the index that way, it would be nice if it were possible to add a logical statement to the second subfield straight in designer. In my mind it would look something like pva:MY_PV/subfield1/subfield2==indexIWant. I could also see a solution using syntax similar to the calc plugin. I defer to your all's expertise!

@YektaY YektaY self-assigned this Apr 7, 2023
@YektaY
Copy link
Collaborator

YektaY commented May 23, 2023

Hey! Would it possible to give us a use case or small example where this would be applied. So I can better understand the feature. Thank you

@jakerudolph
Copy link
Author

Hi Yekta, sure:
I have an NTTable containing information about klystron anomalies with 2 columns, "station" and "anomaly_state". If I want to get the anomaly state of a particular station, I need to find the index of that station in the "station" column, and append that to the pv, so I end up with something like:

station_idx = stations_column.index(klystron_i_want)
channel = f"pva://KLYS:SYS0:1:ANOM_STATES/anomaly_state/{station_idx}"

This works fine, but it might be nice to index directly to that index, so that channel becomes:

channel = f"pva://KLYS:SYS0:1:ANOM_STATES/anomaly_state/station={klys_i_want}"

Does this make sense?

@YektaY
Copy link
Collaborator

YektaY commented Aug 10, 2023

Hey, yeah sorry for the slow reply, I will look into this soon. Thanks!

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

No branches or pull requests

2 participants