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: | Re: Question about pv value and the label display in CSS boy opi |
From: | "Kasemir, Kay" <[email protected]> |
To: | lzf neu <[email protected]> |
Cc: | "[email protected]" <[email protected]> |
Date: | Fri, 12 Aug 2016 15:09:59 +0000 |
Hi:
Ideally, you add a calc record to the IOC to create your scaled PV.
Then you can just display the PV “as is”.
The Text Update widget displays the value of the PV.
If you have a script that also updates the value of the widget, they both fight each other.
Use a Label widget, then update its text:
var pv0=PVUtil.getDouble(pvs[0]);
widget.setPropertyValue=(“text", “The scaled value is %g” % pv0*1E6);
Ideally, though, avoid the script and just create a proper PV in the first place.
How is the text supposed to change? Hope is not a good strategy for this case.
You can again attach a script to the Label widget that sets the label’s “text” property based on the value of some PV.
Ideally, though, avoid the script and create a proper PV in the first place:
record(calc, “scaled_value")
{
field(INPA, “that_original_value CP”)
field(CALC, “A*1E6”)
field(EGU, "uSv/h”)
}
==> Now you just add a Text Update widget, enter the “scaled_value” as a PV name, done.
-Kay
|