Merge branch 'master' of git.mimbach49.de:GerhardHoffmann/MOBILISIS-Calculator
This commit is contained in:
commit
5ec2a6d730
@ -59,13 +59,13 @@ CalcState CALCULATE_LIBRARY_API init_tariff(parking_tariff_t **tariff, char cons
|
|||||||
|
|
||||||
QString json = fname.readAll();
|
QString json = fname.readAll();
|
||||||
if (! (*tariff)->ParseJson(*tariff, json.toStdString().c_str())) {
|
if (! (*tariff)->ParseJson(*tariff, json.toStdString().c_str())) {
|
||||||
calcState.m_status = CalcState::State::ERROR_PARSING_TARIFF;
|
return calcState.set(CalcState::State::ERROR_PARSING_TARIFF);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
calcState.m_status = CalcState::State::ERROR_LOADING_TARIFF;
|
return calcState.set(CalcState::State::ERROR_LOADING_TARIFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
qCritical() << "init_tariff: Parsing tariff config (" << confFile << ") failed!";
|
qCritical() << "init_tariff: Parsing tariff config (" << confFile << ")";
|
||||||
|
|
||||||
return calcState;
|
return calcState;
|
||||||
}
|
}
|
||||||
|
@ -509,6 +509,6 @@ double Calculator::GetCostFromDuration(Configuration* cfg, uint8_t payment_optio
|
|||||||
|
|
||||||
double ret_val = total_cost;
|
double ret_val = total_cost;
|
||||||
total_cost = 0.0f;
|
total_cost = 0.0f;
|
||||||
// return ceil(ret_val);
|
return ceil(ret_val);
|
||||||
return floor(ret_val);
|
// return floor(ret_val);
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,8 @@ int main() {
|
|||||||
memset(&now, 0, sizeof(now));
|
memset(&now, 0, sizeof(now));
|
||||||
strptime("2023-04-30T06:00:00", "%Y-%m-%dT%H:%M:%S", &now);
|
strptime("2023-04-30T06:00:00", "%Y-%m-%dT%H:%M:%S", &now);
|
||||||
now.tm_hour -= 1; // for ctime
|
now.tm_hour -= 1; // for ctime
|
||||||
for (int i=0; i<6*24; ++i) {
|
// for (int i=0; i<6*24; ++i) {
|
||||||
|
for (int i=0; i<1; ++i) {
|
||||||
int const duration = 120;
|
int const duration = 120;
|
||||||
time_t t = mktime(&now);
|
time_t t = mktime(&now);
|
||||||
start_parking_time = t / 60;
|
start_parking_time = t / 60;
|
||||||
|
Loading…
Reference in New Issue
Block a user