Actuallu use pop_accumulate_durations.
This commit is contained in:
parent
82ca274c45
commit
8b65bb3e2c
@ -519,11 +519,28 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
|
|||||||
uint32_t const durationUnit = cfg->Duration.find(durationId)->second.pun_duration;
|
uint32_t const durationUnit = cfg->Duration.find(durationId)->second.pun_duration;
|
||||||
|
|
||||||
new_price += pra_price;
|
new_price += pra_price;
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") XXXXXX price:" << price;
|
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") YYYYYY new_price:" << new_price;
|
#if DEBUG_GET_DURATION_FROM_COST==1
|
||||||
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") pra_price:" << pra_price;
|
||||||
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") price:" << price;
|
||||||
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") cost:" << cost;
|
||||||
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") new_price:" << new_price;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (new_price <= cost) {
|
if (new_price <= cost) {
|
||||||
|
if (pop_accumulate_durations) {
|
||||||
|
duration_previous += durationUnit;
|
||||||
|
} else {
|
||||||
duration_previous = durationUnit;
|
duration_previous = durationUnit;
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") ZZZZZZ duration_previous" << duration_previous;
|
}
|
||||||
|
durationInSecs = duration_previous * 60;
|
||||||
|
|
||||||
|
#if DEBUG_GET_DURATION_FROM_COST==1
|
||||||
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") durationUnit" << durationUnit;
|
||||||
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") duration_previous" << duration_previous;
|
||||||
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") durationInSecs" << durationInSecs;
|
||||||
|
#endif
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
found = true;
|
found = true;
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") WWWWWW duration_previous" << duration_previous;
|
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") WWWWWW duration_previous" << duration_previous;
|
||||||
|
Loading…
Reference in New Issue
Block a user