bool TheveninMethod::isComlete(bool isEndVout, AnalogInputs::ValueType value) { // SerialLog::printString("TM::isComlete "); SerialLog::printUInt(isEndVout); SerialLog::printD(); SerialLog::printUInt(value); SerialLog::printD(); SerialLog::printUInt(minValue_); SerialLog::printD(); SerialLog::printUInt(getMinValueB()); // SerialLog::printNL(); if(balance_) { //if(value > max(minBalanceValue_, minValue_)) if(value > max(IBALANCE, minValue_)) Balancer::done_ = false; // if(Ifalling_ != LastRthMesurment) //ign bstatus_ = Balancer::doStrategy(); } if(bstatus_ != Strategy::COMPLETE) return false; // isEndVout |= (Ifalling_ == Falling) && value < minValue_; // if (value < minValue_) isEndVout = true; //ign if(value <= getMinValueB() && isEndVout) { if(fullCount_++ >= 10) { return true; } } else { fullCount_ = 0; } return false; }
AnalogInputs::ValueType TheveninMethod::normalizeI(AnalogInputs::ValueType value, AnalogInputs::ValueType oldValue) { valueTh_ = value; if(value > maxValue_) { value = maxValue_; } if(value < getMinValueB()) { value = getMinValueB(); } if(oldValue != value) { if(Ifalling_ != Falling || value < oldValue || (oldValue <= minValue_ && lastBallancingEnded_ != Balancer::balancingEnded_)) { lastBallancingEnded_ = Balancer::balancingEnded_; return value; } } return oldValue; }
bool TheveninMethod::isComlete(bool isEndVout, AnalogInputs::ValueType value) { if(balance_) { if(value > max(minBalanceValue_, minValue_)) Balancer::done_ = false; if(Ifalling_ != LastRthMesurment) bstatus_ = Balancer::doStrategy(); } if(bstatus_ != Strategy::COMPLETE) return false; isEndVout |= (Ifalling_ == Falling) && value < minValue_; if(value <= getMinValueB() && isEndVout) { if(fullCount_++ >= 10) { return true; } } else { fullCount_ = 0; } return false; }