|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.Port
ptolemy.kernel.ComponentPort
ptolemy.actor.IOPort
ptolemy.actor.TypedIOPort
ptolemy.domains.wireless.kernel.WirelessIOPort
This port communicates via channels without wired connections. Channels are instances of WirelessChannel. The port references channels by name, where the name is specified by the outsideChannel or insideChannel parameter.
This port can be used on the boundary of wireless domain models. A port is outside wireless if an outside channel name is given and a wireless channel with the given name is contained by the container of the port's container (transparent hierarchy is not supported). Specially, it will use the specified wireless channel to communicate on the outside. A port is inside wireless if an inside channel name is given and a wireless channel with the given name is contained by the container of this port. It will use the specified wireless channel to communicate on the inside. If no outside channel or inside channel name is given or the named channel does not exist, then the behavior of the port reverts to that of the base class. Specifically, it will only communicate if it is wired.
it is valid for a model using the wireless director to have both wireless communication and wired communication, i.e. it may contain actors with ports using wireless communication (by specifying a wireless channel) and actors with ports using wired communication. If a port is outside/inside wireless(a wireless channel is specified), it will ignore all the communication through the wired connections to it if there is any on the outside/inside of it.
The width of this port on either side that is using wireless communication is fixed at one. Otherwise, it depends on the number of links to the port.
When this port is used for wireless communications, nothing is connected to it. Consequently, methods that access the topology such as connectedPortList() and deepConnectedInPortList() return an empty list. There are no deeply connected ports. However, sinkPortList() returns the port of the specified wireless channel. A consequence of this is that type constraints are automatically set up between ports that send on the channel and the channel port.
| Yellow (cxh) |
| Green (cxh) |
| Nested Class Summary |
| Nested classes inherited from class ptolemy.kernel.util.NamedObj |
NamedObj.ContainedObjectsIterator |
| Field Summary | |
StringParameter |
insideChannel
The name of the inside channel. |
Parameter |
insideTransmitProperties
The transmit properties of this port for inside transmissions. |
StringParameter |
outsideChannel
The name of the outside channel. |
Parameter |
outsideTransmitProperties
The transmit properties of this port for outside transmissions. |
| Fields inherited from class ptolemy.actor.TypedIOPort |
TYPE |
| Fields inherited from class ptolemy.actor.IOPort |
CONFIGURATION, RECEIVERS, REMOTERECEIVERS |
| Fields inherited from class ptolemy.kernel.Port |
_insideLinks, _relationsList |
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
| Constructor Summary | |
WirelessIOPort(ComponentEntity container,
java.lang.String name)
Construct a port with the specified container and name that is neither an input nor an output. |
|
WirelessIOPort(ComponentEntity container,
java.lang.String name,
boolean isInput,
boolean isOutput)
Construct a port with a container and a name that is either an input, an output, or both, depending on the third and fourth arguments. |
|
WirelessIOPort(Workspace workspace)
Construct a port in the specified workspace with an empty string as a name. |
|
| Method Summary | |
protected boolean |
_insideIsWireless()
Return true if the port is inside wireless. |
protected boolean |
_outsideIsWireless()
Return true if the port is outside wireless. |
void |
attributeChanged(Attribute attribute)
If the attribute is one of the properties attributes, make sure its value is a record token. |
void |
broadcast(Token token)
Override the base class to delegate to the channel if there is one. |
void |
broadcast(Token[] tokenArray,
int vectorLength)
Override the base class to delegate to the channel if there is one. |
void |
broadcastClear()
Override the base class to delegate to the channel if there is one. |
void |
createReceivers()
Override the base class to create receivers for WirelessIOPort. |
WirelessChannel |
getInsideChannel()
Get the channel specified by the insideChannel parameter. |
Receiver[][] |
getInsideReceivers()
Override the base class to return the inside receiver for wireless communication if wireless communication is being used. |
WirelessChannel |
getOutsideChannel()
Get the channel specified by the outsideChannel parameter. |
Token |
getProperties(int channelIndex)
Get the properties token associated with the data token most recently retrieved using get(). |
Token |
getPropertiesInside(int channelIndex)
Get the properties token associated with the data token most recently retrieved using getInside(). |
Receiver[][] |
getReceivers()
Override the base class to return the outside receiver for wireless communication if wireless communication is being used. |
int |
getWidth()
Get the width of the port. |
int |
getWidthInside()
Return the inside width of this port. |
boolean |
hasRoom(int channelIndex)
Override the base class to always return true if there is a wireless channel, and otherwise, defer to the base class. |
boolean |
hasRoomInside(int channelIndex)
Override the base class to always return true if there is a wireless channel, and otherwise, defer to the base class. |
java.util.List |
insideSinkPortList()
Return a list of the ports that can potentially accept data from this port when it sends on the inside. |
java.util.List |
insideSourcePortList()
Return a list of the ports that can potentially send data to this port from the inside. |
int |
numberOfSinks()
Return 1 if the port is outside wireless, which represents the channel port of the outside wireless channel. |
int |
numberOfSources()
Return 1 if the port is outside wireless,, which represents the channel port of the outside wireless channel. |
void |
send(int channelIndex,
Token token)
Override the base class to delegate to the wireless channel if the port is outside wireless. |
void |
send(int channelIndex,
Token[] tokenArray,
int vectorLength)
Override the base class to delegate to the wireless channel if the port is outside wireless. |
void |
sendClear(int channelIndex)
Override the base class to delegate to the wireless channel if the port is outside wireless. |
void |
sendClearInside(int channelIndex)
Override the base class to delegate to the wireless channel if the port is inside wireless. |
void |
sendInside(int channelIndex,
Token token)
Override the base class to delegate to the wireless channel if the port is inside wireless. |
java.util.List |
sinkPortList()
Return a list of the ports that can potentially accept data from this port when it sends on the outside. |
java.util.List |
sourcePortList()
Return a list of the ports that can potentially send data to this port from the outside. |
| Methods inherited from class ptolemy.actor.TypedIOPort |
_checkContainer, _checkLiberalLink, _checkLink, _checkType, _description, addTypeListener, clone, convert, getType, getTypeTerm, isTypeAcceptable, removeTypeListener, setTypeAtLeast, setTypeAtLeast, setTypeAtMost, setTypeEquals, setTypeSameAs, typeConstraintList |
| Methods inherited from class ptolemy.kernel.ComponentPort |
_deepConnectedPortList, _deepConnectedPorts, _deepInsidePortList, _deepInsidePorts, _isInsideLinkable, deepConnectedPortList, deepConnectedPorts, deepInsidePortList, deepInsidePorts, insertInsideLink, insidePortList, insidePorts, insideRelationList, insideRelations, isDeeplyConnected, isInsideLinked, isOpaque, numInsideLinks |
| Methods inherited from class ptolemy.kernel.Port |
_getContainedObject, _propagateExistence, connectedPortList, connectedPorts, getContainer, isLinked, linkedRelationList, linkedRelations, numLinks, setName |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public StringParameter insideChannel
public Parameter insideTransmitProperties
public StringParameter outsideChannel
public Parameter outsideTransmitProperties
| Constructor Detail |
public WirelessIOPort(Workspace workspace)
throws IllegalActionException,
NameDuplicationException
workspace - The workspace that will list the port.
IllegalActionException - If creating the parameters
of this port throws it.
NameDuplicationException - If creating the parameters
of this port throws it.
public WirelessIOPort(ComponentEntity container,
java.lang.String name)
throws IllegalActionException,
NameDuplicationException
container - The container actor.name - The name of the port.
IllegalActionException - If the port is not of an acceptable
class for the container, or if the container does not implement the
Actor interface.
NameDuplicationException - If the name coincides with
a port already in the container.
public WirelessIOPort(ComponentEntity container,
java.lang.String name,
boolean isInput,
boolean isOutput)
throws IllegalActionException,
NameDuplicationException
container - The container actor.name - The name of the port.isInput - True if this is to be an input port.isOutput - True if this is to be an output port.
IllegalActionException - If the port is not of an acceptable
class for the container, or if the container does not implement the
Actor interface.
NameDuplicationException - If the name coincides with
a port already in the container.| Method Detail |
public void attributeChanged(Attribute attribute)
throws IllegalActionException
attributeChanged in class TypedIOPortattribute - The attribute that changed.
IllegalActionException - If the change is not acceptable
to this container.
public void broadcast(Token token)
throws IllegalActionException
broadcast in class TypedIOPorttoken - The token to send.
IllegalActionException - If the port is not an output,
or if the outsideChannel parameter cannot be evaluated
or if the transmit() method throws an IllegalActionException.
public void broadcast(Token[] tokenArray,
int vectorLength)
throws IllegalActionException,
NoRoomException
broadcast in class TypedIOPorttokenArray - The token array to sendvectorLength - The number of elements of the token
array to send.
NoRoomException - If there is no room in the receiver.
IllegalActionException - If the tokens to be sent cannot
be converted to the type of this port
public void broadcastClear()
throws IllegalActionException
broadcastClear in class IOPortIllegalActionException - If a receiver does not support
clear().IOPort.sendClear(int )
public void createReceivers()
throws IllegalActionException
createReceivers in class IOPortIllegalActionException - If this port is not
an opaque input port or if there is no director.
public WirelessChannel getInsideChannel()
throws IllegalActionException
IllegalActionException - If the insideChannel
parameter value cannot be evaluated.public Receiver[][] getInsideReceivers()
getInsideReceivers in class IOPortIOPort.getInside(int)
public WirelessChannel getOutsideChannel()
throws IllegalActionException
IllegalActionException - If the outsideChannel
parameter value cannot be evaluated.public Token getProperties(int channelIndex)
channelIndex - The channel index.
IOPort.get(int),
IOPort.get(int, int)public Token getPropertiesInside(int channelIndex)
channelIndex - The channel index.
IOPort.getInside(int)public Receiver[][] getReceivers()
getReceivers in class IOPortpublic int getWidth()
getWidth in class IOPortIOPort.numberOfSinks(),
IOPort.numberOfSources()public int getWidthInside()
getWidthInside in class IOPort
public boolean hasRoom(int channelIndex)
throws IllegalActionException
hasRoom in class IOPortchannelIndex - The channel index.
IllegalActionException - If the receivers do not support
this query, if this is not an output port, or if the channel index
is out of range.
public boolean hasRoomInside(int channelIndex)
throws IllegalActionException
hasRoomInside in class IOPortchannelIndex - The channel index.
IllegalActionException - If the receivers do not support
this query, if this is not an output port, or if the channel index
is out of range.public java.util.List insideSinkPortList()
insideSinkPortList in class IOPortIOPort.deepGetReceivers()public java.util.List insideSourcePortList()
insideSourcePortList in class IOPortpublic int numberOfSinks()
numberOfSinks in class IOPortIOPort.sinkPortList(),
IOPort.numberOfSources(),
IOPort.getWidth()public int numberOfSources()
numberOfSources in class IOPortIOPort.sourcePortList(),
IOPort.numberOfSinks(),
IOPort.getWidth()
public void send(int channelIndex,
Token token)
throws IllegalActionException,
NoRoomException
send in class TypedIOPortchannelIndex - The index of the channel, from 0 to width-1.
If there is an outside channel, then this argument is ignored.token - The token to send.
IllegalActionException - If the port is not an output,
or if the token to be sent cannot
be converted to the type of this port, or if the token is null.
NoRoomException - If there is no room in the receiver.
This should not occur in the DE domain.
public void send(int channelIndex,
Token[] tokenArray,
int vectorLength)
throws IllegalActionException,
NoRoomException
send in class TypedIOPortchannelIndex - The index of the channel, from 0 to width-1
If there is an outside channel, then this argument is ignored.tokenArray - The token array to sendvectorLength - The number of elements of the token
array to send.
NoRoomException - If there is no room in the receiver.
IllegalActionException - If the tokens to be sent cannot
be converted to the type of this port, or if the vectorLength
argument is greater than the length of the tokenArray
argument.
public void sendClear(int channelIndex)
throws IllegalActionException
sendClear in class IOPortchannelIndex - The index of the channel, from 0 to width-1.
If there is an outside channel, then this argument is ignored.
IllegalActionException - If a receiver does not support
clear().IOPort.broadcastClear(),
IOPort.sendClearInside(int)
public void sendClearInside(int channelIndex)
throws IllegalActionException
sendClearInside in class IOPortchannelIndex - The index of the channel, from 0 to width-1.
If there is an inside channel, then this argument is ignored.
IllegalActionException - If a receiver does not support
clear().IOPort.sendClear(int)
public void sendInside(int channelIndex,
Token token)
throws IllegalActionException,
NoRoomException
sendInside in class TypedIOPortchannelIndex - The index of the channel, from 0 to width-1.
If there is an inside channel, then this argument is ignored.token - The token to send
NoRoomException - If there is no room in the receiver.
IllegalActionException - If conversion to the type of
the destination port cannot be done.public java.util.List sinkPortList()
sinkPortList in class IOPortIOPort.getRemoteReceivers()public java.util.List sourcePortList()
sourcePortList in class IOPortprotected boolean _insideIsWireless()
protected boolean _outsideIsWireless()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||