EPICS Home

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  <20172018  2019  2020  2021  2022  2023  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  <20172018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: New Display Builder widget question using Navigation Tabs
From: Amien Crombie <[email protected]>
To: EPICS Tech-Talk <[email protected]>
Date: Tue, 22 Aug 2017 11:45:38 +0200

Hi

After seeing the latest 'Builder' CSS and Kay's emails to me, I decided to go this route.

So far everything is working except the following scenario:

I have a normal main.bob file that contains my 'navigation tabs' as show above .

Then I have an 'embedded' bob file named 'my_embedded'..

I have a python script :

1    from org.csstudio.display.builder.runtime.script import PVUtil, ScriptUtil
2    from org.csstudio.display.builder.model.properties import WidgetColor

3    OUT = 48
4    IN = 22
      ####################################
5    ActVal  = PVUtil.getLong(pvs[0])   #  pv actuator $(pvname)
6    StatVal = PVUtil.getLong(pvs[1])   #  pv status

      ## just building my Label_<pv_name> as pvlabel
7    prePV = str(pvs[0])
8    newPre = prePV.split(":")
9    prex = "Label_" + newPre[0]

       ########################################################
10    st = ScriptUtil.findWidgetByName(widget, "ss")          ## this widget is in my harpsgroup.bob
11    pvlabel = ScriptUtil.findWidgetByName(widget, prex)     ## this widget is in my harpsgroup.bob
12    e = ScriptUtil.findWidgetByName(widget, "my_embedded")  ## this widget is in my harpsmain.bob

if StatVal==64:
            pvlabel.setPropertyValue("background_color", WidgetColor(26, 0, 104))     #
            pvlabel.setPropertyValue("foreground_color", WidgetColor(255, 255, 255))  #
            #e.setPropertyValue("visible", True)
            st.setPropertyValue("text", str(StatVal))
            widget.setPropertyValue("y",IN)                                     #
if StatVal>64 and StatVal<128:
            pvlabel.setPropertyValue("background_color", WidgetColor(255, 0, 0))      # Red
            pvlabel.setPropertyValue("foreground_color", WidgetColor(0, 0, 0))        # Black
            widget.setPropertyValue("y",IN)  ## OUT
            #e.setPropertyValue("visible", False)
elif StatVal==128:
            widget.setPropertyValue("y",OUT)   ## IN  
            pvlabel.setPropertyValue("background_color", WidgetColor(26, 0, 104))     #
            pvlabel.setPropertyValue("foreground_color", WidgetColor(255, 255, 255))  # White
            #embed.setPropertyValue("visible", False)
elif StatVal>128:
            widget.setPropertyValue("y",OUT)   ## IN  
            pvlabel.setPropertyValue("background_color", WidgetColor(255, 0, 0)) #
            #e.setPropertyValue("visible", True)
            pvlabel.setPropertyValue("foreground_color", WidgetColor(0, 0, 0))  # Black
#########################################################

My problem comes at line 12 where it somehow cannot get to "my_embedded" widget.

In fact only widgets in 'harpsgroup.bob' is accessible .....

Amien

Cape Town


Replies:
Re: New Display Builder widget question using Navigation Tabs Kasemir, Kay

Navigate by Date:
Prev: Upgrading to CSS 4.5 Abdalla Ahmad
Next: Re: New Display Builder widget question using Navigation Tabs Kasemir, Kay
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Upgrading to CSS 4.5 Abdalla Ahmad
Next: Re: New Display Builder widget question using Navigation Tabs Kasemir, Kay
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024