Compare commits
54 Commits
3bbf36cdd7
...
master
Author | SHA1 | Date | |
---|---|---|---|
4b38e2e46e | |||
9fa37d125d | |||
00dbf4485a | |||
88670c1079 | |||
2efdbe2d68 | |||
38994ac192 | |||
f6238e5a36 | |||
f0762e272f | |||
46ab0ec80f | |||
1d8eb2a808 | |||
22fb039172 | |||
cf8dd83a48 | |||
1a08f8ee3a | |||
94b51b5794 | |||
f833d9d13d | |||
aa4cc78380 | |||
83e282b7fc | |||
444b2f09e3 | |||
ce08b4b334 | |||
5f73704020 | |||
df9078de98 | |||
a139fdb58f | |||
6491646243 | |||
af351ee092 | |||
8490ba8a3a | |||
f9680105ab | |||
c8c19e8cfc | |||
c5654509a3 | |||
be98f7e178 | |||
909d1355a0 | |||
35f3c5f0a1 | |||
1c2ac9f4da | |||
078dd94e60 | |||
ed8505c177 | |||
63b4d7577d | |||
fc70115079 | |||
f96ac85a18 | |||
028792143a | |||
d15d15b55a | |||
5f7fc7f168 | |||
0f6e666124 | |||
27bc4afd51 | |||
365b02a9c9 | |||
a1b1cedd09 | |||
af72ad43a4 | |||
dfba8e3807 | |||
5f37646b4a | |||
74cf8f136c | |||
e52813b78f | |||
e6d7e7a536 | |||
f85bf3debf | |||
08655a0229 | |||
197dacf822 | |||
838c02d9e2 |
858
ATBHMIconfig.cpp
858
ATBHMIconfig.cpp
@@ -1,858 +0,0 @@
|
||||
#include "ATBHMIconfig.h"
|
||||
#include "atb_system.h"
|
||||
#include <QDebug>
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
|
||||
|
||||
|
||||
ATBHMIconfig::ATBHMIconfig(QObject *parent) : QObject(parent) {
|
||||
this->initEarly();
|
||||
this->initDefered();
|
||||
}
|
||||
|
||||
ATBHMIconfig::~ATBHMIconfig() {
|
||||
delete settings;
|
||||
}
|
||||
|
||||
void ATBHMIconfig::initEarly() {
|
||||
QString settings_file = QCoreApplication::applicationDirPath() + "/ATBQT.ini";
|
||||
settings = new QSettings(settings_file, QSettings::IniFormat);
|
||||
settings->setIniCodec("UTF-8");
|
||||
configGroups = settings->childGroups();
|
||||
|
||||
// [COMMON]
|
||||
|
||||
settings->beginGroup("COMMON");
|
||||
|
||||
#if defined (ARCH_PTU2) || defined (ARCH_PTU4)
|
||||
ComPortName = settings->value("com_port_name", "/dev/ttyS0").toString();
|
||||
#else
|
||||
ComPortName = settings->value("com_port_name", "/dev/pts/20").toString();
|
||||
#endif
|
||||
ComBaudRate = settings->value("com_baud_rate", "115200").toInt();
|
||||
|
||||
if ((ComBaudRate != 115200) &&
|
||||
(ComBaudRate != 57600) &&
|
||||
(ComBaudRate != 9600)) { ComBaudRate = 115200; }
|
||||
|
||||
|
||||
lang1 = settings->value("lang1", "de_DE").toString();
|
||||
lang2 = settings->value("lang2", "en_US").toString();
|
||||
lang3 = settings->value("lang3", "fr_FR").toString();
|
||||
lang4 = settings->value("lang4", "ja_JP").toString();
|
||||
lang5 = settings->value("lang5", "nl-NL").toString();
|
||||
|
||||
useLanguage = static_cast<quint8>(settings->value("useLanguage", "255").toInt());
|
||||
|
||||
this->defaultLanguage = settings->value("defaultLanguage", "1").toInt();
|
||||
if ((this->defaultLanguage < 1) || (this->defaultLanguage > 5)) {
|
||||
this->defaultLanguage = 1;
|
||||
}
|
||||
|
||||
usePayment = static_cast<quint8>(settings->value("usePayment", "255").toInt());
|
||||
|
||||
useVehicle = static_cast<quint8>(settings->value("useVehicle", "255").toInt());
|
||||
|
||||
useProduct = static_cast<quint8>(settings->value("useProduct", "255").toInt());
|
||||
|
||||
|
||||
textfilename = settings->value("textfile", "HMI_Texte.xml").toString();
|
||||
#if defined (ARCH_DesktopLinux)
|
||||
QString filename = textfilename.split("/").last();
|
||||
textfilename = qApp->applicationDirPath() + "/text/" + filename;
|
||||
#endif
|
||||
|
||||
#if defined (ARCH_DesktopLinux)
|
||||
logfilename = QDir::homePath() + "/ATBAPP_VMC.log";
|
||||
#else
|
||||
logfilename = settings->value("logfile", "/var/log/atbqt.log").toString();
|
||||
#endif
|
||||
|
||||
oooServiceNumber = settings->value("ooo_serviceNumber", "").toString();
|
||||
|
||||
oooServiceEmail = settings->value("ooo_serviceEmail", "").toString();
|
||||
|
||||
oooAlternativeLocation = settings->value("ooo_alternativeLocation", "").toString();
|
||||
|
||||
alternativeLogoFilename = settings->value("alternativeLogoFile").toString();
|
||||
|
||||
this->features = 0;
|
||||
|
||||
// deprecated:
|
||||
qmPath = qApp->applicationDirPath() + "/translations";
|
||||
|
||||
settings->endGroup();
|
||||
|
||||
/*
|
||||
* note: PSA configuration settings are not stored in ini-file
|
||||
*/
|
||||
cust_nr = "0";
|
||||
group_nr = "0";
|
||||
zone_nr = "0";
|
||||
machine_nr = "0";
|
||||
validPSAconfig = false;
|
||||
}
|
||||
|
||||
|
||||
void ATBHMIconfig::initDefered() {
|
||||
bool ok = false;
|
||||
|
||||
// [COMMON]
|
||||
|
||||
settings->beginGroup("COMMON");
|
||||
|
||||
SuspendMethode = settings->value("suspend_methode", "sysfs").toString();
|
||||
SuspendProgram = settings->value("suspend_program", "").toString();
|
||||
SuspendTime = settings->value("suspend_time", "10").toString();
|
||||
|
||||
if (settings->value("feature_Log", "on").toString() == "on" ||
|
||||
settings->value("feature_Log", "on").toString() == "yes" )
|
||||
{ this->setFeatureLog(); }
|
||||
else { this->unsetFeatureLog(); }
|
||||
|
||||
if (settings->value("feature_TouchFeedback", "on").toString() == "on" ||
|
||||
settings->value("feature_TouchFeedback", "on").toString() == "yes" )
|
||||
{ this->setFeatureTF(); }
|
||||
else { this->unsetFeatureTF(); }
|
||||
|
||||
if (settings->value("feature_DisplayControl", "off").toString() == "on" ||
|
||||
settings->value("feature_DisplayControl", "off").toString() == "yes" )
|
||||
{ this->setFeatureDC(); }
|
||||
else { this->unsetFeatureDC(); }
|
||||
|
||||
if (settings->value("feature_StartButton", "on").toString() == "on" ||
|
||||
settings->value("feature_StartButton", "on").toString() == "yes" )
|
||||
{ this->setFeatureStartButton(); }
|
||||
else { this->unsetFeatureStartButton(); }
|
||||
|
||||
if (settings->value("feature_selfOOO", "on").toString() == "on" ||
|
||||
settings->value("feature_selfOOO", "on").toString() == "yes" )
|
||||
{ this->setFeatureSelfOOO(); }
|
||||
else { this->unsetFeatureSelfOOO(); }
|
||||
|
||||
if (settings->value("feature_DBusDisplayControl", "on").toString() == "on" ||
|
||||
settings->value("feature_DBusDisplayControl", "on").toString() == "yes" )
|
||||
{ this->setFeatureDBusDisplayControl(); }
|
||||
else { this->unsetFeatureDBusDisplayControl(); }
|
||||
|
||||
if (settings->value("feature_DBusSuspendControl", "on").toString() == "on" ||
|
||||
settings->value("feature_DBusSuspendControl", "on").toString() == "yes" )
|
||||
{ this->setFeatureDBusSuspendControl(); }
|
||||
else { this->unsetFeatureDBusSuspendControl(); }
|
||||
|
||||
if (settings->value("feature_ShowParkingTime", "on").toString() == "on" ||
|
||||
settings->value("feature_ShowParkingTime", "on").toString() == "yes" )
|
||||
{ this->setFeatureShowParkingTime(); }
|
||||
else { this->unsetFeatureShowParkingTime(); }
|
||||
|
||||
|
||||
touch_feedback_gpio = settings->value("touch_feedback_gpio", "121").toString();
|
||||
|
||||
touch_feedback_on_value = settings->value("touch_feedback_on_value", "0").toString();
|
||||
touch_feedback_off_value = settings->value("touch_feedback_off_value", "1").toString();
|
||||
|
||||
QString ooo_mode = settings->value("ooo_mode", "useDisk").toString();
|
||||
if (ooo_mode == "useDisk")
|
||||
this->oooMode = OOO_MODE::USE_PARKDISK;
|
||||
else if (ooo_mode == "otherMachine")
|
||||
this->oooMode = OOO_MODE::USE_OTHER_MACHINE;
|
||||
else
|
||||
this->oooMode = OOO_MODE::DEFAULT;
|
||||
|
||||
characterSet = settings->value("CharacterSet", "ISO 8859-15").toByteArray();
|
||||
|
||||
qrCodeLink = settings->value("QRCodeLink", "").toString();
|
||||
|
||||
SellTimeoutTime = settings->value("sellTimeout_time", "60").toString();
|
||||
|
||||
this->privateReadInputDevices();
|
||||
|
||||
this->lpLocalExample = settings->value("LicencePlateExampleString", "HOAB123").toString();
|
||||
|
||||
|
||||
#if defined (USE_BARCODESCANNER)
|
||||
if (settings->value("useBarcode", "on").toString() == "on" ||
|
||||
settings->value("useBarcode", "on").toString() == "yes" )
|
||||
{ this->useBarcode = true; }
|
||||
else { this->useBarcode = false; }
|
||||
#endif // USE_BARCODESCANNER
|
||||
|
||||
#ifdef USE_RFIDREADER
|
||||
if (settings->value("useRFID", "on").toString() == "on" ||
|
||||
settings->value("useRFID", "on").toString() == "yes" )
|
||||
{ this->useRFID = true; }
|
||||
else { this->useRFID = false; }
|
||||
#endif
|
||||
|
||||
// DEBUG
|
||||
qDebug() << "ATBHMIconfig::initDefered() com_port_name = " << ComPortName;
|
||||
qDebug() << "ATBHMIconfig::initDefered() touch_feedback_gpio = " << touch_feedback_gpio;
|
||||
|
||||
// DEBUG: write settings to file:
|
||||
/*
|
||||
settings->setValue("com_port_name", this->ComPortName);
|
||||
settings->setValue("lang1", "de_DE");
|
||||
settings->setValue("lang2", "en_US");
|
||||
settings->setValue("lang3", "fr_FR");
|
||||
settings->setValue("lang4", "ja_JP");
|
||||
settings->setValue("textfile", "HMI_Texte.xml");
|
||||
settings->setValue("logfile", "/var/log/atbqt.log");
|
||||
settings->setValue("feature_Log", false);
|
||||
settings->setValue("feature_TouchFeedback", true);
|
||||
settings->setValue("feature_DisplayControl", true);
|
||||
settings->setValue("feature_SystemSuspend", true);
|
||||
settings->setValue("suspend_methode", "sysfs");
|
||||
settings->setValue("suspend_program", "");
|
||||
settings->setValue("suspend_time", 10);
|
||||
settings->setValue("touch_feedback_gpio", 121);
|
||||
settings->setValue("touch_feedback_on_value", 0);
|
||||
settings->setValue("touch_feedback_off_value", 1);
|
||||
*/
|
||||
|
||||
this->HelpButtonUsed = settings->value("showHelpButton", "0").toBool();
|
||||
this->InfoButtonUsed = settings->value("showInfoButton", "0").toBool();
|
||||
|
||||
settings->endGroup();
|
||||
|
||||
// [PAYMENT]
|
||||
|
||||
settings->beginGroup("PAYMENT");
|
||||
|
||||
QString cashVariantString = settings->value("cashVariant", "CoinsOnly").toString();
|
||||
if (cashVariantString == "CoinsOnly") {
|
||||
this->cashVariant = PAYMENT_VARIANTS::CASH_VARIANT::CoinsOnly;
|
||||
}
|
||||
else
|
||||
if (cashVariantString == "CoinsAndNotes") {
|
||||
this->cashVariant = PAYMENT_VARIANTS::CASH_VARIANT::CoinsAndNotes;
|
||||
}
|
||||
else {
|
||||
// Default
|
||||
this->cashVariant = PAYMENT_VARIANTS::CASH_VARIANT::CoinsOnly;
|
||||
}
|
||||
|
||||
this->currencySymbol = settings->value("currencySymbol", "€").toString();
|
||||
|
||||
|
||||
QString paymentPointInTimeString = settings->value("paymentPointInTime", "poe").toString();
|
||||
if (paymentPointInTimeString == "poe") {
|
||||
this->paymentPointInTime = PAYMENT_POINTINTIME::PAY_ON_EXIT;
|
||||
}
|
||||
else
|
||||
if (paymentPointInTimeString == "poa") {
|
||||
this->paymentPointInTime = PAYMENT_POINTINTIME::PAY_ON_ARRIVAL;
|
||||
}
|
||||
else
|
||||
if (paymentPointInTimeString == "ign") {
|
||||
this->paymentPointInTime = PAYMENT_POINTINTIME::IGNORE;
|
||||
}
|
||||
else {
|
||||
// Default
|
||||
this->paymentPointInTime = PAYMENT_POINTINTIME::PAY_ON_EXIT;
|
||||
}
|
||||
|
||||
|
||||
if (settings->value("useHonestPayment", "on").toString() == "on" ||
|
||||
settings->value("useHonestPayment", "on").toString() == "yes" )
|
||||
{ this->honestPayment = true; }
|
||||
else { this->honestPayment = false; }
|
||||
|
||||
|
||||
settings->endGroup();
|
||||
|
||||
// [CUSTOMER]
|
||||
|
||||
settings->beginGroup("CUSTOMER");
|
||||
|
||||
this->DiscountUsed = settings->value("DiscountUsed", "1").toBool();
|
||||
this->QRCodeReceiptUsed = settings->value("QRCodeReceiptUsed", "1").toBool();
|
||||
|
||||
settings->endGroup();
|
||||
|
||||
#ifdef USE_EXTERNAL_TICKETMANAGER
|
||||
// [BARCODE_VERIFICATION]
|
||||
|
||||
settings->beginGroup("BARCODE_VERIFICATION");
|
||||
|
||||
this->endOfSellingTime = settings->value("EndOfSellingTime", "06:00").toString();
|
||||
this->blockingTimeMin = settings->value("BlockingTime_Min", "15").toInt(&ok);
|
||||
if (!ok) this->blockingTimeMin = 15;
|
||||
|
||||
settings->endGroup();
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef USE_ISMAS
|
||||
// [ISMAS]
|
||||
|
||||
settings->beginGroup("ISMAS");
|
||||
|
||||
this->ismasHost = settings->value("ISMAS_HOST", "87.139.50.222").toString();
|
||||
this->ismasPort = settings->value("ISMAS_PORT", "10000").toInt(&ok);
|
||||
this->ismasID = settings->value("ISMAS_ID", "").toString();
|
||||
|
||||
if (settings->value("ISMAS_DEBUG", "on").toString() == "on" ||
|
||||
settings->value("ISMAS_DEBUG", "on").toString() == "yes")
|
||||
{ this->ismasDebug = true; }
|
||||
else { this->ismasDebug = false; }
|
||||
|
||||
if (settings->value("ISMAS_CheckEntries", "on").toString() == "on" ||
|
||||
settings->value("ISMAS_CheckEntries", "on").toString() == "yes")
|
||||
{ this->ismasCheckEntries = true; }
|
||||
else { this->ismasCheckEntries = false; }
|
||||
|
||||
this->ismasConnectionTimeout = settings->value("ISMAS_ConnectionTimeout", "2").toInt(&ok);
|
||||
if (!ok) this->ismasConnectionTimeout = 2;
|
||||
|
||||
if (settings->value("usePinGenerator", "off").toString() == "on" ||
|
||||
settings->value("usePinGenerator", "off").toString() == "yes" )
|
||||
{ this->usePINgenerator = true; }
|
||||
else { this->usePINgenerator = false; }
|
||||
|
||||
settings->endGroup();
|
||||
#endif
|
||||
|
||||
// [ERRORCODE_MAPPING]
|
||||
|
||||
if (settings->childGroups().contains("ERRORCODE_MAPPING")) {
|
||||
settings->beginGroup("ERRORCODE_MAPPING");
|
||||
|
||||
QStringList ErrorCodes = settings->childKeys();
|
||||
|
||||
for (int i = 0; i < ErrorCodes.size(); ++i) {
|
||||
errorTextHash.insert(ErrorCodes.at(i), settings->value(ErrorCodes.at(i),"").toString());
|
||||
}
|
||||
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
|
||||
qDebug() << ok;
|
||||
}
|
||||
|
||||
|
||||
QSettings * ATBHMIconfig::getSettingsPtr() { return this->settings; }
|
||||
|
||||
const QSettings & ATBHMIconfig::getSettings() { return *(this->settings); }
|
||||
|
||||
QString ATBHMIconfig::getComPortName() { return this->ComPortName; }
|
||||
|
||||
QString ATBHMIconfig::getSuspendMethode() { return this->SuspendMethode; }
|
||||
|
||||
QString ATBHMIconfig::getSuspendProgram() { return this->SuspendProgram; }
|
||||
|
||||
|
||||
/***********************************************************************************************
|
||||
* get suspend time (-> time, after system goes to suspend) in seconds
|
||||
*/
|
||||
QString ATBHMIconfig::getSuspendTime() { return this->SuspendTime; }
|
||||
|
||||
|
||||
/***********************************************************************************************
|
||||
* get sell timout time (-> time, after system switched back to mode idle, if we do not have
|
||||
* any user inputs or vmc messages during sell mode) in seconds
|
||||
*/
|
||||
QString ATBHMIconfig::getSellTimeoutTime() { return this->SellTimeoutTime; }
|
||||
|
||||
QString ATBHMIconfig::getQmPath() { return this->qmPath; }
|
||||
|
||||
bool ATBHMIconfig::hasFeatureTF() { return ((this->features & this->featureMaskTF) != 0); }
|
||||
bool ATBHMIconfig::hasFeatureLog() { return ((this->features & this->featureMaskLog) != 0); }
|
||||
bool ATBHMIconfig::hasFeatureDC() { return ((this->features & this->featureMaskDC) != 0); }
|
||||
bool ATBHMIconfig::hasFeatureStartButton() { return ((this->features & this->featureMaskStartButton) != 0); }
|
||||
bool ATBHMIconfig::hasFeatureSelfOOO() { return ((this->features & this->featureMaskSelfOOO) != 0); }
|
||||
bool ATBHMIconfig::hasFeatureDBusDisplayControl() { return ((this->features & this->featureMaskDBusDisplayControl) != 0); }
|
||||
bool ATBHMIconfig::hasFeatureDBusSuspendControl() { return ((this->features & this->featureMaskDBusSuspendControl) != 0); }
|
||||
bool ATBHMIconfig::hasFeatureShowParkingTime() { return ((this->features & this->featureMaskShowParkingTime) != 0); }
|
||||
|
||||
void ATBHMIconfig::setFeatureTF() { this->features |= this->featureMaskTF; }
|
||||
void ATBHMIconfig::unsetFeatureTF() { this->features &= ~(this->featureMaskTF); }
|
||||
void ATBHMIconfig::setFeatureLog() { this->features |= this->featureMaskLog; }
|
||||
void ATBHMIconfig::unsetFeatureLog() { this->features &= ~(this->featureMaskLog); }
|
||||
void ATBHMIconfig::setFeatureStartButton() { this->features |= this->featureMaskStartButton; }
|
||||
void ATBHMIconfig::unsetFeatureStartButton() { this->features &= ~(this->featureMaskStartButton); }
|
||||
void ATBHMIconfig::setFeatureSelfOOO() { this->features |= this->featureMaskSelfOOO; }
|
||||
void ATBHMIconfig::unsetFeatureSelfOOO() { this->features &= ~(this->featureMaskSelfOOO); }
|
||||
|
||||
|
||||
void ATBHMIconfig::setFeatureDC()
|
||||
{
|
||||
// this features are mutually exclusive
|
||||
if (this->hasFeatureDBusDisplayControl()) {
|
||||
this->unsetFeatureDBusDisplayControl();
|
||||
}
|
||||
this->features |= this->featureMaskDC;
|
||||
}
|
||||
|
||||
void ATBHMIconfig::unsetFeatureDC() { this->features &= ~(this->featureMaskDC); }
|
||||
|
||||
|
||||
void ATBHMIconfig::setFeatureDBusDisplayControl()
|
||||
{
|
||||
// this features are mutually exclusive
|
||||
if (this->hasFeatureDC()) {
|
||||
this->unsetFeatureDC();
|
||||
}
|
||||
this->features |= this->featureMaskDBusDisplayControl;
|
||||
}
|
||||
|
||||
void ATBHMIconfig::setFeatureDBusSuspendControl()
|
||||
{
|
||||
this->features |= this->featureMaskDBusSuspendControl;
|
||||
}
|
||||
|
||||
void ATBHMIconfig::unsetFeatureDBusDisplayControl() { this->features &= ~(this->featureMaskDBusDisplayControl); }
|
||||
void ATBHMIconfig::unsetFeatureDBusSuspendControl() { this->features &= ~(this->featureMaskDBusSuspendControl); }
|
||||
|
||||
void ATBHMIconfig::setFeatureShowParkingTime() { this->features |= this->featureMaskShowParkingTime; }
|
||||
void ATBHMIconfig::unsetFeatureShowParkingTime() { this->features &= ~(this->featureMaskShowParkingTime); }
|
||||
|
||||
|
||||
QString ATBHMIconfig::getTouchFeedbackGPIO() { return this->touch_feedback_gpio; }
|
||||
QString ATBHMIconfig::getTouchFeedbackOnValue() { return this->touch_feedback_on_value; }
|
||||
QString ATBHMIconfig::getTouchFeedbackOffValue() { return this->touch_feedback_off_value; }
|
||||
|
||||
QString ATBHMIconfig::getTextfileName() { return this->textfilename; }
|
||||
|
||||
QString ATBHMIconfig::getAlternativeLogoFilename() { return this->alternativeLogoFilename; }
|
||||
|
||||
#ifdef USE_BARCODESCANNER
|
||||
bool ATBHMIconfig::getUseBarcodeScanner() { return this->useBarcode; }
|
||||
QString & ATBHMIconfig::getBarcodeScannerInputDevice() { return this->barcodeScannerInputDeviceName; }
|
||||
#endif
|
||||
|
||||
#ifdef USE_RFIDREADER
|
||||
bool ATBHMIconfig::getUseRFIDReader() { return this->useRFID; }
|
||||
QString & ATBHMIconfig::getRFIDReaderInputDevice() { return this->rfidReaderInputDeviceName; }
|
||||
#endif
|
||||
|
||||
PAYMENT_VARIANTS::CASH_VARIANT ATBHMIconfig::getCashVariant() { return this->cashVariant; }
|
||||
|
||||
bool ATBHMIconfig::discountIsUsed() { return this->DiscountUsed; }
|
||||
bool ATBHMIconfig::qrCodeReceiptIsUsed() { return this->QRCodeReceiptUsed; }
|
||||
|
||||
#ifdef USE_EXTERNAL_TICKETMANAGER
|
||||
/**********************************************************************
|
||||
* for barcode verification:
|
||||
*
|
||||
* EndOfSellingTime: time, when all daily data (e.g. blocking list) is reset
|
||||
* BlockingTime: time, in minutes, how long a verified ticket is blocked for reentry
|
||||
*/
|
||||
QString ATBHMIconfig::getEndOfSellingTime() { return this->endOfSellingTime; }
|
||||
int ATBHMIconfig::getBlockingTime() { return this->blockingTimeMin; }
|
||||
#endif
|
||||
|
||||
QString ATBHMIconfig::getLang(int lang)
|
||||
{
|
||||
switch (lang) {
|
||||
case 1: return this->lang1;
|
||||
break;
|
||||
case 2: return this->lang2;
|
||||
break;
|
||||
case 3: return this->lang3;
|
||||
break;
|
||||
case 4: return this->lang4;
|
||||
break;
|
||||
case 5: return this->lang5;
|
||||
break;
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the ordered list of configured languages.
|
||||
* { <lang1>, <lang2>, ... , <langN> }
|
||||
* This languages should be available in text file.
|
||||
*/
|
||||
QStringList ATBHMIconfig::getConfiguredLanguages()
|
||||
{
|
||||
QStringList langs;
|
||||
langs << lang1 << lang2 << lang3 << lang4 << lang5;
|
||||
return langs;
|
||||
}
|
||||
|
||||
|
||||
QString ATBHMIconfig::getCountry(int country)
|
||||
{
|
||||
switch (country) {
|
||||
case 1: return this->country1;
|
||||
break;
|
||||
case 2: return this->country2;
|
||||
break;
|
||||
case 3: return this->country3;
|
||||
break;
|
||||
case 4: return this->country4;
|
||||
break;
|
||||
case 5: return this->country5;
|
||||
break;
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
bool ATBHMIconfig::isLanguageUsed(int lang)
|
||||
{
|
||||
switch (lang) {
|
||||
case 1: return (this->useLanguage & 0x80) ? (true) : (false);
|
||||
break;
|
||||
case 2: return (this->useLanguage & 0x40) ? (true) : (false);
|
||||
break;
|
||||
case 3: return (this->useLanguage & 0x20) ? (true) : (false);
|
||||
break;
|
||||
case 4: return (this->useLanguage & 0x10) ? (true) : (false);
|
||||
break;
|
||||
case 5: return (this->useLanguage & 0x08) ? (true) : (false);
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool ATBHMIconfig::isInfoButtonUsed() { return this->InfoButtonUsed; }
|
||||
bool ATBHMIconfig::isHelpButtonUsed() { return this->HelpButtonUsed; }
|
||||
|
||||
|
||||
bool ATBHMIconfig::isPaymentUsed(int payment)
|
||||
{
|
||||
switch (payment) {
|
||||
case 1: return (this->usePayment & 0x80) ? (true) : (false);
|
||||
break;
|
||||
case 2: return (this->usePayment & 0x40) ? (true) : (false);
|
||||
break;
|
||||
case 3: return (this->usePayment & 0x20) ? (true) : (false);
|
||||
break;
|
||||
case 4: return (this->usePayment & 0x10) ? (true) : (false);
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool ATBHMIconfig::isVehicleUsed(int vehicle)
|
||||
{
|
||||
switch (vehicle) {
|
||||
case 1: return (this->useVehicle & 0x80) ? (true) : (false);
|
||||
break;
|
||||
case 2: return (this->useVehicle & 0x40) ? (true) : (false);
|
||||
break;
|
||||
case 3: return (this->useVehicle & 0x20) ? (true) : (false);
|
||||
break;
|
||||
case 4: return (this->useVehicle & 0x10) ? (true) : (false);
|
||||
break;
|
||||
case 5: return (this->useVehicle & 0x08) ? (true) : (false);
|
||||
break;
|
||||
case 6: return (this->useVehicle & 0x04) ? (true) : (false);
|
||||
break;
|
||||
case 7: return (this->useVehicle & 0x02) ? (true) : (false);
|
||||
break;
|
||||
case 8: return (this->useVehicle & 0x01) ? (true) : (false);
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool ATBHMIconfig::isProductUsed(int product)
|
||||
{
|
||||
switch (product) {
|
||||
case 1: return (this->useProduct & 0x80) ? (true) : (false);
|
||||
break;
|
||||
case 2: return (this->useProduct & 0x40) ? (true) : (false);
|
||||
break;
|
||||
case 3: return (this->useProduct & 0x20) ? (true) : (false);
|
||||
break;
|
||||
case 4: return (this->useProduct & 0x10) ? (true) : (false);
|
||||
break;
|
||||
case 5: return (this->useProduct & 0x08) ? (true) : (false);
|
||||
break;
|
||||
case 6: return (this->useProduct & 0x04) ? (true) : (false);
|
||||
break;
|
||||
case 7: return (this->useProduct & 0x02) ? (true) : (false);
|
||||
break;
|
||||
case 8: return (this->useProduct & 0x01) ? (true) : (false);
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QString ATBHMIconfig::getLogFileName()
|
||||
{
|
||||
return this->logfilename;
|
||||
}
|
||||
|
||||
int ATBHMIconfig::getDefaultLanguage()
|
||||
{
|
||||
return this->defaultLanguage;
|
||||
}
|
||||
|
||||
void ATBHMIconfig::setDefaultLanguage(quint8 lang)
|
||||
{
|
||||
this->defaultLanguage = lang;
|
||||
}
|
||||
|
||||
|
||||
int ATBHMIconfig::getComBaudRate()
|
||||
{
|
||||
return this->ComBaudRate;
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************************
|
||||
* Funktions for storing some machine specific configuration data in filesystem.
|
||||
*
|
||||
* Note: this functions must reduce write operations to flash memory.
|
||||
* Therefore, first the data values are read from memory and compared to the new ones.
|
||||
* Only changed values should be written.
|
||||
* Additionally, open files, read their values and compare this values is time consuming.
|
||||
* So we store this values also in our config-object and do only a comparisson if values
|
||||
* have changed.
|
||||
*
|
||||
*
|
||||
*/
|
||||
QString & ATBHMIconfig::getCustNr()
|
||||
{
|
||||
if (!this->validPSAconfig) { this->readPSAConfig(); }
|
||||
return this->cust_nr;
|
||||
}
|
||||
|
||||
QString & ATBHMIconfig::getGroupNr()
|
||||
{
|
||||
if (!this->validPSAconfig) { this->readPSAConfig(); }
|
||||
return this->group_nr;
|
||||
}
|
||||
|
||||
QString & ATBHMIconfig::getZoneNr()
|
||||
{
|
||||
if (!this->validPSAconfig) { this->readPSAConfig(); }
|
||||
return this->zone_nr;
|
||||
}
|
||||
|
||||
QString & ATBHMIconfig::getMachineNr()
|
||||
{
|
||||
if (!this->validPSAconfig) { this->readPSAConfig(); }
|
||||
return this->machine_nr;
|
||||
}
|
||||
|
||||
quint8 ATBHMIconfig::readPSAConfig()
|
||||
{
|
||||
this->cust_nr = ATB_system::readPSAConfigString("/etc/cust_nr");
|
||||
this->group_nr = ATB_system::readPSAConfigString("/etc/group_nr");
|
||||
this->zone_nr = ATB_system::readPSAConfigString("/etc/zone_nr");
|
||||
this->machine_nr = ATB_system::readPSAConfigString("/etc/machine_nr");
|
||||
this->validPSAconfig = true;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void ATBHMIconfig::setCustNr(const QString& cust_nr)
|
||||
{
|
||||
if (! validPSAconfig) { this->readPSAConfig(); }
|
||||
|
||||
// compare to cached value:
|
||||
|
||||
if (cust_nr != this->cust_nr) { // Customer number has changed
|
||||
ATB_system::setPSAConfigString("/etc/cust_nr", cust_nr);
|
||||
this->cust_nr = cust_nr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ATBHMIconfig::setGroupNr(const QString& group_nr)
|
||||
{
|
||||
if (! validPSAconfig) { this->readPSAConfig(); }
|
||||
|
||||
// compare to cached value:
|
||||
|
||||
if (group_nr != this->group_nr) {
|
||||
ATB_system::setPSAConfigString("/etc/group_nr", group_nr);
|
||||
this->group_nr = group_nr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ATBHMIconfig::setZoneNr(const QString& zone_nr)
|
||||
{
|
||||
if (! validPSAconfig) { this->readPSAConfig(); }
|
||||
|
||||
// compare to cached value:
|
||||
|
||||
if (zone_nr != this->zone_nr) {
|
||||
ATB_system::setPSAConfigString("/etc/zone_nr", zone_nr);
|
||||
this->zone_nr = zone_nr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ATBHMIconfig::setMachineNr(const QString &machine_nr)
|
||||
{
|
||||
if (! validPSAconfig) { this->readPSAConfig(); }
|
||||
|
||||
// compare to cached value:
|
||||
|
||||
if (machine_nr != this->machine_nr) {
|
||||
ATB_system::setPSAConfigString("/etc/machine_nr", machine_nr);
|
||||
this->machine_nr = machine_nr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
OOO_MODE ATBHMIconfig::getOOOMode()
|
||||
{
|
||||
return this->oooMode;
|
||||
}
|
||||
|
||||
QString ATBHMIconfig::getOOOModeString()
|
||||
{
|
||||
switch (this->oooMode) {
|
||||
case OOO_MODE::USE_OTHER_MACHINE:
|
||||
return QString("otherMachine");
|
||||
break;
|
||||
case OOO_MODE::USE_PARKDISK:
|
||||
return QString("useDisk");
|
||||
break;
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
QString ATBHMIconfig::getOOOServiceNumber()
|
||||
{
|
||||
return this->oooServiceNumber;
|
||||
}
|
||||
|
||||
QString ATBHMIconfig::getOOOServiceEmail()
|
||||
{
|
||||
return this->oooServiceEmail;
|
||||
}
|
||||
|
||||
QString ATBHMIconfig::getOOOAlternativeLocation()
|
||||
{
|
||||
return this->oooAlternativeLocation;
|
||||
}
|
||||
|
||||
QString ATBHMIconfig::getLicensePlateExampleString()
|
||||
{
|
||||
return this->lpLocalExample;
|
||||
}
|
||||
|
||||
QString ATBHMIconfig::getQrCodeLink()
|
||||
{
|
||||
return this->qrCodeLink;
|
||||
}
|
||||
|
||||
const QByteArray & ATBHMIconfig::getDefaultCharacterSet() const
|
||||
{
|
||||
return this->characterSet;
|
||||
}
|
||||
|
||||
|
||||
const QString & ATBHMIconfig::getPaymentCurrencySymbol()
|
||||
{
|
||||
return this->currencySymbol;
|
||||
}
|
||||
|
||||
PAYMENT_POINTINTIME ATBHMIconfig::getPaymentPointInTime()
|
||||
{
|
||||
return this->paymentPointInTime;
|
||||
}
|
||||
|
||||
bool ATBHMIconfig::useHonestPayment()
|
||||
{
|
||||
return this->honestPayment;
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
* public slot to re-read config
|
||||
*
|
||||
* This slot could be called e.g. on a mode switch from 'service' to 'sell' or vv.
|
||||
*/
|
||||
void ATBHMIconfig::reReadSettings()
|
||||
{
|
||||
this->privateReadInputDevices();
|
||||
}
|
||||
|
||||
/* private common function to set/read input device names.
|
||||
*/
|
||||
void ATBHMIconfig::privateReadInputDevices()
|
||||
{
|
||||
#if defined (USE_BARCODESCANNER)
|
||||
barcodeScannerInputDeviceName = ATB_system::getEventDeviceName(ATB_system::EVENT_DEVICE_BARCODEREADER);
|
||||
#endif // USE_BARCODESCANNER
|
||||
|
||||
#if defined (USE_RFIDREADER)
|
||||
rfidReaderInputDeviceName = ATB_system::getEventDeviceName(ATB_system::EVENT_DEVICE_RFIDREADER);
|
||||
#endif // USE_RFIDREADER
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* ISMAS
|
||||
*/
|
||||
#ifdef USE_ISMAS
|
||||
QString ATBHMIconfig::getISMASHost() { return this->ismasHost; }
|
||||
quint16 ATBHMIconfig::getISMASPort() { return this->ismasPort; }
|
||||
bool ATBHMIconfig::isIsmasDebug() { return this->ismasDebug; }
|
||||
bool ATBHMIconfig::IsmasCheckEntries() { return this->ismasCheckEntries; }
|
||||
quint16 ATBHMIconfig::getIsmasConnectionTimeout() { return this->ismasConnectionTimeout; }
|
||||
bool ATBHMIconfig::UsePINgenerator() { return this->usePINgenerator; }
|
||||
QString ATBHMIconfig::getISMASId()
|
||||
{
|
||||
// if no ismasID is defined, we use customer Number (-> "ATB device Id" in Multipass)
|
||||
if (this->ismasID == "") {
|
||||
return this->getCustNr();
|
||||
}
|
||||
return this->ismasID;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* public methods for ErrorCode
|
||||
*/
|
||||
QString ATBHMIconfig::getErrorText(const QString & errorCode)
|
||||
{
|
||||
return errorTextHash.value(errorCode);
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* get tools name/path
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
* check availability of network diag tool
|
||||
*
|
||||
* possible install path for networkDiag:
|
||||
* 1) /usr/bin/atb_networkDiag
|
||||
* 2) /opt/app/tools/networkDiag
|
||||
* 3) /opt/app/atb_networkDiag/networkDiag
|
||||
*
|
||||
* Check, if file exists and if it is executable,
|
||||
* Return path/name for binary.
|
||||
*/
|
||||
QString & ATBHMIconfig::getNetworkDiagTool()
|
||||
{
|
||||
// search list for config file:
|
||||
QStringList binFileList;
|
||||
|
||||
// check, if file exists and if it is executable
|
||||
#if defined (ARCH_PTU4)
|
||||
binFileList << "/usr/bin/atbNetworkDiag"
|
||||
<< "/opt/app/tools/networkDiag"
|
||||
<< "/opt/app/atbNetworkDiag/networkDiag";
|
||||
#else
|
||||
binFileList << QDir::homePath().append("/atbNetworkDiag");
|
||||
#endif
|
||||
|
||||
// using C++11 range based loop: -> take first file, which is readable
|
||||
for (const auto& filename : binFileList) {
|
||||
if (QFileInfo(filename).isExecutable()) {
|
||||
this->networkDiagToolName = filename;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return this->networkDiagToolName;
|
||||
}
|
285
ATBHMIconfig.h
285
ATBHMIconfig.h
@@ -1,285 +0,0 @@
|
||||
#ifndef ATBHMICONFIG_H
|
||||
#define ATBHMICONFIG_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QSettings>
|
||||
#include <ATBAPP.h>
|
||||
#include "version.h"
|
||||
|
||||
|
||||
/***************************************
|
||||
* Sample configuration:
|
||||
*
|
||||
* [General]
|
||||
* com_port_name=/dev/pts/16
|
||||
* machine_nr=99
|
||||
*
|
||||
* suspend_methode=sysfs
|
||||
* suspend_program=
|
||||
* suspend_time=10
|
||||
*
|
||||
* touch_feedback=on
|
||||
* touch_feedback_gpio=115 // 115 = beep; 121 = vibration motor
|
||||
* touch_feedback_on_value=0 // 0 (buzzer) 1 (vibration)
|
||||
* touch_feedback_off_value=1 // 1 (buzzer) 0 (vibration)
|
||||
*
|
||||
* log=on // loggin is on
|
||||
*
|
||||
* lang1=de_DE
|
||||
* lang2=en_US
|
||||
* lang3=fr_FR
|
||||
* lang4=ja_JP
|
||||
*
|
||||
* textfile=HMI_Texte.xml
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
enum class OOO_MODE : quint8;
|
||||
|
||||
|
||||
class ATBHMIconfig : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
QString ComPortName;
|
||||
|
||||
QString SuspendMethode;
|
||||
QString SuspendProgram;
|
||||
QString SuspendTime;
|
||||
|
||||
QString SellTimeoutTime;
|
||||
|
||||
QString qmPath;
|
||||
|
||||
QString touch_feedback_gpio;
|
||||
QString touch_feedback_on_value;
|
||||
QString touch_feedback_off_value;
|
||||
|
||||
|
||||
QString lang1;
|
||||
QString lang2;
|
||||
QString lang3;
|
||||
QString lang4;
|
||||
QString lang5;
|
||||
|
||||
quint8 useLanguage;
|
||||
quint8 useVehicle;
|
||||
quint8 useProduct;
|
||||
quint8 usePayment;
|
||||
|
||||
QString country1;
|
||||
QString country2;
|
||||
QString country3;
|
||||
QString country4;
|
||||
QString country5;
|
||||
|
||||
QSettings *settings;
|
||||
|
||||
quint16 features;
|
||||
static const quint16 featureMaskTF = 0x0001;
|
||||
static const quint16 featureMaskLog = 0x0002;
|
||||
static const quint16 featureMaskDC = 0x0004; // manuell display control, (in future deprecated)
|
||||
static const quint16 featureMaskSusp = 0x0008; // manuell suspend control, (in future deprecated)
|
||||
static const quint16 featureMaskStartButton = 0x0010;
|
||||
static const quint16 featureMaskSelfOOO = 0x0020;
|
||||
static const quint16 featureMaskDBusDisplayControl = 0x0040;
|
||||
static const quint16 featureMaskDBusSuspendControl = 0x0080;
|
||||
static const quint16 featureMaskShowParkingTime = 0x0100;
|
||||
|
||||
|
||||
|
||||
QString logfilename;
|
||||
|
||||
QString textfilename;
|
||||
|
||||
QString alternativeLogoFilename;
|
||||
|
||||
QString oooServiceNumber;
|
||||
|
||||
QString oooServiceEmail;
|
||||
|
||||
QString oooAlternativeLocation;
|
||||
|
||||
QString qrCodeLink;
|
||||
|
||||
QString lpLocalExample;
|
||||
|
||||
QString currencySymbol;
|
||||
|
||||
quint8 defaultLanguage;
|
||||
|
||||
|
||||
bool HelpButtonUsed;
|
||||
bool InfoButtonUsed;
|
||||
bool DiscountUsed;
|
||||
bool QRCodeReceiptUsed;
|
||||
|
||||
int ComBaudRate;
|
||||
|
||||
QString cust_nr;
|
||||
QString group_nr;
|
||||
QString zone_nr;
|
||||
QString machine_nr;
|
||||
bool validPSAconfig;
|
||||
|
||||
QByteArray characterSet;
|
||||
|
||||
PAYMENT_VARIANTS::CASH_VARIANT cashVariant;
|
||||
|
||||
// ErrorCode-mapping
|
||||
QHash<QString,QString> errorTextHash;
|
||||
|
||||
public:
|
||||
explicit ATBHMIconfig(QObject *parent = nullptr);
|
||||
~ATBHMIconfig();
|
||||
|
||||
QSettings *getSettingsPtr();
|
||||
const QSettings & getSettings();
|
||||
|
||||
void initEarly();
|
||||
void initDefered();
|
||||
|
||||
QString getComPortName();
|
||||
|
||||
QString getSuspendMethode();
|
||||
QString getSuspendProgram();
|
||||
QString getSuspendTime();
|
||||
|
||||
QString getSellTimeoutTime();
|
||||
|
||||
quint32 getHMIScreenChangeTimeoutTime();
|
||||
|
||||
QString getQmPath();
|
||||
|
||||
QString getLang(int lang);
|
||||
QString getCountry(int country);
|
||||
bool isLanguageUsed(int lang);
|
||||
|
||||
bool isInfoButtonUsed();
|
||||
bool isHelpButtonUsed();
|
||||
|
||||
bool isPaymentUsed(int payment);
|
||||
bool isVehicleUsed(int vehicle);
|
||||
bool isProductUsed(int product);
|
||||
bool isProcductUsed(int product);
|
||||
|
||||
QString getTouchFeedbackGPIO();
|
||||
QString getTouchFeedbackOnValue();
|
||||
QString getTouchFeedbackOffValue();
|
||||
|
||||
bool hasFeatureTF(); // touch feedback
|
||||
bool hasFeatureLog(); // log serial communication
|
||||
bool hasFeatureDC(); // display control
|
||||
bool hasFeatureStartButton(); // StartButton
|
||||
bool hasFeatureSelfOOO(); // self ooo capability
|
||||
bool hasFeatureDBusDisplayControl();
|
||||
bool hasFeatureDBusSuspendControl();
|
||||
bool hasFeatureShowParkingTime(); // show parking time in addition to parking end time
|
||||
|
||||
|
||||
QString getTextfileName();
|
||||
QString getAlternativeLogoFilename();
|
||||
|
||||
const QByteArray & getDefaultCharacterSet() const;
|
||||
|
||||
QString getOOOServiceNumber();
|
||||
QString getOOOServiceEmail();
|
||||
QString getOOOAlternativeLocation();
|
||||
QString getLicensePlateExampleString();
|
||||
QString getQrCodeLink();
|
||||
|
||||
const QString & getPaymentCurrencySymbol();
|
||||
|
||||
void setFeatureTF();
|
||||
void unsetFeatureTF();
|
||||
|
||||
void setFeatureLog();
|
||||
void unsetFeatureLog();
|
||||
|
||||
void setFeatureDC();
|
||||
void unsetFeatureDC();
|
||||
|
||||
void setFeatureStartButton();
|
||||
void unsetFeatureStartButton();
|
||||
|
||||
void setFeatureSelfOOO();
|
||||
void unsetFeatureSelfOOO();
|
||||
|
||||
void setFeatureDBusDisplayControl();
|
||||
void unsetFeatureDBusDisplayControl();
|
||||
|
||||
void setFeatureDBusSuspendControl();
|
||||
void unsetFeatureDBusSuspendControl();
|
||||
|
||||
void setFeatureShowParkingTime();
|
||||
void unsetFeatureShowParkingTime();
|
||||
|
||||
QString getLogFileName();
|
||||
|
||||
int getDefaultLanguage();
|
||||
QStringList getConfiguredLanguages();
|
||||
|
||||
int getComBaudRate();
|
||||
|
||||
QString getErrorText(const QString & errorCode);
|
||||
|
||||
// machine configuration
|
||||
QString & getCustNr();
|
||||
QString & getGroupNr();
|
||||
QString & getZoneNr();
|
||||
QString & getMachineNr();
|
||||
quint8 readPSAConfig();
|
||||
|
||||
PAYMENT_VARIANTS::CASH_VARIANT getCashVariant();
|
||||
|
||||
bool discountIsUsed();
|
||||
bool qrCodeReceiptIsUsed();
|
||||
|
||||
// service programs
|
||||
QString & getNetworkDiagTool();
|
||||
//QString & getPTUConfig();
|
||||
//QString & getPTUUpdate();
|
||||
|
||||
OOO_MODE getOOOMode();
|
||||
|
||||
QString getOOOModeString();
|
||||
|
||||
PAYMENT_POINTINTIME getPaymentPointInTime();
|
||||
bool useHonestPayment();
|
||||
|
||||
QStringList configGroups;
|
||||
|
||||
private:
|
||||
OOO_MODE oooMode;
|
||||
|
||||
PAYMENT_POINTINTIME paymentPointInTime;
|
||||
bool honestPayment;
|
||||
|
||||
void privateReadInputDevices();
|
||||
|
||||
QString networkDiagToolName;
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
void setDefaultLanguage(quint8 lang);
|
||||
|
||||
void setCustNr(const QString& cust_nr);
|
||||
void setGroupNr(const QString& group_nr);
|
||||
void setZoneNr(const QString& zone_nr);
|
||||
void setMachineNr(const QString& machine_nr);
|
||||
|
||||
void reReadSettings();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
enum class OOO_MODE : quint8 {
|
||||
DEFAULT = 0,
|
||||
USE_PARKDISK = 1,
|
||||
USE_OTHER_MACHINE = 2
|
||||
};
|
||||
|
||||
#endif // ATBHMICONFIG_H
|
2745
AppControl.cpp
2745
AppControl.cpp
File diff suppressed because it is too large
Load Diff
242
AppControl.h
242
AppControl.h
@@ -1,242 +0,0 @@
|
||||
#ifndef APPCONTROL_H
|
||||
#define APPCONTROL_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "version.h"
|
||||
#include "atb_system.h"
|
||||
#include "ATBAPP.h"
|
||||
#include "plugins/PluginManager.h"
|
||||
#include "plugins/CC/CCInterface.h"
|
||||
#include "plugins/CalculatePrice/CalculatePriceInterface.h"
|
||||
|
||||
#include "support/VendingData.h"
|
||||
#include "CalculatePrice/CalculatePriceDefault.h"
|
||||
|
||||
class VMC;
|
||||
class ATBHMIconfig;
|
||||
class VendingData;
|
||||
class QTimer;
|
||||
|
||||
class AppControl : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AppControl(QObject *parent = nullptr);
|
||||
|
||||
PROGRAM_MODE getCurrentProgramMode();
|
||||
bool requestProgramMode(PROGRAM_MODE newProgramMode);
|
||||
|
||||
bool isProgramModeSELL();
|
||||
bool isProgramModeSELL_ENABLE();
|
||||
bool isProgramModeSERVICE();
|
||||
bool isProgramModeIDLE();
|
||||
bool isProgramModeOOO();
|
||||
|
||||
public slots:
|
||||
void onRequestOfflineProcessing();
|
||||
|
||||
// e.g. by button event,
|
||||
// by vmc screen command,
|
||||
// by vmc data display command
|
||||
// ...
|
||||
void restartSellModeTimeoutTimer();
|
||||
|
||||
// slots for LED configuration:
|
||||
void LEDs_default();
|
||||
void LEDs_ooo();
|
||||
|
||||
// CC-Plugin
|
||||
void onCCStartTransactionResult(nsCCInterface::RESULT_STATE resultState, QString & result);
|
||||
void onCCConfirmTransactionResult(nsCCInterface::RESULT_STATE resultState, QString & result);
|
||||
void onCCCancelTransactionResult(nsCCInterface::RESULT_STATE resultState, QString & result);
|
||||
void onCCRevertTransactionResult(nsCCInterface::RESULT_STATE resultState, QString & result);
|
||||
void onCCPreAuthTransactionResult(nsCCInterface::RESULT_STATE resultState, QString & result);
|
||||
void onCCBookTotalTransactionResult(nsCCInterface::RESULT_STATE resultState, QString & result);
|
||||
void onCCCancelPreAuthTransactionResult(nsCCInterface::RESULT_STATE resultState, QString & result);
|
||||
void onCCRequestCardInfoResult(nsCCInterface::RESULT_STATE resultState, QString & result);
|
||||
|
||||
// CalculatePricePlugin
|
||||
#ifdef USE_CALCULATEPRICE_PLUGIN
|
||||
void onCalculatePrice(QString & licensePlate);
|
||||
void onCalculatePrice(uint parktime);
|
||||
void onCalculatePrice(QString & cardInfo, QString & cardTransactionInfo);
|
||||
void onCalculatePrice();
|
||||
void onCalculatedPrice(nsCalculatePriceInterface::RESULT_STATE resultState,
|
||||
const QString & accessInformation,
|
||||
const QString & accessInformationType,
|
||||
const QString & amountDuePeriodStart,
|
||||
const QString & amountDuePeriodEnd,
|
||||
const PriceInfo & priceInfo,
|
||||
const QString & errorCode,
|
||||
const QString & errorDescription);
|
||||
void onProcessTransaction(nsCalculatePriceInterface::RESULT_STATE resultState,
|
||||
const QString & errorCode,
|
||||
const QString & errorDescription);
|
||||
|
||||
QChar private_getAccessInformationField(const QString & accessInformationType);
|
||||
QString private_calculatedPrice(nsCalculatePriceInterface::RESULT_STATE resultState,
|
||||
const QString & accessInformation,
|
||||
const QString & accessInformationType,
|
||||
const QString & amountDuePeriodStart,
|
||||
const QString & amountDuePeriodEnd,
|
||||
const PriceInfo & priceInfo,
|
||||
const QString & errorCode,
|
||||
const QString & errorDescription);
|
||||
#endif // USE_CALCULATEPRICE_PLUGIN
|
||||
|
||||
|
||||
|
||||
// vmc control
|
||||
void onVMCFormatedString(FormatedStringList data);
|
||||
void onVMCSellData(quint8 nr,QString data);
|
||||
|
||||
// deprecated vmc control for cc
|
||||
// this allows cc control by screens
|
||||
void onVMC_ccStartTransaction();
|
||||
void onVMC_ccCancelTransaction();
|
||||
void onVMC_ccConfirmTransaction();
|
||||
void onVMC_ccStartPreauthorisation();
|
||||
void onVMC_ccCancelPreauthorisation();
|
||||
void onVMC_ccConfirmPreauthorisation();
|
||||
void onVMC_ccStartReadCard();
|
||||
|
||||
// new control interface
|
||||
void onControl_switchMode(quint16 mode);
|
||||
void onControl_switchScreen(quint16 screen);
|
||||
void onControl_setText(quint16 screenNr, quint16 textNr, quint16 lang, QString text);
|
||||
void onShowCurrentIdle();
|
||||
void onShowCurrentOOO();
|
||||
|
||||
// vendingData
|
||||
void onSetVendingData(QString key, QByteArray value);
|
||||
|
||||
|
||||
signals:
|
||||
// signals for signaling a mode change to sub-modules:
|
||||
void changedProgramMode(PROGRAM_MODE newProgramMode);
|
||||
void changedModeToSELL();
|
||||
void changedModeToSERVICE();
|
||||
void changedModeToIDLE();
|
||||
void changedModeToOOO();
|
||||
|
||||
void doOfflineProcessing();
|
||||
|
||||
// cc
|
||||
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *obj, QEvent *ev);
|
||||
|
||||
private:
|
||||
PROGRAM_MODE programmode;
|
||||
ATBHMIconfig *config;
|
||||
ATB_system *system;
|
||||
VMC *vmc;
|
||||
VendingData *vendingData;
|
||||
|
||||
PluginManager *pluginManager;
|
||||
|
||||
void private_setupProgramModeSELL();
|
||||
void private_setupProgramModeSELL_ENABLE();
|
||||
void private_setupProgramModeSERVICE();
|
||||
void private_setupProgramModeIDLE();
|
||||
void private_setupProgramModeOOO();
|
||||
void private_unsetProgramModeSERVICE();
|
||||
void private_unsetProgramModeOOO();
|
||||
|
||||
// plugins
|
||||
CCInterface *cc;
|
||||
CalculatePriceInterface *calcPriceBackend;
|
||||
|
||||
// init methods called from constructor
|
||||
void private_initCCPlugin();
|
||||
void private_initCalculatePricePlugin();
|
||||
void private_initSimulationPlugin();
|
||||
|
||||
// timers
|
||||
QTimer *sellModeTimeoutTimer;
|
||||
|
||||
// flag to prepare for OOO in next idle
|
||||
quint8 prepareInternalOOO;
|
||||
|
||||
// action processing
|
||||
quint8 startAction(APP_ACTION action);
|
||||
|
||||
#if defined (ARCH_DesktopLinux)
|
||||
void private_screenshot();
|
||||
#endif
|
||||
|
||||
#if defined (CUST00318)
|
||||
// hack for 00318/Nexobility
|
||||
void private_CUST00318_handle_CC_ERROR_0x13();
|
||||
#endif
|
||||
|
||||
// mouse detection
|
||||
#if defined (ARCH_PTU4)
|
||||
QFileSystemWatcher *pInputDeviceWatcher;
|
||||
void setMouse(const QString & mouseDeviceFile, const QString & touchDeviceFile);
|
||||
void closeMouse(const QString & mouseDeviceFile, const QString & touchDeviceFile);
|
||||
bool mousePresent;
|
||||
#endif
|
||||
|
||||
|
||||
private slots:
|
||||
|
||||
// firstRun -> things done with running event loop
|
||||
void firstRun();
|
||||
|
||||
// timers
|
||||
void onSellModeTimerTimeout();
|
||||
|
||||
|
||||
/********************************************
|
||||
* CC - Slots
|
||||
*/
|
||||
void onCCStartTransaction();
|
||||
void onCCStartConfirmTransaction();
|
||||
void onCCCancelTransaction();
|
||||
|
||||
void onCCStartPreauthorisation();
|
||||
void onCCConfirmPreauthorisation();
|
||||
void onCCCancelPreauthorisationRequest();
|
||||
|
||||
void onCCPrintReceipt();
|
||||
|
||||
void onCCErrorBackend(QString & result);
|
||||
|
||||
void onCCStartReadCard();
|
||||
/*******************************************/
|
||||
|
||||
|
||||
// called, if system was woken up
|
||||
void onWakeUp();
|
||||
|
||||
|
||||
/********************************************
|
||||
* Barcode / QR-Code - Slots
|
||||
*/
|
||||
#ifdef USE_BARCODESCANNER
|
||||
// called, if a barcode was read from scanner
|
||||
void onReadBarcode(QString & barcode);
|
||||
|
||||
// called, if a new barcode should be created and sent to vmc
|
||||
void onRequestNewBarcode();
|
||||
#endif
|
||||
/*******************************************/
|
||||
|
||||
#if defined (Q_WS_QWS)
|
||||
void onInputDeviceWatcher_directoryChanged(const QString& path);
|
||||
#endif
|
||||
|
||||
/********************************************
|
||||
* ISMAS
|
||||
*/
|
||||
void onProcessed_QRCode(QHash<QString, QByteArray> data);
|
||||
|
||||
/********************************************
|
||||
* Signal System Errors
|
||||
*/
|
||||
void onSignalSystemErrors(const QString & errorCode, const QString & errorDescription);
|
||||
};
|
||||
|
||||
#endif // APPCONTROL_H
|
@@ -5,12 +5,8 @@ QT += serialport
|
||||
|
||||
|
||||
INCLUDEPATH+=$$_PRO_FILE_PWD_
|
||||
INCLUDEPATH+=$$_PRO_FILE_PWD_/support
|
||||
INCLUDEPATH+=$$_PRO_FILE_PWD_/plugins
|
||||
INCLUDEPATH+=$$_PRO_FILE_PWD_/include
|
||||
INCLUDEPATH+=$$_PRO_FILE_PWD_/HMI
|
||||
INCLUDEPATH+=$$_PRO_FILE_PWD_/HMI/screens
|
||||
INCLUDEPATH+=$$_PRO_FILE_PWD_/HMI/support
|
||||
INCLUDEPATH+=$$_PRO_FILE_PWD_/src
|
||||
INCLUDEPATH+=$$_PRO_FILE_PWD_/src/ATBAPP
|
||||
INCLUDEPATH+=$$_PRO_FILE_PWD_/src/ATBAPP/support
|
||||
@@ -21,12 +17,11 @@ QMAKE_CXXFLAGS += -Wno-deprecated-copy -O
|
||||
# default
|
||||
ARCH = PTU5
|
||||
|
||||
DEFINES+=ATB_QT_VERSION=\\\"5.11\\\"
|
||||
|
||||
contains( CONFIG, DesktopLinux ) {
|
||||
QMAKE_CC = ccache $$QMAKE_CC
|
||||
QMAKE_CXX = ccache $$QMAKE_CXX
|
||||
QMAKE_CXXFLAGS += -std=c++11
|
||||
QMAKE_CXXFLAGS += -std=c++17
|
||||
# QMAKE_CXXFLAGS += -Wno-deprecated-ctor
|
||||
linux-clang { QMAKE_CXXFLAGS += -Qunused-arguments }
|
||||
ARCH = DesktopLinux
|
||||
@@ -35,7 +30,7 @@ contains( CONFIG, DesktopLinux ) {
|
||||
contains( CONFIG, PTU5 ) {
|
||||
# QMAKE_CC = ccache $$QMAKE_CC
|
||||
# QMAKE_CXX = ccache $$QMAKE_CXX
|
||||
QMAKE_CXXFLAGS += -std=c++11
|
||||
QMAKE_CXXFLAGS += -std=c++17
|
||||
linux-clang { QMAKE_CXXFLAGS += -Qunused-arguments }
|
||||
CONFIG += link_pkgconfig
|
||||
ARCH = PTU5
|
||||
@@ -51,12 +46,44 @@ contains( CONFIG, PTU5_YOCTO ) {
|
||||
}
|
||||
|
||||
TARGET = ATBVMCPlugin
|
||||
#DESTDIR = ../plugins
|
||||
VERSION = "0.8.0"
|
||||
INTERFACE = VMCInterface
|
||||
INTERFACE_DEFINITION = $${PWD}/src/ATBAPP/VMCInterface.h
|
||||
|
||||
DEFINES += VMCPLUGIN_LIBRARY
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
GIT_COMMIT=$$system("git log -n 1 --format=oneline | cut -d' ' -f1")
|
||||
GIT_BRANCH=$$system("git branch --no-color 2> /dev/null | cut -d' ' -f2")
|
||||
GIT_DESCRIBE=$$system("git describe --dirty --always | tr '-' '_'")
|
||||
|
||||
DEV_SUFFIX=""
|
||||
count(GIT_BRANCH, 2) {
|
||||
DEV_SUFFIX="_dev"
|
||||
}
|
||||
|
||||
EXTENDED_VERSION="$${VERSION}-$${GIT_COMMIT}"
|
||||
|
||||
CONFIG += c++17
|
||||
|
||||
DEFINES+=ATB_QT_VERSION=\\\"$${QT_VERSION}\\\"
|
||||
DEFINES+=PLUGIN_BUILD_DATE=\\\"$${BUILD_DATE}\\\"
|
||||
DEFINES+=PLUGIN_BUILD_TIME=\\\"$${BUILD_TIME}\\\"
|
||||
DEFINES+=PLUGIN_EXTENDED_VERSION=\\\"$${EXTENDED_VERSION}\\\"
|
||||
|
||||
DEFINES+=INTERFACE=\\\"VMCInterface\\\"
|
||||
DEFINES+=INTERFACE_VERSION=\\\"eu.atb.ptu.plugin.VMCInterface/1.0\\\"
|
||||
DEFINES+=PLUGIN_NAME=\\\"ATBVMCPlugin\\\"
|
||||
DEFINES+=PLUGIN_VERSION=\\\"$${BUILD_DATE}_$${BUILD_TIME}\\\"
|
||||
DEFINES+=PLUGIN_GIT_DESCRIBE=\\\"$${GIT_DESCRIBE}_$${GIT_BRANCH}$${DEV_SUFFIX}\\\"
|
||||
|
||||
# Default rules for deployment.
|
||||
#qnx: target.path = /tmp/$${TARGET}/bin
|
||||
#else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||
@@ -64,12 +91,9 @@ DEFINES += VMCPLUGIN_LIBRARY
|
||||
|
||||
# ATBAPP interface
|
||||
HEADERS += \
|
||||
AppControl.h \
|
||||
ATBHMIconfig.h \
|
||||
atb_system.h \
|
||||
include/interfaces.h \
|
||||
src/ATBAPP/VMCInterface.h \
|
||||
src/ATBAPP/ATBVMCPlugin.h \
|
||||
src/ATBAPP/ATBAPPplugin.h \
|
||||
src/ATBAPP/UnifiedDCVMCInterface.h \
|
||||
src/ATBAPP/support/VMC/com_interface.h \
|
||||
src/ATBAPP/support/VMC/ReceiveBuffer.h \
|
||||
@@ -78,26 +102,9 @@ HEADERS += \
|
||||
src/ATBAPP/support/VendingData.h
|
||||
|
||||
SOURCES += \
|
||||
atb_system.cpp \
|
||||
AppControl.cpp \
|
||||
ATBHMIconfig.cpp \
|
||||
src/ATBAPP/ATBVMCPlugin.cpp \
|
||||
src/ATBAPP/support/VMC/com_interface.cpp \
|
||||
src/ATBAPP/support/VMC/ReceiveBuffer.cpp \
|
||||
src/ATBAPP/support/VMC/SendBuffer.cpp \
|
||||
src/ATBAPP/support/VMC/vmc.cpp \
|
||||
src/ATBAPP/support/VendingData.cpp
|
||||
|
||||
DISTFILES += \
|
||||
generate-version.sh
|
||||
|
||||
|
||||
# Define how to create version.h
|
||||
VERSION_H = $$PWD/include/version.h
|
||||
version.output = $$PWD/include/version.h
|
||||
version.commands = $$PWD/generate-version.sh $${ARCH} $${TARGET} $${INTERFACE} $${INTERFACE_DEFINITION} $${VERSION_H}
|
||||
version.depends = FORCE
|
||||
version.input = VERSION_H
|
||||
version.variable_out = HEADERS
|
||||
QMAKE_EXTRA_COMPILERS += version
|
||||
QMAKE_CLEAN += $${PWD}/include/version.h
|
||||
|
652
atb_system.cpp
652
atb_system.cpp
@@ -1,652 +0,0 @@
|
||||
#include "atb_system.h"
|
||||
#include "ATBHMIconfig.h"
|
||||
#include <QDebug>
|
||||
#include <QProcess>
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QTextStream>
|
||||
#include <QString>
|
||||
#include <QTimer>
|
||||
|
||||
|
||||
ATB_system::ATB_system(ATBHMIconfig *config, QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
|
||||
this->config = config;
|
||||
|
||||
this->tf_gpio = nullptr;
|
||||
|
||||
#if defined (ARCH_PTU2)
|
||||
if (config->hasFeatureTF()) init_touch_feedback();
|
||||
#elif defined (ARCH_PTU4)
|
||||
if (config->hasFeatureTF()) init_touch_feedback();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
ATB_system::~ATB_system()
|
||||
{
|
||||
if (config->hasFeatureTF()) {
|
||||
delete(this->tf_gpio_outstream);
|
||||
delete(this->tf_gpio);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ATB_system::executeSystemCommand(quint16 cmd, QByteArray data)
|
||||
{
|
||||
Q_UNUSED(data);
|
||||
|
||||
switch (cmd) {
|
||||
case SYS_COMMAND_SLEEP:
|
||||
qDebug() << "ATB_system::executeSystemCommand(): " << cmd;
|
||||
dbus_permitSuspend();
|
||||
break;
|
||||
case SYS_COMMAND_DIMLOW:
|
||||
if (config->hasFeatureDBusDisplayControl()) {
|
||||
dbus_DimControlStart();
|
||||
} else {
|
||||
this->DimLow();
|
||||
}
|
||||
break;
|
||||
case SYS_COMMAND_DIMHIGH:
|
||||
if (config->hasFeatureDBusDisplayControl()) {
|
||||
dbus_DimHighPermanent();
|
||||
} else {
|
||||
this->DimHigh();
|
||||
}
|
||||
break;
|
||||
case SYS_COMMAND_BEEP:
|
||||
if (config->hasFeatureTF()) this->Beep();
|
||||
break;
|
||||
case SYS_COMMAND_MACHINE_NUMBER: // deprecated and not used
|
||||
// setMachineNumber(data);
|
||||
break;
|
||||
case SYS_COMMAND_LED_CONTROL:
|
||||
this->privateConfigLED(data);
|
||||
break;
|
||||
case SYS_COMMAND_HALT:
|
||||
this->halt();
|
||||
break;
|
||||
case SYS_COMMAND_REBOOT:
|
||||
this->reboot();
|
||||
break;
|
||||
default:
|
||||
qDebug() << "ATB_system::executeSystemCommand(): unknown command: " << cmd;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* stubs for display control
|
||||
*
|
||||
* this methodes should later be scriptable an call corresponding methodes
|
||||
* in DisplayControl via DBus.
|
||||
*/
|
||||
|
||||
void ATB_system::DimLow() { return; }
|
||||
|
||||
void ATB_system::DimHigh()
|
||||
{
|
||||
//if (config->hasFeatureDC())
|
||||
// this->dc->DimHigh();
|
||||
}
|
||||
|
||||
//void ATB_system::Dim(quint8 value) { if (config->hasFeatureDC()) this->dc->Dim((uchar)value); }
|
||||
|
||||
void ATB_system::DimStart() { return; }
|
||||
void ATB_system::DimStop() { return; }
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*/
|
||||
|
||||
void ATB_system::Beep() {
|
||||
qDebug() << "ATB_system::Beep(): now i should make a beep!";
|
||||
#if defined (ARCH_PTU2) || defined (ARCH_PTU4)
|
||||
QTimer::singleShot (BEEPTIMEOUT, this, SLOT(BeepStop()) );
|
||||
*(this->tf_gpio_outstream) << config->getTouchFeedbackOnValue();
|
||||
this->tf_gpio_outstream->flush();
|
||||
#endif
|
||||
}
|
||||
|
||||
void ATB_system::BeepStop() {
|
||||
#if defined (ARCH_PTU2) || defined (ARCH_PTU4)
|
||||
*(this->tf_gpio_outstream) << config->getTouchFeedbackOffValue();
|
||||
this->tf_gpio_outstream->flush();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************************
|
||||
* set date/time
|
||||
*
|
||||
* Datestring format: YYYY-MM-DD hh:mm[:ss]
|
||||
* This is a format that is accepted both by busybox-date (e.g. PTU2) and by
|
||||
* coreutils-date.
|
||||
*
|
||||
* example:
|
||||
* /bin/date -s "2015-08-05 17:55:00"
|
||||
*
|
||||
*/
|
||||
void ATB_system::setDateTime(const QString & dateTimeString)
|
||||
{
|
||||
QString datetimeCMD = "/bin/date -s " + dateTimeString;
|
||||
|
||||
#if defined (ARCH_PTU2) || defined (ARCH_PTU4)
|
||||
QProcess::startDetached(datetimeCMD);
|
||||
|
||||
// the following does not work on PTU2:
|
||||
//QProcess::startDetached ("/sbin/hwclock -w");
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/********************************************************************************
|
||||
* static functions to write single values to files.
|
||||
*
|
||||
* Used e.g. to store some machine specific settings like customer number or machine
|
||||
* number in filesystem.
|
||||
*
|
||||
* This data should be updated rarely and the calling function must keep this in mind!
|
||||
*
|
||||
* Note: QFile::open() creates a file, if it is not existing.
|
||||
*/
|
||||
|
||||
quint8 ATB_system::setPSAConfigInt(const QString &filename, quint16 iValue)
|
||||
{
|
||||
return setPSAConfigString(filename, QString::number(iValue));
|
||||
}
|
||||
|
||||
|
||||
quint8 ATB_system::setPSAConfigString(const QString & filename, const QString & sValue)
|
||||
{
|
||||
#if defined (ARCH_PTU2) || defined (ARCH_PTU4)
|
||||
QFile file(filename);
|
||||
#else
|
||||
QFile file(QDir::homePath() + filename);
|
||||
#endif
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
qDebug() << "ATB_system::setPSAConfigString() cannot open file: " << filename;
|
||||
qDebug() << " file.errorString() = " << file.errorString();
|
||||
return 0;
|
||||
}
|
||||
|
||||
qDebug() << "ATB_system::setPSAConfigString() write file: " << filename;
|
||||
|
||||
QTextStream out(&file);
|
||||
out << sValue;
|
||||
out.flush();
|
||||
|
||||
file.close();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
quint16 ATB_system::readPSAConfigInt(const QString & filename)
|
||||
{
|
||||
bool ok;
|
||||
quint16 result = (quint16)readPSAConfigString(filename).toInt(&ok);
|
||||
|
||||
if (!ok) {
|
||||
result = 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
QString ATB_system::readPSAConfigString(const QString & filename)
|
||||
{
|
||||
#if defined (ARCH_PTU2) || defined (ARCH_PTU4)
|
||||
QFileInfo fileinfo(filename);
|
||||
#else
|
||||
QFileInfo fileinfo(QDir::homePath() + filename);
|
||||
#endif
|
||||
if (! fileinfo.isReadable() ) {
|
||||
qDebug() << "ATB_system::readPSAConfigString(): \"" << filename << "\" is not readable";
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined (ARCH_PTU2) || defined (ARCH_PTU4)
|
||||
QFile file(filename);
|
||||
#else
|
||||
QFile file(QDir::homePath() + filename);
|
||||
#endif
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
qDebug() << "ATB_system::readPSAConfigString() cannot open file: " << filename;
|
||||
return 0;
|
||||
}
|
||||
|
||||
QTextStream in(&file);
|
||||
|
||||
QString stringValue = in.readLine(100);
|
||||
qDebug() << "ATB_system::readPSAConfigString() stringValue = " << stringValue;
|
||||
|
||||
file.close();
|
||||
|
||||
return stringValue;
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************************
|
||||
* LED control interface
|
||||
*
|
||||
*/
|
||||
void ATB_system::onConfigLED(LED_NAME LED, LED_TRIGGER trigger, quint16 delayOn, quint16 delayOff)
|
||||
{
|
||||
QString LEDPath = "/sys/class/leds/";
|
||||
QString LEDName = "";
|
||||
QString LEDtrigger = "";
|
||||
|
||||
// DEBUG
|
||||
|
||||
|
||||
|
||||
// ////////
|
||||
|
||||
|
||||
switch (LED) {
|
||||
#if defined (ARCH_PTU2)
|
||||
case ATB_LED1: LEDName.append("atb_led1"); break;
|
||||
case ATB_LED2: LEDName.append("atb_led2"); break;
|
||||
case ATB_LED3: LEDName.append("atb_led3"); break;
|
||||
case ATB_LED4: LEDName.append("atb_led4"); break;
|
||||
#elif defined (ARCH_PTU4)
|
||||
case ATB_LED1: LEDName.append("D504"); break;
|
||||
case ATB_LED2: LEDName.append("D503"); break;
|
||||
case ATB_LED3: LEDName.append("D502"); break;
|
||||
case ATB_LED4: LEDName.append("D501"); break;
|
||||
#endif
|
||||
default: return;
|
||||
}
|
||||
|
||||
switch (trigger) {
|
||||
case LED_TRIGGER_NONE: LEDtrigger.append("none"); break;
|
||||
case LED_TRIGGER_TIMER: LEDtrigger.append("timer"); break;
|
||||
#if defined (ARCH_PTU2)
|
||||
case LED_TRIGGER_DEFAULT_ON: LEDtrigger.append("default-on"); break;
|
||||
#elif defined (ARCH_PTU4)
|
||||
/* note: ptu4 leds currently do not support 'default-on' trigger
|
||||
* workaround is to set delay_off to '0'
|
||||
*/
|
||||
case LED_TRIGGER_DEFAULT_ON: LEDtrigger.append("timer");
|
||||
trigger = LED_TRIGGER_TIMER;
|
||||
delayOn = 1;
|
||||
delayOff = 0;
|
||||
break;
|
||||
#endif
|
||||
default: return;
|
||||
}
|
||||
|
||||
QString filename = LEDPath + LEDName + "/trigger";
|
||||
|
||||
// set trigger
|
||||
this->privateSetLEDTrigger(filename, LEDtrigger);
|
||||
|
||||
|
||||
// set delays for trigger 'timer'
|
||||
if (trigger == LED_TRIGGER_TIMER) {
|
||||
|
||||
// set delay on
|
||||
if (delayOn != 0) {
|
||||
filename = LEDPath + LEDName + "/delay_on";
|
||||
this->privateSetLEDDelayOn(filename, QString::number(delayOn));
|
||||
}
|
||||
|
||||
// set delay off
|
||||
if (delayOff != 0) {
|
||||
filename = LEDPath + LEDName + "/delay_off";
|
||||
this->privateSetLEDDelayOn(filename, QString::number(delayOff));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* wrapper function for LED control.
|
||||
*
|
||||
* TODO: Test, check: plausibillity, cmd.lenght(), type casts to LED_NAME, LED_TRIGGER
|
||||
*/
|
||||
void ATB_system::privateConfigLED(const QByteArray & cmd)
|
||||
{
|
||||
quint16 delayOn = (quint8)cmd.at(3) + ((quint16)(cmd.at(2) << 8));
|
||||
quint16 delayOff = (quint8)cmd.at(5) + ((quint16)(cmd.at(4) << 8));
|
||||
|
||||
this->onConfigLED((LED_NAME)cmd.at(0), (LED_TRIGGER)cmd.at(1), delayOn, delayOff);
|
||||
}
|
||||
|
||||
void ATB_system::privateSetLEDTrigger(const QString & led, const QString & trigger)
|
||||
{
|
||||
#if defined (ARCH_PTU2) || defined (ARCH_PTU4)
|
||||
QFile file(led);
|
||||
#else
|
||||
QFile file(QDir::homePath() + led);
|
||||
#endif
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
qDebug() << "ATB_system::onConfigLED() cannot open file: " << led;
|
||||
qDebug() << " file.errorString() = " << file.errorString();
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug() << "ATB_system::onConfigLED() write file: " << led;
|
||||
|
||||
QTextStream out(&file);
|
||||
out << trigger;
|
||||
out.flush();
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
|
||||
void ATB_system::privateSetLEDDelayOn(const QString & led, const QString & delayOn)
|
||||
{
|
||||
#if defined (ARCH_PTU2) || defined (ARCH_PTU4)
|
||||
QFile file(led);
|
||||
#else
|
||||
QFile file(QDir::homePath() + led);
|
||||
#endif
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
qDebug() << "ATB_system::onConfigLED() cannot open file: " << led;
|
||||
qDebug() << " file.errorString() = " << file.errorString();
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug() << "ATB_system::onConfigLED() write file: " << led;
|
||||
|
||||
QTextStream out(&file);
|
||||
out << delayOn;
|
||||
out.flush();
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
|
||||
void ATB_system::privateSetLEDDelayOff(const QString & led, const QString & delayOff)
|
||||
{
|
||||
#if defined (ARCH_PTU2) || defined (ARCH_PTU4)
|
||||
QFile file(led);
|
||||
#else
|
||||
QFile file(QDir::homePath() + led);
|
||||
#endif
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
qDebug() << "ATB_system::onConfigLED() cannot open file: " << led;
|
||||
qDebug() << " file.errorString() = " << file.errorString();
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug() << "ATB_system::onConfigLED() write file: " << led;
|
||||
|
||||
QTextStream out(&file);
|
||||
out << delayOff;
|
||||
out.flush();
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* functions for switching blink button on/off
|
||||
* This is only available on PTU4
|
||||
*/
|
||||
void ATB_system::switchBlinkButtonOn()
|
||||
{
|
||||
this->privateSwitchBlinkButton(true);
|
||||
}
|
||||
|
||||
void ATB_system::switchBlinkButtonOff()
|
||||
{
|
||||
this->privateSwitchBlinkButton(false);
|
||||
}
|
||||
|
||||
void ATB_system::privateSwitchBlinkButton(bool on)
|
||||
{
|
||||
#if defined (ARCH_PTU2)
|
||||
|
||||
#elif defined (ARCH_PTU4)
|
||||
QString BlinkLED("/sys/class/leds/TIMER_RESET/brightness");
|
||||
|
||||
QFile file(BlinkLED);
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
qDebug() << "ATB_system::privateSwitchBlinkButton() cannot open file: " << BlinkLED;
|
||||
qDebug() << " file.errorString() = " << file.errorString();
|
||||
return;
|
||||
}
|
||||
|
||||
QTextStream out(&file);
|
||||
|
||||
if (on) { out << "0"; }
|
||||
else { out << "1"; }
|
||||
|
||||
out.flush();
|
||||
|
||||
file.close();
|
||||
|
||||
|
||||
#else
|
||||
Q_UNUSED(on)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* halt system.
|
||||
*
|
||||
*/
|
||||
void ATB_system::halt()
|
||||
{
|
||||
QProcess::startDetached("/sbin/halt");
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* reboot system.
|
||||
*
|
||||
*/
|
||||
void ATB_system::reboot()
|
||||
{
|
||||
QProcess::startDetached("/sbin/reboot");
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* functions for wake vmc
|
||||
* This is only available on PTU4
|
||||
*/
|
||||
void ATB_system::onWakeVMC()
|
||||
{
|
||||
#if defined (ARCH_PTU2)
|
||||
|
||||
#elif defined (ARCH_PTU4)
|
||||
if (config->hasFeatureDBusSuspendControl()) {
|
||||
this->dbus_wakeSystem();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* get event device name by a type:
|
||||
*
|
||||
* e.g. type is TOUCHSCREEN:
|
||||
* getEventDeviceName(TOUCHSCREEN) returns "/dev/input/event0"
|
||||
*
|
||||
*/
|
||||
QString ATB_system::getEventDeviceName(DEVICE_TYPE type)
|
||||
{
|
||||
QString procDevices = "/proc/bus/input/devices";
|
||||
|
||||
QFile inFile(procDevices);
|
||||
if (!inFile.open(QFile::ReadOnly)) {
|
||||
qCritical() << "ATB_system::getEventDeviceName() ERROR open()" << procDevices;
|
||||
return "";
|
||||
}
|
||||
|
||||
QTextStream textInStream(&inFile);
|
||||
QString line;
|
||||
QString N_RegExp;
|
||||
QString DeviceTypeName;
|
||||
int lineCounter = 0;
|
||||
bool typeFound = false;
|
||||
QString H_RegExp = "^H: Handlers"; // H: Handlers=kbd event2
|
||||
QString eventDeviceName = "";
|
||||
QString eventPart;
|
||||
QStringList devNames;
|
||||
QString DeviceNamePattern;
|
||||
|
||||
//PTU4 Touchscreen N: Name="atmel_mxt_ts T100 touchscreen"
|
||||
//PTU4 GPIO kys N: Name="gpio_keys.6"
|
||||
//RFID Reader, Stronglink SL040 N: Name="StrongLink USB CardReader"
|
||||
//2D Scanner, Datalogig DSE0420 N: Name="Datalogic ADC Inc. Handheld Barcode Scanner" VID: 05f9, PID:4005
|
||||
//2D Scanner, Datalogig DSM0400 N: Name="Datalogic Handheld Barcode Scanner" VID: 05f9, PID:4005
|
||||
//2D Scanner, Honeywell N56000 N: Name="Honeywell Imaging & Mobility N5600"
|
||||
//2D Scanner, Newland FM3080 N: Name="Newland Auto-ID NLS-FM3080V2-20 USB POS KBW" VID: 1eab, PID:0022
|
||||
//2D Scanner, Opticon MDI-4000 N: Name="Opticon Opticon USB Barcode Reader"
|
||||
//USB Mouse N: Name="Logitech USB-PS/2 Optical Mouse"
|
||||
|
||||
/* Datalogic DSE0420
|
||||
I: Bus=0003 Vendor=05f9 Product=4005 Version=0110
|
||||
N: Name="Datalogic ADC Inc. Handheld Barcode Scanner"
|
||||
P: Phys=usb-700000.ehci-2.3/input2
|
||||
S: Sysfs=/devices/ahb.0/700000.ehci/usb1/1-2/1-2.3/1-2.3:1.2/input/input14
|
||||
U: Uniq=S/N G16C15795
|
||||
H: Handlers=kbd event3
|
||||
B: PROP=0
|
||||
B: EV=120013
|
||||
B: KEY=10000 7 ff9f207a c14057ff febeffdf ffefffff ffffffff fffffffe
|
||||
B: MSC=10
|
||||
B: LED=1f
|
||||
*/
|
||||
/* Datalogic DSM04XX
|
||||
I: Bus=0003 Vendor=05f9 Product=4005 Version=0110
|
||||
N: Name="Datalogic Handheld Barcode Scanner"
|
||||
P: Phys=usb-700000.ehci-2.3/input0
|
||||
S: Sysfs=/devices/ahb.0/700000.ehci/usb1/1-2/1-2.3/1-2.3:1.0/input/input15
|
||||
U: Uniq=S/N G21FA0180
|
||||
H: Handlers=kbd event3
|
||||
B: PROP=0
|
||||
B: EV=120013
|
||||
B: KEY=e080ffdf 1cfffff ffffffff fffffffe
|
||||
B: MSC=10
|
||||
B: LED=1f
|
||||
*/
|
||||
/*
|
||||
I: Bus=0003 Vendor=1eab Product=0022 Version=0110
|
||||
N: Name="Newland Auto-ID NLS-FM3080V2-20 USB POS KBW"
|
||||
P: Phys=usb-700000.ehci-2.2/input0
|
||||
S: Sysfs=/devices/ahb.0/700000.ehci/usb1/1-2/1-2.2/1-2.2:1.0/input/input6
|
||||
U: Uniq=FM3080V2-20-BH00017
|
||||
H: Handlers=kbd event2
|
||||
B: PROP=0
|
||||
B: EV=120013
|
||||
B: KEY=10000 7 ff9f207a c14057ff febeffdf ffefffff ffffffff fffffffe
|
||||
B: MSC=10
|
||||
B: LED=1f
|
||||
*/
|
||||
|
||||
|
||||
switch (type) {
|
||||
case EVENT_DEVICE_BARCODEREADER:
|
||||
N_RegExp = "^N: Name=.+(Barcode|Honeywell Imaging|Newland Auto).+";
|
||||
DeviceTypeName = "1D/2D-Scanner";
|
||||
DeviceNamePattern = "event";
|
||||
break;
|
||||
case EVENT_DEVICE_TOUCHSCREEN:
|
||||
N_RegExp = "^N: Name=.+touch.+";
|
||||
DeviceTypeName = "Touchscreen";
|
||||
DeviceNamePattern = "event";
|
||||
break;
|
||||
case EVENT_DEVICE_GPIO_KEYBOARD:
|
||||
N_RegExp = "^N: Name=.+gpio.+";
|
||||
DeviceTypeName = "gpio-keys";
|
||||
DeviceNamePattern = "event";
|
||||
break;
|
||||
case EVENT_DEVICE_KEYBOARD:
|
||||
N_RegExp = "^N: Name=.+touch.+";
|
||||
DeviceTypeName = "keyboard";
|
||||
DeviceNamePattern = "event";
|
||||
break;
|
||||
case EVENT_DEVICE_RFIDREADER:
|
||||
N_RegExp = "^N: Name=.+Card.+";
|
||||
DeviceTypeName = "card reader";
|
||||
DeviceNamePattern = "event";
|
||||
break;
|
||||
case EVENT_DEVICE_USBMOUSE:
|
||||
N_RegExp = "^N: Name=.+USB.+Mouse.+";
|
||||
DeviceTypeName = "USB Mouse";
|
||||
DeviceNamePattern = "mouse";
|
||||
break;
|
||||
}
|
||||
|
||||
qDebug() << "ATB_system::getEventDeviceName() N_RegExp = " << N_RegExp;
|
||||
|
||||
do {
|
||||
line = textInStream.readLine();
|
||||
|
||||
// DEBUG
|
||||
//qDebug() << " " << line;
|
||||
|
||||
// find "N:"-line:
|
||||
if (line.contains(QRegExp(N_RegExp))) {
|
||||
typeFound = true;
|
||||
lineCounter = 0;
|
||||
|
||||
qDebug() << "ATB_system::getEventDeviceName() found N_RegExp = " << N_RegExp;
|
||||
|
||||
}
|
||||
|
||||
if (typeFound) {
|
||||
// found "N:"-line, now search for "H:"-line;
|
||||
// the corresponding "H:"-line should be within the next 7 following text lines.
|
||||
|
||||
// example lines:
|
||||
// - "H: Handlers=event0 mouse0" -> for touchscreen on PTU4
|
||||
// - "H: Handlers=event3 mouse1" -> for USB mouse on PTU4
|
||||
|
||||
lineCounter++;
|
||||
if ( (lineCounter<=7) && (line.contains(QRegExp(H_RegExp))) ) {
|
||||
eventPart = line.split("=", QString::SkipEmptyParts).takeLast();
|
||||
devNames = eventPart.split(" ", QString::SkipEmptyParts);
|
||||
|
||||
for (int i=0; i<devNames.size(); i++ ) {
|
||||
|
||||
if (devNames.at(i).contains(DeviceNamePattern)) {
|
||||
eventDeviceName = "/dev/input/" + devNames.at(i);
|
||||
|
||||
qDebug() << "ATB_system::getEventDeviceName() found device = " << eventDeviceName;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if ( lineCounter>7 ) {
|
||||
lineCounter=0;
|
||||
typeFound = false;
|
||||
}
|
||||
}
|
||||
} while (!line.isNull());
|
||||
|
||||
if (eventDeviceName == "") {
|
||||
qCritical() << "ATB_system::getEventDeviceName(): could not detect input event device type " << DeviceTypeName;
|
||||
}
|
||||
|
||||
return eventDeviceName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
117
atb_system.h
117
atb_system.h
@@ -1,117 +0,0 @@
|
||||
#ifndef ATB_SYSTEM_H
|
||||
#define ATB_SYSTEM_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include "version.h"
|
||||
|
||||
|
||||
#define SYS_COMMAND_SLEEP 0x0001
|
||||
#define SYS_COMMAND_DIMLOW 0x0002
|
||||
#define SYS_COMMAND_DIMHIGH 0x0003
|
||||
#define SYS_COMMAND_BEEP 0x0004
|
||||
#define SYS_COMMAND_MACHINE_NUMBER 0x0005
|
||||
#define SYS_COMMAND_HALT 0x0006
|
||||
#define SYS_COMMAND_REBOOT 0x0007
|
||||
#define SYS_COMMAND_LED_CONTROL 0x3600
|
||||
|
||||
|
||||
#if defined (ARCH_PTU2)
|
||||
#define BEEPTIMEOUT 200
|
||||
#elif defined (ARCH_PTU4)
|
||||
#define BEEPTIMEOUT 100
|
||||
#else
|
||||
#define BEEPTIMEOUT 100
|
||||
#endif
|
||||
|
||||
class ATBHMIconfig;
|
||||
|
||||
class ATB_system : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
ATBHMIconfig *config;
|
||||
QFile *tf_gpio;
|
||||
QTextStream *tf_gpio_outstream;
|
||||
|
||||
quint8 current_dim_value;
|
||||
|
||||
void privateConfigLED(const QByteArray & cmd);
|
||||
void privateSetLEDTrigger(const QString & led, const QString & trigger);
|
||||
void privateSetLEDDelayOn(const QString & led, const QString & delayOn);
|
||||
void privateSetLEDDelayOff(const QString & led, const QString & delayOff);
|
||||
void privateSwitchBlinkButton(bool on);
|
||||
|
||||
public:
|
||||
explicit ATB_system(ATBHMIconfig *config, QObject *parent = nullptr);
|
||||
~ATB_system();
|
||||
|
||||
|
||||
static quint8 setPSAConfigInt(const QString & filename, quint16 iValue);
|
||||
static quint16 readPSAConfigInt(const QString &filename);
|
||||
|
||||
static quint8 setPSAConfigString(const QString & filename, const QString & sValue);
|
||||
static QString readPSAConfigString(const QString & filename);
|
||||
|
||||
enum LED_NAME {
|
||||
ATB_LED1 = 1,
|
||||
ATB_LED2,
|
||||
ATB_LED3,
|
||||
ATB_LED4
|
||||
};
|
||||
|
||||
enum LED_TRIGGER {
|
||||
LED_TRIGGER_NONE = 1,
|
||||
LED_TRIGGER_TIMER,
|
||||
LED_TRIGGER_DEFAULT_ON
|
||||
};
|
||||
|
||||
enum DEVICE_TYPE {
|
||||
EVENT_DEVICE_BARCODEREADER,
|
||||
EVENT_DEVICE_TOUCHSCREEN,
|
||||
EVENT_DEVICE_GPIO_KEYBOARD,
|
||||
EVENT_DEVICE_KEYBOARD,
|
||||
EVENT_DEVICE_RFIDREADER,
|
||||
EVENT_DEVICE_USBMOUSE
|
||||
};
|
||||
|
||||
static QString getEventDeviceName(DEVICE_TYPE type);
|
||||
static quint8 setupInductionLoops();
|
||||
|
||||
|
||||
void dbus_permitSuspend();
|
||||
void dbus_preventSuspend();
|
||||
|
||||
void dbus_DimHighPermanent();
|
||||
void dbus_DimControlStart();
|
||||
|
||||
void dbus_wakeSystem();
|
||||
|
||||
signals:
|
||||
/* emitted, after waking up from suspend...
|
||||
*/
|
||||
void wakeUp();
|
||||
|
||||
public slots:
|
||||
void executeSystemCommand(quint16 cmd, QByteArray data);
|
||||
void DimHigh();
|
||||
void DimLow();
|
||||
void Dim(quint8 value);
|
||||
void DimStart();
|
||||
void DimStop();
|
||||
void Beep();
|
||||
void BeepStop();
|
||||
void setDateTime(const QString &dateTimeString);
|
||||
|
||||
void onConfigLED(LED_NAME LED, LED_TRIGGER trigger, quint16 delayOn = 0, quint16 delayOff = 0);
|
||||
|
||||
void switchBlinkButtonOn();
|
||||
void switchBlinkButtonOff();
|
||||
|
||||
void onWakeVMC();
|
||||
void halt();
|
||||
void reboot();
|
||||
};
|
||||
|
||||
#endif // ATB_SYSTEM_H
|
@@ -1,157 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
VERSION_STRING=""
|
||||
|
||||
#GIT='/cygdrive/c/Program Files \(x86\)/Git/bin/git'
|
||||
GIT=git
|
||||
|
||||
|
||||
|
||||
|
||||
parse_git_branch () {
|
||||
$GIT branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/"
|
||||
}
|
||||
|
||||
|
||||
ARCH=$1
|
||||
TARGET=$2
|
||||
INTERFACE=$3
|
||||
INTERFACE_DEFINITION=$4
|
||||
VERSION_H=$5
|
||||
|
||||
SCRIPT=$(readlink -f $0)
|
||||
SCRIPTPATH=`dirname $SCRIPT`
|
||||
OUTPUTDIR=$(pwd)
|
||||
echo " current dir is : " $(pwd)
|
||||
echo $SCRIPT
|
||||
echo $SCRIPTPATH
|
||||
|
||||
echo "changing dir to script path: " $SCRIPTPATH
|
||||
cd $SCRIPTPATH
|
||||
|
||||
# set version string ##################################################################
|
||||
if [ -z $VERSION_STRING ] ; then
|
||||
VERSION_STRING=$(date +%Y%m%d_%H%M)
|
||||
fi
|
||||
GIT_DESCRIBE=$($GIT describe --always)
|
||||
GIT_BRANCH=$(parse_git_branch)
|
||||
|
||||
# extract path from branchname:
|
||||
IFS='_' read -ra TMP_ARRAY <<< "${GIT_BRANCH}"
|
||||
BRANCH_PATH=${TMP_ARRAY[0]}
|
||||
|
||||
|
||||
|
||||
# detect if we have a development version:
|
||||
if [ ${#TMP_ARRAY[1]} -gt 0 ] ; then
|
||||
DEV_SUFFIX="_dev"
|
||||
else
|
||||
DEV_SUFFIX=""
|
||||
fi
|
||||
|
||||
# detect if git status is dirty
|
||||
GIT_DESCRIBE_DIRTY=$($GIT describe --dirty)
|
||||
if [ "${GIT_DESCRIBE_DIRTY:(-6)}" == "-dirty" ] ; then
|
||||
DIRTY_SUFFIX="_dirty"
|
||||
else
|
||||
DIRTY_SUFFIX=""
|
||||
fi
|
||||
|
||||
|
||||
if [ -n "$DIRTY_SUFFIX" ] || [ -n "$DEV_SUFFIX" ] ; then
|
||||
DEVDIRTY=true
|
||||
else
|
||||
DEVDIRTY=false
|
||||
fi
|
||||
|
||||
|
||||
# extract interface definition
|
||||
|
||||
#
|
||||
#Q_DECLARE_INTERFACE(CCInterface,
|
||||
# "eu.atb.ptu.plugin.CCInterface/2.9.0")
|
||||
#Q_DECLARE_INTERFACE(DeviceControllerInterface,
|
||||
# "eu.atb.ptu.plugin.DeviceControllerInterface/1.0")
|
||||
# -> extract whole string within quotation marks
|
||||
INTERFACE_VERSION=$(grep 'eu.atb.ptu.plugin.' ${INTERFACE_DEFINITION})
|
||||
# get string within quotes:
|
||||
INTERFACE_VERSION=`echo ${INTERFACE_VERSION} | awk -F \" '{print $2}'`
|
||||
|
||||
|
||||
#
|
||||
# write version.h
|
||||
|
||||
|
||||
echo " TARGET is: $TARGET"
|
||||
echo " ARCH is: $ARCH"
|
||||
echo " "
|
||||
echo " PluginName: $TARGET"
|
||||
echo " Interface: $INTERFACE"
|
||||
echo " InterfaceVersion: $INTERFACE_VERSION"
|
||||
echo " "
|
||||
echo " new version is: $VERSION_STRING"
|
||||
echo " git describe is: $GIT_DESCRIBE"
|
||||
echo " git branch is: $GIT_BRANCH"
|
||||
echo " branch-path is: $BRANCH_PATH"
|
||||
echo " "
|
||||
|
||||
echo " dev suffix: $DEV_SUFFIX"
|
||||
echo " dirty suffix: $DIRTY_SUFFIX"
|
||||
|
||||
|
||||
PLUGIN_VERSION=${VERSION_STRING}
|
||||
#ATB_QT_GIT_DESCRIBE=${GIT_DESCRIBE}_${GIT_BRANCH}
|
||||
PLUGIN_GIT_DESCRIBE=${GIT_DESCRIBE}_${BRANCH_PATH}${DEV_SUFFIX}${DIRTY_SUFFIX}
|
||||
|
||||
#TARGET=IngenicoZVT_CCPlugin
|
||||
|
||||
|
||||
# build version.h #####################################################################
|
||||
|
||||
echo " building new version info (version.h) ..."
|
||||
|
||||
|
||||
|
||||
|
||||
echo "#ifndef VERSION_H" > ${VERSION_H}
|
||||
echo "#define VERSION_H" >> ${VERSION_H}
|
||||
echo "" >> ${VERSION_H}
|
||||
echo "" >> ${VERSION_H}
|
||||
echo "#define INTERFACE_VERSION \"${INTERFACE_VERSION}\"" >> ${VERSION_H}
|
||||
echo "#define PLUGIN_VERSION \"${PLUGIN_VERSION}\"" >> ${VERSION_H}
|
||||
echo "" >> ${VERSION_H}
|
||||
echo "#define PLUGIN_GIT_DESCRIBE \"${PLUGIN_GIT_DESCRIBE}\"" >> ${VERSION_H}
|
||||
echo "" >> ${VERSION_H}
|
||||
echo "" >> ${VERSION_H}
|
||||
|
||||
cat <<EOT >> ${VERSION_H}
|
||||
|
||||
const std::string pluginInfoString = R"(
|
||||
{
|
||||
"Interface": "${INTERFACE}",
|
||||
"InterfaceVersion": "${INTERFACE_VERSION}",
|
||||
"PluginName": "${TARGET}",
|
||||
"Version": "${PLUGIN_VERSION}",
|
||||
"git-describe": "${PLUGIN_GIT_DESCRIBE}",
|
||||
}
|
||||
)";
|
||||
|
||||
EOT
|
||||
|
||||
echo "" >> ${VERSION_H}
|
||||
echo "" >> ${VERSION_H}
|
||||
if [ ${DEVDIRTY} == "true" ] ; then
|
||||
echo "#define DEVDIRTY" >> ${VERSION_H}
|
||||
echo "" >> ${VERSION_H}
|
||||
echo "" >> ${VERSION_H}
|
||||
fi
|
||||
echo "#define SYSTEM_ARCH \"${ARCH}\"" >> ${VERSION_H}
|
||||
echo "#define ARCH_${ARCH}" >> ${VERSION_H}
|
||||
echo "" >> ${VERSION_H}
|
||||
echo "" >> ${VERSION_H}
|
||||
echo "#endif //VERSION_H" >> ${VERSION_H}
|
||||
|
||||
|
||||
|
||||
|
||||
|
1468
include/interfaces.h
1468
include/interfaces.h
File diff suppressed because it is too large
Load Diff
@@ -5,13 +5,66 @@
|
||||
* a simple class with only one method for plugin info
|
||||
*/
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
class ATBAPPplugin {
|
||||
public:
|
||||
virtual const QString & getPluginInfo() = 0;
|
||||
class UnifiedDCVMCInterface;
|
||||
|
||||
template <typename T>
|
||||
struct ATBAPPplugin {
|
||||
enum class PLUGIN_STATE : quint8 {
|
||||
NOT_INITIALIZED = 0,
|
||||
INITIALIZED = 1
|
||||
};
|
||||
enum class RESULT_STATE : quint8 {
|
||||
SUCCESS = 1, // operation was successfull
|
||||
ERROR_BACKEND, // error from backend (e.g. backend replies with error)
|
||||
ERROR_NETWORK,
|
||||
ERROR_TIMEOUT, // the operation timed out
|
||||
ERROR_PROCESS, // internal plugin error, should not occur (this is a bug in implementation)
|
||||
ERROR_BUSY,
|
||||
ERROR_STATE,
|
||||
ERROR_RETRY, // retry operation
|
||||
INFO // informational (e.g. display a message, log something etc.)
|
||||
};
|
||||
enum class CASH_STATE : quint8 {
|
||||
CACHE_EMPTY, // Cache still empty, default state
|
||||
CACHE_INPUT, // Coins are in Cache
|
||||
OVERPAYED,
|
||||
/* t.b.d. */
|
||||
};
|
||||
enum class TICKET_VARIANT : quint8 {
|
||||
PARKING_TICKET,
|
||||
RECEIPT,
|
||||
ERROR_RECEIPT,
|
||||
START_RECEIPT, // e.g. Szeged Start
|
||||
STOP_RECEIPT, // e.g. Szeged Stop
|
||||
};
|
||||
enum class STEP : quint8 {
|
||||
UP = 1,
|
||||
DOWN = 2
|
||||
};
|
||||
enum class TERMINAL_STATE : quint8 {
|
||||
NOT_AVAILABLE = 1,
|
||||
AVAILABLE,
|
||||
PREPARED_FOR_VENDING,
|
||||
BUSY,
|
||||
NEEDS_MAINTENANCE
|
||||
};
|
||||
|
||||
virtual const QString &getPluginInfo() = 0;
|
||||
virtual QStringList getPluginInfoList() {
|
||||
return QStringList(QString());
|
||||
}
|
||||
};
|
||||
|
||||
Q_DECLARE_INTERFACE(ATBAPPplugin, "eu.atb.ptu.plugin.ATBAPPplugin/0.9")
|
||||
using PLUGIN_STATE = ATBAPPplugin<UnifiedDCVMCInterface>::PLUGIN_STATE;
|
||||
using RESULT_STATE = ATBAPPplugin<UnifiedDCVMCInterface>::RESULT_STATE;
|
||||
using CASH_STATE = ATBAPPplugin<UnifiedDCVMCInterface>::CASH_STATE;
|
||||
using TICKET_VARIANT = ATBAPPplugin<UnifiedDCVMCInterface>::TICKET_VARIANT;
|
||||
using STEP = ATBAPPplugin<UnifiedDCVMCInterface>::STEP;
|
||||
using TERMINAL_STATE = ATBAPPplugin<UnifiedDCVMCInterface>::TERMINAL_STATE;
|
||||
|
||||
//Q_DECLARE_INTERFACE(ATBAPPplugin,
|
||||
// "eu.atb.ptu.plugin.ATBAPPplugin/0.9")
|
||||
|
||||
#endif // ATBAPPPLUGIN_H
|
||||
|
@@ -17,59 +17,138 @@ ATBVMCPlugin::ATBVMCPlugin(QObject *parent)
|
||||
: VMCInterface(parent)
|
||||
, m_errorCode("")
|
||||
, m_errorDescription("")
|
||||
, m_pluginInfo("")
|
||||
, m_serialPortName("")
|
||||
, m_useDebug(false)
|
||||
, m_pluginState(PLUGIN_STATE::NOT_INITIALIZED)
|
||||
, m_eventReceiver(nullptr)
|
||||
, m_settings(nullptr)
|
||||
, m_config(nullptr) {
|
||||
, m_vmc(nullptr) {
|
||||
|
||||
m_pluginInfoList.clear();
|
||||
m_pluginInfoList << QString(" Interface: ") + INTERFACE;
|
||||
m_pluginInfoList << QString("Interface Version: ") + INTERFACE_VERSION;
|
||||
m_pluginInfoList << QString(" PluginName: ") + PLUGIN_NAME;
|
||||
m_pluginInfoList << QString(" Version: ") + PLUGIN_VERSION;
|
||||
m_pluginInfoList << QString(" git-describe: ") + PLUGIN_GIT_DESCRIBE;
|
||||
m_pluginInfoList << QString(" Extended version: ") + PLUGIN_EXTENDED_VERSION;
|
||||
|
||||
m_pluginInfo = m_pluginInfoList.join('\n');
|
||||
}
|
||||
|
||||
ATBVMCPlugin::~ATBVMCPlugin() {
|
||||
if (m_vmc) {
|
||||
delete m_vmc;
|
||||
m_vmc = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
PLUGIN_STATE ATBVMCPlugin::initVMCPlugin(QObject *eventReceiver,
|
||||
QStringList ATBVMCPlugin::getPluginInfoList() {
|
||||
return m_pluginInfoList;
|
||||
}
|
||||
|
||||
QString const &ATBVMCPlugin::getPluginInfo() {
|
||||
return m_pluginInfo;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// interface:
|
||||
PLUGIN_STATE ATBVMCPlugin::initDCPlugin(QObject *eventReceiver, const QSettings & settings) {
|
||||
Q_UNUSED(eventReceiver);
|
||||
Q_UNUSED(settings);
|
||||
|
||||
return PLUGIN_STATE::NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
PLUGIN_STATE ATBVMCPlugin::initPlugin(QObject *eventReceiver, QObject *atbSystem, QObject *hmiConfig, QSettings const &settings) {
|
||||
return initVMCPlugin(eventReceiver, atbSystem, hmiConfig, settings);
|
||||
}
|
||||
|
||||
PLUGIN_STATE ATBVMCPlugin::initPlugin(QObject *eventReceiver, QSettings const &settings) {
|
||||
Q_UNUSED(eventReceiver);
|
||||
Q_UNUSED(settings);
|
||||
|
||||
return PLUGIN_STATE::NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
PLUGIN_STATE ATBVMCPlugin::initVMCPlugin(QObject *appControl,
|
||||
QObject *atbSystem,
|
||||
QObject *hmiConfig,
|
||||
QSettings const &settings) {
|
||||
m_eventReceiver = eventReceiver;
|
||||
m_settings = &settings;
|
||||
if (appControl && atbSystem && hmiConfig) {
|
||||
m_vmc = new VMC(appControl, &settings);
|
||||
|
||||
// Beachte: QSettings hat .fileName().
|
||||
// Damit kann man dann ATBSystem benutzen.
|
||||
// -------------------- connect vmc --------------------------------------------
|
||||
connect(m_vmc, SIGNAL(VMCFormatedString(FormatedStringList)), appControl, SLOT(onVMCFormatedString(FormatedStringList)), Qt::QueuedConnection);
|
||||
connect(m_vmc, SIGNAL(displayData(quint8,QString)), appControl, SLOT(onVMCSellData(quint8,QString)), Qt::QueuedConnection);
|
||||
connect(m_vmc, SIGNAL(retriggerModeSell()), appControl, SLOT(restartSellModeTimeoutTimer()), Qt::QueuedConnection);
|
||||
connect(m_vmc, SIGNAL(setVendingData(QString,QByteArray)), appControl, SLOT(onSetVendingData(QString,QByteArray)), Qt::QueuedConnection);
|
||||
|
||||
return PLUGIN_STATE::INITIALIZED;
|
||||
}
|
||||
connect(m_vmc, SIGNAL(sysCommand(quint16, QByteArray)), atbSystem, SLOT(executeSystemCommand(quint16, QByteArray)), Qt::QueuedConnection);
|
||||
connect(m_vmc, SIGNAL(newDateTime(QString)), atbSystem, SLOT(setDateTime(QString)), Qt::QueuedConnection);
|
||||
connect(m_vmc, SIGNAL(wakeVMC()), atbSystem, SLOT(onWakeVMC()));
|
||||
|
||||
PLUGIN_STATE ATBVMCPlugin::initVMCPlugin(QObject *eventReceiver, ATBHMIconfig *config) {
|
||||
m_eventReceiver = eventReceiver;
|
||||
m_settings = &config->getSettings();
|
||||
m_config = config;
|
||||
return PLUGIN_STATE::INITIALIZED;
|
||||
connect(m_vmc, SIGNAL(setCustNr(QString)), hmiConfig, SLOT(setCustNr(QString)), Qt::QueuedConnection);
|
||||
connect(m_vmc, SIGNAL(setGroupNr(QString)), hmiConfig, SLOT(setGroupNr(QString)), Qt::QueuedConnection);
|
||||
connect(m_vmc, SIGNAL(setZoneNr(QString)), hmiConfig, SLOT(setZoneNr(QString)), Qt::QueuedConnection);
|
||||
connect(m_vmc, SIGNAL(setMachineNr(QString)), hmiConfig, SLOT(setMachineNr(QString)), Qt::QueuedConnection);
|
||||
connect(m_vmc, SIGNAL(setDefaultLanguage(quint8)), hmiConfig, SLOT(setDefaultLanguage(quint8)), Qt::QueuedConnection);
|
||||
|
||||
connect(m_vmc, SIGNAL(wakeVMC()), m_vmc, SLOT(onWakeVMC()), Qt::QueuedConnection);
|
||||
|
||||
return PLUGIN_STATE::INITIALIZED;
|
||||
}
|
||||
|
||||
return PLUGIN_STATE::NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
// mandantory ATBAPP plugin methods: ------------------------------------------
|
||||
PLUGIN_STATE ATBVMCPlugin::getState() {
|
||||
return PLUGIN_STATE::NOT_INITIALIZED;
|
||||
return m_pluginState;
|
||||
}
|
||||
|
||||
QString ATBVMCPlugin::getLastError() {
|
||||
return "";
|
||||
QString const &ATBVMCPlugin::getLastError() {
|
||||
return m_errorCode;
|
||||
}
|
||||
|
||||
QString ATBVMCPlugin::getLastErrorDescription() {
|
||||
return "";
|
||||
}
|
||||
|
||||
QString const &ATBVMCPlugin::getPluginInfo() {
|
||||
static QString info;
|
||||
return info;
|
||||
QString const &ATBVMCPlugin::getLastErrorDescription() {
|
||||
return m_errorDescription;
|
||||
}
|
||||
|
||||
// helpers e.g. for debug / log
|
||||
QString ATBVMCPlugin::getString(RESULT_STATE /*resultState*/) {
|
||||
return "";
|
||||
QString const &ATBVMCPlugin::getString(RESULT_STATE resultState) {
|
||||
static QString str;
|
||||
|
||||
switch (resultState) {
|
||||
case RESULT_STATE::SUCCESS:
|
||||
str = QString("RESULT_STATE::SUCCESS");
|
||||
break;
|
||||
case RESULT_STATE::ERROR_BACKEND:
|
||||
str = QString("RESULT_STATE::ERROR_BACKEND");
|
||||
break;
|
||||
case RESULT_STATE::ERROR_TIMEOUT:
|
||||
str = QString("RESULT_STATE::ERROR_TIMEOUT");
|
||||
break;
|
||||
case RESULT_STATE::ERROR_PROCESS:
|
||||
str = QString("RESULT_STATE::ERROR_PROCESS");
|
||||
break;
|
||||
case RESULT_STATE::ERROR_RETRY:
|
||||
str = QString("RESULT_STATE::ERROR_RETRY");
|
||||
break;
|
||||
case RESULT_STATE::INFO:
|
||||
str = QString("RESULT_STATE::INFO");
|
||||
break;
|
||||
case RESULT_STATE::ERROR_NETWORK:
|
||||
str = QString("RESULT_STATE::ERROR_NETWORK");
|
||||
break;
|
||||
case RESULT_STATE::ERROR_BUSY:
|
||||
str = QString("RESULT_STATE::ERROR_BUSY");
|
||||
break;
|
||||
case RESULT_STATE::ERROR_STATE:
|
||||
str = QString("RESULT_STATE::ERROR_STATE");
|
||||
break;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
void ATBVMCPlugin::onChangedProgramModeToSELL() {
|
||||
|
||||
}
|
||||
@@ -101,3 +180,20 @@ void ATBVMCPlugin::reboot() {
|
||||
void ATBVMCPlugin::reset() {
|
||||
|
||||
}
|
||||
|
||||
QStringList ATBVMCPlugin::interfaces() const {
|
||||
QStringList result;
|
||||
int const count = this->metaObject()->classInfoCount();
|
||||
for (int i = 0; i < count; ++i) {
|
||||
QString const name(QString::fromLatin1(this->metaObject()->classInfo(i).name()));
|
||||
QString const value(QString::fromLatin1(this->metaObject()->classInfo(i).value()));
|
||||
if (name == "Interface") {
|
||||
result << value;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
Q_EXPORT_PLUGIN2(ATBVMCPlugin, ATBVMCPlugin)
|
||||
#endif
|
||||
|
@@ -3,45 +3,47 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QSettings>
|
||||
#include <QtPlugin>
|
||||
|
||||
#include "src/ATBAPP/VMCInterface.h"
|
||||
#include "src/ATBAPP/ATBAPPplugin.h"
|
||||
#include "src/ATBAPP/VMCInterface.h"
|
||||
#include "src/ATBAPP/UnifiedDCVMCInterface.h"
|
||||
|
||||
#include "version.h"
|
||||
|
||||
#include "include/interfaces.h"
|
||||
#include "vmc.h"
|
||||
|
||||
class ATBHMIconfig;
|
||||
class AppControl;
|
||||
class ATBSystem;
|
||||
|
||||
class ATBVMCPlugin : public VMCInterface {
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(ATBAPPplugin)
|
||||
Q_INTERFACES(UnifiedDCVMCInterface)
|
||||
#if QT_VERSION >= 0x050000
|
||||
Q_PLUGIN_METADATA( IID "ATBVMCPlugin" )
|
||||
#endif
|
||||
|
||||
Q_INTERFACES(VMCInterface)
|
||||
Q_CLASSINFO("Interface", "VMCInterface")
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
Q_PLUGIN_METADATA(IID "eu.atb.ptu.plugin.ATBVMCPlugin")
|
||||
#endif
|
||||
|
||||
public:
|
||||
explicit ATBVMCPlugin(QObject *parent = nullptr);
|
||||
~ATBVMCPlugin();
|
||||
virtual ~ATBVMCPlugin();
|
||||
|
||||
virtual QStringList getPluginInfoList() override;
|
||||
virtual const QString &getPluginInfo() override;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// interface:
|
||||
PLUGIN_STATE initVMCPlugin(QObject *eventReceiver, QSettings const &settings);
|
||||
PLUGIN_STATE initVMCPlugin(QObject *eventReceiver, ATBHMIconfig *config);
|
||||
virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, QObject *atbSystem, QObject *hmiConfig, QSettings const &settings) override;
|
||||
virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, QSettings const &settings) override;
|
||||
virtual PLUGIN_STATE initDCPlugin(QObject *eventReceiver, const QSettings & settings) override;
|
||||
virtual PLUGIN_STATE initVMCPlugin(QObject *eventReceiver, QObject *atbSystem, QObject *hmiConfig, QSettings const &settings) override;
|
||||
|
||||
// mandantory ATBAPP plugin methods: ------------------------------------------
|
||||
PLUGIN_STATE getState() override;
|
||||
QString getLastError() override;
|
||||
QString getLastErrorDescription() override;
|
||||
|
||||
virtual const QString & getPluginInfo() override;
|
||||
QString const &getLastError() override;
|
||||
QString const &getLastErrorDescription() override;
|
||||
|
||||
// helpers e.g. for debug / log
|
||||
virtual QString getString(RESULT_STATE resultState) override;
|
||||
virtual QString const &getString(RESULT_STATE resultState) override;
|
||||
|
||||
QStringList interfaces() const;
|
||||
|
||||
public slots:
|
||||
virtual void onChangedProgramModeToSELL() override;
|
||||
@@ -57,13 +59,13 @@ public slots:
|
||||
private:
|
||||
QString m_errorCode;
|
||||
QString m_errorDescription;
|
||||
QStringList m_pluginInfoList;
|
||||
QString m_pluginInfo;
|
||||
QString m_serialPortName;
|
||||
bool m_useDebug;
|
||||
PLUGIN_STATE m_pluginState;
|
||||
QObject* m_eventReceiver;
|
||||
QSettings const *m_settings;
|
||||
ATBHMIconfig *m_config;
|
||||
QObject* m_appControl;
|
||||
VMC *m_vmc;
|
||||
};
|
||||
|
||||
#endif // ATBDEVICECONTROLLERPLUGIN_H
|
||||
|
@@ -11,56 +11,41 @@
|
||||
|
||||
#include "ATBAPPplugin.h"
|
||||
|
||||
class ATBHMIconfig;
|
||||
class AppControl;
|
||||
class ATBSystem;
|
||||
|
||||
class UnifiedDCVMCInterface : public QObject, public ATBAPPplugin {
|
||||
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(ATBAPPplugin)
|
||||
class UnifiedDCVMCInterface : public ATBAPPplugin<UnifiedDCVMCInterface> {
|
||||
//Q_INTERFACES(ATBAPPplugin)
|
||||
//Q_CLASSINFO("Interface", "ATBAPPplugin")
|
||||
|
||||
public:
|
||||
enum class PLUGIN_STATE : quint8 {
|
||||
NOT_INITIALIZED = 0,
|
||||
INITIALIZED = 1
|
||||
};
|
||||
enum class RESULT_STATE : quint8 {
|
||||
SUCCESS = 1, // operation was successfull
|
||||
ERROR_BACKEND, // error from backend (e.g. backend replies with error)
|
||||
ERROR_TIMEOUT, // the operation timed out
|
||||
ERROR_PROCESS, // internal plugin error, should not occur (this is a bug in implementation)
|
||||
ERROR_RETRY, // retry operation
|
||||
INFO // informational (e.g. display a message, log something etc.)
|
||||
};
|
||||
enum class CASH_STATE : quint8 {
|
||||
CACHE_EMPTY, // Cache still empty, default state
|
||||
CACHE_INPUT, // Coins are in Cache
|
||||
OVERPAYED,
|
||||
/* t.b.d. */
|
||||
};
|
||||
enum class TICKET_VARIANT : quint8 {
|
||||
PARKING_TICKET,
|
||||
RECEIPT,
|
||||
ERROR_RECEIPT,
|
||||
START_RECEIPT, // e.g. Szeged Start
|
||||
STOP_RECEIPT, // e.g. Szeged Stop
|
||||
};
|
||||
explicit UnifiedDCVMCInterface() = default;
|
||||
virtual ~UnifiedDCVMCInterface() = default;
|
||||
|
||||
explicit UnifiedDCVMCInterface(QObject *parent = nullptr) : QObject(parent) {}
|
||||
virtual ~UnifiedDCVMCInterface() {}
|
||||
|
||||
virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, QSettings const &settings) = 0;
|
||||
virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, ATBHMIconfig *config) = 0;
|
||||
virtual QStringList getPluginInfoList() = 0;
|
||||
virtual const QString &getPluginInfo() = 0;
|
||||
|
||||
// mandantory ATBAPP plugin methods:
|
||||
virtual PLUGIN_STATE getState() = 0;
|
||||
virtual QString getLastError() = 0;
|
||||
virtual QString getLastErrorDescription() = 0;
|
||||
virtual QString const &getLastError() = 0;
|
||||
virtual QString const &getLastErrorDescription() = 0;
|
||||
|
||||
virtual QString getString(RESULT_STATE resultState) = 0;
|
||||
virtual PLUGIN_STATE initPlugin(QObject *eventReceiver,
|
||||
QObject *atbSystem,
|
||||
QObject *hmiConfig,
|
||||
QSettings const &settings) = 0;
|
||||
|
||||
public slots:
|
||||
virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, QSettings const &settings) = 0;
|
||||
|
||||
virtual PLUGIN_STATE initDCPlugin(QObject *eventReceiver,
|
||||
const QSettings & settings) = 0;
|
||||
|
||||
virtual PLUGIN_STATE initVMCPlugin(QObject *eventReceiver,
|
||||
QObject *atbSystem, QObject *hmiConfig,
|
||||
const QSettings & settings) = 0;
|
||||
|
||||
|
||||
virtual QString const &getString(RESULT_STATE resultState) = 0;
|
||||
|
||||
//public slots:
|
||||
virtual void onChangedProgramModeToSELL() = 0;
|
||||
virtual void onChangedProgramModeToSERVICE() = 0;
|
||||
virtual void onChangedProgramModeToIDLE() = 0;
|
||||
@@ -70,79 +55,9 @@ public slots:
|
||||
virtual void stopPhysicalLayer() = 0;
|
||||
virtual void reboot() = 0;
|
||||
virtual void reset() = 0;
|
||||
|
||||
signals:
|
||||
void printTicketFinished(RESULT_STATE resultState,
|
||||
const QString & errorCode,
|
||||
const QString & errorDescription);
|
||||
void printReceiptFinished(RESULT_STATE resultState,
|
||||
const QString & errorCode,
|
||||
const QString & errorDescription);
|
||||
|
||||
/**
|
||||
* emitted on e.g. a coin input
|
||||
*/
|
||||
void cashInputEvent(RESULT_STATE resultState,
|
||||
CASH_STATE cashState,
|
||||
const QString & newCashValue,
|
||||
/* additional variables? */
|
||||
const QString & errorCode,
|
||||
const QString & errorDescription);
|
||||
|
||||
/**
|
||||
* emitted if cashInput has been stopped, e.g. in result to task requestStopCashInput():
|
||||
* -> shutter is blocked
|
||||
* -> no cash input is possible
|
||||
* -> coins are in cache
|
||||
*/
|
||||
void cashInputFinished(RESULT_STATE resultState,
|
||||
const QString & newCashValue,
|
||||
/* additional variables? */
|
||||
const QString & errorCode,
|
||||
const QString & errorDescription);
|
||||
|
||||
|
||||
/**
|
||||
* emitted e.g. if service door is opened
|
||||
*/
|
||||
void requestModeSERVICE();
|
||||
|
||||
/**
|
||||
* emitted e.g. if doors are closed
|
||||
*/
|
||||
void requestModeIDLE();
|
||||
|
||||
/**
|
||||
* emitted e.g. on severe errors
|
||||
*/
|
||||
void requestModeOOO();
|
||||
|
||||
/**
|
||||
* emitted e.g. if service door is opened
|
||||
*/
|
||||
void requestAccountResponse(const QHash<QString, QVariant> & accountData);
|
||||
|
||||
/**
|
||||
* emitted on error
|
||||
* depending on errorCode:
|
||||
* -> interrupt selling process
|
||||
* -> machine can go to state OOO
|
||||
* -> send error event to ISMAS
|
||||
* -> ...
|
||||
*/
|
||||
void Error(
|
||||
/* additional variables? */
|
||||
const QString & errorCode,
|
||||
const QString & errorDescription);
|
||||
|
||||
};
|
||||
|
||||
Q_DECLARE_INTERFACE(UnifiedDCVMCInterface,
|
||||
"eu.atb.ptu.plugin.UnifiedDCVMCInterface/1.0")
|
||||
|
||||
using PLUGIN_STATE = UnifiedDCVMCInterface::PLUGIN_STATE;
|
||||
using RESULT_STATE = UnifiedDCVMCInterface::RESULT_STATE;
|
||||
using CASH_STATE = UnifiedDCVMCInterface::CASH_STATE;
|
||||
using TICKET_VARIANT = UnifiedDCVMCInterface::TICKET_VARIANT;
|
||||
//Q_DECLARE_INTERFACE(UnifiedDCVMCInterface,
|
||||
// "eu.atb.ptu.plugin.UnifiedDCVMCInterface/1.0")
|
||||
|
||||
#endif // UNIFIED_DCVMC_INTERFACE_H_INCLUDED
|
||||
|
@@ -6,7 +6,6 @@
|
||||
#include <QSettings>
|
||||
#include <QString>
|
||||
|
||||
#include "ATBHMIconfig.h"
|
||||
#include "ATBAPPplugin.h"
|
||||
#include "UnifiedDCVMCInterface.h"
|
||||
|
||||
@@ -18,36 +17,39 @@ namespace nsVMCInterface {
|
||||
}
|
||||
|
||||
|
||||
class ATBHMIconfig;
|
||||
|
||||
class VMCInterface : public UnifiedDCVMCInterface {
|
||||
class VMCInterface : public QObject, public UnifiedDCVMCInterface {
|
||||
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(ATBAPPplugin)
|
||||
Q_INTERFACES(UnifiedDCVMCInterface)
|
||||
|
||||
//Q_INTERFACES(ATBAPPplugin UnifiedDCVMCInterface)
|
||||
//Q_INTERFACES(UnifiedDCVMCInterface)
|
||||
//Q_CLASSINFO("Interface", "ATBAPPplugin")
|
||||
//Q_CLASSINFO("Interface", "UnifiedDCVMCInterface")
|
||||
public:
|
||||
|
||||
explicit VMCInterface(QObject *parent = nullptr)
|
||||
: UnifiedDCVMCInterface(parent) {}
|
||||
explicit VMCInterface(QObject *parent = nullptr) : QObject(parent) {}
|
||||
virtual ~VMCInterface() = default;
|
||||
|
||||
virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, QSettings const &settings) override {
|
||||
return initVMCPlugin(eventReceiver, settings);
|
||||
virtual QStringList getPluginInfoList() = 0;
|
||||
virtual const QString &getPluginInfo() = 0;
|
||||
virtual QString const &getString(RESULT_STATE resultState) = 0;
|
||||
|
||||
virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, QObject *atbSystem,
|
||||
QObject *hmiConfig, QSettings const &settings) override {
|
||||
return initVMCPlugin(eventReceiver, atbSystem, hmiConfig, settings);
|
||||
}
|
||||
|
||||
virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, ATBHMIconfig *config) override {
|
||||
return initVMCPlugin(eventReceiver, config->getSettings());
|
||||
}
|
||||
|
||||
virtual ~VMCInterface() {}
|
||||
|
||||
/**
|
||||
* @brief initDCPlugin
|
||||
* @brief initVMCPlugin
|
||||
* @param eventReceiver - QObject to receive ATBMachineEvents or HealthEvents
|
||||
* @param settings
|
||||
* @return
|
||||
*/
|
||||
virtual PLUGIN_STATE initVMCPlugin(QObject *eventReceiver, const QSettings & settings) = 0;
|
||||
virtual PLUGIN_STATE initVMCPlugin(QObject *eventReceiver,
|
||||
QObject *atbSystem, QObject *hmiConfig,
|
||||
const QSettings & settings) = 0;
|
||||
};
|
||||
|
||||
Q_DECLARE_INTERFACE(VMCInterface,
|
||||
"eu.atb.ptu.plugin.VMCInterface/1.0")
|
||||
|
||||
#endif // VMCINTERFACE_H
|
||||
|
@@ -2,7 +2,6 @@
|
||||
#include "SendBuffer.h"
|
||||
#include "vmc.h"
|
||||
#include <QDebug>
|
||||
#include "version.h"
|
||||
|
||||
SendBuffer::SendBuffer(COM_interface *cinterface, QObject *parent) :
|
||||
QObject(parent)
|
||||
|
@@ -1,37 +1,44 @@
|
||||
#include "vmc.h"
|
||||
#include "AppControl.h"
|
||||
#include "ATBHMIconfig.h"
|
||||
#include "version.h"
|
||||
#include "ATBAPP.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QProcess>
|
||||
#include <QTextCodec>
|
||||
#include <QDateTime>
|
||||
#include <QTimer>
|
||||
#include <QDebug>
|
||||
#include <QSettings>
|
||||
|
||||
|
||||
VMC::VMC(QObject *parent) : QObject(parent) {
|
||||
}
|
||||
VMC::VMC(QObject *appControl, QSettings const *settings,
|
||||
QObject *parent)
|
||||
: QObject(parent) {
|
||||
|
||||
this->REMOTE_OUT_gpio_outstream = nullptr;
|
||||
this->REMOTE_OUT_gpio = nullptr;
|
||||
this->sendBuffer = nullptr;
|
||||
this->receiveBuffer = nullptr;
|
||||
this->com_interface = nullptr;
|
||||
|
||||
VMC::VMC(AppControl *main, ATBHMIconfig *config, QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
this->flag_blockVMCScreen = 0;
|
||||
this->currentCachedScreen = VMC_CMD_SCREEN_START;
|
||||
|
||||
this->main = main;
|
||||
this->config = config;
|
||||
this->m_appControl = appControl;
|
||||
this->m_settings = settings;
|
||||
|
||||
this->com_interface = new COM_interface(this);
|
||||
this->receiveBuffer = new ReceiveBuffer(com_interface, this);
|
||||
this->sendBuffer = new SendBuffer(com_interface, this);
|
||||
|
||||
this->privateInit_REMOTE_OUT();
|
||||
|
||||
connect(receiveBuffer, SIGNAL(ReceiveResponse(quint8)), sendBuffer, SLOT(onReceiveResponse(quint8)));
|
||||
|
||||
com_interface->open(config->getComPortName(), config->getComBaudRate());
|
||||
com_interface->open(settings->value("VMC/serialPort", "ttymxc2").toString(),
|
||||
settings->value("VMC/baudrate", "115200").toInt());
|
||||
|
||||
connect(receiveBuffer, SIGNAL(ReceiveError(RECEIVE_ERROR)), this, SLOT(onReceiveError(RECEIVE_ERROR)), Qt::QueuedConnection);
|
||||
connect(sendBuffer, SIGNAL(sendError(SEND_ERROR)), this, SLOT(onSendError(SEND_ERROR)));
|
||||
connect(receiveBuffer, SIGNAL(ReceiveError(RECEIVE_ERROR)), this, SLOT(onReceiveError(RECEIVE_ERROR)), Qt::QueuedConnection);
|
||||
connect(sendBuffer, SIGNAL(sendError(SEND_ERROR)), this, SLOT(onSendError(SEND_ERROR)));
|
||||
|
||||
this->sendDelayTimer = new QTimer;
|
||||
this->sendDelayTimer->setSingleShot(true);
|
||||
@@ -43,11 +50,59 @@ VMC::VMC(AppControl *main, ATBHMIconfig *config, QObject *parent) :
|
||||
|
||||
|
||||
VMC::~VMC() {
|
||||
delete(this->sendBuffer);
|
||||
delete(this->receiveBuffer);
|
||||
delete(this->com_interface);
|
||||
if (this->REMOTE_OUT_gpio_outstream) {
|
||||
delete(this->REMOTE_OUT_gpio_outstream);
|
||||
}
|
||||
if (this->REMOTE_OUT_gpio) {
|
||||
delete(this->REMOTE_OUT_gpio);
|
||||
}
|
||||
if (this->sendBuffer) {
|
||||
delete(this->sendBuffer);
|
||||
}
|
||||
if (this->receiveBuffer) {
|
||||
delete(this->receiveBuffer);
|
||||
}
|
||||
if (this->com_interface) {
|
||||
delete(this->com_interface);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* functions for wake vmc
|
||||
*/
|
||||
|
||||
void VMC::onWakeVMC() {
|
||||
this->privateWakeVMC();
|
||||
}
|
||||
|
||||
void VMC::privateWakeVMC() {
|
||||
QTimer::singleShot (100, this, SLOT(privateSuspendVMC()));
|
||||
this->privateSet_REMOTE_OUT(true);
|
||||
}
|
||||
|
||||
void VMC::privateSuspendVMC() {
|
||||
this->privateSet_REMOTE_OUT(false);
|
||||
}
|
||||
|
||||
void VMC::privateSet_REMOTE_OUT(bool state) {
|
||||
if (state) { *(this->REMOTE_OUT_gpio_outstream) << "1"; }
|
||||
else { *(this->REMOTE_OUT_gpio_outstream) << "0"; }
|
||||
|
||||
this->REMOTE_OUT_gpio_outstream->flush();
|
||||
}
|
||||
|
||||
void VMC::privateInit_REMOTE_OUT() {
|
||||
QString sysfs_remout_out("/sys/class/leds/REMOTE_OUT/brightness");
|
||||
|
||||
this->REMOTE_OUT_gpio = new QFile(sysfs_remout_out);
|
||||
if (!REMOTE_OUT_gpio->open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
qDebug() << "ATB_system::privateInit_REMOTE_OUT() cannot open file: " << sysfs_remout_out;
|
||||
qDebug() << " file.errorString() = " << REMOTE_OUT_gpio->errorString();
|
||||
return;
|
||||
}
|
||||
|
||||
this->REMOTE_OUT_gpio_outstream = new QTextStream(this->REMOTE_OUT_gpio);
|
||||
}
|
||||
|
||||
/********************************************************************************
|
||||
* S E N D M E S S A G E S t o V M C
|
||||
@@ -57,6 +112,9 @@ VMC::~VMC() {
|
||||
|
||||
int VMC::SendMessage(QString msg)
|
||||
{
|
||||
// TODO: use
|
||||
// this->SendMessage(msg.toUtf8());
|
||||
|
||||
QByteArray ba;
|
||||
this->SendMessage(ba.append(msg));
|
||||
|
||||
@@ -510,11 +568,18 @@ int VMC::SendVersion(QString VersionString) {
|
||||
*/
|
||||
int VMC::SendCurrentState()
|
||||
{
|
||||
QByteArray message(QByteArray::fromHex("3E1132"));
|
||||
message.append(static_cast<char>(main->getCurrentProgramMode()));
|
||||
SendMessage(message);
|
||||
QByteArray message(QByteArray::fromHex("3E1132"));
|
||||
|
||||
return 1;
|
||||
PROGRAM_MODE currentMode;
|
||||
if (QMetaObject::invokeMethod(m_appControl,
|
||||
"getCurrentProgramMode",
|
||||
Qt::DirectConnection,
|
||||
Q_RETURN_ARG(PROGRAM_MODE, currentMode))) {
|
||||
message.append(static_cast<char>(currentMode));
|
||||
SendMessage(message);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Send lic plate String to VMC
|
||||
@@ -950,12 +1015,12 @@ quint8 VMC::parseTextCommand(QByteArray &cmd)
|
||||
|
||||
if (size > cmd.size() - 7) { size = cmd.size() - 7; }
|
||||
|
||||
QTextCodec *codec = QTextCodec::codecForName(config->getDefaultCharacterSet());
|
||||
QTextCodec *codec = QTextCodec::codecForName(m_settings->value("CharacterSet", "ISO 8859-15").toByteArray());
|
||||
QString text = codec->toUnicode(cmd.mid(6,size));
|
||||
|
||||
qDebug() << "VMC::parseTextCommand() screennr = " << QString::number(screennr, 16);
|
||||
qDebug() << "VMC::parseTextCommand() textnr = " << QString::number(textnr, 16);
|
||||
qDebug() << "VMC::parseTextCommand() lang = " << QString::number(lang, 16);
|
||||
|
||||
//qDebug() << "VMC::parseTextCommand() size = " << QString::number(size, 16);
|
||||
//qDebug() << "VMC::parseTextCommand() text = " << text;
|
||||
|
||||
@@ -1071,7 +1136,7 @@ quint8 VMC::parseDataDisplayCommand(QByteArray &cmd)
|
||||
QString text = codec->toUnicode(data.constData(), data.size(), &state);
|
||||
if (state.invalidChars > 0) {
|
||||
// Not a UTF-8 text
|
||||
QTextCodec *defaultCodec = QTextCodec::codecForName(config->getDefaultCharacterSet());
|
||||
QTextCodec *defaultCodec = QTextCodec::codecForName(m_settings->value("CharacterSet", "ISO 8859-15").toByteArray());
|
||||
text = defaultCodec->toUnicode(data);
|
||||
}
|
||||
|
||||
@@ -1124,8 +1189,7 @@ quint8 VMC::parseDataDisplayCommand(QByteArray &cmd)
|
||||
// set vendingData
|
||||
emit setVendingData("DATETIME_PARKEND", endTime.toString("yyyy-MM-dd HH:mm:ss").toLatin1());
|
||||
|
||||
if (config->hasFeatureShowParkingTime()) {
|
||||
|
||||
if (m_settings->value("FeatureShowParkingTime", "false").toBool()) {
|
||||
// calculate time difference to current time:
|
||||
int secondsTo = QDateTime::currentDateTime().secsTo(endTime);
|
||||
|
||||
@@ -1293,7 +1357,7 @@ QString & VMC::privateHandleDataCommand_AmountToPay(quint8 data, QString & dataS
|
||||
|
||||
// append currency symbol
|
||||
dataString.append(" ");
|
||||
dataString.append(this->config->getPaymentCurrencySymbol());
|
||||
dataString.append(m_settings->value("currencySymbol", "€").toString());
|
||||
}
|
||||
else
|
||||
if(QRegExp(pattern2).exactMatch(dataString)) {
|
||||
@@ -1314,7 +1378,7 @@ QString & VMC::privateHandleDataCommand_AmountToPay(quint8 data, QString & dataS
|
||||
|
||||
// add currency symbol
|
||||
dataString.append(" ");
|
||||
dataString.append(this->config->getPaymentCurrencySymbol());
|
||||
dataString.append(m_settings->value("currencySymbol", "€").toString());
|
||||
}
|
||||
else
|
||||
if(QRegExp(pattern3).exactMatch(dataString)) {
|
||||
@@ -1613,7 +1677,8 @@ void VMC::onSendError(SEND_ERROR error)
|
||||
emit resetBusy();
|
||||
break;
|
||||
case SEND_ERROR::MULTIPLE_RESPONSE_TIMER_TIMEOUT:
|
||||
if ( config->hasFeatureSelfOOO() ) {
|
||||
// TODO: add feature to settings
|
||||
if (m_settings->value("FeatureSelf000", "false").toBool()) {
|
||||
// Handling on ERROR_RESPONSE_TIMER_TIMEOUT:
|
||||
// -> compare to receive a screen command from vmc to set the ooo-screen:
|
||||
}
|
||||
|
@@ -4,14 +4,15 @@
|
||||
#include "com_interface.h"
|
||||
#include "VMC/ReceiveBuffer.h"
|
||||
#include "SendBuffer.h"
|
||||
#include "support/VendingData.h"
|
||||
#include <QObject>
|
||||
#include <QByteArray>
|
||||
#include <QStateMachine>
|
||||
#include <QDebug>
|
||||
#include <QTimer>
|
||||
#include <QList>
|
||||
#include "version.h"
|
||||
#include <QSettings>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
|
||||
|
||||
#define VMC_RECEIVE_TIMEOUT 1000
|
||||
@@ -142,24 +143,23 @@
|
||||
#define ACK 0x06
|
||||
#define NACK 0x15
|
||||
|
||||
class AppControl;
|
||||
class ReceiveBuffer;
|
||||
class SendBuffer;
|
||||
class HMI;
|
||||
class ATBHMIconfig;
|
||||
|
||||
class VMC : public QObject
|
||||
{
|
||||
using FormatedStringList = QList<QByteArray>;
|
||||
|
||||
|
||||
class VMC : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
private:
|
||||
AppControl *main;
|
||||
QObject *m_appControl;
|
||||
COM_interface *com_interface;
|
||||
ReceiveBuffer *receiveBuffer;
|
||||
SendBuffer *sendBuffer;
|
||||
SendBuffer *sendBuffer;
|
||||
QSettings const *m_settings;
|
||||
|
||||
ATBHMIconfig *config;
|
||||
QFile *REMOTE_OUT_gpio;
|
||||
QTextStream *REMOTE_OUT_gpio_outstream;
|
||||
|
||||
// internal: write a ByteArray to com-port:
|
||||
int SendMessage(QByteArray ba, bool enqueue = false);
|
||||
@@ -187,14 +187,18 @@ private:
|
||||
quint8 flag_blockVMCScreen;
|
||||
quint16 currentCachedScreen;
|
||||
|
||||
void privateInit_REMOTE_OUT();
|
||||
|
||||
private slots:
|
||||
void onDelayedMessageTimerTimeout();
|
||||
|
||||
void skipDiscount();
|
||||
void privateSet_REMOTE_OUT(bool state);
|
||||
void privateWakeVMC();
|
||||
void privateSuspendVMC();
|
||||
|
||||
public:
|
||||
explicit VMC(QObject *parent = nullptr);
|
||||
VMC(AppControl *main, ATBHMIconfig *config, QObject *parent = nullptr);
|
||||
explicit VMC(QObject *eventReceiver, QSettings const *settings,
|
||||
QObject *parent = nullptr);
|
||||
~VMC();
|
||||
|
||||
int SendMessage(QString msg);
|
||||
@@ -389,6 +393,8 @@ public slots:
|
||||
void ccStartTransactionRequest(); // called to start/restart a CC transaction
|
||||
void ccStartConfirmTransaction(); // called to start confirmation
|
||||
void ccPrintReceipt(QString receipt); // called to send receipt to vmc
|
||||
|
||||
void onWakeVMC();
|
||||
};
|
||||
|
||||
#endif // VMC_H
|
||||
|
@@ -1,7 +1,6 @@
|
||||
#include "VendingData.h"
|
||||
#include <QDebug>
|
||||
#include "ATBAPP.h"
|
||||
#include "version.h"
|
||||
|
||||
VendingData::VendingData(QObject *parent) : QObject(parent)
|
||||
{
|
||||
|
Reference in New Issue
Block a user