|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.actor.lib.gui.PlotterBase
ptolemy.actor.lib.gui.Plotter
ptolemy.actor.lib.gui.SequencePlotter
ptolemy.actor.lib.gui.SketchedSource
public class SketchedSource
This actor is a plotter that also produces as its output a signal that has been sketched by the user on the screen. The length parameter specifies the number of samples in the sketched signal. The periodic parameter, if true, specifies that the signal should be repeated. If this parameter is false, then the sketched signal is produced exactly once, at the beginning of the execution of the model. If periodic is true and the sketch is modified during execution of the model, then the modification appears in the next cycle after the modification has been completed. In other words, the change does not appear mid-cycle.
This actor is also a plotter, and will plot the input signals on the same plot as the sketched signal. It can be used in a feedback loop where the output affects the input. The first batch of outputs is produced in the initialize() method, so it can be put in a feedback loop in a dataflow model.
Red (vogel) |
Yellow (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 int |
_count
Current position in the signal. |
private double[][] |
_data
Sketched data. |
private boolean |
_dataModified
Indicator that the user has modified the data. |
private boolean |
_initialTraceIsSet
Indicator that initial trace has been supplied. |
private static IntToken |
_one
|
private int |
_previousLengthValue
|
private boolean |
_settingInitialTrace
|
private static DoubleToken |
_zero
Zero token. |
Parameter |
initialTrace
The default signal to generate, prior to any user sketch. |
Parameter |
length
The length of the output signal that will be generated. |
TypedIOPort |
output
The output port. |
Parameter |
periodic
An indicator of whether the signal should be periodically repeated. |
Parameter |
runOnModification
If true, then when the user edits the plot, if the manager is currently idle, then run the model. |
Parameter |
yBottom
The bottom of the Y range. |
Parameter |
yTop
The top of the Y range. |
Fields inherited from class ptolemy.actor.lib.gui.SequencePlotter |
---|
_connected, _xInit, _xUnit, _xValue, input, xInit, xUnit |
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 | |
---|---|
SketchedSource(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name. |
Method Summary | |
---|---|
protected PlotBox |
_newPlot()
Create a new plot. |
private void |
_setRanges()
|
private void |
_showInitialTrace()
|
private void |
_updateInitialTrace()
|
void |
attributeChanged(Attribute attribute)
If the specified attribute is length, then set the trace to its initial value. |
java.lang.Object |
clone(Workspace workspace)
Clone the actor into the specified workspace. |
void |
editDataModified(EditablePlot source,
int dataset)
React to the fact that data in the specified plot has been modified by a user edit action by recording the data. |
void |
fire()
Produce one data sample from the sketched signal on the output port. |
void |
initialize()
Override the base class to read data from the plot and to produce all the data on the output. |
void |
place(java.awt.Container container)
Override the base class to create an initial trace. |
void |
preinitialize()
Override the base class to not clear the plot. |
Methods inherited from class ptolemy.actor.lib.gui.SequencePlotter |
---|
postfire |
Methods inherited from class ptolemy.actor.lib.gui.PlotterBase |
---|
_exportMoMLContents, _implementDeferredConfigurations, _propagateValue, configure, getConfigureSource, getConfigureText, 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, 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 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 |
---|
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 |
---|
public Parameter initialTrace
public Parameter length
public TypedIOPort output
public Parameter periodic
public Parameter runOnModification
public Parameter yBottom
public Parameter yTop
private int _count
private double[][] _data
private boolean _dataModified
private boolean _initialTraceIsSet
private static IntToken _one
private int _previousLengthValue
private boolean _settingInitialTrace
private static DoubleToken _zero
Constructor Detail |
---|
public SketchedSource(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of this actor.
IllegalActionException
- If the actor cannot be contained
by the proposed container.
NameDuplicationException
- If the container already has an
actor with this name.Method Detail |
---|
public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class SequencePlotter
attribute
- The attribute that changed.
IllegalActionException
- If the specified attribute
is length and its value is not positive.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class PlotterBase
workspace
- The workspace for the new object.
java.lang.CloneNotSupportedException
- If a derived class has an
attribute that cannot be cloned.NamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public void editDataModified(EditablePlot source, int dataset)
editDataModified
in interface EditListener
source
- The plot containing the modified data.dataset
- The data set that has been modified.public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class AtomicActor
IllegalActionException
- If there is no director, or
if the base class throws it.public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class SequencePlotter
IllegalActionException
- If the parent class throws it.public void place(java.awt.Container container)
place
in interface Placeable
place
in class PlotterBase
container
- The container into which to place the plot.public void preinitialize() throws IllegalActionException
preinitialize
in interface Initializable
preinitialize
in class PlotterBase
IllegalActionException
- If triggered by creating receivers.AtomicActor.initialize()
protected PlotBox _newPlot()
_newPlot
in class PlotterBase
private void _setRanges() throws IllegalActionException
IllegalActionException
private void _showInitialTrace() throws IllegalActionException
IllegalActionException
private void _updateInitialTrace() throws IllegalActionException
IllegalActionException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |