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  2020  2021  <20222023  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  2020  2021  <20222023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Phoebus and dynamic macros
From: GAGET Alexis via Tech-talk <tech-talk at aps.anl.gov>
To: "Kasemir, Kay" <kasemirk at ornl.gov>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Wed, 2 Nov 2022 15:16:09 +0000

Ok, thanks the example is perfect.

I have looked in the example before but haven't looked in the correct section (i was looking in Macros ...)


De : Kasemir, Kay <kasemirk at ornl.gov>
Envoyé : mercredi 2 novembre 2022 15:35:59
À : tech-talk at aps.anl.gov; GAGET Alexis
Objet : Re: Phoebus and dynamic macros

 

> I was ... using script.

 

As we've promised from the start, details of the script API are subject to change.Transitioning from BOY/Eclipse/SWT to Display Builder/Plain JRE/JavaFX, i.e. a completely new implementation, does require adjustments to scripts, and script of course won't work at all in the web runtime that uses HTML/CSS/_javascript_.

 

To port your BOY scripts, see https://github.com/ControlSystemStudio/phoebus/wiki/Display-Builder-Script-Compatibility regarding _javascript_ vs. jython, and for an example of updating macros for an embedded display see display builder examples, embedded displays, specifically https://github.com/ControlSystemStudio/phoebus/blob/master/app/display/model/src/main/resources/examples/embedded/update_display.py

 

-Kay

 


From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of GAGET Alexis via Tech-talk <tech-talk at aps.anl.gov>
Sent: Wednesday, November 2, 2022 10:17 AM
To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: [EXTERNAL] Phoebus and dynamic macros

 

Hello,

I’m trying to migrate to Phoebus for our new development and I’d like to be able to set Macro dynamically (for my hundreds of acquisition channel for example). I was able to do that with CSS boy using script.

According to https://control-system-studio.readthedocs.io/en/latest/app/display/editor/doc/property_type.html?highlight=macros#macros-property it seems possible also.

 

But when I applied the example to an “Embedded Display”:

 

importPackage(Packages.org.csstudio.opibuilder.scriptUtil);

var macroInput = DataUtil.createMacrosInput(true);

macroInput.put("CHANNEL", PVUtil.getString(pvs[0]));

widget.setPropertyValue("macros", macroInput);

 

I got the following exception :

 

 [..]

Caused by: java.lang.Exception: Need Macros, got {CHANNEL=2}
    at org.csstudio.display.builder.model.properties.MacrosWidgetProperty.setValueFromObject(MacrosWidgetProperty.java:53)

[..]

CHANNEL=2 because my PV loc://macroValue is set to 2.

 

seems to come from here but it's not really understandable for me

https://github.com/ControlSystemStudio/phoebus/blob/1a42ce4afc128f32b845db985ed7966f94078032/app/display/model/src/main/java/org/csstudio/display/builder/model/properties/MacrosWidgetProperty.java

 

Is the example incorrect, or is it not usable on an "Embedded Display" I've tried on a simple windows, i got the same result

 

Thanks in advance

 

Alexis GAGET

CEA Saclay - DRF/Irfu/DIS/LDISC

Bâtiment 472 - pièce 105

alexis.gaget at cea.fr

 


References:
Phoebus and dynamic macros GAGET Alexis via Tech-talk
Re: Phoebus and dynamic macros Kasemir, Kay via Tech-talk

Navigate by Date:
Prev: Re: Phoebus and dynamic macros Kasemir, Kay via Tech-talk
Next: Open position at Diamond: Head of Beamline Controls Pedersen, Ulrik (DLSLtd, RAL, LSCI) 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  <20222023  2024 
Navigate by Thread:
Prev: Re: Phoebus and dynamic macros Kasemir, Kay via Tech-talk
Next: Open position at Diamond: Head of Beamline Controls Pedersen, Ulrik (DLSLtd, RAL, LSCI) 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  <20222023  2024 
ANJ, 02 Nov 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·