foundOne = true;
Entity container = (Entity) (port.getContainer());
String channelName = ((WirelessIOPort) port).outsideChannel
.stringValue();
CompositeEntity container2 = (CompositeEntity) container
.getContainer();
if (container2 == null) {
throw new IllegalActionException(this,
"The port's container does not have a container.");
}
Entity channel = container2.getEntity(channelName);
if (channel instanceof WirelessChannel) {
// Cache it here, so no need to do it again in wrapup().
_outputWirelessChannel = (WirelessChannel) channel;
_wirelessOutputPort = (WirelessIOPort) port;
((WirelessChannel) channel).registerPropertyTransformer(
this, (WirelessIOPort) port);
} else {
throw new IllegalActionException(this,
"The connected output port does not refer to a "
+ "valid channel.");
}
}
}
//register this property transformer for the connected wireless
//input port. It assumes there is only one.
Iterator connectedInputPorts = input.sourcePortList().iterator();
while (connectedInputPorts.hasNext()) {
//register this property transformer for the connected wireless
//output port. It assumes there is only one.
IOPort port = (IOPort) connectedInputPorts.next();
if (port.isInput() && port instanceof WirelessIOPort) {
// Found the port.
foundOne = true;
Entity container = (Entity) (port.getContainer());
String channelName = ((WirelessIOPort) port).outsideChannel
.stringValue();
CompositeEntity container2 = (CompositeEntity) container
.getContainer();
if (container2 == null) {
throw new IllegalActionException(this,
"The port's container does not have a container.");
}
Entity channel = container2.getEntity(channelName);
if (channel instanceof WirelessChannel) {
// Cache it here, so no need to do it again in wrapup().
_inputWirelessChannel = (WirelessChannel) channel;
_wirelessInputPort = (WirelessIOPort) port;