节点周围的双红色圆圈的含义是什么?

时间:2019-05-07 16:29:18

标签: contiki cooja

enter image description here我正在模拟一个简单的rpl-udp场景。在仿真过程中的无线电环境中,这些围绕节点的双红色圆圈出现了吗?它到底显示了什么?

1 个答案:

答案 0 :(得分:1)

在contiki / tools / cooja / java / org / contikios / cooja / plugins / skins / TrafficVisualizerSkin.java文件中找到了答案。

/ *如果没有目的地,请用红色圆圈表示未发送的消息* /  在TrafficVisualizerSkin.java中提到。

public void paintBeforeMotes(Graphics g) {
    synchronized (historyList) {
      for (RadioConnectionArrow connArrow : historyList) {
        float colorHistoryIndex = 1.0f - connArrow.getAge();
        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(UNTRANSMITTED_COLOR_RGB[0], UNTRANSMITTED_COLOR_RGB[1], UNTRANSMITTED_COLOR_RGB[2], colorHistoryIndex));
          g.drawOval(sourcePoint.x - 20, sourcePoint.y - 20, 40, 40);
          g.drawOval(sourcePoint.x - 30, sourcePoint.y - 30, 60, 60);
          continue;
        }
        g.setColor(new Color(TRANSMITTED_COLOR_RGB[0], TRANSMITTED_COLOR_RGB[1], TRANSMITTED_COLOR_RGB[2], colorHistoryIndex));
        for (Radio destRadio : connArrow.getConnection().getDestinations()) {
          Position destPos = destRadio.getPosition();
          Point destPoint = visualizer.transformPositionToPixel(destPos);
          drawArrow(g, sourcePoint.x, sourcePoint.y, destPoint.x, destPoint.y, 8);
        }
      }
    }
  }