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));
}
}