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  2022  2023  2024  <2025 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  <2025
<== Date ==> <== Thread ==>

Subject: Re: [CSS/Phoebus] Adding widgets as children to other widgets, from Python
From: "Kasemir, Kay via Tech-talk" <tech-talk at aps.anl.gov>
To: "Gonzalez, Jose Carlos" <jose.carlos.gonzalez at ipp.mpg.de>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Tue, 11 Mar 2025 14:14:11 +0000

Best try to avoid scripts in the display. Scripts for the display builder desktop won’t function in the web runtime, and when you eventually transition to whatever is the hot display tool in 5 years, you’ll have to re-do that.

Maybe you can simply use the Navigation Tabs widget as is?

Or use scripts to generate the XML for the display files offline, not running inside the display?

Otherwise, if you’re ready to read the examples, dig into the API (TabsWidget, TabItemProperty, ChildrenProperty, ..), and prepare to update your scripts as the API might change.

 

> How can I get the page handlers for the .. Navigator Tabs widget

 

See ‘Change Tabs’ button in the nav tabs example. It has a script which adds/removes tabs.

https://github.com/ControlSystemStudio/phoebus/blob/0ae9b167491f6f33bea46f998e58988b3e20e34d/app/display/model/src/main/resources/examples/structure_navtabs.bob#L135

 

> .. a child of one of those <tabs>

 

# Example script for "Tabs" widget that adds content to a tab

from org.csstudio.display.builder.model import WidgetFactory

 

# Add widget to existing tab

w = WidgetFactory.getInstance().getWidgetDescriptor("label").createWidget()

w.setPropertyValue("x", 20)

w.setPropertyValue("y", 10)

w.setPropertyValue("text", "Example")

# Add to 2nd tab (counting from zero)

tab = widget.propTabs().getElement(1)

tab.children().addChild(-1, w)

 

# Select the active tab

widget.setPropertyValue('active_tab', 1)

 

 

From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Gonzalez, Jose Carlos via Tech-talk <tech-talk at aps.anl.gov>
Date: Tuesday, March 11, 2025 at 6:45
AM
To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: [EXTERNAL] [CSS/Phoebus] Adding widgets as children to other widgets, from Python

Hi, I'm trying to use scripting to populate a CSStudio/Phoebus panel/display with a set of replica of a template panel, which shows information from a single monitored entity. In total, there would be N1 copies of that template in the panel

Hi,

 

I'm trying to use scripting to populate a CSStudio/Phoebus panel/display with a set of replica of a template panel, which shows information from a single monitored entity. In total, there would be N1 copies of that template in the panel (distributed in rows and columns). I'm following pretty much the example provided in the template sample panel.

 

Now, in fact I don't have 1 single set of entities, but 3 of them. So, I have two possibilitites:

a) I can create 3 similar panels, each of them showing one of these 3 sets, or

b) I can (my preferred solution, if possible) I can create 1 single panel with a Tabs or Navigator Tabs widget, with 3 pages, and show in each of them one of those 3 sets.

 

My only question is: how can I, from a Python script, make that the new template panel that I'm replicating is a child of one of those pages (instead of being a child of the display/panel itself). In the later case, I use:

 

    display = widget.getDisplayModel()

 

to get the display handler, and then

 

    for i in range(...):
        . . .
        instance = createInstance(...)
        display.runtimeChildren().addChild(instance)

 

to add each single instance ans a child of the display.

 

How can I get the page handlers for the Tabs or Navigator Tabs widget, instead?

 

Thanks in advance,

 

J C

--

Jose Carlos Gonzalez

Max-Planck-Institut für Plasmaphysik
Experiment-IT - Tokamak Scenario Development - L6/18

Boltzmannstr. 2,
D-85748 Garching bei München
Phone +49 89 3299-1698
jose.carlos.gonzalez at ipp.mpg.de


Replies:
Re: [CSS/Phoebus] Adding widgets as children to other widgets, from Python Gonzalez, Jose Carlos via Tech-talk
References:
[CSS/Phoebus] Adding widgets as children to other widgets, from Python Gonzalez, Jose Carlos via Tech-talk

Navigate by Date:
Prev: Re: Keithley device reading failure Mark Rivers via Tech-talk
Next: More Issues Installing Galil EPICS Drivers – asyn Jonathan Hai 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  <2025
Navigate by Thread:
Prev: [CSS/Phoebus] Adding widgets as children to other widgets, from Python Gonzalez, Jose Carlos via Tech-talk
Next: Re: [CSS/Phoebus] Adding widgets as children to other widgets, from Python Gonzalez, Jose Carlos 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  <2025
ANJ, 13 Mar 2025 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions ·
· Download · Search · IRMIS · Talk · Documents · Links · Licensing ·