-
Notifications
You must be signed in to change notification settings - Fork 96
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
Boolean button behavior with confirmation #2423
Comments
A brief glance at https://github.com/ControlSystemStudio/phoebus/blob/master/app/display/representation-javafx/src/main/java/org/csstudio/display/builder/representation/javafx/widgets/BoolButtonRepresentation.java suggests that we always call So I don't see any difference in returning to the default value, it always seems wrong. Should be like this:
Ideally, steps 2-4 happen so quickly that the user never notices any flicker. Looks like push, done; not push, pop back to previous state, then update to the pushed state. But if there's flicker, so be it. We certainly want to avoid this case:
|
Thanks, but not sure this helps me. |
"Push" writes 1 on mouse-down, then 0 on mouse-release. The intended usage is for example moving a motor as long as the button is pushed down, then stop when released. So typically held down for a little while. "Toggle" changes between 0 and 1 on each click. For example used to turn a power supply on/off. |
Since "push" tends to be used in a way where the operator pushes down, checks for something to happen, keeps mouse held down, then releases when "done", the operator is part of the feedback loop to verify that we're actually writing. But for "toggle", thinking that a PS was turned on when really nothing happened would be unfortunate. |
OK thanks. |
It can't really work with "push". You push down, and should keep it pressed down for a while. But you can't, because you need to handle the confirmation dialog... |
So maybe we should disable use of confirmation dialog with push? |
Ideally, yes, but it's a little tricky. The editor fundamentally just lists widgets and their properties. It doesn't "understand" what they do. You can configure both the background and the foreground color of a text to be black, the editor won't explain to you why you no longer see anything. Likewise, the editor doesn't know about the Bool Button with its toggle mode vs. confirmation behavior. So this would have to be in the bool button model or maybe even representation: If it notices "push" with "confirm", it changes one or both of them to remain compatible, and the editor just shows the current settings. |
Well, if we can agree that "push" shall not support confirmation dialog then I can give it a try... Isn't this a matter of acting on property changes? Maybe I'm oversimplifying... |
Yes, I'd say there's no practical way to keep pushing down for a while and handle confirmation at the same time. |
So I looked into this and here is a proposal: If user selects Push/Push inverted, the confirmation dialog setting will automatically set to "no". If user then tries to select confirmation dialog, the value stays unchanged. For this to work I need to change in EnumWidgetPropertyBinding#L42:
to
Question is also whether to launch an alert with suitable message if user wants to configure an unsupported combination of mode and confirmation dialog. |
Not sure how to do that in a clean way. The logic for de-selecting the confirmation when mode is "push" could be in the bool button widget model. If making that work requires a generic tweak to the editor (EnumWidgetPropertyBinding), fine. What I'd like to avoid is something like |
Ideally I'd like to disable the confirmation dialog drop-down if user selects anything but toggle. Is there an API for that? I was planning to put everything in the |
No, there's nothing to enable/disable/add/hide properties in the editor. Good to put everything into the That leaves what to do at edit time with older displays. Would they open a dialog for each misconfigured bool button? Or only when changing a bool button to a conflicting setting? |
Since a display could contain multiple such boolean buttons, it would be quite annoying to have to dismiss all dialogs. Moreover, this issue was discovered in a display from a user that is pretty new to CS Studio, so let's assume it's a beginner's mistake. In short: existing displays would show dialog only of these properties are changed. |
If the Boolean Button widget is configured as "push" and to show a confirmation dialog (on set), the button does not return to default value after positive confirmation. As this is different compared to running without confirmation I assume this is a bug, but want to confirm before I tackle it.
The text was updated successfully, but these errors were encountered: