ptolemy.actor.lib.jopio
Class JopSerialRead
java.lang.Object
ptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.actor.lib.Source
ptolemy.actor.lib.jopio.JopSerialRead
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
public class JopSerialRead
- extends Source
Read serail port on the Java processor JOP (see http://www.jopdesign.com).
In the simulation just dummy values are returned (the simulated us counter).
- Since:
- Ptolemy II 8.0
- Version:
- $Id: JopSerialRead.java 59203 2010-09-23 21:41:27Z cxh $
- Author:
- Martin Schoeberl
- See Also:
- Serialized Form
- Accepted Rating:
- Proposed Rating:
Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Constructor Summary |
JopSerialRead(CompositeEntity container,
java.lang.String name)
Construct an actor in the specified container with the specified
name. |
Method Summary |
java.lang.Object |
clone(Workspace workspace)
Override the base class to set type constraints on the ports. |
void |
fire()
Read the input port on the first invocation of fire() in the
current iteration and send the value on each fire(). |
boolean |
postfire()
Enable read on the next invokation of fire(). |
Methods inherited from class ptolemy.actor.AtomicActor |
_actorFiring, _actorFiring, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, initialize, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate, wrapup |
Methods inherited from class ptolemy.kernel.ComponentEntity |
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName |
Methods inherited from class ptolemy.kernel.Entity |
_description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName |
Methods inherited from class ptolemy.kernel.util.NamedObj |
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, 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, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
_firstFire
private boolean _firstFire
_val
private IntToken _val
_cnt
private int _cnt
JopSerialRead
public JopSerialRead(CompositeEntity container,
java.lang.String name)
throws IllegalActionException,
NameDuplicationException
- Construct an actor in the specified container with the specified
name.
- Parameters:
container
- The container.name
- The name of this adder within the container.
- Throws:
IllegalActionException
- If the actor cannot be contained
by the proposed container.
NameDuplicationException
- If the name coincides with
an actor already in the container.
clone
public java.lang.Object clone(Workspace workspace)
throws java.lang.CloneNotSupportedException
- Override the base class to set type constraints on the ports.
- Overrides:
clone
in class AtomicActor
- Parameters:
workspace
- The workspace into which to clone.
- Returns:
- A new instance of AddSubtract.
- Throws:
java.lang.CloneNotSupportedException
- If a derived class contains
an attribute that cannot be cloned.- See Also:
NamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
fire
public void fire()
throws IllegalActionException
- Read the input port on the first invocation of fire() in the
current iteration and send the value on each fire().
- Specified by:
fire
in interface Executable
- Overrides:
fire
in class Source
- Throws:
IllegalActionException
- If there is no director.
postfire
public boolean postfire()
throws IllegalActionException
- Enable read on the next invokation of fire().
- Specified by:
postfire
in interface Executable
- Overrides:
postfire
in class AtomicActor
- Returns:
- True if execution can continue into the next iteration.
- Throws:
IllegalActionException
- If the base class throws it.