Package se.sics.cooja.interfaces

Examples of se.sics.cooja.interfaces.Log


      public void update(Observable obs, Object obj) {
        if (logTextArea == null)
          return;

        Mote mote = (Mote) obj;
        Log moteLogInterface = (Log) obs;
        String outputString = "TIME:" + simulation.getSimulationTime() + "\t";
        if (mote != null && mote.getInterfaces().getMoteID() != null) {
          outputString = outputString.concat("ID:" + mote.getInterfaces().getMoteID().getMoteID() + "\t");
        }
        // Match against filter (if any)
        if (filterText != null && !filterText.equals("") &&
            !moteLogInterface.getLastLogMessages().contains(filterText))
          return;
       
        outputString = outputString.concat(moteLogInterface.getLastLogMessages());

       
        final String str = outputString;
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
View Full Code Here


  }

  public void setInactive() {
    simulation.deleteObserver(simObserver);
    for (Mote mote: simulation.getMotes()) {
      Log log = mote.getInterfaces().getLog();
      if (log != null) {
        log.deleteObserver(logObserver);
      }
    }
  }
View Full Code Here

    FontMetrics fm = g.getFontMetrics();

    /* Paint last output below motes */
    Mote[] allMotes = simulation.getMotes();
    for (Mote mote: allMotes) {
      Log log = mote.getInterfaces().getLog();
      if (log == null) {
        continue;
      }
      String msg = log.getLastLogMessage();
      if (msg == null) {
        continue;
      }

      Position pos = mote.getInterfaces().getPosition();
View Full Code Here

        if (logTextArea == null) {
          return;
        }

        Mote mote = (Mote) obj;
        Log moteLogInterface = (Log) obs;
        String lastMessage = moteLogInterface.getLastLogMessage();
        if (lastMessage.length() > 0 && lastMessage.charAt(lastMessage.length() - 1) == '\n') {
          lastMessage = lastMessage.substring(0, lastMessage.length() - 1);
        }
        String outputString = "TIME:" + simulation.getSimulationTime() + "\t";
        if (mote != null && mote.getInterfaces().getMoteID() != null) {
View Full Code Here

  }

  private void addMoteObservers(Mote mote, final MoteEvents moteEvents) {
    final LED moteLEDs = mote.getInterfaces().getLED();
    final Radio moteRadio = mote.getInterfaces().getRadio();
    final Log moteLog = mote.getInterfaces().getLog();
    /* TODO Watchpoints? */

    /* LEDs */
    if (moteLEDs != null) {
      LEDEvent startupEv = new LEDEvent(
View Full Code Here

      String msg = null;
      for (MoteInterface mi: mote.getInterfaces().getInterfaces()) {
        if (!(mi instanceof Log)) {
          continue;
        }
        Log log = (Log) mi;
        if (log.getLastLogMessage() == null) {
          continue;
        }
        msg = log.getLastLogMessage();
      }
      if (msg == null) {
        continue;
      }
View Full Code Here

TOP

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

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.