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
|
@ -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() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue