Fix: nextTimeStep must be between minParkingTime and maxParkingTime.

This commit is contained in:
Gerhard Hoffmann 2023-12-11 09:00:24 +01:00
parent 0f05a1a784
commit 88e92dddb9

View File

@ -173,9 +173,9 @@ int CALCULATE_LIBRARY_API compute_next_timestep(parking_tariff_t *tariff, int cu
qCritical() << " compute_next_timestep() firstDurationStep:" << firstDurationStep;
int nextTimeStep = currentTimeMinutes + firstDurationStep;
int const nextTimeStep = currentTimeMinutes + firstDurationStep;
if (currentTimeMinutes >= minParkingTime && nextTimeStep <= maxParkingTime) {
if (nextTimeStep >= minParkingTime && nextTimeStep <= maxParkingTime) {
qCritical() << " compute_next_timestep() nextTimeStep:" << nextTimeStep;
return nextTimeStep;
}