diff --git a/library/src/calculator_functions.cpp b/library/src/calculator_functions.cpp index afe43fa..5a679ee 100644 --- a/library/src/calculator_functions.cpp +++ b/library/src/calculator_functions.cpp @@ -344,8 +344,6 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg, #if DEBUG_GET_DURATION_FROM_COST==1 qCritical() << DBG_HEADER << "(ADAPTED) INPUT-DATE" << inputDate.toString(Qt::ISODate); #endif - //qCritical() << __func__ << __LINE__; - // inputDate is now located in a valid operational-working-range // find this working-time-range int pwd_period_day_in_week_id = inputDate.date().dayOfWeek(); @@ -359,8 +357,6 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg, return ""; } - //qCritical() << __func__ << __LINE__; - QTime current_working_time_from; QTime current_working_time_to; @@ -1018,12 +1014,14 @@ uint32_t Calculator::GetCostFromDuration(Configuration * cfg, int paymentOptionIndex) const { static const PaymentMethod paymentMethodId = Utilities::getPaymentMethodId(cfg); - //qCritical() << __func__ << __LINE__ << "paymentOptionIndex" << paymentOptionIndex; + // qCritical() << __func__ << __LINE__ << "paymentOptionIndex" << paymentOptionIndex; if (paymentMethodId == PaymentMethod::Steps || paymentMethodId == PaymentMethod::Degressive) { int const timeStepInMinutes = start.secsTo(end) / 60; QList tlist = Calculator::GetInstance().GetTimeSteps(cfg, paymentOptionIndex, start); + qCritical() << DBG_HEADER << " start" << start.toString(Qt::ISODate); + qCritical() << DBG_HEADER << " end" << end.toString(Qt::ISODate); qCritical() << DBG_HEADER << "timeStepList" << timeStepInMinutes << tlist; qCritical() << DBG_HEADER << "timeStepInMinutes" << timeStepInMinutes << start.toString(Qt::ISODate); @@ -2532,10 +2530,10 @@ QList &Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex, } } } else { // if (carryOverTimeRangeFrom == QTime(0, 0, 0)) { - //if (DBG_LEVEL >= DBG_DEBUG) { + if (DBG_LEVEL >= DBG_DEBUG) { qCritical() << "(" << __func__ << ":" << __LINE__ << ") carry over time range from:" << carryOverTimeRangeFrom.toString(Qt::ISODate); qCritical() << "(" << __func__ << ":" << __LINE__ << ") carry over time range to:" << carryOverTimeRangeTo.toString(Qt::ISODate); - //} + } m_timeSteps[paymentOptionIndex].clear(); @@ -2559,7 +2557,7 @@ QList &Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex, qCritical() << "(" << __func__ << ":" << __LINE__ << ") interpolation end:" << interpolationEnd.toString(Qt::ISODate); } } else { - qCritical() << "(" << __func__ << ":" << __LINE__ << ") TODO"; + // qCritical() << "(" << __func__ << ":" << __LINE__ << ") TODO"; } // int const start_time = start.time().hour() * 60 + start.time().minute(); @@ -2587,7 +2585,7 @@ QList &Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex, for (auto[itr, rangeEnd] = cfg->PaymentRate.equal_range(pop_id); itr != rangeEnd; ++itr) { int const durationId = itr->second.pra_payment_unit_id; - //qCritical() << "(" << __func__ << ":" << __LINE__ << ") durationId" << durationId; + // qCritical() << "(" << __func__ << ":" << __LINE__ << ") durationId" << durationId; // int const price = itr->second.pra_price; auto search = cfg->Duration.find(durationId); @@ -2611,7 +2609,8 @@ QList &Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex, ATBInterpolation interpolation = ipolCheck.value(); if (duration.pun_interpolation_id == (int)ATBInterpolation::DYNAMIC_ABSTRACT_TIMEPOINT_AND_STATIC_PRICE) { - qCritical() << "(" << __func__ << ":" << __LINE__ << ") HIER NICHT"; + //qCritical() << "(" << __func__ << ":" << __LINE__ << ") payment option id:" << pop_id; + //qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun_intnerpolation_id:" << duration.pun_interpolation_id; interpolation.dynamic_start = start.time(); interpolation.dynamic_start.setHMS(start.time().hour(), start.time().minute(), 0); @@ -2666,6 +2665,7 @@ QList &Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex, if (duration.pun_interpolation_id == (int)ATBInterpolation::NO_INTERPOLATION) { //qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun_id:" << duration.pun_id; + //qCritical() << "(" << __func__ << ":" << __LINE__ << ") paymentOptionIndex:" << paymentOptionIndex; //qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun duration:" << duration.pun_duration; //qCritical() << "(" << __func__ << ":" << __LINE__ << ") next time step:" << nextTimeStep.toString(Qt::ISODate); //qCritical() << "(" << __func__ << ":" << __LINE__ << ") runtime in minutes (2):" << runtimeInMinutes; @@ -2678,6 +2678,7 @@ QList &Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex, m_timeSteps[paymentOptionIndex] << duration.pun_duration; search->second = duration; cfg->getPaymentOptions(paymentOptionIndex).pop_min_time = runtimeInMinutes; + qCritical() << "(" << __func__ << ":" << __LINE__ << ") pop_min_time" << cfg->getPaymentOptions(paymentOptionIndex).pop_min_time; continue; } } @@ -2754,7 +2755,6 @@ QList &Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex, m_timeSteps[paymentOptionIndex] << duration.pun_duration; search->second = duration; } else { - qCritical() << "(" << __func__ << ":" << __LINE__ << ") HIER NICHT"; cfg->Duration.erase(search); } } @@ -2788,7 +2788,7 @@ QList &Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex, } } - qCritical() << "(" << __func__ << ":" << __LINE__ << ") NEW timeSteps:" << m_timeSteps; + // qCritical() << "(" << __func__ << ":" << __LINE__ << ") NEW timeSteps:" << m_timeSteps; if (DBG_LEVEL >= DBG_DEBUG) { qCritical() << "(" << __func__ << ":" << __LINE__ << ") NEW timeSteps:" << m_timeSteps; @@ -2821,9 +2821,13 @@ uint32_t Calculator::GetPriceForTimeStep(Configuration *cfg, int timeStep, int p uint32_t price = 0; int pun_duration = 0; - qCritical() << "(" << __func__ << ":" << __LINE__ << ") paymentOptionIndex" << paymentOptionIndex; - //qCritical() << "(" << __func__ << ":" << __LINE__ << ") timeStep" << timeStep; - //qCritical() << "(" << __func__ << ":" << __LINE__ << ") pop_id" << pop_id; + if (DBG_LEVEL >= DBG_DEBUG) { + qCritical() << "(" << __func__ << ":" << __LINE__ << ") paymentOptionIndex" << paymentOptionIndex; + qCritical() << "(" << __func__ << ":" << __LINE__ << ") timeStep" << timeStep; + qCritical() << "(" << __func__ << ":" << __LINE__ << ") pop_id" << pop_id; + qCritical() << "(" << __func__ << ":" << __LINE__ << ") pop_accumulate_prices" << pop_accumulate_prices; + qCritical() << "(" << __func__ << ":" << __LINE__ << ") pop_accumulate_durations" << pop_accumulate_durations; + } for (auto[itr, rangeEnd] = cfg->PaymentRate.equal_range(pop_id); itr != rangeEnd; ++itr) { @@ -2848,6 +2852,7 @@ uint32_t Calculator::GetPriceForTimeStep(Configuration *cfg, int timeStep, int p } if (DBG_LEVEL >= DBG_DEBUG) { + qCritical() << "(" << __func__ << ":" << __LINE__ << ")"; qCritical() << "(" << __func__ << ":" << __LINE__ << ") price" << price; qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun_id" << pun_id; qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun_unit_id" << payment_unit_id;