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 <2022> 2023 2024 2025 | 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 <2022> 2023 2024 2025 |
<== 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
You're correct, it doesn't support runtime changes of the images.Might be an easy fix, https://github.com/ControlSystemStudio/phoebus/issues/2113
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-ButtonHi 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 PVUtilfrom java import langa = PVUtil.getDouble(pvs[0])s = PVUtil.getDouble(pvs[1])## Script Bodyif 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