Actuallu use pop_accumulate_durations.

This commit is contained in:
Gerhard Hoffmann 2024-08-13 14:59:11 +02:00
parent 82ca274c45
commit 8b65bb3e2c

View File

@ -519,11 +519,28 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
uint32_t const durationUnit = cfg->Duration.find(durationId)->second.pun_duration;
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) {
duration_previous = durationUnit;
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") ZZZZZZ duration_previous" << duration_previous;
if (pop_accumulate_durations) {
duration_previous += durationUnit;
} else {
duration_previous = durationUnit;
}
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 {
found = true;
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") WWWWWW duration_previous" << duration_previous;