Compare commits
7 Commits
2.3.99-12
...
6ef57792ce
Author | SHA1 | Date | |
---|---|---|---|
6ef57792ce | |||
ec9f7d9262 | |||
a2c40fa32a | |||
25b3143d88
|
|||
0856f10ca9 | |||
88c703ecc2
|
|||
465b2274a1 |
@@ -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>;
|
||||||
|
|
||||||
@@ -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;
|
||||||
@@ -37,4 +46,9 @@ public:
|
|||||||
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;
|
||||||
};
|
};
|
||||||
|
@@ -21,8 +21,9 @@ enum MemberType
|
|||||||
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
|
||||||
|
@@ -996,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);
|
||||||
|
@@ -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()
|
||||||
|
Reference in New Issue
Block a user