EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
<== Date ==> <== Thread ==>

Subject: Re: [EXTERNAL] Phoebus - image on Boolean-Button
From: Mogamad Amien Crombie via Tech-talk <tech-talk at aps.anl.gov>
To: "Kasemir, Kay" <kasemirk at ornl.gov>, EPICS Tech-Talk <tech-talk at aps.anl.gov>, Mogamad Amien Crombie <acrombie at tlabs.ac.za>
Date: Fri, 28 Jan 2022 11:33:59 +0200

Hi Kay

Yes, I see your point.

The 'easy fix' listed below won't work in my case as I have to load a different image for my 3 conditions (normal, red and pink).

So my 'on_image' and 'off_image' is the same image for both.

What I can try is to have the 3 'boolean_buttons' on top of each other and only make 1 visible, according to my condition. But this would make the script too long...

Thanks

Amien


On 2022/01/26 17:03, Kasemir, Kay wrote:
You're correct, it doesn't support runtime changes of the images.

Thanks,
Kay

From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Mogamad Amien Crombie via Tech-talk <tech-talk at aps.anl.gov>
Sent: Wednesday, January 26, 2022 9:00 AM
To: EPICS Tech-Talk <tech-talk at aps.anl.gov>
Subject: [EXTERNAL] Phoebus - image on Boolean-Button
 

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.


Here is my external script:

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 ############")


Thanks

Amien

iThemba-LABS :

South Africa





References:
Phoebus - image on Boolean-Button Mogamad Amien Crombie via Tech-talk
Re: [EXTERNAL] Phoebus - image on Boolean-Button Kasemir, Kay via Tech-talk

Navigate by Date:
Prev: motor record field assignment problem 高振华 via Tech-talk
Next: Re: Phoebus-olog integration Juan F. Esteban Müller via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
Navigate by Thread:
Prev: Re: [EXTERNAL] Phoebus - image on Boolean-Button Kasemir, Kay via Tech-talk
Next: Job opportunities at Diamond: Software Systems Engineers and so much more Pedersen, Ulrik (DLSLtd, RAL, LSCI) via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
ANJ, 14 Sep 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·