Minor: Moved
getMinimalParkingTime(), getMaximalParkingTime(), getMinimalParkingPrice() computeWeekDaysPrice() and computeWeekDaysDurationUnit() to Utilities namespace.
This commit is contained in:
parent
a95a39a557
commit
c51d350618
@ -266,18 +266,6 @@ double Calculator::GetCostFromDuration(Configuration* cfg,
|
|||||||
return t.getPrice();
|
return t.getPrice();
|
||||||
}
|
}
|
||||||
|
|
||||||
int Calculator::getMinimalParkingTime(Configuration const *cfg, PaymentMethod methodId) {
|
|
||||||
return std::max((int)cfg->PaymentOption.find(methodId)->second.pop_min_time, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int Calculator::getMaximalParkingTime(Configuration const *cfg, PaymentMethod methodId) {
|
|
||||||
return std::max((int)cfg->PaymentOption.find(methodId)->second.pop_max_time, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t Calculator::getMinimalParkingPrice(Configuration const *cfg, PaymentMethod methodId) {
|
|
||||||
return std::max((int)cfg->PaymentOption.find(methodId)->second.pop_min_price, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Calculator::checkDurationMinutes(int minParkingTime,
|
bool Calculator::checkDurationMinutes(int minParkingTime,
|
||||||
int maxParkingTime,
|
int maxParkingTime,
|
||||||
int durationMinutes) {
|
int durationMinutes) {
|
||||||
@ -322,17 +310,6 @@ int Calculator::findNextWorkTimeRange(QDateTime const &dt,
|
|||||||
return nextWorkTimeRange;
|
return nextWorkTimeRange;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Calculator::computeWeekDaysPrice(Configuration const *cfg, PaymentMethod id) const {
|
|
||||||
int pop_id = cfg->PaymentOption.find(id)->second.pop_id;
|
|
||||||
return cfg->PaymentRate.find(pop_id)->second.pra_price;
|
|
||||||
}
|
|
||||||
|
|
||||||
double Calculator::computeWeekDaysDurationUnit(Configuration const *cfg, PaymentMethod id) const {
|
|
||||||
int pop_id = cfg->PaymentOption.find(id)->second.pop_id;
|
|
||||||
int durationId = cfg->PaymentRate.find(pop_id)->second.pra_payment_unit_id;
|
|
||||||
return (double)(cfg->Duration.find(durationId)->second.pun_duration);
|
|
||||||
}
|
|
||||||
|
|
||||||
using namespace Utilities;
|
using namespace Utilities;
|
||||||
|
|
||||||
Ticket Calculator::private_GetCostFromDuration(Configuration const* cfg,
|
Ticket Calculator::private_GetCostFromDuration(Configuration const* cfg,
|
||||||
|
Loading…
Reference in New Issue
Block a user