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");
else
widget.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