Hi:
If you cannot use an actual enum PV because there are too many labels,
and you can't use a local enum PV because that doesn't allow changes to the enum labels,
then don't use an enum PV.
Instead, on the combo box, un-check the option to get "Items from PV" and directly enter the items, as many as you want.
Or set the items from a script:
from org.csstudio.display.builder.runtime.script import ScriptUtil
combo = ScriptUtil.findWidgetByName(widget, "Name Of My Combo")
combo.setItems( [ "Ene", "Mene", "Muh" ] )
For more examples:
Menu CS-Studio, Utilities, Install Samples,
select the Display Builder examples,
then check out Display Builder/controls_combo.bob
-Kay
Thank you, Kay. Can you tell me how to modify the enum labels from a script after I have defined the local enum PV as you describe?
--Ray
> Is it possible to create a local enum PV in CSS that can be used as the PV for a Combo widget that also gets its items from the PV?
Yes:
loc://demo<VEnum>(2, "A", "B", "C", "D")
You have to provide the data type <VEnum> to get an enum.
The initializer needs to contain the initial index value, followed by the enum labels.
-Kay
|