ptolemy.actor.lib.gui
Class TimedPlotter

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.InstantiableNamedObj
          extended by ptolemy.kernel.Entity
              extended by ptolemy.kernel.ComponentEntity
                  extended by ptolemy.actor.AtomicActor
                      extended by ptolemy.actor.TypedAtomicActor
                          extended by ptolemy.actor.lib.gui.PlotterBase
                              extended by ptolemy.actor.lib.gui.Plotter
                                  extended by ptolemy.actor.lib.gui.TimedPlotter
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Actor, Executable, FiringsRecordable, Placeable, Initializable, TimedActor, TypedActor, Changeable, Configurable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
Direct Known Subclasses:
TimedScope

public class TimedPlotter
extends Plotter
implements TimedActor

A signal plotter. This plotter contains an instance of the Plot class from the Ptolemy plot package as a public member. Data at the input, which can consist of any number of channels, are plotted on this instance. Each channel is plotted as a separate data set. The horizontal axis represents time, which by default is the global time of the model (the model time of the top-level director). Setting useLocalTime to true changes this to use the local time of the input port, which is (in most domains) the model time of the local director.

Since:
Ptolemy II 1.0
Version:
$Id: TimedPlotter.java 57046 2010-01-27 23:35:53Z cxh $
Author:
Edward A. Lee, Contributor: Bert Rodiers
See Also:
Serialized Form
Accepted Rating:
Green (cxh)
Proposed Rating:
Green (eal)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.actor.lib.gui.PlotterBase
PlotterBase.PlotWindowTableau
 
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
 
Field Summary
private  java.util.ArrayList<java.lang.Boolean> _connected
           
 Parameter disconnectGraphOnAbsentValue
          When disconnectGraphOnAbsentValue is True there will be a gap in the graph each time a the actor is fired, but the value is absent for a certain channel.
 TypedIOPort input
          Input port, which has type DoubleToken.
 Parameter useLocalTime
          If true, use the model time reported by the input port, which is normally the model time of the local director.
 
Fields inherited from class ptolemy.actor.lib.gui.Plotter
startingDataset
 
Fields inherited from class ptolemy.actor.lib.gui.PlotterBase
_base, _container, _frame, _plotSize, _source, _tableau, _text, _windowProperties, automaticRescale, fillOnWrapup, legend, plot
 
Fields inherited from class ptolemy.actor.AtomicActor
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
 
Constructor Summary
TimedPlotter(CompositeEntity container, java.lang.String name)
          Construct an actor with the given container and name.
 
Method Summary
 java.lang.Object clone(Workspace workspace)
          Clone the actor into the specified workspace.
 void initialize()
          Initialize this actor.
 boolean postfire()
          Read at most one input from each channel and plot it as a function of time.
 
Methods inherited from class ptolemy.actor.lib.gui.Plotter
attributeChanged
 
Methods inherited from class ptolemy.actor.lib.gui.PlotterBase
_exportMoMLContents, _implementDeferredConfigurations, _newPlot, _propagateValue, configure, getConfigureSource, getConfigureText, place, preinitialize, setContainer, setDisplayName, setName, wrapup
 
Methods inherited from class ptolemy.actor.TypedAtomicActor
_addPort, _fireAt, _fireAt, attributeTypeChanged, clone, newPort, typeConstraintList, typeConstraints
 
Methods inherited from class ptolemy.actor.AtomicActor
_actorFiring, _actorFiring, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, fire, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, prefire, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, stop, stopFire, terminate
 
Methods inherited from class ptolemy.kernel.ComponentEntity
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence
 
Methods inherited from class ptolemy.kernel.Entity
_description, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
 
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeList, attributeList, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ptolemy.actor.Actor
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
 
Methods inherited from interface ptolemy.actor.Executable
fire, isFireFunctional, isStrict, iterate, prefire, stop, stopFire, terminate
 
Methods inherited from interface ptolemy.actor.Initializable
addInitializable, removeInitializable
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName
 
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
 

Field Detail

disconnectGraphOnAbsentValue

public Parameter disconnectGraphOnAbsentValue
When disconnectGraphOnAbsentValue is True there will be a gap in the graph each time a the actor is fired, but the value is absent for a certain channel. Especially in the continuous domain this options is useful. By default this parameter is False.


input

public TypedIOPort input
Input port, which has type DoubleToken.


useLocalTime

public Parameter useLocalTime
If true, use the model time reported by the input port, which is normally the model time of the local director. If false (the default), use the model time reported by the top-level director. Local time may differ from global time inside modal models and certain domains that manipulate time.


_connected

private java.util.ArrayList<java.lang.Boolean> _connected
Constructor Detail

TimedPlotter

public TimedPlotter(CompositeEntity container,
                    java.lang.String name)
             throws IllegalActionException,
                    NameDuplicationException
Construct an actor with the given container and name.

Parameters:
container - The container.
name - The name of this actor.
Throws:
IllegalActionException - If the actor cannot be contained by the proposed container.
NameDuplicationException - If the container already has an actor with this name.
Method Detail

clone

public java.lang.Object clone(Workspace workspace)
                       throws java.lang.CloneNotSupportedException
Clone the actor into the specified workspace. This calls the base class and then creates new ports and parameters.

Overrides:
clone in class PlotterBase
Parameters:
workspace - The workspace for the new object.
Returns:
A new actor.
Throws:
java.lang.CloneNotSupportedException - If a derived class has an attribute that cannot be cloned.
See Also:
NamedObj.exportMoML(Writer, int, String), NamedObj.setDeferringChangeRequests(boolean)

initialize

public void initialize()
                throws IllegalActionException
Initialize this actor. Derived classes override this method to perform actions that should occur once at the beginning of an execution, but after type resolution. Derived classes can produce output data and schedule events.

Specified by:
initialize in interface Initializable
Overrides:
initialize in class Plotter
Throws:
IllegalActionException - If a derived class throws it.

postfire

public boolean postfire()
                 throws IllegalActionException
Read at most one input from each channel and plot it as a function of time. This is done in postfire to ensure that data has settled.

Specified by:
postfire in interface Executable
Overrides:
postfire in class AtomicActor
Returns:
True if it is OK to continue.
Throws:
IllegalActionException - If there is no director, or if the base class throws it.