-
Notifications
You must be signed in to change notification settings - Fork 116
Update the widget info to allow simpler selection of PV's #3057
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
Conversation
kasemir
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't complain, looks good
abrahamwolk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the commented-out line of code, I think the implementation looks good!
I would like to ask if the changes introduced by this PR are intended to complement the new column under the "PVs" tab in the Widget Info window that is introduced in #2998, or if the changes introduced by this PR are intended as an alternative solution to the same problem?
| // reset the selection | ||
| SelectionService.getInstance().setSelection(table, old); | ||
| } catch (Exception ex) { | ||
| //logger.log(Level.WARNING, "Failed to execute action " + entry.getName(), ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented-out code.
|
I am hoping this is an alternate solutions which can address some of the points from the #2998 We might have to add some more features, but this was a simple change which would address some of the use cases which lead to the above PR |
|
@shroffk Thanks for clarifying! I will bring forward and discuss this alternative solution with the stakeholders here at ESS. |
|
@shroffk, @kasemir : I have now discussed the solution implemented in this PR with the stakeholders here at ESS, and the conclusion is that this solution works for them for copying PV names in the Widget Info window. 1. Functionality to copy & append PV names to the clipboard Do you think the following solution is good?
I am not familiar with the plug-in architecture; do you happen to know which interface needs to be implemented to realize point 2? 2. Functionality to paste PV names into the Data Browser |
I'd prefer to stay with just the "copy". Keeps the context menu smaller. If you add "append", there'll always be somebody who prefers a different concatenation.
Sure, there could be a "Paste PV" context menu entry which ends up calling what you now get when you drag/drop something like "One, Two Three", making a simple attempt to split the text into PV names: |
|
Regarding 1 (copy): For us, it's OK either with or without "append", since we can implement the other options as site-specific plugins. Regarding 2 (pasting into the Data Browser): We would like to have the ability to paste also Display Names associated with the PVs. Unfortunately, there is no plug-in architecture for implementing such a functionality in the Data Browser. Would you be OK with having support for optional Display Names built into the pasting functionality? I think it would make sense from a UI perspective to be able to enter/edit Display Names when pasting PVs into the Data Browser. |
|
How do you want to parse PV names and display names from the pasted text? |
|
They would be delimited using a comma character. My understanding is that a PV name is either:
I think it should be possible to parse the PV Name in all cases (in the case of filters either fully, or by parsing opening and closing brackets and [1] https://epics.anl.gov/base/R3-16/2-docs/AppDevGuide.pdf (p. 114) |
|
I thought comma already separates PV names. |
|
That is a good point! Then we do not currently support filters when pasting PV names into the Data Browser? I just tried to create a widget in an OPI with a PV name that also specifies a filter, but it was unsuccessful; do we support filters in Phoebus? |
We do support them. In fact we're future-proof in a sense because we simply pass anything, as entered, as a PV name. Run Works with This does mean if you have an archive engine configured to sample Trying to parse filters would be tricky. You probably don't want to understand the complete filter syntax, since that would require updates whenever something new is added on the IOC end. So you simply remove anything between |
|
I see! But then the current functionality to split PV names when pasted into the Data Browser could split the filters in two? JSON can contain commas as well as spaces, I believe, and I think we split PV names on both of those in the current logic.
Yes, care must be taken to parse correctly! Are you sure names like [1] https://epics.anl.gov/base/R3-16/2-docs/AppDevGuide.pdf (p. 114) |
Yes, it would split on spaces or commata. It's not claiming to be perfect. That's in part why it offers what we think we got as PVs in the "Add PV" dialog, so end user can then copy/paste/edit the names back together.
@shroffk, that's from your channel finder examples... |
yes, these are very much in use and this pattern is applicable to 100,000s of PV's here |
What do you think of the following idea?: We keep the logic to separate a string containing PV names into a list of PV names. However, if one of the PV names is a name enclosed in single quotes, then it stands for the display name of the PV that appeared before it. E.g., the string I think this would:
[1] https://epics.anl.gov/base/R3-16/2-docs/AppDevGuide.pdf p. 114 |
|
|
|
.. "Add PV" dialog which needs to be extended to include display name .. |
Yes, the "Add PV" dialog needs to be extended to include Display Name. |
|
@kasemir , @shroffk : I have now updated the PR #3000 to implement the proposal I wrote here yesterday. The the original parsing mechanism is now used, with one modification only: when encountering a single quote character PV names that start and end with single quote characters are interpreted as the display name of the preceding PV name (if it exists). I would like to ask for a review of or comments on the PR again with these changes. |


Based on some of use case discussion we had during the codeathon. I have updated the WidgetInfo in the display builder to simplify the process of selecting a set of PV's from an screen or a widget