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  <20122013  2014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: RE: CSS with a dynamic IOC (=labview?)
From: "Chen, Xihui" <chenx1@ornl.gov>
To: Touchard Dominique <dominique.touchard@ganil.fr>, "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Wed, 20 Jun 2012 13:55:02 -0400
Hi Dominique,

Yes, this is possible. You can add a EditPartListener to a widget, which will be notified when a widget deactivated (removed or closed). See: http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.gef.doc.isv/reference/api/org/eclipse/gef/EditPartListener.html

So attach following Jython script to a widget on the OPI will do what you want. For complete example, see attached OPI.

------------------------------------------
from org.csstudio.opibuilder.scriptUtil import PVUtil, ConsoleUtil
from org.eclipse.gef import EditPartListener

class OPICloseListener(EditPartListener):
    def partDeactivated(self, editpart):
	ConsoleUtil.writeInfo("OPI Closed"); //replace this with the command to close your IOC

widget.addEditPartListener(OPICloseListener())
--------------------------------------------------------

This script should only be executed once on OPI startup, so use a constant PV, for example "1" as the trigger PV will do that.

It is not recommended to attach this script (in fact, any script) to the display, because that won't work when this OPI is embedded in a linking container. When a  display is embedded in a linking container, only its children are loaded in the container so the scripts on the display itself will not be executed.

Cheers,
Xihui




________________________________________
From: Touchard Dominique [dominique.touchard@ganil.fr]
Sent: Wednesday, June 20, 2012 11:42 AM
To: tech-talk@aps.anl.gov
Subject: CSS with a dynamic IOC (=labview?)

Hi,

My goal is to start a linux IOC inside CSS boy as a labview IDE. (NI@) Here, no trouble at all. But…

Is there any OPI property that runs a dedicated command when the user click on the cross to close the OPI. The goal is to stop the Linux IOC embedded with the OPI.

Thanks for your help.

Dominique Touchard.

Attachment: NotifiedOnDisplayClose.opi
Description: NotifiedOnDisplayClose.opi


References:
CSS with a dynamic IOC (=labview?) Touchard Dominique

Navigate by Date:
Prev: Re: dbd expand errors for measurementComputing module Tim Mooney
Next: Re: caxy-1.0.0 released; CA tunneling with SSH Martin Konrad
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: CSS with a dynamic IOC (=labview?) Touchard Dominique
Next: caxy-1.0.0 released; CA tunneling with SSH Till Straumann
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·