Hi Hovanes,
The list of plugins that can be imported in BOY script are these plugins BOY depends on, so you can find them from org.csstudio.opibuilder->plugin.xml->Dependencies. Those plugins with *rap* in the name are plugins for webopi only, so they cannot be imported in BOY script. You can also import your own libraries/plugins by creating fragment of org.csstudio.opibuilder, please see: http://htmlpreview.github.com/?https://raw.github.com/ControlSystemStudio/cs-studio/master/applications/plugins/org.csstudio.opibuilder/html/script/CreateCustomScriptUtil.html
I understand your use case, but it is really a burden for you to manage the PV life cycle by yourself. It is also not recommended to import packages from BOY's dependent plugins because they may be changed in future without notice. The best way is to use ScriptUtil from BOY, so I will add a createPV(name) method to PVUtil for you to use.
Cheers,
Xihui
________________________________________
From: Hovanes Egiyan [[email protected]]
Sent: Thursday, December 13, 2012 12:05 PM
To: Chen, Xihui
Cc: [email protected]; Beni Zihlmann
Subject: Re: EPICSPVFactory in CSS JavaScript
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.
>
>
- References:
- EPICSPVFactory in CSS JavaScript Hovanes Egiyan
- RE: EPICSPVFactory in CSS JavaScript Chen, Xihui
- Re: EPICSPVFactory in CSS JavaScript Hovanes Egiyan
- Navigate by Date:
- Prev:
Re: LeCroy DSO using VXI Eric Norum
- Next:
How to access menu choice strings inside record support Zhang, Dehong
- 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 Hovanes Egiyan
- Next:
How to access menu choice strings inside record support Zhang, Dehong
- 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
|