Add debug messages
This commit is contained in:
parent
69c469c918
commit
c28351b1bf
@ -148,6 +148,14 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
||||
double minMin = tariff->PaymentOption.find(PaymentOption::Option1)->second.pop_min_time;
|
||||
double maxMin = tariff->PaymentOption.find(PaymentOption::Option1)->second.pop_max_time;
|
||||
|
||||
// DEBUG
|
||||
qCritical() << "compute_price_for_parking_ticket() " << endl
|
||||
<< " start_parking_time: " << start_parking_time << endl
|
||||
<< " end_parking_time: " << end_parking_time << endl
|
||||
<< " minMin: " << minMin << endl
|
||||
<< " maxMin: " << maxMin;
|
||||
|
||||
|
||||
int const duration = (end_parking_time.toSecsSinceEpoch() -
|
||||
start_parking_time.toMSecsSinceEpoch()) / 60;
|
||||
|
||||
@ -181,6 +189,10 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
||||
calcState.setDesc(QString("minCost=%1, cost=%2").arg(minCost, cost));
|
||||
return calcState.set(CalcState::State::BELOW_MIN_PARKING_PRICE);
|
||||
}
|
||||
|
||||
// DEBUG
|
||||
qCritical() << " -> calculated cost (price->netto) = " << cost;
|
||||
|
||||
price->units = cost;
|
||||
price->netto = cost;
|
||||
} else {
|
||||
@ -202,6 +214,12 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket(
|
||||
start = start.toLocalTime().addSecs(start_parking_time * 60);
|
||||
if (start.isValid()) {
|
||||
QString cs = start.toString(Qt::ISODate);
|
||||
|
||||
// DEBUG
|
||||
qCritical() << "compute_duration_for_parking_ticket(): ";
|
||||
qCritical() << " start (cs): " << cs;
|
||||
qCritical() << " price: " << price;
|
||||
|
||||
duration = calculator.GetDurationFromCost(tariff, PaymentOption::Option1,
|
||||
cs.toLocal8Bit().constData(),
|
||||
price, false, true).c_str();
|
||||
@ -230,6 +248,12 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket(
|
||||
cs.toLocal8Bit().constData(),
|
||||
price, false, true).c_str();
|
||||
ticketEndTime = QDateTime::fromString(endTime);
|
||||
|
||||
// DEBUG
|
||||
qCritical() << "compute_duration_for_parking_ticket(): ";
|
||||
qCritical() << " endTime: " << endTime;
|
||||
qCritical() << " ticketEndTime: " << ticketEndTime;
|
||||
|
||||
if (!ticketEndTime.isValid()) {
|
||||
calcState.setDesc(QString("ticketEndTime=%1").arg(endTime));
|
||||
return calcState.set(CalcState::State::WRONG_ISO_TIME_FORMAT);
|
||||
|
Loading…
Reference in New Issue
Block a user