Thank you for the very helpful explanation, Kay. This explains a lot. --Ray
From: Kasemir, Kay
Sent: Wednesday, May 23, 2018 7:40 AM
To: Gregory, Ray <[email protected]>; [email protected]
Subject: Re: [UNTRUSTED] Problem accessing TextUpdate text property in Display Builder script.
Hi:
The TextUpdate widget's purpose is to have a pv_name.
At runtime, it connects to that PV and displays its value, formatted as text, on the screen.
The Label widget's purpose is to have a text.
At runtime, it displays that text on the screen.
In BOY, it was possible to have a TextUpdate with a pv_name plus a script or rule that updates the text.
What you'd see on the screen depends on the phase of the moon. Might be the value of the PV, or the text set by the rule/script.
In BOY is was also possible to have a TextUpdate with the pv_name left empty, and then use a rule/script to set the text.
In the display builder, the TextUpdate can only display the value of a PV.
The 'text' property is no longer accessible from rules/scripts to avoid the uncertainly of what you'd see on the screen.
In the display builder, you'd have to use a Label if you want to set a 'text' property from a rule/script.
In most cases, however, it's likely best to avoid such Labels-with-rule-or-script and just create a PV with the desired value, then show that in a plain Text Update as one would have done with edd/dm/medm/dm2k/edm/..
or any of the other EPICS display tools.
Thanks,
Kay
I am converting a BOY OPI to a Display Builder .bob file. One of the scripts attached to the OPI retrieves the text of another (Text Update) widget as follows:
raw_curve_file_list_widget = display.getWidget("PredefinedCurveListOutput")
raw_string = raw_curve_file_list_widget.getPropertyValue("text")
When I convert to using Display builder I have:
raw_curve_file_list_widget = ScriptUtil.findWidgetByName(widget, "PredefinedCurveListOutput")
raw_string = raw_curve_file_list_widget.getPropertyValue("text")
However, when I try to run this in Display Builder, I get the error:
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Widget 'SelectedPredefinedCurveFileInput' (textentry) has no 'text' property
How can I access the text property of this widget in Display Builder?
--Ray