test add compact format
This commit is contained in:
@@ -28,6 +28,13 @@ CONFIG(debug, debug|release) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
contains(CONFIG, DesktopLinux) {
|
||||||
|
DEFINES += DESKTOP_LINUX
|
||||||
|
|
||||||
|
CONFIG -= c++11 c++14
|
||||||
|
CONFIG += c++17
|
||||||
|
}
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
src/calculator_functions.cpp \
|
src/calculator_functions.cpp \
|
||||||
src/utilities.cpp \
|
src/utilities.cpp \
|
||||||
@@ -104,3 +111,6 @@ OTHER_FILES += src/main.cpp \
|
|||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
!isEmpty(target.path): INSTALLS += target
|
!isEmpty(target.path): INSTALLS += target
|
||||||
|
|
||||||
|
SOURCES += src/compact_api.cpp
|
||||||
|
HEADERS += include/mobilisis/compact_api.h include/mobilisis/compact_engine.h include/mobilisis/compact_tariff.h include/mobilisis/compact_calendar.h
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include "period_year.h"
|
#include "period_year.h"
|
||||||
#include "tariff_permit_type.h"
|
#include "tariff_permit_type.h"
|
||||||
|
|
||||||
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
@@ -446,20 +447,30 @@ int CALCULATE_LIBRARY_API get_maximal_parkingprice(Configuration *cfg,
|
|||||||
|
|
||||||
int CALCULATE_LIBRARY_API get_zone_nr(int zone)
|
int CALCULATE_LIBRARY_API get_zone_nr(int zone)
|
||||||
{
|
{
|
||||||
if(zone > -1) return zone;
|
if (zone > -1)
|
||||||
else
|
return zone;
|
||||||
{
|
|
||||||
QFile zone("/mnt/system_data/zone_nr");
|
#ifdef DESKTOP_LINUX
|
||||||
if (zone.exists()) {
|
QString zonePath = QDir::homePath() + "/atbapp/zone_nr";
|
||||||
QFileInfo finfo(zone);
|
#else
|
||||||
if (zone.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
QString zonePath = "/mnt/system_data/zone_nr";
|
||||||
QTextStream in(&zone);
|
#endif
|
||||||
return in.readLine(100).toInt();
|
|
||||||
}
|
QFile zoneFile(zonePath);
|
||||||
|
|
||||||
|
if (zoneFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
|
QTextStream in(&zoneFile);
|
||||||
|
|
||||||
|
bool ok = false;
|
||||||
|
int zoneNr = in.readLine(100).trimmed().toInt(&ok);
|
||||||
|
|
||||||
|
if (ok)
|
||||||
|
return zoneNr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qWarning() << "Failed to read zone number from:" << zonePath;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
CalcState CALCULATE_LIBRARY_API init_tariff(parking_tariff_t **tariff, char const *config_file) {
|
CalcState CALCULATE_LIBRARY_API init_tariff(parking_tariff_t **tariff, char const *config_file) {
|
||||||
*tariff = new Configuration();
|
*tariff = new Configuration();
|
||||||
|
|||||||
Executable → Regular
Executable → Regular
Executable → Regular
Reference in New Issue
Block a user