[kepler-dev] Disabling run....

Matt Jones jones at nceas.ucsb.edu
Thu Sep 23 08:47:12 PDT 2004


Hi,

It seems to me that these two operations should be possible outside of 
the ptolemy GUI.  The ptolemy execution engine has to exist whether you 
are running headless or not, and it *should* have a controller -- maybe 
this is the director, maybe something else, I'm not sure.  Whatever the 
object is that controls execution, you should be able to make a call 
like this hypothetical code:

controller.setExecutionEnabled(false);

or, in the case of the progress meter,

controller.setBusyFlag(true);

The controller would then know that, when headless, it has to disable 
execution, but only when running in a graphical env would it then make 
UI changes to vergil (such as changing the state of the run button).  In 
this way, the actors would still not have any GUI dependencies, but the 
execution controller would.

Just a thought,
Matt

Edward A Lee wrote:
> At 08:39 AM 9/23/2004 -0500, Rod Spears wrote:
> 
>> Is there a way to actually stop or delay a model from running when all 
>> the actors are not yet ready?
> 
> 
> Sure... Write the actor so it doesn't return from initialize() until
> it's ready... Each run of a model proceeds in an independent thread,
> so this shouldn't hang up the UI.  You probably want to time out,
> however, and also check for the stop button being pushed (the
> protected variable _stopRequested from ptolemy.actor.AtomicActor
> is available to all atomic actors...
> 
> 
>> Also, (just so the question doesn't get lost) is there an example of 
>> an actor interacting with the progress meter? Or is that not possible 
>> because of your previous statment.
> 
> 
> I don't know of such an example, but I'm sure it's possible.
> The hard part is going to be to obtain somehow a reference to the
> progress meter.  The actor by default has no references that lead
> to the UI, since this will create a dependence in the Java code.
> 
> Looking at the following actor will show how you can
> get a reference to the TableauFrame, which is the top-level window
> displaying the actor:
> 
>   ptolemy.vergil.actor.lib.VisualModelReference
> 
> The TableauFrame is a subclass of ptolemy.gui.Top, which contains
> an instance of ptolemy.gui.StatusBar, which contains the progress
> bar...
> 
> On quick glance, however, I'm not sure the API of Top is rich enough
> to give access to the StatusBar... It probably needs one or more
> methods to control what is displayed there... If you suggest changes,
> I'll gladly fold them in (assuming they conform with our style guide ;-)
> 
> Edward
> 
> 
> 
> ------------
> Edward A. Lee, Professor
> 518 Cory Hall, UC Berkeley, Berkeley, CA 94720
> phone: 510-642-0455, fax: 510-642-2739
> eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal
> 
> _______________________________________________
> kepler-dev mailing list
> kepler-dev at ecoinformatics.org
> http://www.ecoinformatics.org/mailman/listinfo/kepler-dev

-- 
-------------------------------------------------------------------
Matt Jones                                     jones at nceas.ucsb.edu
http://www.nceas.ucsb.edu/    Fax: 425-920-2439    Ph: 907-789-0496
National Center for Ecological Analysis and Synthesis (NCEAS)
University of California Santa Barbara
Interested in ecological informatics? http://www.ecoinformatics.org
-------------------------------------------------------------------



More information about the Kepler-dev mailing list