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,15 +271,20 @@ 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";
|
||||||
|
|
||||||
#if !defined(_SVID_SOURCE) && !defined(_XOPEN_SOURCE)
|
#ifdef __linux__
|
||||||
|
#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)"
|
||||||
#else
|
#else
|
||||||
// timezone correction: localtime() needs argument in UTC-timezone
|
// timezone correction: localtime() needs argument in UTC-timezone
|
||||||
// The global variable 'timezone' is set by tzset(), see
|
// The global variable 'timezone' is set by tzset(), see
|
||||||
// https://linux.die.net/man/3/tzset, so I change of the timezone will
|
// https://linux.die.net/man/3/tzset, so I change of the timezone will
|
||||||
// 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
|
||||||
|
#else // windows, only for testing
|
||||||
|
static const long timezone = -3600;
|
||||||
|
valid_until_datetime_t += timezone;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct tm valid_until_datetime;
|
struct tm valid_until_datetime;
|
||||||
|
Loading…
Reference in New Issue
Block a user