-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Milestone
Description
Matt C. reported running a Jython script in BOY which triggers on a slow changing PV. Setting a value for a combo box does not work on the first time through the script (when the OPI is started), but does work when the PV triggers.
Doing something similar with a text box works fine on the first time through.
The script looks like this, and is attached to the display:
from org.csstudio.opibuilder.scriptUtil import PVUtil
display.getWidget("Combo").setPropertyValue("items", ["A", "B", "C"])
display.getWidget("Combo").setValue(1)
display.getWidget("Text").setPropertyValue("text", "hello")
When I attach similar code directly to a Text Update widget
widget.setPropertyValue("text", "hello")
the text is updated by the script, but when attaching this to a Combo,
widget.setPropertyValue("items", ["A", "B", "C"])
the Combo continues to show the items which were originally configured.
So overall:
- Updating the combo items from a widget script doesn't work at all
- Updating combo items from a display script succeeds after several runs
- Updating a text update widget text succeeds in all those cases