Handle SUCCESS_MAXPRICE (calc-state).
This commit is contained in:
parent
dbedfd094f
commit
205896903b
@ -26,6 +26,7 @@ QString const CalcState::BELOW_MIN_PARKING_PRICE = "BELOW_MIN_PARKING_PRICE";
|
|||||||
QString const CalcState::ABOVE_MAX_PARKING_PRICE = "ABOVE_MAX_PARKING_PRICE";
|
QString const CalcState::ABOVE_MAX_PARKING_PRICE = "ABOVE_MAX_PARKING_PRICE";
|
||||||
QString const CalcState::OVERPAID = "OVERPAID";
|
QString const CalcState::OVERPAID = "OVERPAID";
|
||||||
QString const CalcState::OUTSIDE_ALLOWED_PARKING_TIME = "OUTSIDE_ALLOWED_PARKING_TIME";
|
QString const CalcState::OUTSIDE_ALLOWED_PARKING_TIME = "OUTSIDE_ALLOWED_PARKING_TIME";
|
||||||
|
QString const CalcState::SUCCESS_MAXPRICE = "SUCCESS_MAXPRICE";
|
||||||
|
|
||||||
QList<int> CALCULATE_LIBRARY_API get_time_steps(Configuration *cfg) {
|
QList<int> CALCULATE_LIBRARY_API get_time_steps(Configuration *cfg) {
|
||||||
return Calculator::GetInstance().GetTimeSteps(cfg);
|
return Calculator::GetInstance().GetTimeSteps(cfg);
|
||||||
@ -818,6 +819,13 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
|||||||
qCritical() << __func__ << ":" << __LINE__ << " re-computed prepaid-id" << pop_prepaid_option_id;
|
qCritical() << __func__ << ":" << __LINE__ << " re-computed prepaid-id" << pop_prepaid_option_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QTime carryOverStart = tariff->TariffCarryOverOptions.find(pop_carry_over_option_id)->second.carryover[weekDay].static_start;
|
||||||
|
int carryOverDuration = tariff->TariffCarryOverOptions.find(pop_carry_over_option_id)->second.carryover[weekDay].duration;
|
||||||
|
|
||||||
|
qCritical() << __func__ << ":" << __LINE__ << " carryOverStart" << carryOverStart.toString(Qt::ISODate);
|
||||||
|
qCritical() << __func__ << ":" << __LINE__ << "carryOverDuration" << carryOverDuration;
|
||||||
|
|
||||||
|
|
||||||
QDateTime effectiveStartTime(start_parking_time);
|
QDateTime effectiveStartTime(start_parking_time);
|
||||||
|
|
||||||
// handle special days
|
// handle special days
|
||||||
@ -1103,6 +1111,12 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket(
|
|||||||
if (endTime == CalcState::SUCCESS) {
|
if (endTime == CalcState::SUCCESS) {
|
||||||
calcState.setDesc(QString("SUCCESS"));
|
calcState.setDesc(QString("SUCCESS"));
|
||||||
calcState.setStatus(endTime);
|
calcState.setStatus(endTime);
|
||||||
|
qCritical() << __func__ << ":" << __LINE__ << "SUCCESS";
|
||||||
|
} else
|
||||||
|
if (endTime == CalcState::SUCCESS_MAXPRICE) {
|
||||||
|
calcState.setDesc(QString("SUCCESS_MAXPRICE"));
|
||||||
|
calcState.setStatus(endTime);
|
||||||
|
qCritical() << __func__ << ":" << __LINE__ << "SUCCESS_MAXPRICE";
|
||||||
} else
|
} else
|
||||||
if (endTime == CalcState::ERROR_PARSING_ZONE_NR) {
|
if (endTime == CalcState::ERROR_PARSING_ZONE_NR) {
|
||||||
calcState.setStatus(endTime);
|
calcState.setStatus(endTime);
|
||||||
@ -1255,7 +1269,9 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket(
|
|||||||
return calcState.set(CalcState::State::INVALID_START_DATE);
|
return calcState.set(CalcState::State::INVALID_START_DATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return calcState.set(CalcState::State::SUCCESS);
|
//return calcState.set(CalcState::State::SUCCESS);
|
||||||
|
qCritical() << __func__ << ":" << __LINE__ << " calcState" << calcState.toString();
|
||||||
|
return calcState;
|
||||||
}
|
}
|
||||||
|
|
||||||
CalcState CALCULATE_LIBRARY_API compute_duration_for_daily_ticket(parking_tariff_t *tariff,
|
CalcState CALCULATE_LIBRARY_API compute_duration_for_daily_ticket(parking_tariff_t *tariff,
|
||||||
|
Loading…
Reference in New Issue
Block a user