Ejemplo n.º 1
0
Strategy::statusType Balancer::doStrategy()
{
    if(balance == 0) {
            startBalacing();
    } else {
        trySaveVon();
        if(getBalanceTime() > maxBalanceTime) {
            setBalance(0);
        }
    }
    if((!isWorking()) && done)
        return Strategy::COMPLETE;
    return Strategy::RUNNING;
}
Ejemplo n.º 2
0
Strategy::statusType Balancer::doStrategy()
{
    LogDebug("minCell=", minCell, " balance=", balance, " conCells=", connectedCells);
    if(balance == 0) {
            startBalacing();
    } else {
        trySaveVon();
        if(getBalanceTime() > maxBalanceTime) {
            setBalance(0);
        }
    }
    if((!isWorking()) && done)
        return Strategy::COMPLETE;
    return Strategy::RUNNING;
}
Ejemplo n.º 3
0
Strategy::statusType Balancer::doStrategy()
{
    if(done_)
        return COMPLETE;
    if(isStable()) {
        if(balance_ == 0) {
            startBalacing();
        } else {
            trySaveVon();
            uint8_t balance = calculateBalance();
            if((balance_ & (~balance)) || getBalanceTime() > maxBalanceTime) {
                setBalance(0);
            }
        }
    }
    return RUNNING;
}