Hi Kacper,
thanks for the hint. We made it through.
Peter
On 2. 09. 20 4:45 pop., Kacper Kłys wrote:
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
- References:
- change MACRO with text-entry value in CSS Phoebus Peter Leban via Tech-talk
- Re: change MACRO with text-entry value in CSS Phoebus Kacper Kłys via Tech-talk
- Navigate by Date:
- Prev:
Numbers as Hex encoded strings in StreamDevice Bo Jakobsen via Tech-talk
- Next:
Raspberry pi 3 -CAENels EASY-DRIVER 0520 - ethernet victor levy 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
<2020>
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: change MACRO with text-entry value in CSS Phoebus Kacper Kłys via Tech-talk
- Next:
Integration of Elog into Phoebus Florian Feldbauer 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
<2020>
2021
2022
2023
2024
|