added mote interface method to be called when add mote interfaces have been added. useful if the mote interfaces want to observe each

other
This commit is contained in:
Fredrik Osterlind 2012-03-06 14:33:14 +01:00
parent bef1a013f1
commit 86a6d296fe
2 changed files with 12 additions and 0 deletions

View file

@ -147,5 +147,11 @@ public abstract class MoteInterface extends Observable {
*/ */
public void removed() { public void removed() {
} }
/**
* Called when all mote interfaces have been added to mote.
*/
public void added() {
}
} }

View file

@ -790,6 +790,12 @@ public class Simulation extends Observable implements Runnable {
motes.add(mote); motes.add(mote);
currentRadioMedium.registerMote(mote, Simulation.this); currentRadioMedium.registerMote(mote, Simulation.this);
/* Notify mote interfaces that node was added */
for (MoteInterface i: mote.getInterfaces().getInterfaces()) {
i.added();
}
setChanged(); setChanged();
notifyObservers(mote); notifyObservers(mote);
} }