Package se.sics.cooja.interfaces

Examples of se.sics.cooja.interfaces.MoteID


    FontMetrics fm = g.getFontMetrics();

    /* Paint ID inside each mote */
    Mote[] allMotes = simulation.getMotes();
    for (Mote mote: allMotes) {
      MoteID id = mote.getInterfaces().getMoteID();
      if (id == null) {
        continue;
      }

      Position pos = mote.getInterfaces().getPosition();
      Point pixel = visualizer.transformPositionToPixel(pos);

      String msg = "" + id.getMoteID();
      int msgWidth = fm.stringWidth(msg);
      g.drawString(msg, pixel.x - msgWidth/2, pixel.y + 5);
    }
  }
View Full Code Here


      // Could not select
    }
  }

  private String getMoteID(Mote mote) {
    MoteID moteID = mote.getInterfaces().getMoteID();
    if (moteID != null) {
      return Integer.toString(moteID.getMoteID());
    }
    return mote.toString();
  }
View Full Code Here

            if (existing >= nextMoteID) {
              nextMoteID = existing + 1;
            }
          }
          for (Mote m: newMotes) {
            MoteID moteID = m.getInterfaces().getMoteID();
            if (moteID != null) {
              moteID.setMoteID(nextMoteID++);
            } else {
              logger.warn("Can't set mote ID (no mote ID interface): " + m);
            }
          }
View Full Code Here

TOP

Related Classes of se.sics.cooja.interfaces.MoteID

Copyright © 2018 www.massapicom. 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.