Package org.contikios.cooja

Examples of org.contikios.cooja.WatchpointMote


  }

  public void actionPerformed(ActionEvent e) {
    JMenuItem menuItem = (JMenuItem) e.getSource();
    Action action = menuItem.getAction();
    WatchpointMote watchpointMote = (WatchpointMote) action.getValue("WatchpointMote");
    if (watchpointMote == null) {
      logger.warn("Error: No source, cannot configure breakpoint");
      return;
    }

    File file = (File) action.getValue("WatchpointFile");
    Integer line = (Integer) action.getValue("WatchpointLine");
    Integer address = (Integer) action.getValue("WatchpointAddress");
    if (file == null || line == null || address == null) {
      logger.warn("Error: Bad breakpoint info, cannot remove breakpoint");
      return;
    }
    for (Watchpoint w: watchpointMote.getBreakpoints()) {
      if (file.equals(w.getCodeFile()) && line.equals(w.getLineNumber()) && address.equals(w.getExecutableAddress())) {
        watchpointMote.removeBreakpoint(w);
      }
    }

  }
View Full Code Here


  }
 
  public void actionPerformed(ActionEvent e) {
    JMenuItem menuItem = (JMenuItem) e.getSource();
    Action action = menuItem.getAction();
    WatchpointMote watchpointMote = (WatchpointMote) action.getValue("WatchpointMote");
    if (watchpointMote == null) {
      logger.warn("Error: No source, cannot configure breakpoint");
      return;
    }

    File file = (File) action.getValue("WatchpointFile");
    Integer line = (Integer) action.getValue("WatchpointLine");
    Integer address = (Integer) action.getValue("WatchpointAddress");
    if (file == null || line == null || address == null) {
      logger.warn("Error: Bad breakpoint info, cannot add breakpoint");
      return;
    }

    watchpointMote.addBreakpoint(file, line, address);
  }
View Full Code Here

      activeMoteObservers.add(new MoteObservation(mote, moteRadio, observer));
    }

    /* Watchpoints */
    if (mote instanceof WatchpointMote) {
      final WatchpointMote watchpointMote = ((WatchpointMote)mote);
      WatchpointListener listener = new WatchpointListener() {
        public void watchpointTriggered(Watchpoint watchpoint) {
          WatchpointEvent ev = new WatchpointEvent(simulation.getSimulationTime(), watchpoint);

          if (executionDetails && mote instanceof AbstractEmulatedMote) {
            String details = ((AbstractEmulatedMote) mote).getExecutionDetails();
            if (details != null) {
              details = "<br>" + details.replace("\n", "<br>");
              ev.details = details;
            }
          }

          moteEvents.addWatchpoint(ev);
        }
        public void watchpointsChanged() {
        }
      };

      watchpointMote.addWatchpointListener(listener);
      activeMoteObservers.add(new MoteObservation(mote, watchpointMote, listener));
    }

  }
View Full Code Here

TOP

Related Classes of org.contikios.cooja.WatchpointMote

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.