Compare commits
6 Commits
59fd4750cc
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
| dfb074e4ce | |||
| 05c9a1dcf2 | |||
| ce0f355f88 | |||
| bfa49cf226 | |||
| e2db18f995 | |||
| 039b366165 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.user
|
||||
3
ATBTariffCalculator.pro
Normal file
3
ATBTariffCalculator.pro
Normal file
@@ -0,0 +1,3 @@
|
||||
TEMPLATE = subdirs
|
||||
CONFIG += ordered
|
||||
SUBDIRS = Calculator Utilities
|
||||
0
Calculator/Calculator.pro
Normal file
0
Calculator/Calculator.pro
Normal file
82
Utilities/Utilities.pro
Normal file
82
Utilities/Utilities.pro
Normal file
@@ -0,0 +1,82 @@
|
||||
QT += core
|
||||
|
||||
TARGET = util
|
||||
|
||||
VERSION="0.1.0"
|
||||
win32 {
|
||||
BUILD_DATE=$$system("date /t")
|
||||
BUILD_TIME=$$system("time /t")
|
||||
} else {
|
||||
BUILD_DATE=$$system("date +%d-%m-%y")
|
||||
BUILD_TIME=$$system("date +%H:%M:%S")
|
||||
}
|
||||
|
||||
GIT_COMMIT=$$system("git log -1 --format=oneline | cut -d' ' -f1")
|
||||
|
||||
EXTENDED_VERSION="$${VERSION}-$${GIT_COMMIT}"
|
||||
|
||||
CONFIG += c++17
|
||||
|
||||
DEFINES+=APP_VERSION=\\\"$$VERSION\\\"
|
||||
DEFINES+=APP_BUILD_DATE=\\\"$$BUILD_DATE\\\"
|
||||
DEFINES+=APP_BUILD_TIME=\\\"$$BUILD_TIME\\\"
|
||||
DEFINES+=APP_EXTENDED_VERSION=\\\"$$EXTENDED_VERSION\\\"
|
||||
|
||||
# keep comments, as /* fall through */
|
||||
QMAKE_CXXFLAGS += -C
|
||||
QMAKE_CXXFLAGS += -g
|
||||
QMAKE_CXXFLAGS += -Wno-deprecated-copy -O
|
||||
|
||||
contains( CONFIG, PTU5 ) {
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += serialport
|
||||
CONFIG += link_pkgconfig
|
||||
lessThan(QT_MAJOR_VERSION, 5): PKGCONFIG += qextserialport
|
||||
QMAKE_CXXFLAGS += -O2 -std=c++17 # for GCC >= 4.7
|
||||
# QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
||||
ARCH = PTU5
|
||||
DEFINES+=PTU5
|
||||
}
|
||||
contains( CONFIG, PTU5_YOCTO ) {
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += serialport
|
||||
QMAKE_CXXFLAGS += -std=c++17 # for GCC >= 4.7
|
||||
# QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
||||
PTU5BASEPATH = /opt/devel/ptu5
|
||||
ARCH = PTU5
|
||||
DEFINES+=PTU5
|
||||
|
||||
# add qmqtt lib
|
||||
#LIBS += -lQt5Qmqtt
|
||||
}
|
||||
contains( CONFIG, DesktopLinux ) {
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += serialport
|
||||
lessThan(QT_MAJOR_VERSION, 5): CONFIG += extserialport
|
||||
# QMAKE_CC = ccache $$QMAKE_CC
|
||||
# QMAKE_CXX = ccache $$QMAKE_CXX
|
||||
QMAKE_CXXFLAGS += -std=c++17
|
||||
# QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
||||
linux-clang { QMAKE_CXXFLAGS += -Qunused-arguments }
|
||||
ARCH = DesktopLinux
|
||||
DEFINES+=DesktopLinux
|
||||
}
|
||||
|
||||
SOURCES += \
|
||||
main.cpp \
|
||||
tariff_json_template.cpp \
|
||||
tariff_editor.cpp
|
||||
|
||||
HEADERS += \
|
||||
tariff_json_template.h \
|
||||
tariff_editor.h
|
||||
|
||||
OTHER_FILES += \
|
||||
tariff.json \
|
||||
tariff.template.json
|
||||
|
||||
|
||||
##########################################################################################
|
||||
# for running program on target through QtCreator
|
||||
contains( CONFIG, PTU5 ) {
|
||||
qnx: target.path = /tmp/$${TARGET}/bin
|
||||
else: unix:!android: target.path = /opt/app/tools/atbupdate/
|
||||
!isEmpty(target.path): INSTALLS += target
|
||||
}
|
||||
51
Utilities/main.cpp
Normal file
51
Utilities/main.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QFile>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QDebug>
|
||||
|
||||
#include "tariff_editor.h"
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
Q_UNUSED(argc);
|
||||
Q_UNUSED(argv);
|
||||
|
||||
TariffEditor editor;
|
||||
editor.writeToDocument("Project", "Szeged");
|
||||
editor.writeToDocument("Version", "1.0.0");
|
||||
editor.writeToDocument("Date", "01.01.1970");
|
||||
editor.writeToDocument("Commiter" , "");
|
||||
editor.writeToDocument("Info", "");
|
||||
|
||||
editor.writeToDocument(editor.create("TariffType"));
|
||||
editor.writeToDocument(editor.create("TariffAccuracy"));
|
||||
editor.writeToDocument(editor.create("TariffPrice"));
|
||||
editor.writeToDocument(editor.create("TariffProducts"));
|
||||
editor.writeToDocument(editor.create("TariffConfig"));
|
||||
editor.writeToDocument(editor.create("TimeRanges"));
|
||||
|
||||
|
||||
qCritical().noquote() << editor.document().toJson();
|
||||
|
||||
return 0;
|
||||
|
||||
QFile currentFile("/home/linux/ATBTariffCalculator/Utilities/tariff.template.json");
|
||||
if (currentFile.open(QIODevice::ReadOnly)) {
|
||||
|
||||
qCritical() << __LINE__;
|
||||
QByteArray json = currentFile.readAll();
|
||||
|
||||
QJsonParseError e;
|
||||
QJsonDocument doc = QJsonDocument::fromJson(json, &e);
|
||||
if (e.error == QJsonParseError::NoError) {
|
||||
qCritical().noquote() << doc.toJson(QJsonDocument::JsonFormat::Indented);
|
||||
} else {
|
||||
qCritical() << e.errorString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
5761
Utilities/tariff.json
Normal file
5761
Utilities/tariff.json
Normal file
File diff suppressed because it is too large
Load Diff
5768
Utilities/tariff.template.json
Normal file
5768
Utilities/tariff.template.json
Normal file
File diff suppressed because it is too large
Load Diff
5753
Utilities/tariff.template.json.bck
Normal file
5753
Utilities/tariff.template.json.bck
Normal file
File diff suppressed because it is too large
Load Diff
181
Utilities/tariff_editor.cpp
Normal file
181
Utilities/tariff_editor.cpp
Normal file
@@ -0,0 +1,181 @@
|
||||
#include "tariff_editor.h"
|
||||
|
||||
#include <QJsonObject>
|
||||
#include <QJsonArray>
|
||||
#include <QDebug>
|
||||
#include <QPair>
|
||||
|
||||
#include <initializer_list>
|
||||
|
||||
TariffEditor::TariffEditor() {
|
||||
m_doc = QJsonDocument();
|
||||
// m_doc.setObject(QJsonObject());
|
||||
}
|
||||
|
||||
QJsonObject TariffEditor::create(QString const &key) {
|
||||
QJsonArray a;
|
||||
if (key.compare("TariffType", Qt::CaseInsensitive) == 0) {
|
||||
a.push_back(QJsonObject({
|
||||
QPair(QString("tariff_type_id"), QJsonValue(1)),
|
||||
QPair(QString("tariff_type_label"), QJsonValue("uniform-to-the-minute")),
|
||||
QPair(QString("comment"), QJsonValue("same price for all computational units, typically minutes"))}));
|
||||
} else
|
||||
if (key.compare("TariffAccuracy", Qt::CaseInsensitive) == 0) {
|
||||
a.push_back(QJsonObject({
|
||||
QPair(QString("tariff_accuracy_id"), QJsonValue(1)),
|
||||
QPair(QString("tariff_accuracy_label"), QJsonValue("computation per minute")),
|
||||
QPair(QString("tariff_accuracy_value"), QJsonValue(1)),
|
||||
QPair(QString("comment"), QJsonValue("accuracy of tariff computation is individual minutes"))
|
||||
}));
|
||||
} else
|
||||
if (key.compare("TariffPrice", Qt::CaseInsensitive) == 0) {
|
||||
a.push_back(QJsonObject({
|
||||
QPair(QString("tariff_price_id"), QJsonValue(1)),
|
||||
QPair(QString("tariff_price"), QJsonValue(165)),
|
||||
QPair(QString("editable"), QJsonValue(true)),
|
||||
QPair(QString("comment"), QJsonValue("price per hour as entered by customer"))
|
||||
}));
|
||||
a.push_back(QJsonObject({
|
||||
QPair(QString("tariff_price_id"), QJsonValue(2)),
|
||||
QPair(QString("tariff_price"), QJsonValue(990)),
|
||||
QPair(QString("editable"), QJsonValue(true)),
|
||||
QPair(QString("comment"), QJsonValue("price for dayticket as entered by customer"))
|
||||
}));
|
||||
} else
|
||||
if (key.compare("TariffConfig", Qt::CaseInsensitive) == 0) {
|
||||
a.push_back(QJsonObject({
|
||||
QPair(QString("tariff_config_id"), QJsonValue(1)),
|
||||
QPair(QString("tariff_config_label"), QJsonValue("Tariff-Config")),
|
||||
QPair(QString("tariff_config_accuracy"), QJsonValue(1)),
|
||||
QPair(QString("tariff_config_type"), QJsonValue(1)),
|
||||
QPair(QString("tariff_config_carry_over"), QJsonValue(true)),
|
||||
QPair(QString("tariff_config_prepaid"), QJsonValue(true))
|
||||
}));
|
||||
a.push_back(QJsonObject({
|
||||
QPair(QString("MinimalTime"),
|
||||
QJsonValue(QJsonObject({
|
||||
QPair(QString("value"), QJsonValue(15)),
|
||||
QPair(QString("editable"), QJsonValue(true)),
|
||||
QPair(QString("comment"), QJsonValue("minimal parking time in minutes (net)"))})))}));
|
||||
a.push_back(QJsonObject({
|
||||
QPair(QString("MaximalTime"),
|
||||
QJsonValue(QJsonObject({
|
||||
QPair(QString("value"), QJsonValue(360)),
|
||||
QPair(QString("editable"), QJsonValue(true)),
|
||||
QPair(QString("comment"), QJsonValue("maximal parking time in minutes (net)"))})))}));
|
||||
a.push_back(QJsonObject({
|
||||
QPair(QString("MinimalPrice"),
|
||||
QJsonValue(QJsonObject({
|
||||
QPair(QString("value"), QJsonValue(15)),
|
||||
QPair(QString("editable"), QJsonValue(true)),
|
||||
QPair(QString("comment"), QJsonValue("customer entered price (for hour) expressed in minimal time: 15*(165/60) = 41.25"))})))}));
|
||||
a.push_back(QJsonObject({
|
||||
QPair(QString("MaximalPrice"),
|
||||
QJsonValue(QJsonObject({
|
||||
QPair(QString("value"), QJsonValue(990)),
|
||||
QPair(QString("editable"), QJsonValue(true)),
|
||||
QPair(QString("comment"), QJsonValue("customer entered price (for hour) expressed in maximal time: 15*(165/60) = 41.25"))})))}));
|
||||
} else
|
||||
if (key.compare("TariffProducts", Qt::CaseInsensitive) == 0) {
|
||||
a.push_back(QJsonObject({
|
||||
QPair(QString("ShortTimeParking"),
|
||||
QJsonValue(QJsonObject({
|
||||
QPair(QString("tariff_product_id"), QJsonValue(1)),
|
||||
QPair(QString("tariff_product_price_id"), QJsonValue(1))})))}));
|
||||
a.push_back(QJsonObject({
|
||||
QPair(QString("DayTicket"),
|
||||
QJsonValue(QJsonObject({
|
||||
QPair(QString("tariff_product_id"), QJsonValue(2)),
|
||||
QPair(QString("tariff_product_price_id"), QJsonValue(2))})))}));
|
||||
} else
|
||||
if (key.compare("TimeRanges", Qt::CaseInsensitive) == 0) {
|
||||
// if prepaid, unrestricted
|
||||
QJsonArray b;
|
||||
|
||||
QJsonValue v;
|
||||
|
||||
v = QJsonObject({
|
||||
QPair(QString("tariff_range_id"), QJsonValue(100001)),
|
||||
QPair(QString("tariff_range_start"), QJsonValue("00:00:00")),
|
||||
QPair(QString("tariff_range_end"), QJsonValue("00:00:00")),
|
||||
QPair(QString("tariff_range_price_id"), QJsonValue(0)),
|
||||
QPair(QString("comment"), QJsonValue(QString("start block is free of charge")))});
|
||||
|
||||
v = QJsonObject({QPair(QString("Block-Start-0"), v)});
|
||||
b.append(v);
|
||||
|
||||
v = QJsonObject({
|
||||
QPair(QString("tariff_range_id"), QJsonValue(100002)),
|
||||
QPair(QString("tariff_range_start"), QJsonValue("00:00:00")),
|
||||
QPair(QString("tariff_range_end"), QJsonValue("00:00:00")),
|
||||
QPair(QString("tariff_range_price_id"), QJsonValue(0)),
|
||||
QPair(QString("comment"), QJsonValue(QString("end block is free of charge")))}),
|
||||
v = QJsonObject({QPair(QString("Block-End-0"), v)});
|
||||
b.append(v);
|
||||
|
||||
v = QJsonObject({
|
||||
QPair(QString("tariff_range_id"), QJsonValue(100003)),
|
||||
QPair(QString("tariff_range_start"), QJsonValue("00:00:00")),
|
||||
QPair(QString("tariff_range_end"), QJsonValue("08:00:00")),
|
||||
QPair(QString("tariff_range_price_id"), QJsonValue(0)),
|
||||
QPair(QString("comment"), QJsonValue(QString("start block is free of charge")))});
|
||||
v = QJsonObject({QPair(QString("Block-Start-1"), v)});
|
||||
b.append(v);
|
||||
|
||||
v = QJsonObject({
|
||||
QPair(QString("tariff_range_id"), QJsonValue(100004)),
|
||||
QPair(QString("tariff_range_start"), QJsonValue("18:00:00")),
|
||||
QPair(QString("tariff_range_end"), QJsonValue("00:00:00")),
|
||||
QPair(QString("tariff_range_price_id"), QJsonValue(0)),
|
||||
QPair(QString("comment"), QJsonValue(QString("end block is free of charge")))});
|
||||
v = QJsonObject({QPair(QString("Block-End-1"), v)});
|
||||
b.append(v);
|
||||
|
||||
v = QJsonObject({
|
||||
QPair(QString("tariff_range_id"), QJsonValue(100005)),
|
||||
QPair(QString("tariff_range_start"), QJsonValue("00:00:00")),
|
||||
QPair(QString("tariff_range_end"), QJsonValue("08:00:00")),
|
||||
QPair(QString("tariff_range_price_id"), QJsonValue(0)),
|
||||
QPair(QString("comment"), QJsonValue(QString("start block is free of charge")))});
|
||||
v = QJsonObject({QPair(QString("Block-Start-1"), v)});
|
||||
b.append(v);
|
||||
|
||||
v = QJsonObject({
|
||||
QPair(QString("tariff_range_id"), QJsonValue(100006)),
|
||||
QPair(QString("tariff_range_start"), QJsonValue("12:00:00")),
|
||||
QPair(QString("tariff_range_end"), QJsonValue("00:00:00")),
|
||||
QPair(QString("tariff_range_price_id"), QJsonValue(0)),
|
||||
QPair(QString("comment"), QJsonValue(QString("end block is free of charge")))});
|
||||
v = QJsonObject({QPair(QString("Block-End-1"), v)});
|
||||
b.append(v);
|
||||
|
||||
a.push_back(QJsonObject({QPair(QString("OperationTimes"), b)}));
|
||||
}
|
||||
#if 0
|
||||
{
|
||||
"time_range_id": 100001,
|
||||
"time_range_start": "00:00:00",
|
||||
"time_range_end": "00:00:00",
|
||||
"time_range_start_minute": 0,
|
||||
"time_range_end_minute": 1440,
|
||||
"time_range_price_id": 2,
|
||||
"comment": "[ 00:00-00:00 [ = [ 00:00-24:00 ["
|
||||
},
|
||||
|
||||
#endif
|
||||
|
||||
return QJsonObject({QPair(key, QJsonValue(a))});
|
||||
}
|
||||
|
||||
QJsonDocument &TariffEditor::writeToDocument(QJsonObject const &object) {
|
||||
QJsonArray a = m_doc.array();
|
||||
a.push_back(object);
|
||||
//a.push_back(object);
|
||||
//a.push_back(QJsonObject(std::initializer_list{QPair(key, value)}));
|
||||
m_doc.setArray(a);
|
||||
return m_doc;
|
||||
}
|
||||
|
||||
QJsonDocument &TariffEditor::writeToDocument(QString const &key, QString const &value) {
|
||||
return writeToDocument(std::initializer_list{QPair(key, QJsonValue(value))});
|
||||
}
|
||||
22
Utilities/tariff_editor.h
Normal file
22
Utilities/tariff_editor.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef TARIFF_EDITOR_H_INCLUDED
|
||||
#define TARIFF_EDITOR_H_INCLUDED
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QString>
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
class TariffEditor {
|
||||
QJsonDocument m_doc;
|
||||
|
||||
public:
|
||||
explicit TariffEditor();
|
||||
|
||||
QJsonObject create(QString const &key);
|
||||
QJsonDocument &document() { return m_doc; }
|
||||
QJsonDocument const &document() const { return m_doc; }
|
||||
QJsonDocument &writeToDocument(QString const &key, QString const &value);
|
||||
QJsonDocument &writeToDocument(QJsonObject const &value);
|
||||
};
|
||||
|
||||
#endif // TARIFF_EDITOR_H_INCLUDED
|
||||
1031
Utilities/tariff_json_template.cpp
Normal file
1031
Utilities/tariff_json_template.cpp
Normal file
File diff suppressed because it is too large
Load Diff
277
Utilities/tariff_json_template.h
Normal file
277
Utilities/tariff_json_template.h
Normal file
@@ -0,0 +1,277 @@
|
||||
#ifndef TARIFF_JSON_TEMPLATE_H_INCLUDED
|
||||
#define TARIFF_JSON_TEMPLATE_H_INCLUDED
|
||||
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonParseError>
|
||||
#include <QJsonValue>
|
||||
|
||||
|
||||
struct TariffTemplate : public QJsonObject {
|
||||
QJsonValue m_project;
|
||||
QJsonValue m_version;
|
||||
QJsonValue m_date;
|
||||
QJsonValue m_committer;
|
||||
QJsonValue m_info;
|
||||
|
||||
struct TariffProduct : public QJsonObject {
|
||||
QJsonValue m_tariff_product_id;
|
||||
QJsonValue m_tariff_product_price_id;
|
||||
QJsonValue m_tariff_product_name;
|
||||
QJsonArray m_tariff_product_time_ranges;
|
||||
} m_tariff_product;
|
||||
|
||||
QJsonArray m_tariff_product_setting;
|
||||
|
||||
struct TariffProduct : public QJsonObject {
|
||||
QJsonValue m_tariff_accuracy_id;
|
||||
QJsonValue m_tariff_accuracy_label;
|
||||
QJsonValue m_tariff_accuracy_value;
|
||||
QJsonArray m_comment;
|
||||
} m_tariff_accuracy;
|
||||
|
||||
QJsonArray m_tariff_accuracy_setting;
|
||||
|
||||
struct TariffType : public QJsonObject {
|
||||
QJsonValue m_tariff_type_id;
|
||||
QJsonValue m_tariff_type_label;
|
||||
QJsonValue m_comment;
|
||||
} m_tariff_type;
|
||||
|
||||
QJsonArray m_tariff_type_setting;
|
||||
|
||||
struct TariffTimeBase : public QJsonObject {
|
||||
QJsonValue m_tariff_timebase_id;
|
||||
QJsonValue m_tariff_timebase_label;
|
||||
QJsonValue m_comment;
|
||||
} m_tariff_timebase;
|
||||
|
||||
QJsonArray m_tariff_timebase_setting;
|
||||
|
||||
struct TariffPriceCustomer : public QJsonObject {
|
||||
QJsonValue m_tariff_price_customer_id;
|
||||
QJsonValue m_tariff_price_customer_label;
|
||||
QJsonValue m_editable;
|
||||
QJsonValue m_comment;
|
||||
};
|
||||
|
||||
struct TariffConfig : public QJsonObject {
|
||||
QJsonValue m_tariff_config_id;
|
||||
QJsonValue m_tariff_config_label;
|
||||
QJsonValue m_tariff_config_accuracy;
|
||||
QJsonValue m_tariff_config_type;
|
||||
|
||||
struct TariffMinimalTime : public QJsonObject {
|
||||
QJsonValue m_value;
|
||||
QJsonValue m_editable;
|
||||
QJsonValue m_comment;
|
||||
} m_tariff_minimal_time;
|
||||
|
||||
struct TariffMaximalTime : public QJsonObject {
|
||||
QJsonValue m_value;
|
||||
QJsonValue m_editable;
|
||||
QJsonValue m_comment;
|
||||
} m_tariff_maximal_time;
|
||||
|
||||
struct TariffMinimalPrice : public QJsonObject {
|
||||
QJsonValue m_value;
|
||||
QJsonValue m_editable;
|
||||
QJsonValue m_comment;
|
||||
} m_minimal_price;
|
||||
|
||||
struct TariffMaximalPrice : public QJsonObject {
|
||||
QJsonValue m_value;
|
||||
QJsonValue m_editable;
|
||||
QJsonValue m_comment;
|
||||
} m_maximal_price;
|
||||
|
||||
QJsonValue m_tariff_config_time_base;
|
||||
QJsonValue m_tariff_config_carry_over;
|
||||
QJsonValue m_tariff_config_prepaid;
|
||||
};
|
||||
|
||||
struct TariffTimeRange : public QJsonObject {
|
||||
QJsonValue m_time_range_id;
|
||||
QJsonValue m_time_range_start;
|
||||
QJsonValue m_time_range_end;
|
||||
QJsonValue m_time_range_start_minute;
|
||||
QJsonValue m_time_range_end_minute;
|
||||
QJsonValue m_time_range_price_id;
|
||||
QJsonValue m_comment;
|
||||
} m_tariff_time_range;
|
||||
|
||||
QJsonArray m_tariff_time_range_setting;
|
||||
|
||||
struct TariffDateRange : public QJsonObject {
|
||||
QJsonValue m_date_range_id;
|
||||
QJsonValue m_date_range_label;
|
||||
QJsonValue m_date_range_from;
|
||||
};
|
||||
|
||||
QJsonArray m_tariff_time_range_setting;
|
||||
|
||||
struct TariffDayConfiguration : public QJsonObject {
|
||||
QJsonValue m_day_config_id;
|
||||
QJsonValue m_day_config_date_range;
|
||||
QJsonValue m_day_consfig_comment_date_range;
|
||||
QJsonArray m_day_config_product_ids;
|
||||
QJsonValue m_day_config_comment_product_ids;
|
||||
|
||||
struct : QJsonArray {
|
||||
struct : public QJsonObject {
|
||||
QJsonArray m_data;
|
||||
} m_day_time_ranges_short_time_parking;
|
||||
|
||||
struct : public QJsonObject {
|
||||
QJsonArray m_data;
|
||||
} m_day_time_ranges_day_ticket;
|
||||
} m_day_config_day_time_ranges;
|
||||
|
||||
};
|
||||
|
||||
struct TariffWeekDay : public QJsonObject {
|
||||
QJsonValue m_day_id;
|
||||
QJsonValue m_day_label;
|
||||
QJsonValue m_day_config_id;
|
||||
};
|
||||
|
||||
struct TariffHolidayDay : public QJsonObject {
|
||||
QJsonValue m_day_id;
|
||||
QJsonValue m_day_label;
|
||||
QJsonValue m_day_config_id;
|
||||
QJsonValue m_day_moveable;
|
||||
};
|
||||
|
||||
QJsonArray m_tariff_days_setting;
|
||||
};
|
||||
|
||||
#if 0
|
||||
|
||||
namespace ISMAS {
|
||||
|
||||
struct TransferData : public QJsonObject {
|
||||
struct : public QJsonObject {
|
||||
QJsonValue tariffId;
|
||||
QJsonValue group;
|
||||
QJsonValue zone;
|
||||
} device;
|
||||
|
||||
struct : public QJsonObject {
|
||||
QJsonValue state;
|
||||
QJsonValue uid;
|
||||
QJsonValue seq_tick_number;
|
||||
QJsonValue timestamp;
|
||||
QJsonValue userText;
|
||||
QJsonValue userTextType;
|
||||
} transaction;
|
||||
|
||||
struct : public QJsonObject {
|
||||
// TODO: check what is really used at the moment
|
||||
QJsonValue id; // unique article id
|
||||
QJsonValue name; // name
|
||||
QJsonValue price; // price in cent
|
||||
QJsonValue currency; //
|
||||
QJsonValue startTime; // start time
|
||||
QJsonValue endTime; // end time
|
||||
QJsonValue userText; // additional info
|
||||
QJsonValue parkingTime;
|
||||
QJsonValue printText;
|
||||
// QJsonValue discount;
|
||||
} item;
|
||||
|
||||
struct : public QJsonObject {
|
||||
struct : public QJsonObject {
|
||||
QJsonValue coins; // total amount of coins value
|
||||
// QJsonValue notes; // total amount of notes value
|
||||
QJsonValue overpaid; // in cent
|
||||
QJsonValue currency;
|
||||
QJsonValue change;
|
||||
} cash;
|
||||
|
||||
struct : public QJsonObject {
|
||||
QJsonValue cardNumber;
|
||||
QJsonValue value; // buchungsbetrag
|
||||
QJsonValue cardType;
|
||||
QJsonValue currency;
|
||||
QJsonValue tid;
|
||||
QJsonValue tresult;
|
||||
} card;
|
||||
|
||||
struct : public QJsonObject {
|
||||
QJsonValue cardNumber;
|
||||
QJsonValue cardType;
|
||||
QJsonValue value;
|
||||
QJsonValue valueOld;
|
||||
QJsonValue valueNew;
|
||||
QJsonValue time;
|
||||
QJsonValue timeOld;
|
||||
QJsonValue timeNew;
|
||||
} prePaidCard;
|
||||
} payment;
|
||||
|
||||
struct : public QJsonObject {
|
||||
QJsonValue delivery; // PRINT, OnlineTicket
|
||||
QJsonValue result; // SUCCESS, ERROR
|
||||
QJsonValue errorCode; // 0=OK, 1=...
|
||||
QJsonValue errorMsg;
|
||||
} result;
|
||||
};
|
||||
|
||||
|
||||
struct AccountData : public QJsonObject {
|
||||
struct : public QJsonObject {
|
||||
QJsonValue UID;
|
||||
QJsonValue ChangeNumber;
|
||||
QJsonValue Process; // Vorgang
|
||||
QJsonValue startDateTime;
|
||||
QJsonValue endDateTime;
|
||||
QJsonValue startHash;
|
||||
QJsonValue endHash;
|
||||
|
||||
struct : public QJsonObject {
|
||||
QJsonValue value; // coin value
|
||||
QJsonValue numberOfCoins; // number of coins
|
||||
QJsonValue currency;
|
||||
} coin;
|
||||
|
||||
} coinBox; // Münzkasse
|
||||
};
|
||||
|
||||
|
||||
struct EventData : public QJsonObject {
|
||||
struct : public QJsonObject {
|
||||
QJsonValue eventID;
|
||||
QJsonValue deviceName;
|
||||
QJsonValue reason;
|
||||
QJsonValue event;
|
||||
QJsonValue eventState;
|
||||
QJsonValue timeStamp;
|
||||
QJsonValue parameter;
|
||||
QJsonValue secondLevelInfo;
|
||||
} machineEvent; //
|
||||
};
|
||||
|
||||
struct StateData : public QJsonObject {
|
||||
QJsonValue Timestamp;
|
||||
QJsonArray HW_States;
|
||||
struct : public QJsonObject {
|
||||
QJsonValue name;
|
||||
QJsonValue value;
|
||||
QJsonValue unit;
|
||||
} machineState; //
|
||||
};
|
||||
|
||||
|
||||
enum class REQUEST : quint8 {
|
||||
NO_REQUEST,
|
||||
START,
|
||||
STOP,
|
||||
PING,
|
||||
SELF,
|
||||
PARAMETER
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // TARIFF_JSON_TEMPLATE_H_INCLUDED
|
||||
Reference in New Issue
Block a user