handling radio when nodes die

This commit is contained in:
fros4943 2007-07-13 09:08:24 +00:00
parent 81185f2e84
commit cc865f18bb
2 changed files with 9 additions and 2 deletions

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: ContikiMote.java,v 1.5 2007/05/19 16:56:55 fros4943 Exp $
* $Id: ContikiMote.java,v 1.6 2007/07/13 09:08:24 fros4943 Exp $
*/
package se.sics.cooja.contikimote;
@ -116,6 +116,10 @@ public class ContikiMote implements Mote {
myState = newState;
stateObservable.stateChanged();
}
if (myState == State.DEAD) {
mySim.getRadioMedium().unregisterMote(this, mySim);
}
}
public State getState() {

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: UDGM.java,v 1.5 2007/07/10 12:43:24 fros4943 Exp $
* $Id: UDGM.java,v 1.6 2007/07/13 09:08:25 fros4943 Exp $
*/
package se.sics.cooja.radiomediums;
@ -245,6 +245,9 @@ public class UDGM extends AbstractRadioMedium {
if (moteRadio == null)
return new Color[] { Color.GRAY };
if (mote.getState() == Mote.State.DEAD)
return new Color[] { Color.GRAY };
if (selectedMote != null && mote == selectedMote)
return new Color[] { Color.CYAN };