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:
parent
bef1a013f1
commit
86a6d296fe
|
@ -148,4 +148,10 @@ 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() {
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue