Hello Xihui,
The scripts will be actually attached to a BOY widget. But the number of
EPICS variables used is going to be quite large, and they can change
often as well,
so the scripts will be accessing different set of variables in different
conditions that can be determined within the script itself. I don't know
how to do these kind of things using input PVs of the widgets.
That is why we will try to use "Packages.org.csstudio.utility.pv"
instead and see
in what kind of trouble we get.
Is there a way, hopefully a list, that can tell us which of the plugins
that are included
in a CSS product can be imported from BOY javascripts? Our group is new to
CSS, and this would help us plan ahead regarding when we can use scripts
for our
applications, and when we will have to develop new Eclipse plugins.
Thanks a lot for your help,
Hovanes.
On 12/13/2012 11:06 AM, Chen, Xihui wrote:
Hi Hovanes,
Packages.org.csstudio.utility.pv.epics is not exported from BOY, so you cannot use this package. In utility.pv, you should always use PVFactory to create PV. Also, it is not recommended to create PV in BOY script, because you need to manage the whole life cycle of the PV carefully, such as start() and stop(). Why don't you attach the PV to the script or a widget?
Thanks,
Xihui
________________________________________
From: Hovanes Egiyan [[email protected]]
Sent: Thursday, December 13, 2012 10:15 AM
To: [email protected]
Cc: Beni Zihlmann
Subject: EPICSPVFactory in CSS JavaScript
Hi,
we are trying to connect to EPICS variables from a CSS JavaScript script.
By looking at the CSS source and some examples we figured that we would
need to use
"EPICSPVFactory" class to create an object to connect to our EPICS
variables.
This class is apparently defined in "org.csstudio.utility.pv.epics", so we
try the following short script:
importPackage(Packages.org.csstudio.opibuilder.scriptUtil);
importPackage(Packages.java.lang);
importPackage(Packages.org.csstudio.utility.pv);
importPackage(Packages.org.csstudio.utility.pv.epics);
//-----------------------------------
runnable = {
run:function()
{
var pv = EPICSPVFactory.createPV( "epics://value1" );
}
};
new Thread(new Runnable(runnable)).start();
//-----------------------------------------------
But when we run it, there is an error message:
Exception in thread "Thread-152" org.mozilla.javascript.EcmaError: ReferenceError: "EPICSPVFactory" is not defined. (script#11)
When we change "EPICSPVFactory.createPV" to "PVFactory.createPV", the
error disappears.
This is as if the "importPackage(Packages.org.csstudio.utility.pv.epics"
statement has no effect.
We are using SNS Basic EPICS CSS 3.1.2 product that we downloaded from
the SNS web site.
Is there something else or something different we need to do to be able
to use the
"EPICSPVFactory" and "EPICS_V3_PV" classes in our scripts?
Thanks in advance,
Hovanes.
- Replies:
- RE: EPICSPVFactory in CSS JavaScript Chen, Xihui
- References:
- EPICSPVFactory in CSS JavaScript Hovanes Egiyan
- RE: EPICSPVFactory in CSS JavaScript Chen, Xihui
- Navigate by Date:
- Prev:
RE: EPICSPVFactory in CSS JavaScript Chen, Xihui
- Next:
Re: Utilities for EPICS on Multi-Core Linux Ralph Lange
- 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
- Navigate by Thread:
- Prev:
RE: EPICSPVFactory in CSS JavaScript Chen, Xihui
- Next:
RE: EPICSPVFactory in CSS JavaScript Chen, Xihui
- 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
|