EPICS Home

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: about css
From: Eusebio Naif Al-Soliman Fuentes via Tech-talk <tech-talk at aps.anl.gov>
To: Mayou Hasegawa <hasegawamayou at gmail.com>
Cc: tech-talk at aps.anl.gov
Date: Wed, 05 Feb 2025 10:27:34 +0100
Hello Mayou.
 
It might be not the best solution, but a few years ago, I created a Python script similar to the one below:
 

#executed with jython

from connect2j import scriptContext

with scriptContext('widget', 'pvs', 'PVUtil', 'ColorFontUtil', dict=globals()):

    RED = ColorFontUtil.RED
    BLUE = ColorFontUtil.BLUE
    GREEN = ColorFontUtil.getColorFromRGB(0, 255, 0)

    node = PVUtil.getString(pvs[0])
    device = PVUtil.getString(pvs[1])

    if device == "rpi4":
        color = GREEN
    elif device == "nano2gb":
        color = BLUE
    elif device == "nano4gb":
        color = RED

    widget.setPropertyValue("traces[0].y_pv", "pva://" + device + ":NTP_client:" + node)

    widget.setPropertyValue("traces[0].color", color)

    widget.setPropertyValue("traces[0].name", device + " Node: " + node)


My goal was to dynamically change the colors, names, and traces in a Strip Chart to visualize data from different nodes and devices using the same chart. To achieve this, I declared two PVs, node_ID and device_name, and used other elements like a Combo Box to switch between them.

You can find some examples I created for that project in this link: https://github.com/EusebioAlsoliman/TFM/tree/main/Phoebus


The opi file is named "Main.bob", and the script is called "update_trace_NTP.py". I hope this helps you.


Cheers, Eusebio.

 
---

Saludos/Best regards

University of Granada  

Eusebio Naif Al-Soliman Fuentes
MSc. Data Science and Computer Engineering

eunaif at correo.ugr.es



El 2025-02-04 09:06, Mayou Hasegawa via Tech-talk escribió:
Hello, I have a question regarding CSS. I would like to check alternately 2
different PVs on one screen.
Simple example:
If I choose the pv PM1 in the combo box, it press the LEDs and buttons
related to PM1, and if i choose PM2, it press the LEDs and buttons related
to PM2. Can I use it on one screen without creating a new OPI window or
tab? I put a macro in the PM$(N) number.
Please give me some advice on how to do it, RULE, ACTION, SCRIPT.

I attatched my opi file also.

Sincerely,
Mayou.

References:
about css Mayou Hasegawa via Tech-talk

Navigate by Date:
Prev: PVA Gateway issues with two networks client Saisrikiran Mudigonda via Tech-talk
Next: Re: Forking EPICS processes Grzegorz Kowalski 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: about css Mayou Hasegawa via Tech-talk
Next: Re: about css Michael Davidsaver 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