Hi there.
I switched to Phoebus about 6 months ago and everything so far is working except 1 problem.
I have a 'boolean-button' with a 'on_image' that needs to change to 1 of 3 images I have.
Now when I 'run' my display, I get the default image and I need to click on the 'boolean-button' again to show the right image.
from org.csstudio.display.builder.runtime.script
import PVUtil
from java
import lang
a = PVUtil.getDouble(pvs[0])
s = PVUtil.getDouble(pvs[1])
## Script Body
if s==0.0:
widget.setPropertyValue('on_image',
"fcup_red.png")
widget.setPropertyValue('off_image',
"fcup_red.png")
elif s==64.0
or s==128.0:
widget.setPropertyValue('y',
45)
widget.setPropertyValue('on_image',
"fcup.png")
widget.setPropertyValue('off_image',
"fcup.png")
elif s>64.0
and
s<128.0:
widget.setPropertyValue('y',
45)
widget.setPropertyValue('on_image',
"fcup_red.png")
widget.setPropertyValue('off_image',
"fcup_red.png")
elif s>128:
widget.setPropertyValue('on_image',
"fcup_pink.png")
widget.setPropertyValue('off_image',
"fcup_pink.png")
else:
widget.setPropertyValue('on_image',
"fcup.png")
widget.setPropertyValue('off_image',
"fcup.png")
#print ("######## Done ############")