1

i want to turn off movement and interface of a node, and here i using activeTime=0,1800,25000,42300 settings, the movement inactive but the interface is active. what should i do? is there something missing in the settings section? or how? can you give me some clue?

here the code

public boolean isActive() {
    boolean active;

    if (ah == null) {
        return true; /* no handler: always active */
    }

    active = ah.isActive(this.activenessJitterValue);

    if (active && host.getComBus().getDouble(EnergyModel.ENERGY_VALUE_ID,
                1) <= 0) {
        /* TODO: better way to check battery level */
        /* no battery -> inactive */
        active = false;
    }

    if (active == false && this.transmitRange > 0) {
        /* not active -> make range 0 */
        this.oldTransmitRange = this.transmitRange;
        host.getComBus().updateProperty(RANGE_ID, 0.0);
                    System.out.println("tuyul");
    } else if (active == true && this.transmitRange == 0.0) {
        /* active, but range == 0 -> restore range  */
        host.getComBus().updateProperty(RANGE_ID, 
                this.oldTransmitRange);
    }   
    return active;
}

the problem is "active" always considered to True and never false

4

0 回答 0