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() {
}
/**
* 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);
currentRadioMedium.registerMote(mote, Simulation.this);
/* Notify mote interfaces that node was added */
for (MoteInterface i: mote.getInterfaces().getInterfaces()) {
i.added();
}
setChanged();
notifyObservers(mote);
}