GetDurationFromCost():
Minor: changed some debug output.
This commit is contained in:
parent
e6b5bc0f4d
commit
397e0f9061
@ -344,8 +344,6 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
|
|||||||
#if DEBUG_GET_DURATION_FROM_COST==1
|
#if DEBUG_GET_DURATION_FROM_COST==1
|
||||||
qCritical() << DBG_HEADER << "(ADAPTED) INPUT-DATE" << inputDate.toString(Qt::ISODate);
|
qCritical() << DBG_HEADER << "(ADAPTED) INPUT-DATE" << inputDate.toString(Qt::ISODate);
|
||||||
#endif
|
#endif
|
||||||
//qCritical() << __func__ << __LINE__;
|
|
||||||
|
|
||||||
// inputDate is now located in a valid operational-working-range
|
// inputDate is now located in a valid operational-working-range
|
||||||
// find this working-time-range
|
// find this working-time-range
|
||||||
int pwd_period_day_in_week_id = inputDate.date().dayOfWeek();
|
int pwd_period_day_in_week_id = inputDate.date().dayOfWeek();
|
||||||
@ -359,8 +357,6 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
//qCritical() << __func__ << __LINE__;
|
|
||||||
|
|
||||||
QTime current_working_time_from;
|
QTime current_working_time_from;
|
||||||
QTime current_working_time_to;
|
QTime current_working_time_to;
|
||||||
|
|
||||||
@ -1018,12 +1014,14 @@ uint32_t Calculator::GetCostFromDuration(Configuration * cfg,
|
|||||||
int paymentOptionIndex) const {
|
int paymentOptionIndex) const {
|
||||||
static const PaymentMethod paymentMethodId = Utilities::getPaymentMethodId(cfg);
|
static const PaymentMethod paymentMethodId = Utilities::getPaymentMethodId(cfg);
|
||||||
|
|
||||||
//qCritical() << __func__ << __LINE__ << "paymentOptionIndex" << paymentOptionIndex;
|
// qCritical() << __func__ << __LINE__ << "paymentOptionIndex" << paymentOptionIndex;
|
||||||
|
|
||||||
if (paymentMethodId == PaymentMethod::Steps ||
|
if (paymentMethodId == PaymentMethod::Steps ||
|
||||||
paymentMethodId == PaymentMethod::Degressive) {
|
paymentMethodId == PaymentMethod::Degressive) {
|
||||||
int const timeStepInMinutes = start.secsTo(end) / 60;
|
int const timeStepInMinutes = start.secsTo(end) / 60;
|
||||||
QList<int> tlist = Calculator::GetInstance().GetTimeSteps(cfg, paymentOptionIndex, start);
|
QList<int> 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 << "timeStepList" << timeStepInMinutes << tlist;
|
||||||
qCritical() << DBG_HEADER << "timeStepInMinutes" << timeStepInMinutes << start.toString(Qt::ISODate);
|
qCritical() << DBG_HEADER << "timeStepInMinutes" << timeStepInMinutes << start.toString(Qt::ISODate);
|
||||||
|
|
||||||
@ -2532,10 +2530,10 @@ QList<int> &Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { // if (carryOverTimeRangeFrom == QTime(0, 0, 0)) {
|
} 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 from:" << carryOverTimeRangeFrom.toString(Qt::ISODate);
|
||||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ") carry over time range to:" << carryOverTimeRangeTo.toString(Qt::ISODate);
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") carry over time range to:" << carryOverTimeRangeTo.toString(Qt::ISODate);
|
||||||
//}
|
}
|
||||||
|
|
||||||
m_timeSteps[paymentOptionIndex].clear();
|
m_timeSteps[paymentOptionIndex].clear();
|
||||||
|
|
||||||
@ -2559,7 +2557,7 @@ QList<int> &Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex,
|
|||||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ") interpolation end:" << interpolationEnd.toString(Qt::ISODate);
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") interpolation end:" << interpolationEnd.toString(Qt::ISODate);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ") TODO";
|
// qCritical() << "(" << __func__ << ":" << __LINE__ << ") TODO";
|
||||||
}
|
}
|
||||||
|
|
||||||
// int const start_time = start.time().hour() * 60 + start.time().minute();
|
// int const start_time = start.time().hour() * 60 + start.time().minute();
|
||||||
@ -2587,7 +2585,7 @@ QList<int> &Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex,
|
|||||||
for (auto[itr, rangeEnd] = cfg->PaymentRate.equal_range(pop_id); itr != rangeEnd; ++itr) {
|
for (auto[itr, rangeEnd] = cfg->PaymentRate.equal_range(pop_id); itr != rangeEnd; ++itr) {
|
||||||
int const durationId = itr->second.pra_payment_unit_id;
|
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;
|
// int const price = itr->second.pra_price;
|
||||||
|
|
||||||
auto search = cfg->Duration.find(durationId);
|
auto search = cfg->Duration.find(durationId);
|
||||||
@ -2611,7 +2609,8 @@ QList<int> &Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex,
|
|||||||
ATBInterpolation interpolation = ipolCheck.value();
|
ATBInterpolation interpolation = ipolCheck.value();
|
||||||
|
|
||||||
if (duration.pun_interpolation_id == (int)ATBInterpolation::DYNAMIC_ABSTRACT_TIMEPOINT_AND_STATIC_PRICE) {
|
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 = start.time();
|
||||||
interpolation.dynamic_start.setHMS(start.time().hour(), start.time().minute(), 0);
|
interpolation.dynamic_start.setHMS(start.time().hour(), start.time().minute(), 0);
|
||||||
@ -2666,6 +2665,7 @@ QList<int> &Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex,
|
|||||||
if (duration.pun_interpolation_id == (int)ATBInterpolation::NO_INTERPOLATION) {
|
if (duration.pun_interpolation_id == (int)ATBInterpolation::NO_INTERPOLATION) {
|
||||||
|
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun_id:" << duration.pun_id;
|
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun_id:" << duration.pun_id;
|
||||||
|
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") paymentOptionIndex:" << paymentOptionIndex;
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun duration:" << duration.pun_duration;
|
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun duration:" << duration.pun_duration;
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") next time step:" << nextTimeStep.toString(Qt::ISODate);
|
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") next time step:" << nextTimeStep.toString(Qt::ISODate);
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") runtime in minutes (2):" << runtimeInMinutes;
|
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") runtime in minutes (2):" << runtimeInMinutes;
|
||||||
@ -2678,6 +2678,7 @@ QList<int> &Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex,
|
|||||||
m_timeSteps[paymentOptionIndex] << duration.pun_duration;
|
m_timeSteps[paymentOptionIndex] << duration.pun_duration;
|
||||||
search->second = duration;
|
search->second = duration;
|
||||||
cfg->getPaymentOptions(paymentOptionIndex).pop_min_time = runtimeInMinutes;
|
cfg->getPaymentOptions(paymentOptionIndex).pop_min_time = runtimeInMinutes;
|
||||||
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") pop_min_time" << cfg->getPaymentOptions(paymentOptionIndex).pop_min_time;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2754,7 +2755,6 @@ QList<int> &Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex,
|
|||||||
m_timeSteps[paymentOptionIndex] << duration.pun_duration;
|
m_timeSteps[paymentOptionIndex] << duration.pun_duration;
|
||||||
search->second = duration;
|
search->second = duration;
|
||||||
} else {
|
} else {
|
||||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ") HIER NICHT";
|
|
||||||
cfg->Duration.erase(search);
|
cfg->Duration.erase(search);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2788,7 +2788,7 @@ QList<int> &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) {
|
if (DBG_LEVEL >= DBG_DEBUG) {
|
||||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ") NEW timeSteps:" << m_timeSteps;
|
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;
|
uint32_t price = 0;
|
||||||
int pun_duration = 0;
|
int pun_duration = 0;
|
||||||
|
|
||||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ") paymentOptionIndex" << paymentOptionIndex;
|
if (DBG_LEVEL >= DBG_DEBUG) {
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") timeStep" << timeStep;
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") paymentOptionIndex" << paymentOptionIndex;
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") pop_id" << pop_id;
|
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)
|
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) {
|
if (DBG_LEVEL >= DBG_DEBUG) {
|
||||||
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ")";
|
||||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ") price" << price;
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") price" << price;
|
||||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun_id" << pun_id;
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun_id" << pun_id;
|
||||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun_unit_id" << payment_unit_id;
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun_unit_id" << payment_unit_id;
|
||||||
|
Loading…
Reference in New Issue
Block a user