Fix: compute_next_time_step(): removed check for product ids.

This commit is contained in:
Gerhard Hoffmann 2024-07-29 17:31:33 +02:00
parent 24ab01695d
commit fbc255a6f2

View File

@ -430,15 +430,16 @@ int CALCULATE_LIBRARY_API compute_next_timestep(parking_tariff_t *tariff, int cu
qCritical() << " compute_next_timestep() currentTimeMinutes: " << currentTimeMinutes; qCritical() << " compute_next_timestep() currentTimeMinutes: " << currentTimeMinutes;
qCritical() << " compute_next_timestep() up/down (1=up, 0=down): " << UpDown; qCritical() << " compute_next_timestep() up/down (1=up, 0=down): " << UpDown;
std::optional<ATBPaymentOption> paymentOption = tariff->getPaymentOptionForKey(permitType.get()); // FIXME
if (!paymentOption.has_value()) { //std::optional<ATBPaymentOption> paymentOption = tariff->getPaymentOptionForKey(permitType.get());
return currentTimeMinutes; //if (!paymentOption.has_value()) {
} // qCritical() << " compute_next_timestep() ERROR";
// return currentTimeMinutes;
//}
int const paymentOptionIndex = tariff->getPaymentOptionIndex(permitType); int const paymentOptionIndex = tariff->getPaymentOptionIndex(permitType);
qCritical() << " compute_next_timestep() payment option index: " << paymentOptionIndex; qCritical() << " compute_next_timestep() payment option index: " << paymentOptionIndex;
Configuration const *cfg = tariff; Configuration const *cfg = tariff;
// compute payment method id (e.g. Linear=3, Steps=4) // compute payment method id (e.g. Linear=3, Steps=4)
@ -510,6 +511,7 @@ int CALCULATE_LIBRARY_API compute_next_timestep(parking_tariff_t *tariff, int cu
return currentTimeMinutes; return currentTimeMinutes;
} }
else { else {
qCritical() << " compute_next_timestep() return next time step:" << stepList[currentStepIndex + 1];
return stepList[currentStepIndex + 1]; return stepList[currentStepIndex + 1];
} }
} }
@ -519,6 +521,7 @@ int CALCULATE_LIBRARY_API compute_next_timestep(parking_tariff_t *tariff, int cu
return currentTimeMinutes; return currentTimeMinutes;
} }
else { else {
qCritical() << " compute_next_timestep() return next time step:" << stepList[currentStepIndex - 1];
return stepList[currentStepIndex - 1]; return stepList[currentStepIndex - 1];
} }
} }