test add compact format

This commit is contained in:
2026-11-24 15:14:38 +01:00
parent f2156e4650
commit 98be94f33b
5 changed files with 33 additions and 12 deletions
+10
View File
@@ -28,6 +28,13 @@ CONFIG(debug, debug|release) {
}
}
contains(CONFIG, DesktopLinux) {
DEFINES += DESKTOP_LINUX
CONFIG -= c++11 c++14
CONFIG += c++17
}
SOURCES += \
src/calculator_functions.cpp \
src/utilities.cpp \
@@ -104,3 +111,6 @@ OTHER_FILES += src/main.cpp \
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!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
+22 -11
View File
@@ -7,6 +7,7 @@
#include "period_year.h"
#include "tariff_permit_type.h"
#include <QDir>
#include <QFile>
#include <QFileInfo>
#include <QDateTime>
@@ -446,20 +447,30 @@ int CALCULATE_LIBRARY_API get_maximal_parkingprice(Configuration *cfg,
int CALCULATE_LIBRARY_API get_zone_nr(int zone)
{
if(zone > -1) return zone;
else
{
QFile zone("/mnt/system_data/zone_nr");
if (zone.exists()) {
QFileInfo finfo(zone);
if (zone.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream in(&zone);
return in.readLine(100).toInt();
}
if (zone > -1)
return zone;
#ifdef DESKTOP_LINUX
QString zonePath = QDir::homePath() + "/atbapp/zone_nr";
#else
QString zonePath = "/mnt/system_data/zone_nr";
#endif
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;
}
}
CalcState CALCULATE_LIBRARY_API init_tariff(parking_tariff_t **tariff, char const *config_file) {
*tariff = new Configuration();
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File