Compare commits
15 Commits
2.3.99-11
...
6ef57792ce
Author | SHA1 | Date | |
---|---|---|---|
6ef57792ce | |||
ec9f7d9262 | |||
a2c40fa32a | |||
25b3143d88
|
|||
0856f10ca9 | |||
88c703ecc2
|
|||
465b2274a1 | |||
f946cd13e4
|
|||
62c52fd580 | |||
1023f6ede1 | |||
36b3e85d1b | |||
b394ed46cc | |||
3dda2d8355 | |||
1152c3824e | |||
4271c0fb31 |
@@ -28,6 +28,7 @@
|
|||||||
#include "tariff_interpolation.h"
|
#include "tariff_interpolation.h"
|
||||||
#include "tariff_prepaid.h"
|
#include "tariff_prepaid.h"
|
||||||
#include "tariff_carryover.h"
|
#include "tariff_carryover.h"
|
||||||
|
#include "tariff_prepay.h"
|
||||||
#include "tariff_permit_type.h"
|
#include "tariff_permit_type.h"
|
||||||
|
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
@@ -47,6 +48,7 @@ public:
|
|||||||
using ATBPaymentOptionType = std::multimap<int, ATBPaymentOption>;
|
using ATBPaymentOptionType = std::multimap<int, ATBPaymentOption>;
|
||||||
using TariffInterpolationType = std::multimap<int, ATBInterpolation>;
|
using TariffInterpolationType = std::multimap<int, ATBInterpolation>;
|
||||||
using TariffPrepaidType = std::multimap<int, ATBPrepaid>;
|
using TariffPrepaidType = std::multimap<int, ATBPrepaid>;
|
||||||
|
using TariffPrepayOptionType = std::multimap<int, ATBPrepay>;
|
||||||
using TariffCarryOverType = std::multimap<int, ATBCarryOver>;
|
using TariffCarryOverType = std::multimap<int, ATBCarryOver>;
|
||||||
using TariffDurationType = std::multimap<int, ATBDuration>;
|
using TariffDurationType = std::multimap<int, ATBDuration>;
|
||||||
|
|
||||||
@@ -54,7 +56,7 @@ public:
|
|||||||
ATBCurrency Currency;
|
ATBCurrency Currency;
|
||||||
ATBDuration duration;
|
ATBDuration duration;
|
||||||
|
|
||||||
TariffDurationType Duration;
|
TariffDurationType Duration;
|
||||||
multimap<int, ATBPaymentMethod> PaymentMethod;
|
multimap<int, ATBPaymentMethod> PaymentMethod;
|
||||||
multimap<int, ATBPaymentRate> PaymentRate;
|
multimap<int, ATBPaymentRate> PaymentRate;
|
||||||
SpecialDaysWorktimeType SpecialDaysWorktime;
|
SpecialDaysWorktimeType SpecialDaysWorktime;
|
||||||
@@ -71,6 +73,7 @@ public:
|
|||||||
TariffProductType TariffProduct;
|
TariffProductType TariffProduct;
|
||||||
TariffInterpolationType TariffInterpolations;
|
TariffInterpolationType TariffInterpolations;
|
||||||
TariffPrepaidType TariffPrepaidOptions;
|
TariffPrepaidType TariffPrepaidOptions;
|
||||||
|
TariffPrepayOptionType TariffPrepayOptions;
|
||||||
TariffCarryOverType TariffCarryOverOptions;
|
TariffCarryOverType TariffCarryOverOptions;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@@ -12,7 +12,12 @@ public:
|
|||||||
, pun_duration_saved(0)
|
, pun_duration_saved(0)
|
||||||
, pun_duration_min(0)
|
, pun_duration_min(0)
|
||||||
, pun_duration_max(0)
|
, pun_duration_max(0)
|
||||||
, pun_interpolation_id(-1) {
|
, pun_interpolation_id(-1)
|
||||||
|
, pun_netto(false)
|
||||||
|
, pun_brutto(false)
|
||||||
|
, pun_fixed(false)
|
||||||
|
, pun_requires_change(false)
|
||||||
|
, pun_next_step_correction(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
friend QDebug operator<<(QDebug debug, ATBDuration const &td) {
|
friend QDebug operator<<(QDebug debug, ATBDuration const &td) {
|
||||||
@@ -25,6 +30,10 @@ public:
|
|||||||
<< " pun_duration_saved: " << td.pun_duration_saved << "\n"
|
<< " pun_duration_saved: " << td.pun_duration_saved << "\n"
|
||||||
<< " pun_duration_min: " << td.pun_duration_min << "\n"
|
<< " pun_duration_min: " << td.pun_duration_min << "\n"
|
||||||
<< " pun_duration_max: " << td.pun_duration_max << "\n"
|
<< " pun_duration_max: " << td.pun_duration_max << "\n"
|
||||||
|
<< " pun_netto: " << td.pun_netto << "\n"
|
||||||
|
<< " pun_brutto: " << td.pun_brutto << "\n"
|
||||||
|
<< " pun_fixed: " << td.pun_fixed << "\n"
|
||||||
|
<< " pun_requires_change: " << td.pun_requires_change << "\n"
|
||||||
<< "pun_interpolation_id: " << td.pun_interpolation_id << "\n";
|
<< "pun_interpolation_id: " << td.pun_interpolation_id << "\n";
|
||||||
|
|
||||||
return debug;
|
return debug;
|
||||||
@@ -33,8 +42,13 @@ public:
|
|||||||
int pun_id;
|
int pun_id;
|
||||||
std::string pun_label;
|
std::string pun_label;
|
||||||
int pun_duration;
|
int pun_duration;
|
||||||
int pun_duration_saved;
|
int pun_duration_saved;
|
||||||
int pun_duration_min;
|
int pun_duration_min;
|
||||||
int pun_duration_max;
|
int pun_duration_max;
|
||||||
int pun_interpolation_id;
|
int pun_interpolation_id;
|
||||||
|
bool pun_netto; // the timestep expressed by this duration is a netto timestep
|
||||||
|
bool pun_brutto; // the timestep expressed by this duration is a brutto timestep
|
||||||
|
bool pun_fixed; // the value given in tariff-file is fixed (constant)
|
||||||
|
bool pun_requires_change; // the value has to be changes (controlled by other parameters)
|
||||||
|
int pun_next_step_correction;
|
||||||
};
|
};
|
||||||
|
@@ -13,16 +13,17 @@ enum MemberType
|
|||||||
WeekDaysWorkTimeType = 0x06,
|
WeekDaysWorkTimeType = 0x06,
|
||||||
SpecialDaysWorktimeType = 0x07,
|
SpecialDaysWorktimeType = 0x07,
|
||||||
SpecialDaysType = 0x08,
|
SpecialDaysType = 0x08,
|
||||||
PeriodYearType = 0x09,
|
PeriodYearType = 0x09,
|
||||||
DailyTicketType = 0x0A,
|
DailyTicketType = 0x0A,
|
||||||
CustomerType = 0x0B,
|
CustomerType = 0x0B,
|
||||||
TimeBaseType = 0x0C,
|
TimeBaseType = 0x0C,
|
||||||
TimeRangeType = 0x0D,
|
TimeRangeType = 0x0D,
|
||||||
TimeStepConfigType = 0x0E,
|
TimeStepConfigType = 0x0E,
|
||||||
ProductType = 0x0F,
|
ProductType = 0x0F,
|
||||||
InterpolationType = 0x10,
|
InterpolationType = 0x10,
|
||||||
PrepaidType = 0x11,
|
PrepaidType = 0x11, // deprecated
|
||||||
CarryOverType = 0x12
|
CarryOverType = 0x12,
|
||||||
|
PrepaidOptionType = 0x13,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MEMBER_TYPE_H_INCLUDED
|
#endif // MEMBER_TYPE_H_INCLUDED
|
||||||
|
@@ -508,10 +508,12 @@ int CALCULATE_LIBRARY_API compute_next_timestep(parking_tariff_t *tariff, int cu
|
|||||||
// without given YearPeriod, SpecialDays and SpecialDaysWorktime
|
// without given YearPeriod, SpecialDays and SpecialDaysWorktime
|
||||||
if ((paymentMethodId == PaymentMethod::Steps) ||
|
if ((paymentMethodId == PaymentMethod::Steps) ||
|
||||||
// progressive tariff: e.g. Neuhauser, Kirchdorf (743)
|
// progressive tariff: e.g. Neuhauser, Kirchdorf (743)
|
||||||
(paymentMethodId == PaymentMethod::Progressive))
|
(paymentMethodId == PaymentMethod::Progressive) ||
|
||||||
// (paymentMethodId == PaymentMethod::Degressive)) degressive tariff: e.g. Fuchs Technik (500)
|
// degressive tariff: e.g. Fuchs Technik (500)
|
||||||
|
(paymentMethodId == PaymentMethod::Degressive))
|
||||||
{
|
{
|
||||||
QList<int> &stepList = Calculator::GetInstance().GetTimeSteps(tariff, paymentOptionIndex);
|
QList<int> &stepList = Calculator::GetInstance().GetTimeSteps(tariff, paymentOptionIndex);
|
||||||
|
|
||||||
int const size = stepList.size();
|
int const size = stepList.size();
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
qCritical() << "compute_next_timestep() *ERROR empty step-list*";
|
qCritical() << "compute_next_timestep() *ERROR empty step-list*";
|
||||||
@@ -769,17 +771,19 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
|||||||
QList<int> tlist = Calculator::GetInstance().GetTimeSteps(tariff);
|
QList<int> tlist = Calculator::GetInstance().GetTimeSteps(tariff);
|
||||||
Q_UNUSED(tlist);
|
Q_UNUSED(tlist);
|
||||||
|
|
||||||
|
// compute cost (price)
|
||||||
cost = Calculator::GetInstance().GetCostFromDuration(tariff, start_parking_time, netto_parking_time, paymentOptionIndex);
|
cost = Calculator::GetInstance().GetCostFromDuration(tariff, start_parking_time, netto_parking_time, paymentOptionIndex);
|
||||||
|
|
||||||
int weekDay = start_parking_time.date().dayOfWeek();
|
int weekDay = start_parking_time.date().dayOfWeek();
|
||||||
int pop_carry_over_option_id = tariff->getPaymentOptions(paymentOptionIndex).pop_carry_over_option_id;
|
int pop_carry_over_option_id = tariff->getPaymentOptions(paymentOptionIndex).pop_carry_over_option_id;
|
||||||
|
qCritical() << __func__ << __LINE__ << "configured carry-over-id" << pop_carry_over_option_id;
|
||||||
|
|
||||||
std::optional<ATBPeriodYear> yperiod = Utilities::GetYearPeriodActive(tariff, start_parking_time);
|
std::optional<ATBPeriodYear> yperiod = Utilities::GetYearPeriodActive(tariff, start_parking_time);
|
||||||
if (yperiod.has_value()) {
|
if (yperiod.has_value()) {
|
||||||
ATBPeriodYear const &period = yperiod.value();
|
ATBPeriodYear const &period = yperiod.value();
|
||||||
pop_carry_over_option_id = period.pye_id;
|
pop_carry_over_option_id = period.pye_id;
|
||||||
|
qCritical() << __func__ << __LINE__ << "re-computed carry-over-id" << pop_carry_over_option_id;
|
||||||
}
|
}
|
||||||
qCritical() << __func__ << __LINE__ << "carryOver-id" << pop_carry_over_option_id;
|
|
||||||
|
|
||||||
QTime const carryOverStart = tariff->TariffCarryOverOptions.find(pop_carry_over_option_id)->second.carryover[weekDay].static_start;
|
QTime const carryOverStart = tariff->TariffCarryOverOptions.find(pop_carry_over_option_id)->second.carryover[weekDay].static_start;
|
||||||
int const carryOverDuration = tariff->TariffCarryOverOptions.find(pop_carry_over_option_id)->second.carryover[weekDay].duration;
|
int const carryOverDuration = tariff->TariffCarryOverOptions.find(pop_carry_over_option_id)->second.carryover[weekDay].duration;
|
||||||
@@ -793,11 +797,15 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
|||||||
std::optional<ATBPrepaid> prepaidOption = tariff->getPrepaidType(prepaid_option_id);
|
std::optional<ATBPrepaid> prepaidOption = tariff->getPrepaidType(prepaid_option_id);
|
||||||
if (prepaidOption.has_value()) {
|
if (prepaidOption.has_value()) {
|
||||||
ATBPrepaid const &p = prepaidOption.value();
|
ATBPrepaid const &p = prepaidOption.value();
|
||||||
if (start_parking_time.time() < p.static_end) { // static_end: e.g. 08:00:00
|
if (p.never) {
|
||||||
effectiveStartTime.setTime(p.static_end);
|
qCritical() << __func__ << __LINE__ << "prepaid: no";
|
||||||
} else
|
} else {
|
||||||
if (start_parking_time.time() > p.static_start) { // static_start: e.g. 22:00:00
|
if (start_parking_time.time() < p.static_end) { // static_end: e.g. 08:00:00
|
||||||
effectiveStartTime.setTime(p.static_start);
|
effectiveStartTime.setTime(p.static_end);
|
||||||
|
} else
|
||||||
|
if (start_parking_time.time() > p.static_start) { // static_start: e.g. 22:00:00
|
||||||
|
effectiveStartTime.setTime(p.static_start);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -841,6 +849,12 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
|||||||
return calcState.set(CalcState::State::INVALID_START_DATE);
|
return calcState.set(CalcState::State::INVALID_START_DATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (end_parking_time.time().hour() == 0 && end_parking_time.time().minute() == 0) {
|
||||||
|
end_parking_time = end_parking_time.addDays(-1);
|
||||||
|
end_parking_time.setTime(QTime(23, 59, 0));
|
||||||
|
}
|
||||||
|
qCritical() << __func__ << __LINE__ << "end_parking_time" << end_parking_time.toString(Qt::ISODate);
|
||||||
|
|
||||||
return calcState.set(CalcState::State::SUCCESS);
|
return calcState.set(CalcState::State::SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -982,15 +996,20 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket(
|
|||||||
} else {
|
} else {
|
||||||
ticketEndTime = QDateTime::fromString(endTime,Qt::ISODate);
|
ticketEndTime = QDateTime::fromString(endTime,Qt::ISODate);
|
||||||
|
|
||||||
// DEBUG
|
|
||||||
//qCritical() << "compute_duration_for_parking_ticket(): ";
|
|
||||||
//qCritical() << " endTime: " << endTime;
|
|
||||||
//qCritical() << " ticketEndTime: " << ticketEndTime;
|
|
||||||
|
|
||||||
if (!ticketEndTime.isValid()) {
|
if (!ticketEndTime.isValid()) {
|
||||||
calcState.setDesc(QString("ticketEndTime=%1").arg(endTime));
|
calcState.setDesc(QString("ticketEndTime=%1").arg(endTime));
|
||||||
return calcState.set(CalcState::State::WRONG_ISO_TIME_FORMAT);
|
return calcState.set(CalcState::State::WRONG_ISO_TIME_FORMAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ticketEndTime.time().hour() == 0 && ticketEndTime.time().minute() == 0) {
|
||||||
|
ticketEndTime = ticketEndTime.addDays(-1);
|
||||||
|
ticketEndTime.setTime(QTime(23, 59, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
// DEBUG
|
||||||
|
qCritical() << "compute_duration_for_parking_ticket(): ";
|
||||||
|
qCritical() << " endTime: " << endTime;
|
||||||
|
qCritical() << " ticketEndTime: " << ticketEndTime;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return calcState.set(CalcState::State::INVALID_START_DATE);
|
return calcState.set(CalcState::State::INVALID_START_DATE);
|
||||||
|
@@ -181,8 +181,8 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
|
|||||||
price = pra_price;
|
price = pra_price;
|
||||||
}
|
}
|
||||||
|
|
||||||
//qCritical() << DBG_HEADER << " PRICE" << price << "COST" << cost;
|
// qCritical() << DBG_HEADER << " PRICE" << price << "COST" << cost;
|
||||||
//qCritical() << DBG_HEADER << " duration id" << durationId;
|
// qCritical() << DBG_HEADER << " duration id" << durationId;
|
||||||
|
|
||||||
auto search = cfg->Duration.find(durationId);
|
auto search = cfg->Duration.find(durationId);
|
||||||
if (search != cfg->Duration.end()) {
|
if (search != cfg->Duration.end()) {
|
||||||
@@ -207,11 +207,16 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
|
|||||||
//found = true;
|
//found = true;
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") duration_previous" << duration_previous;
|
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") duration_previous" << duration_previous;
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") duration in minutes" << durationInMinutes;
|
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") duration in minutes" << durationInMinutes;
|
||||||
QDateTime d(inputDate.addSecs(duration_previous * 60));
|
QDateTime d;
|
||||||
|
if (pop_accumulate_durations) {
|
||||||
|
d = inputDate.addSecs(durationInMinutes * 60);
|
||||||
|
} else {
|
||||||
|
d = inputDate.addSecs(duration_previous * 60);
|
||||||
|
}
|
||||||
|
|
||||||
qCritical() << DBG_HEADER << " provided price (cost):" << cost;
|
qCritical() << DBG_HEADER << " provided price (cost):" << cost;
|
||||||
qCritical() << DBG_HEADER << " computed time for price (minutes):" << duration_previous;
|
qCritical() << DBG_HEADER << " computed time for price (minutes):" << duration_previous;
|
||||||
qCritical() << DBG_HEADER << "configured minimal parking time (minutes):" << cfg->getPaymentOptions(paymentOptionIndex).pop_min_time;
|
qCritical() << DBG_HEADER << " minimal parking time (minutes):" << cfg->getPaymentOptions(paymentOptionIndex).pop_min_time;
|
||||||
|
|
||||||
if (duration_previous < cfg->getPaymentOptions(paymentOptionIndex).pop_min_time) {
|
if (duration_previous < cfg->getPaymentOptions(paymentOptionIndex).pop_min_time) {
|
||||||
return CalcState::BELOW_MIN_PARKING_TIME.toStdString(); // minimal parking time is set by GetTimeSteps()
|
return CalcState::BELOW_MIN_PARKING_TIME.toStdString(); // minimal parking time is set by GetTimeSteps()
|
||||||
@@ -1018,7 +1023,8 @@ uint32_t Calculator::GetCostFromDuration(Configuration * cfg,
|
|||||||
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);
|
||||||
|
qCritical() << DBG_HEADER << "timeStepList" << timeStepInMinutes << tlist;
|
||||||
qCritical() << DBG_HEADER << "timeStepInMinutes" << timeStepInMinutes << start.toString(Qt::ISODate);
|
qCritical() << DBG_HEADER << "timeStepInMinutes" << timeStepInMinutes << start.toString(Qt::ISODate);
|
||||||
|
|
||||||
return GetPriceForTimeStep(cfg, timeStepInMinutes, paymentOptionIndex);
|
return GetPriceForTimeStep(cfg, timeStepInMinutes, paymentOptionIndex);
|
||||||
@@ -2809,11 +2815,13 @@ uint32_t Calculator::GetPriceForTimeStep(Configuration *cfg, int timeStep, int p
|
|||||||
// paymentOptionIndex = 1;
|
// paymentOptionIndex = 1;
|
||||||
|
|
||||||
int const pop_id = cfg->getPaymentOptions(paymentOptionIndex).pop_id;
|
int const pop_id = cfg->getPaymentOptions(paymentOptionIndex).pop_id;
|
||||||
|
int const pop_accumulate_durations = cfg->getPaymentOptions(paymentOptionIndex).pop_accumulate_durations;
|
||||||
int const pop_accumulate_prices = cfg->getPaymentOptions(paymentOptionIndex).pop_accumulate_prices;
|
int const pop_accumulate_prices = cfg->getPaymentOptions(paymentOptionIndex).pop_accumulate_prices;
|
||||||
|
|
||||||
uint32_t price = 0;
|
uint32_t price = 0;
|
||||||
|
int pun_duration = 0;
|
||||||
|
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") paymentOptionIndex" << paymentOptionIndex;
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") paymentOptionIndex" << paymentOptionIndex;
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") timeStep" << timeStep;
|
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") timeStep" << timeStep;
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") pop_id" << pop_id;
|
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") pop_id" << pop_id;
|
||||||
|
|
||||||
@@ -2827,19 +2835,25 @@ uint32_t Calculator::GetPriceForTimeStep(Configuration *cfg, int timeStep, int p
|
|||||||
//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;
|
||||||
|
|
||||||
int const pun_duration = cfg->Duration.find(payment_unit_id)->second.pun_duration;
|
if (pop_accumulate_durations) {
|
||||||
//int const pun_duration = cfg->Duration.find(2)->second.pun_duration;
|
pun_duration += cfg->Duration.find(payment_unit_id)->second.pun_duration;
|
||||||
|
} else {
|
||||||
|
pun_duration = cfg->Duration.find(payment_unit_id)->second.pun_duration;
|
||||||
|
}
|
||||||
|
|
||||||
if (pop_accumulate_prices) {
|
if (pop_accumulate_prices) {
|
||||||
price += itr->second.pra_price;
|
price += itr->second.pra_price;
|
||||||
} else {
|
} else {
|
||||||
price = (uint32_t)(itr->second.pra_price);
|
price = (uint32_t)(itr->second.pra_price);
|
||||||
}
|
}
|
||||||
|
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") price" << price;
|
if (DBG_LEVEL >= DBG_DEBUG) {
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun_id" << pun_id;
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") price" << price;
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun_unit_id" << payment_unit_id;
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun_id" << pun_id;
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun_duration" << pun_duration;
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun_unit_id" << payment_unit_id;
|
||||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") timeStep" << timeStep;
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") pun_duration" << pun_duration;
|
||||||
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") timeStep" << timeStep;
|
||||||
|
}
|
||||||
|
|
||||||
if (timeStep == pun_duration) {
|
if (timeStep == pun_duration) {
|
||||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ") return price" << price;
|
qCritical() << "(" << __func__ << ":" << __LINE__ << ") return price" << price;
|
||||||
|
@@ -47,11 +47,11 @@ extern "C" char* strptime(const char* s,
|
|||||||
#define NEUHAUSER_CHRISTOPH_REISEN (0)
|
#define NEUHAUSER_CHRISTOPH_REISEN (0)
|
||||||
#define NEUHAUSER_PERNEGG_AN_DER_MUR (0)
|
#define NEUHAUSER_PERNEGG_AN_DER_MUR (0)
|
||||||
#define NEUHAUSER_STOCKERAU (0)
|
#define NEUHAUSER_STOCKERAU (0)
|
||||||
#define KLEIPEDA_LITAUEN (1)
|
#define KLEIPEDA_LITAUEN (0)
|
||||||
#define SEXTEN (0)
|
#define SEXTEN (0)
|
||||||
#define SCHNALS_LEITER_KIRCHL (0)
|
#define SCHNALS_LEITER_KIRCHL (0)
|
||||||
#define SCHNALS_STAUMAUER (SCHNALS_LEITER_KIRCHL)
|
#define SCHNALS_STAUMAUER (SCHNALS_LEITER_KIRCHL)
|
||||||
#define VALSER_ALM (0)
|
#define VALSER_ALM (1)
|
||||||
|
|
||||||
#if NEUHAUSER_KIRCHDORF==1
|
#if NEUHAUSER_KIRCHDORF==1
|
||||||
static bool test_neuhauser_kirchdorf(int step, double cost) {
|
static bool test_neuhauser_kirchdorf(int step, double cost) {
|
||||||
@@ -919,22 +919,24 @@ int main() {
|
|||||||
s.setTime(QTime(12, 0, 0));
|
s.setTime(QTime(12, 0, 0));
|
||||||
|
|
||||||
int minimal_parking_price = get_minimal_parkingprice(&cfg,
|
int minimal_parking_price = get_minimal_parkingprice(&cfg,
|
||||||
PermitType(PERMIT_TYPE::SHORT_TERM_PARKING),
|
PermitType(PERMIT_TYPE::SHORT_TERM_PARKING_PKW),
|
||||||
paymentOptionIndex, s);
|
paymentOptionIndex, s);
|
||||||
|
|
||||||
|
#if 0
|
||||||
qCritical() << "minimal parking price" << minimal_parking_price;
|
qCritical() << "minimal parking price" << minimal_parking_price;
|
||||||
|
|
||||||
for (int i = 0; i < 8; ++i) {
|
for (int i = 0; i < 8; ++i) {
|
||||||
calcState = compute_duration_for_parking_ticket(&cfg, s,
|
calcState = compute_duration_for_parking_ticket(&cfg, s,
|
||||||
(double)minimal_parking_price + i*800,
|
(double)minimal_parking_price + i*800,
|
||||||
end, PermitType(PERMIT_TYPE::SHORT_TERM_PARKING));
|
end, PermitType(PERMIT_TYPE::SHORT_TERM_PARKING_PKW));
|
||||||
qCritical() << "RUN" << i << end.toString(Qt::ISODate) << calcState.toString();
|
qCritical() << "RUN" << i << end.toString(Qt::ISODate) << calcState.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
s.setTime(QTime(15, 0, 0));
|
s.setTime(QTime(15, 0, 0));
|
||||||
|
|
||||||
minimal_parking_price = get_minimal_parkingprice(&cfg,
|
minimal_parking_price = get_minimal_parkingprice(&cfg,
|
||||||
PermitType(PERMIT_TYPE::SHORT_TERM_PARKING),
|
PermitType(PERMIT_TYPE::SHORT_TERM_PARKING_PKW),
|
||||||
paymentOptionIndex, s);
|
paymentOptionIndex, s);
|
||||||
|
|
||||||
qCritical() << "minimal parking price" << minimal_parking_price;
|
qCritical() << "minimal parking price" << minimal_parking_price;
|
||||||
@@ -942,9 +944,10 @@ int main() {
|
|||||||
for (int i = 0; i < 8; ++i) {
|
for (int i = 0; i < 8; ++i) {
|
||||||
calcState = compute_duration_for_parking_ticket(&cfg, s,
|
calcState = compute_duration_for_parking_ticket(&cfg, s,
|
||||||
(double)minimal_parking_price + i*800,
|
(double)minimal_parking_price + i*800,
|
||||||
end, PermitType(PERMIT_TYPE::SHORT_TERM_PARKING));
|
end, PermitType(PERMIT_TYPE::SHORT_TERM_PARKING_PKW));
|
||||||
qCritical() << "RUN" << i << end.toString(Qt::ISODate) << calcState.toString();
|
qCritical() << "RUN" << i << end.toString(Qt::ISODate) << calcState.toString();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user