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  <20142015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: Re: CSS: The difference among Javascript 、Python Script and Execute Command
From: "Kasemir, Kay" <kasemirk@ornl.gov>
To: hongchunxia <hongchunxia@sinap.ac.cn>
Cc: tech-talk <tech-talk@aps.anl.gov>, chenx1 <chenx1@ornl.gov>
Date: Mon, 12 May 2014 13:15:14 +0000
On May 10, 2014, at 4:44 AM, hongchunxia <hongchunxia@sinap.ac.cn<mailto:hongchunxia@sinap.ac.cn>>
 wrote:

hi,
I have two questions:
First, if I have a Action Button, in its Behavior->Actions, I can use " Add Execute Command"、"Add Execute Javascript" and "Add Execute Python Script", also, I can "create an embedded script". if I achieve  a function, which Programming language is best? That is, If I want to realize a same function for a equipment, maybe a long code segment, which is best? The operating efficiency、execution speed and occupy computer memory is the same?

The scripting interface within CSS BOY is meant as a last ditch effort for things that you cannot do based on existing widget functionality.

In general, and for long code segments in particular, you best don't use any of those options.
The CSS user interface is the user interface. It should not have any control system functionality.
If you have a need for a long code segment, put that onto the IOC.
Adding control system functionality into the user interface will result in problems:
What if somebody closes the user interface? What if it crashes? What if somebody opens another copy of the user interface?

If you still need to use scripts:
"Add Execute Command" starts an external command. One example for this would be if you do need to start legacy MEDM/EDM/DM2K/tcl-tk/Qt displays from within a CSS *.opi.

The JavaScript and PythonScript options execute these scripts within the user interface thread of the *.opi, with access to the widget properties. Those are meant for those  ditch efforts when you cannot accomplish a certain user interface functionality based on existing widget functionality. For example, if you need to change the position or visibility of a widget based on PVs, except that you then better look at the "Rules" instead of the scripts, because details of the script API can change. For instance, we completely changed the underlying PV layer from utility.pv&IValue data types to pvmanager&VType data types for the samples. The script utilities mostly shield you from that change, but this cannot be guaranteed. Script should definitely not contain long code segments: Since they have full access to the widgets and run in the user interface thread, long code segments can delay the overall CSS execution.

If you still believe you need to use a script, use non-embedded python.

Second, how to realize a network video display in CSS? In CSS Palette, there is a Web Browser, but when I input the Video's ip, and run CSS, the interface is running but there is no video display. I do not know why.
There is currently no video display. For data coming from EPICS, the IntensityGraph can be used to display images, for example from the AreaDetector. The update rates can be 10Hz, somewhat like a video, but there's no mjpeg or the like.

-Kay



References:
CSS: The difference among Javascript 、Python Script and Execute Command hongchunxia

Navigate by Date:
Prev: Re: areaDetector Windows 7 x64 Build Problems Zachary Brown
Next: writing scan data to file via CSS Christian Pauly
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019 
Navigate by Thread:
Prev: CSS: The difference among Javascript 、Python Script and Execute Command hongchunxia
Next: areaDetector Windows 7 x64 Build Problems Zachary Brown
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·