outputRange.setTypeEquals(BaseType.DOUBLE);
output.outsideTransmitProperties.setExpression("{range = outputRange}");
// Hide the ports in Vergil.
SingletonParameter hide = new SingletonParameter(output, "_hide");
hide.setToken(BooleanToken.TRUE);
hide = new SingletonParameter(input, "_hide");
hide.setToken(BooleanToken.TRUE);
// Create an icon for this sensor node.
EditorIcon node_icon = new EditorIcon(this, "_icon");
// The icon has two parts: a circle and an antenna.
// Create a circle that indicates the signal radius.
_circle = new EllipseAttribute(node_icon, "_circle");
_circle.centered.setToken("true");
_circle.width.setToken("outputRange*2");
_circle.height.setToken("outputRange*2");
_circle.fillColor.setToken("{0.0, 0.0, 1.0, 0.08}");
_circle.lineColor.setToken("{0.0, 0.5, 0.5, 1.0}");
// Create the green antenna shape.
ResizablePolygonAttribute antenna = new ResizablePolygonAttribute(
node_icon, "antenna2");
antenna.vertices.setToken("{0, -5, -5, -15, 5, -15, 0, -5, 0, 15}");
antenna.width.setToken("10");
antenna.height.setToken("30");
// Set the color to green.
antenna.fillColor.setToken("{0.0, 1.0, 0.0, 1.0}");
node_icon.setPersistent(false);
// Hide the name of this sensor node.
hide = new SingletonParameter(this, "_hideName");
hide.setToken(BooleanToken.TRUE);
hide.setVisibility(Settable.EXPERT);
}