Read pop_accumulate_prices and pop_accumulate_durations.

This commit is contained in:
Gerhard Hoffmann 2024-07-22 15:56:04 +02:00
parent ba8e2786fc
commit 40440e28d3

View File

@ -602,6 +602,10 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
this->currentPaymentOptions.last().pop_prepaid_option_id = k->value.GetInt();
} else if (strcmp(inner_obj_name, "pop_truncate_last_interpolation_step") == 0) {
this->currentPaymentOptions.last().pop_truncate_last_interpolation_step = k->value.GetBool();
} else if (strcmp(inner_obj_name, "pop_accumulate_prices") == 0) {
this->currentPaymentOptions.last().pop_accumulate_prices = k->value.GetBool();
} else if (strcmp(inner_obj_name, "pop_accumulate_durations") == 0) {
this->currentPaymentOptions.last().pop_accumulate_durations = k->value.GetBool();
} else if (strcmp(inner_obj_name, "pop_carry_over_option_id") == 0) {
this->currentPaymentOptions.last().pop_carry_over_option_id = k->value.GetInt();
} else if (strcmp(inner_obj_name, "pop_carry_over") == 0) {
@ -834,6 +838,7 @@ std::optional<QDateTime> Configuration::getInterpolationEnd(QDateTime const &sta
std::optional<QDateTime> value = std::nullopt;
QDateTime interpolationEndTime = start;
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") computed interpol end:" << interpolationEndTime.toString(Qt::ISODate);
int price = 0;
@ -918,8 +923,8 @@ std::optional<QDateTime> Configuration::getInterpolationEnd(QDateTime const &sta
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") price:" << price;
if (price >= interpolation.dynamic_until_price) {
qCritical() << "(" << __func__ << ":" << __LINE__ << ") price:" << price;
qCritical() << "(" << __func__ << ":" << __LINE__ << ") computed interpol endr:" << interpolationEndTime.toString(Qt::ISODate);
// qCritical() << "(" << __func__ << ":" << __LINE__ << ") price:" << price;
// qCritical() << "(" << __func__ << ":" << __LINE__ << ") computed interpol end:" << interpolationEndTime.toString(Qt::ISODate);
value = value.value_or(interpolationEndTime);
break;
}