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 | 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 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: CS-Studio (Phoebus) Dynamic Population of PVs in GUI |
From: | Tynan Ford via Tech-talk <tech-talk at aps.anl.gov> |
To: | Michael Davidsaver <mdavidsaver at gmail.com> |
Cc: | EPICS tech-talk <tech-talk at aps.anl.gov> |
Date: | Fri, 15 Jan 2021 09:38:31 -0800 |
>>> import phoebusgen.widget as w >>> text_update_widget = w.TextUpdate('test widget', 'TEST:PV', 10, 20, 20, 50) >>> text_update_widget.predefined_foreground_color('OK') >>> print(text_update_widget) <?xml version="1.0" ?> <widget type="textupdate" version="2.0.0"> <name>test widget</name> <x>10</x> <y>20</y> <width>20</width> <height>50</height> <pv_name>TEST:PV</pv_name> <foreground_color> <color red="0" green="255" blue="0" alpha="255" name="OK"/> </foreground_color> </widget>
On 1/14/21 2:28 PM, Manoussakis, Adamandios via Tech-talk wrote:
> Hello All,
>
>
>
> I was curious what the best way to go about populating our GUIs in CS Studio when we are dealing with multiple PVs that share a common attributes. Such as
>
>
>
> Device1:Subdevice1:Signal1
>
> Device1:Subdevice1:Signal2
>
>
>
> Device1:Subdevice2:Signal1
>
> Device1:Subdevice2:Signal2
>
>
>
> And so forth for N devices M Subdevices Z Signals
>
>
>
> I was thinking to use macros that pull from drop down menus which would then populate the correct PVs for say specific waveforms.
>
>
>
> Dropdown menu to select Device #, Dropdown menu to select subdevice # and then populate the PV waveforms for the correct subset I selected.
>
>
>
> I only just started to use CS Studio and I think this seems possible but wasn’t completely sure. I also saw that I could write some python scripting and have it run in CS Studio to parse out and place the correct PVs depending on drop down selections but wanted to check in first and see how people have been using it.
You might want to start by looking at ways to accomplish this with macros.
For example, it is possible to use an Action Button to replace an OPI with the
same OPI file and different macros values. So I can have a row of buttons,
or one button with a menu, to select between different device instances.
I think it may also be possible for an embedded script to change macro values,
though cleverness with client side scripting is generally recommended as a last
resort.
wrt. generation screens. So far I've only done this sort of thing offline.
eg. with python scripts to generate OPI screen files (variously .bob, .opi,
or .edl). Usually with the idea of quickly generating tabular "expert"
screens for devices with a large number of scalar settings.
For cs-studio, this is mostly an exercise in xml.etree.ElementTree with
some logic to manage incrementing Y position for successive Embedded Display
widgets.