GetTimeSteps(): adapt for progressive tariff (e.g. neuhauser/kirchdorf).
Compute timesteps according to tariff01.json file.
This commit is contained in:
parent
81d515eb7f
commit
102607b71f
@ -584,7 +584,6 @@ double Calculator::GetCostFromDuration(Configuration* cfg,
|
||||
|
||||
Q_ASSERT_X(from < to, __func__, "MISCONFIGURED WORK-TIMES");
|
||||
|
||||
|
||||
if (current.time() >= to) {
|
||||
continue; // try to use next available work-time
|
||||
} else
|
||||
@ -1167,6 +1166,8 @@ QList<int> Calculator::GetTimeSteps(Configuration *cfg) const {
|
||||
int const pop_carry_over = cfg->getPaymentOptions().pop_carry_over;
|
||||
int const pop_time_step_config = cfg->getPaymentOptions().pop_time_step_config;
|
||||
|
||||
static PaymentMethod const paymentMethodId = Utilities::getPaymentMethodId(cfg);
|
||||
|
||||
qCritical() << __func__ << ":" << __LINE__ << " start parking time:" << start.toString(Qt::ISODate);
|
||||
qCritical() << __func__ << ":" << __LINE__ << " payment option id:" << pop_id;
|
||||
qCritical() << __func__ << ":" << __LINE__ << "payment option carry over:" << pop_carry_over;
|
||||
@ -1174,6 +1175,13 @@ QList<int> Calculator::GetTimeSteps(Configuration *cfg) const {
|
||||
if (pop_time_step_config == (int)ATBTimeStepConfig::TimeStepConfig::DYNAMIC) {
|
||||
//qCritical() << __PRETTY_FUNCTION__ << "payment option time step config:" << "TimeStepConfig::DYNAMIC";
|
||||
|
||||
if (paymentMethodId == PaymentMethod::Progressive) { // e.g. neuhauser kirchdorf (743)
|
||||
std::size_t const s = cfg->TimeRange.size();
|
||||
for (std::size_t id = 1; id <= s; ++id) {
|
||||
int const step = Utilities::getTimeRangeStep(cfg, id, paymentMethodId);
|
||||
m_timeSteps.append(step);
|
||||
}
|
||||
} else {
|
||||
uint16_t timeStepCompensation = 0;
|
||||
|
||||
if (pop_carry_over) {
|
||||
@ -1232,6 +1240,7 @@ QList<int> Calculator::GetTimeSteps(Configuration *cfg) const {
|
||||
} else { // if (pop_carry_over) {
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
} else {
|
||||
qCritical() << __PRETTY_FUNCTION__ << "payment option time step config:" << "TimeStepConfig::STATIC";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user