[cooja] skins/TrafficVisualizerSkin: Indicate sent but unreceived messages by a red double circle around mote

This commit is contained in:
Enrico Joerns 2014-06-11 00:29:26 +02:00
parent 0e78bc67f9
commit c92f83c048

View File

@ -200,6 +200,13 @@ public class TrafficVisualizerSkin implements VisualizerSkin {
g.setColor(new Color(colorHistoryIndex, colorHistoryIndex, 1.0f));
Radio source = connArrow.getConnection().getSource();
Point sourcePoint = visualizer.transformPositionToPixel(source.getPosition());
/* If there is no destination, paint red circles to indicate untransmitted message */
if (connArrow.getConnection().getDestinations().length == 0) {
g.setColor(new Color(1.0f, colorHistoryIndex, colorHistoryIndex));
g.drawOval(sourcePoint.x - 20, sourcePoint.y - 20, 40, 40);
g.drawOval(sourcePoint.x - 30, sourcePoint.y - 30, 60, 60);
continue;
}
for (Radio destRadio : connArrow.getConnection().getDestinations()) {
Position destPos = destRadio.getPosition();
Point destPoint = visualizer.transformPositionToPixel(destPos);