Examples of Mote


Examples of se.sics.cooja.Mote

        if (!(obj instanceof Mote)) {
          return;
        }

        final Timer timer = new Timer(100, null);
        final Mote mote = (Mote) obj;
        timer.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            /* Count down */
            if (timer.getDelay() < 90) {
              timer.stop();
View Full Code Here

Examples of se.sics.cooja.Mote

      keepMoteOnlyItem.setText("Remove all motes from timeline but");
      popupMenu.add(keepMoteOnlyItem);

      addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent e) {
          Mote m = getMote(e.getPoint());
          if (m == null) {
            return;
          }
          simulation.getGUI().signalMoteHighlight(m);
View Full Code Here

Examples of se.sics.cooja.Mote

      }
    }

    public String getToolTipText(MouseEvent event) {
      Point p = event.getPoint();
      Mote m = getMote(p);
      if (m == null)
        return null;

      return "<html>" + m + "<br>Click mote for options</html>";
    }
View Full Code Here

Examples of se.sics.cooja.Mote

    visualizer.unregisterSimulationMenuAction(RangeMenuAction.class);
    visualizer.unregisterSimulationMenuAction(SuccessRatioMenuAction.class);
  }

  public Color[] getColorOf(Mote mote) {
    Mote selectedMote = visualizer.getSelectedMote();
    if (mote == selectedMote) {
      return new Color[] { Color.CYAN };
    }
    return null;
  }
View Full Code Here

Examples of se.sics.cooja.Mote

    }
    return null;
  }

  public void paintBeforeMotes(Graphics g) {
    Mote selectedMote = visualizer.getSelectedMote();
    if (simulation == null
        || selectedMote == null
        || selectedMote.getInterfaces().getRadio() == null) {
      return;
    }

    /* Paint transmission and interference range for selected mote */
    Position motePos = selectedMote.getInterfaces().getPosition();

    Point pixelCoord = visualizer.transformPositionToPixel(motePos);
    int x = pixelCoord.x;
    int y = pixelCoord.y;

    // Fetch current output power indicator (scale with as percent)
    Radio selectedRadio = selectedMote.getInterfaces().getRadio();
    double moteInterferenceRange =
      radioMedium.INTERFERENCE_RANGE
      * ((double) selectedRadio.getCurrentOutputPowerIndicator()
          / (double) selectedRadio.getOutputPowerIndicatorMax());
    double moteTransmissionRange =
View Full Code Here

Examples of se.sics.cooja.Mote

      l = l.trim();
      if (l.startsWith("#")) {
        continue;
      }

      Mote m;
      String[] arr = l.split(" ");
      int source = Integer.parseInt(arr[INDEX_SRC]);
      m = simulation.getMoteWithID(source);
      if (m == null) {
        throw new RuntimeException("No simulation mote with ID " + source);
      }
      Radio sourceRadio = m.getInterfaces().getRadio();
      int dst = Integer.parseInt(arr[INDEX_DST]);
      m = simulation.getMoteWithID(dst);
      if (m == null) {
        throw new RuntimeException("No simulation mote with ID " + dst);
      }
      DGRMDestinationRadio destRadio = new DGRMDestinationRadio(m.getInterfaces().getRadio());
      double prr = Double.parseDouble(arr[INDEX_PRR]);
      /*double prrConfidence = Double.parseDouble(arr[INDEX_PRR_CI]);*/
      /*int numTX <- INDEX_NUM_TX;*/
      /*int numRX <- INDEX_NUM_RX;*/
      double rssi = Double.parseDouble(arr[INDEX_RSSI_MEDIAN]);
View Full Code Here

Examples of se.sics.cooja.Mote

      return;
    }
  }

  public Color[] getColorOf(Mote mote) {
    Mote selectedMote = visualizer.getSelectedMote();
    if (mote == selectedMote) {
      return new Color[] { Color.CYAN };
    }
    return null;
  }
View Full Code Here

Examples of se.sics.cooja.Mote

    }
    return null;
  }

  public void paintBeforeMotes(Graphics g) {
          Mote selectedMote = visualizer.getSelectedMote();
    if (simulation == null
        || selectedMote == null
        || selectedMote.getInterfaces().getRadio() == null) {
      return;
    }

    /* Paint transmission and interference range for selected mote */
    Position motePos = selectedMote.getInterfaces().getPosition();

    Point pixelCoord = visualizer.transformPositionToPixel(motePos);
    int x = pixelCoord.x;
    int y = pixelCoord.y;
    Radio selectedRadio = selectedMote.getInterfaces().getRadio();

    FontMetrics fm = g.getFontMetrics();
    g.setColor(Color.BLACK);

    DirectedGraphMedium radioMedium = (DirectedGraphMedium) simulation.getRadioMedium();
View Full Code Here

Examples of se.sics.cooja.Mote

    // Create new motes
          newMotes = new Vector<Mote>();
          int motesToAdd = ((Number) numberOfMotesField.getValue()).intValue();
          while (newMotes.size() < motesToAdd) {
            Mote newMote = moteType.generateMote(simulation);
            newMotes.add(newMote);
          }

          // Position new motes
          Class<? extends Positioner> positionerClass = null;
View Full Code Here

Examples of se.sics.cooja.Mote

    }
    String state = args[2];

    /* Locate destination mote */
    /* TODO Use Rime address interface instead of mote ID? */
    Mote destinationMote = mote.getSimulation().getMoteWithID(destID);
    if (destinationMote == null) {
      logger.warn("No destination mote with ID: " + destID);
      return;
    }
    if (destinationMote == mote) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.