Argonne National Laboratory

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  <2017 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
<== Date ==> <== Thread ==>

Subject: Re: CSS-4.5 : Display-Builder : getting widget's PV value
From: Amien Crombie <acrombie@tlabs.ac.za>
To: "Kasemir, Kay" <kasemirk@ornl.gov>, EPICS Tech-Talk <tech-talk@aps.anl.gov>
Date: Thu, 24 Aug 2017 17:55:11 +0200
Kay, I got the print to work...looks like my script is not triggered at the time

When I put a 'Action Button' on my display that calls the script, it works fine..at least with the 'print' I can see where I am now.

Any idea how I can fire my script when the 'widget' becomes 'visible' ? (without my having to add an action-button)

thanks

Amien


On 24/08/2017 15:18, Kasemir, Kay wrote:
Hi:

  According to 'cainfo' my pv is a DBF_DOUBLE and request is DBR_DOUBLE
Well, when I try it with double or int PVs, I do get the value out via PVUtil.getDouble.
When the PV is a string, then PVUtil.getDouble returns nan.

  But I do not know how to check for output with the 'print' statement..
I'm using Mint 18 and CSS is started >without a terminal command (am I doing something wrong?)
Just open a terminal (xterm, gnome-terminal, ...) and then start CSS from within the terminal.
=> In that terminal you can now see the print statements.

If you don't have a terminal (like on MS Windows), you can use the ScriptUtil.

​from org.csstudio.display.builder.runtime.script import ScriptUtil

ScriptUtil.getLogger().warning("Script has a problem")

==> Those messages appear in the console and also in the workspace/.metadata/.log

Finally, the ScriptUtil also allows you to open dialogs:

ScripUtil.showErrorDialog(widget, "I have a problem, pv has value " + str(pv.read()))


-Kay


Replies:
Re: CSS-4.5 : Display-Builder : getting widget's PV value Kasemir, Kay
References:
CSS-4.5 : Display-Builder : getting widget's PV value Amien Crombie
Re: CSS-4.5 : Display-Builder : getting widget's PV value Kasemir, Kay
Re: CSS-4.5 : Display-Builder : getting widget's PV value Amien Crombie
Re: CSS-4.5 : Display-Builder : getting widget's PV value Kasemir, Kay

Navigate by Date:
Prev: RE: Problems building seq 2.2.4 on Linux Mark Rivers
Next: Re: CSS-4.5 : Display-Builder : getting widget's PV value 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  <2017
Navigate by Thread:
Prev: Re: CSS-4.5 : Display-Builder : getting widget's PV value Kasemir, Kay
Next: Re: CSS-4.5 : Display-Builder : getting widget's PV value 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  <2017
ANJ, 24 Aug 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·