EPICS Controls 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  2018  2019  <20202021  2022  2023  2024  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  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: change MACRO with text-entry value in CSS Phoebus
From: Kacper Kłys via Tech-talk <tech-talk at aps.anl.gov>
To: Peter Leban <peter.leban at i-tech.si>, tech-talk at aps.anl.gov
Date: Wed, 2 Sep 2020 16:45:54 +0200
Hi Peter,

Check the function description here:

https://github.com/kasemir/org.csstudio.display.builder/blob/master/org.csstudio.display.builder.runtime/src/org/csstudio/display/builder/runtime/script/PVUtil.java

"getString" method takes pv object as parameter, not string with the name of PV.

I believe that should solve your problem.

Cheers,

Kacper

W dniu 02.09.2020 o 12:54, Peter Leban via Tech-talk pisze:
Hello,

I'm working on the GUI in CSS Phoebus where I have a macro that specifies the IOC name (IOCname='llrf10'). All panels open from the main one and the macro is inherited.

Instead of having the macro defined as a property of the main panel, I'd like to have a text-entry field in the main panel where I'd set up the IOC name.

I have an action button with a script (embeddedJs) which shall do the job. However, the script gets stuck in the PVUtil getString call.

This is an excerpt of a simple script (just to check how to read a PV):

*************
var mypv = PVUtil.getString("llrf10:llrf:version");
logger.info(mypv);
*************

The error message:
*************
2020-09-02 11:02:46 WARNING [org.csstudio.display.builder.runtime] Execution of 'JavaScript EmbeddedJs' failed org.mozilla.javascript.EvaluatorException: Can't find method org.csstudio.display.builder.runtime.script.PVUtil.getString(string). (EmbeddedJs#14)     at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:79)     at org.mozilla.javascript.Context.reportRuntimeError(Context.java:1011)     at org.mozilla.javascript.Context.reportRuntimeError(Context.java:1064)     at org.mozilla.javascript.Context.reportRuntimeError1(Context.java:1027)     at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:145)     at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:45)
    at org.mozilla.javascript.gen.EmbeddedJs_4._c_script_0(EmbeddedJs:14)
    at org.mozilla.javascript.gen.EmbeddedJs_4.call(EmbeddedJs)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:412)     at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3545)
    at org.mozilla.javascript.gen.EmbeddedJs_4.call(EmbeddedJs)
    at org.mozilla.javascript.gen.EmbeddedJs_4.exec(EmbeddedJs)
    at org.csstudio.display.builder.runtime.script.internal.JavaScriptSupport.lambda$submit$0(JavaScriptSupport.java:84)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
    at java.base/java.lang.Thread.run(Thread.java:832)

*************

Could you advise the correct use of the PVUtil.getString function?

Finally, my text-entry field will have a 'loc://myname' PV which I intend to read in the script and assign it to the "IOCname" macro.

Thanks,
Peter

Replies:
Re: change MACRO with text-entry value in CSS Phoebus Peter Leban via Tech-talk
References:
change MACRO with text-entry value in CSS Phoebus Peter Leban via Tech-talk

Navigate by Date:
Prev: Support for Watlow EZ-zone PM controller Phillip A. Sorensen via Tech-talk
Next: autosave for V4 PVA record Sandeep Kumar Malu - UKRI STFC via Tech-talk
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  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: change MACRO with text-entry value in CSS Phoebus Peter Leban via Tech-talk
Next: Re: change MACRO with text-entry value in CSS Phoebus Peter Leban via Tech-talk
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  <20202021  2022  2023  2024 
ANJ, 07 Sep 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·