Merge branch 'master' of git.mimbach49.de:GerhardHoffmann/MOBILISIS-Calculator
This commit is contained in:
commit
ee1f7eca44
@ -28,6 +28,8 @@ CalcState CALCULATE_LIBRARY_API init_tariff(parking_tariff_t **tariff, char cons
|
|||||||
*tariff = new Configuration();
|
*tariff = new Configuration();
|
||||||
|
|
||||||
CalcState calcState;
|
CalcState calcState;
|
||||||
|
#if __linux__
|
||||||
|
|
||||||
int const zone = get_zone_nr();
|
int const zone = get_zone_nr();
|
||||||
|
|
||||||
// DEBUG
|
// DEBUG
|
||||||
@ -49,6 +51,9 @@ CalcState CALCULATE_LIBRARY_API init_tariff(parking_tariff_t **tariff, char cons
|
|||||||
memset(buffer, 0x00, sizeof(buffer));
|
memset(buffer, 0x00, sizeof(buffer));
|
||||||
snprintf(buffer, sizeof(buffer)-1, "tariff%02d.json", zone);
|
snprintf(buffer, sizeof(buffer)-1, "tariff%02d.json", zone);
|
||||||
confFile += buffer;
|
confFile += buffer;
|
||||||
|
#else // windows
|
||||||
|
QString confFile(config_file);
|
||||||
|
#endif
|
||||||
|
|
||||||
// DEBUG
|
// DEBUG
|
||||||
qCritical() << " ... confFile = " << confFile;
|
qCritical() << " ... confFile = " << confFile;
|
||||||
|
@ -271,6 +271,7 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
|
|||||||
cout << "Total minutes: " << (int)ret_val << endl;
|
cout << "Total minutes: " << (int)ret_val << endl;
|
||||||
if (ret_val <= 0) return "PARKING NOT ALLOWED";
|
if (ret_val <= 0) return "PARKING NOT ALLOWED";
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
#if !defined(_SVID_SOURCE) && !defined(_XOPEN_SOURCE)
|
#if !defined(_SVID_SOURCE) && !defined(_XOPEN_SOURCE)
|
||||||
// needed for timezone-correction
|
// needed for timezone-correction
|
||||||
#error "!defined(_SVID_SOURCE) && !defined(_XOPEN_SOURCE)"
|
#error "!defined(_SVID_SOURCE) && !defined(_XOPEN_SOURCE)"
|
||||||
@ -281,6 +282,10 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
|
|||||||
// also change the value of the variable 'timezone'.
|
// also change the value of the variable 'timezone'.
|
||||||
valid_until_datetime_t += timezone;
|
valid_until_datetime_t += timezone;
|
||||||
#endif
|
#endif
|
||||||
|
#else // windows, only for testing
|
||||||
|
static const long timezone = -3600;
|
||||||
|
valid_until_datetime_t += timezone;
|
||||||
|
#endif
|
||||||
|
|
||||||
struct tm valid_until_datetime;
|
struct tm valid_until_datetime;
|
||||||
memset(&valid_until_datetime, 0x00, sizeof(valid_until_datetime));
|
memset(&valid_until_datetime, 0x00, sizeof(valid_until_datetime));
|
||||||
|
Loading…
Reference in New Issue
Block a user