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 | 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 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Question about pv value and the label display in CSS boy opi |
From: | lzf neu <[email protected]> |
To: | "[email protected]" <[email protected]> |
Date: | Fri, 12 Aug 2016 14:16:44 +0000 |
hi all,
I have two questions, one is about pv value display; the other is about the label text content changed correspond to the pv value.
1) My first problem is how to display a pv value that multiplied by 1E6; I have tried Text Update widget in CSS Boy opi and write a EmbeddedScript for the widget which is as follows:
import Package(Packages.org.csstudio.opibuilder.scriptUtil); var pv0=PVUtil.getDouble(pvs[0]); widget.setPropertyValue=("pv_value",pv0=pv0*1E6);
2 ) My second question: In order to display the unit, I place a Label widget and set its Text as "Sv/h" and I hope the Text changed to "uSv/h" correspond to
the pv value that multiplied by 1E6.
3) Combined with questions 1) and 2): The pv value multiplied by 1E6 often delayed display in Text update widget until the new pv value refreshed. Before the pv value refreshed, it is the original pv value and I hope the Label widget content display "Sv/h", and after pv value refreshed, it is the pv value multiplied by 1E6 and the label should display "uSv/h".
I tried to write a EmbeddedScript for the Lable widget, which is as follows:
import Package(Packages.org.csstudio.opibuilder.scriptUtil); var pv0=PVUtil.getDouble(pvs[0]); if(pv0==1) widget.setPropertyValue=("text","uSv/h"); elsewidget.setPropertyValue=("text","Sv/h");
however, the label always display Sv/h and didn't change to uSv/h correspond to the
refreshed value that multiplied by 1E6 in Text Update widget.
I don't know how to cope with this problem or a better way to solve my problem.
Could anyone help me and thanks in advance !
Zhefu |