ptolemy.domains.ptinyos.lib
Class NCComponentBase

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.domains.ptinyos.lib.NCComponentBase
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

public class NCComponentBase
extends AtomicActor

Actor that serves as a placeholder for PtinyOS nesC modules and configurations. This class is a base class for nesC component classes. These are classes with source code defined in a .nc file intended for use with TinyOS to program the Berkeley Motes. This class provides a parameter source that is used to identify the nesC source file. It works in conjunction with the NCComponent MoML class, which attaches a tableau factory so that selecting the "Open Actor" menu choice will open the nesC source file.

Since:
Ptolemy II 5.1
Version:
$Id: NCComponentBase.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Elaine Cheong, Edward A. Lee, Yang Zhao
See Also:
Serialized Form
Accepted Rating:
Green (cxh)
Proposed Rating:
Green (celaine)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
 
Field Summary
 StringAttribute displayedName
          Displayed name on icon.
 NameIcon icon
          Icon for this component.
 Parameter rotatePorts
          Relative orientation of ports on the icon of this actor.
 FileParameter source
          The source code file or URL.
 
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
NCComponentBase(CompositeEntity container, java.lang.String name)
          Construct an actor with the given container and name.
NCComponentBase(Workspace workspace)
          Construct an actor in the specified workspace with an empty string as a name.
 
Method Summary
private  void _init()
          Initialize the actor.
 
Methods inherited from class ptolemy.actor.AtomicActor
_actorFiring, _actorFiring, _addPort, addActorFiringListener, addInitializable, clone, connectionsChanged, createReceivers, declareDelayDependency, fire, getCausalityInterface, getDirector, getExecutiveDirector, getManager, initialize, inputPortList, isFireFunctional, isStrict, iterate, newPort, newReceiver, outputPortList, postfire, prefire, 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.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, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, 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
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
 
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
 

Field Detail

source

public FileParameter source
The source code file or URL. The default value is "$PTII/ptolemy/domains/ptinyos/lib/NCComponent.nc"


rotatePorts

public Parameter rotatePorts
Relative orientation of ports on the icon of this actor. The default value is an IntegerToken of value 90.


icon

public NameIcon icon
Icon for this component. The default value is a NameIcon with name "_icon", which will display the value of the displayedName attribute on the icon.


displayedName

public StringAttribute displayedName
Displayed name on icon. The value is set to the name of the nesC component being represented. Otherwise, the name of this class is displayed.

Constructor Detail

NCComponentBase

public NCComponentBase(Workspace workspace)
Construct an actor in the specified workspace with an empty string as a name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace. The object is added to the workspace directory. Increment the version number of the workspace.

Parameters:
workspace - The workspace that will list the entity.

NCComponentBase

public NCComponentBase(CompositeEntity container,
                       java.lang.String name)
                throws NameDuplicationException,
                       IllegalActionException
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

_init

private void _init()
            throws IllegalActionException,
                   NameDuplicationException
Initialize the actor.

Throws:
IllegalActionException
NameDuplicationException