
TransmitPropertyTransformer |
ptolemy.domains.wireless.lib.TransmitPropertyTransformer |
This actor reads input tokens and sends them unmodified to the output;
its role is not to operate on input tokens, but rather to modify the
properties of a transmission.
<p>
This actor implements the PropertyTransformer interface, which provides
a callback that can be use to modify the transmit properties of a
transmission. It register itself and its connected wireless
output port with the channel that the wireless output port uses.
The channel will call its transformProperties() method for each
transmission from the registed output port.
<p>
When transformProperties() is called, this actor sets the value
of three variables and then performs a complete execution of the
contained model. The three variables are <i>senderLocation</i>
(an array of doubles), <i>receiverLocation</i> (also an array of
doubles), and <i>properties</i> (a record token containing the
transmit properties to be modified). After execution of the contained
model, the (possibly modified) value of the record <i>properties</i>
is taken to be the modified properties. Thus, a contained model would
normally read the variable <i>properties</i>, change it, and use
a SetVariable actor to set the new value of <i>properties</i>.
<p>
This actor expects its output port to be connected directly
to the inside of a WirelessIOPort belonging to this actor's container.
It looks for this port in the preinitialize() method, and registers
with the channel specified by that port. If there is no such port,
or no such channel, then preinitialize() throws an exception.
Note that since this connectivity is checked only during preinitialize(),
this actor does not support dynamically reconnecting its output port
during execution of the model.
Author(s): Yang Zhao, Edward Lee
Version:$Id: TransmitPropertyTransformer.doc.html,v 1.1 2006/02/22 18:42:26 mangal Exp $
Pt.Proposed Rating:Yellow (eal)
Pt.Accepted Rating:Red (pjb2e)
input
Port that receives the data to be transmitted on the <i>output</i>
port. The type is unconstrained.
output
Port that sends data to a wireless output. The type is constrained
to be the same as the input.
senderLocation
The location of the sender. This is a double array with default
value {0.0, 0.0}.
receiverLocation
The location of the receiver. This is a double array with default
value {0.0, 0.0}.
properties
The properties to be transformed. This is a
record token with value {power = 0.0, range = 0.0}.