|
|||||||||
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.domains.ptinyos.lib.MicaLeds
public class MicaLeds
An actor to display the LEDs of the simulated mote. There are three LEDS -- red, yellow, and green.
The actor has a boolean port for each LED. A token with value of true received at the port will cause the corresponding LED on the icon to light up.
The actor also has a parameter for each LED, which allows the container to read the value and use it to change the color of the icon.
Green (celaine) |
Green (celaine) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.Entity |
---|
Entity.ContainedObjectsIterator |
Field Summary | |
---|---|
private RectangleAttribute |
_ledGreen
Graphical icon for the green LED. |
private RectangleAttribute |
_ledRed
Graphical icon for red LED. |
private RectangleAttribute |
_ledYellow
Graphical icon for yellow LED. |
Parameter |
green
The color of the "green" LED. |
TypedIOPort |
ledGreen
Input port for the green LED. |
TypedIOPort |
ledRed
Input port for the red LED. |
TypedIOPort |
ledYellow
Input port for the yellow LED. |
Parameter |
red
The color of the "red" LED. |
Parameter |
yellow
The color of the "yellow" LED. |
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 | |
---|---|
MicaLeds(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name. |
Method Summary | |
---|---|
private void |
_greenOff()
Turn the green LED off by changing the color of the graphical icon to dark green and reflecting the color value in the corresponding parameter. |
private void |
_greenOn()
Turn the green LED on by changing the color of the graphical icon to bright green and reflecting the color value in the corresponding parameter. |
private void |
_redOff()
Turn the red LED off by changing the color of the graphical icon to dark red and reflecting the color value in the corresponding parameter. |
private void |
_redOn()
Turn the red LED on by changing the color of the graphical icon to bright red and reflecting the color value in the corresponding parameter. |
private void |
_yellowOff()
Turn the yellow LED off by changing the color of the graphical icon to dark yellow and reflecting the color value in the corresponding parameter. |
private void |
_yellowOn()
Turn the yellow LED on by changing the color of the graphical icon to bright yellow and reflecting the color value in the corresponding parameter. |
void |
fire()
For each LED port, if it is connected and has a token, read the token. |
Methods inherited from class ptolemy.actor.TypedAtomicActor |
---|
_addPort, _fireAt, _fireAt, attributeTypeChanged, clone, newPort, typeConstraintList, typeConstraints |
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 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, postfire, prefire, stop, stopFire, terminate |
Methods inherited from interface ptolemy.actor.Initializable |
---|
addInitializable, initialize, preinitialize, removeInitializable, wrapup |
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 |
---|
public TypedIOPort ledGreen
public TypedIOPort ledRed
public TypedIOPort ledYellow
public Parameter green
public Parameter red
public Parameter yellow
private RectangleAttribute _ledGreen
private RectangleAttribute _ledYellow
private RectangleAttribute _ledRed
Constructor Detail |
---|
public MicaLeds(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
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 fire() throws IllegalActionException
fire
in interface Executable
fire
in class AtomicActor
IllegalActionException
- If any of the LED ports
cannot be read.private void _greenOff() throws IllegalActionException
IllegalActionException
private void _greenOn() throws IllegalActionException
IllegalActionException
private void _redOff() throws IllegalActionException
IllegalActionException
private void _redOn() throws IllegalActionException
IllegalActionException
private void _yellowOff() throws IllegalActionException
IllegalActionException
private void _yellowOn() throws IllegalActionException
IllegalActionException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |