Compare commits
No commits in common. "909d1355a0f14f1179e26e5afe452967c11733ae" and "365b02a9c9e82802bed1a6022499dfd5baa76dc3" have entirely different histories.
909d1355a0
...
365b02a9c9
@ -5,8 +5,12 @@ 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
|
||||
@ -17,11 +21,12 @@ 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++17
|
||||
QMAKE_CXXFLAGS += -std=c++11
|
||||
# QMAKE_CXXFLAGS += -Wno-deprecated-ctor
|
||||
linux-clang { QMAKE_CXXFLAGS += -Qunused-arguments }
|
||||
ARCH = DesktopLinux
|
||||
@ -30,7 +35,7 @@ contains( CONFIG, DesktopLinux ) {
|
||||
contains( CONFIG, PTU5 ) {
|
||||
# QMAKE_CC = ccache $$QMAKE_CC
|
||||
# QMAKE_CXX = ccache $$QMAKE_CXX
|
||||
QMAKE_CXXFLAGS += -std=c++17
|
||||
QMAKE_CXXFLAGS += -std=c++11
|
||||
linux-clang { QMAKE_CXXFLAGS += -Qunused-arguments }
|
||||
CONFIG += link_pkgconfig
|
||||
ARCH = PTU5
|
||||
@ -52,27 +57,6 @@ 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:%S")
|
||||
}
|
||||
|
||||
GIT_COMMIT=$$system("git log -1 --format=oneline | cut -d' ' -f1")
|
||||
|
||||
EXTENDED_VERSION="$${VERSION}-$${GIT_COMMIT}"
|
||||
|
||||
CONFIG += c++17
|
||||
|
||||
DEFINES+=APP_VERSION=\\\"$$VERSION\\\"
|
||||
DEFINES+=ATB_QT_VERSION=\\\"$${QT_VERSION}\\\"
|
||||
DEFINES+=APP_BUILD_DATE=\\\"$$BUILD_DATE\\\"
|
||||
DEFINES+=APP_BUILD_TIME=\\\"$$BUILD_TIME\\\"
|
||||
DEFINES+=APP_EXTENDED_VERSION=\\\"$$EXTENDED_VERSION\\\"
|
||||
|
||||
|
||||
# Default rules for deployment.
|
||||
#qnx: target.path = /tmp/$${TARGET}/bin
|
||||
#else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||
@ -83,7 +67,6 @@ HEADERS += \
|
||||
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 \
|
||||
@ -99,5 +82,16 @@ SOURCES += \
|
||||
src/ATBAPP/support/VMC/vmc.cpp \
|
||||
src/ATBAPP/support/VendingData.cpp
|
||||
|
||||
OTHER_FILES += \
|
||||
plugins/metadata.json
|
||||
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
|
||||
|
1468
include/interfaces.h
Executable file
1468
include/interfaces.h
Executable file
File diff suppressed because it is too large
Load Diff
@ -1,7 +0,0 @@
|
||||
{
|
||||
"type" : "hardware",
|
||||
"name" : "ATBVMCPlugin",
|
||||
"longname" : "VMC hardware control",
|
||||
"version" : "1.0.0",
|
||||
"dependencies" : []
|
||||
}
|
@ -7,20 +7,11 @@
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
class ATBAPPplugin
|
||||
{
|
||||
|
||||
class ATBAPPplugin {
|
||||
public:
|
||||
explicit ATBAPPplugin() = default;
|
||||
virtual ~ATBAPPplugin() = default;
|
||||
|
||||
virtual const QString & getPluginInfo() = 0;
|
||||
virtual void setPluginInfo(QString const &info) = 0;
|
||||
};
|
||||
|
||||
Q_DECLARE_INTERFACE(ATBAPPplugin,
|
||||
"eu.atb.ptu.plugin.ATBAPPplugin/0.9")
|
||||
|
||||
|
||||
Q_DECLARE_INTERFACE(ATBAPPplugin, "eu.atb.ptu.plugin.ATBAPPplugin/0.9")
|
||||
|
||||
#endif // ATBAPPPLUGIN_H
|
||||
|
@ -31,13 +31,6 @@ ATBVMCPlugin::~ATBVMCPlugin() {
|
||||
}
|
||||
}
|
||||
|
||||
QString const &ATBVMCPlugin::getPluginInfo() {
|
||||
return m_pluginInfo;
|
||||
}
|
||||
|
||||
void ATBVMCPlugin::setPluginInfo(QString const &info) {
|
||||
m_pluginInfo = info;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// interface:
|
||||
@ -45,7 +38,7 @@ PLUGIN_STATE ATBVMCPlugin::initVMCPlugin(QObject *appControl,
|
||||
QObject *atbSystem,
|
||||
QObject *hmiConfig,
|
||||
QSettings const &settings) {
|
||||
if (appControl && atbSystem && hmiConfig) {
|
||||
|
||||
m_vmc = new VMC(appControl, &settings);
|
||||
|
||||
// -------------------- connect vmc --------------------------------------------
|
||||
@ -65,26 +58,25 @@ PLUGIN_STATE ATBVMCPlugin::initVMCPlugin(QObject *appControl,
|
||||
connect(m_vmc, SIGNAL(setDefaultLanguage(quint8)), hmiConfig, SLOT(setDefaultLanguage(quint8)), Qt::QueuedConnection);
|
||||
|
||||
return PLUGIN_STATE::INITIALIZED;
|
||||
}
|
||||
|
||||
return PLUGIN_STATE::NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
// mandantory ATBAPP plugin methods: ------------------------------------------
|
||||
PLUGIN_STATE ATBVMCPlugin::getState() {
|
||||
return m_pluginState;
|
||||
return PLUGIN_STATE::NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
QString ATBVMCPlugin::getLastError() {
|
||||
return m_errorCode;
|
||||
return "";
|
||||
}
|
||||
|
||||
QString ATBVMCPlugin::getLastErrorDescription() {
|
||||
return m_errorDescription;
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
QString const &ATBVMCPlugin::getPluginInfo() {
|
||||
static QString info;
|
||||
return info;
|
||||
}
|
||||
|
||||
// helpers e.g. for debug / log
|
||||
QString ATBVMCPlugin::getString(RESULT_STATE /*resultState*/) {
|
||||
@ -122,9 +114,3 @@ void ATBVMCPlugin::reboot() {
|
||||
void ATBVMCPlugin::reset() {
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
Q_EXPORT_PLUGIN2(ATBVMCPlugin, ATBVMCPlugin)
|
||||
#endif
|
||||
|
@ -3,30 +3,26 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QSettings>
|
||||
#include <QtPlugin>
|
||||
|
||||
#include "src/ATBAPP/ATBAPPplugin.h"
|
||||
#include "src/ATBAPP/VMCInterface.h"
|
||||
#include "src/ATBAPP/UnifiedDCVMCInterface.h"
|
||||
#include "src/ATBAPP/ATBAPPplugin.h"
|
||||
|
||||
#include "version.h"
|
||||
|
||||
#include "include/interfaces.h"
|
||||
#include "vmc.h"
|
||||
|
||||
class ATBVMCPlugin : public VMCInterface {
|
||||
Q_OBJECT
|
||||
|
||||
Q_INTERFACES(VMCInterface)
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
Q_PLUGIN_METADATA(IID "eu.atb.ptu.plugin.ATBVMCPlugin" FILE "plugins/metadata.json")
|
||||
#endif
|
||||
Q_INTERFACES(ATBAPPplugin)
|
||||
Q_INTERFACES(UnifiedDCVMCInterface)
|
||||
#if QT_VERSION >= 0x050000
|
||||
Q_PLUGIN_METADATA( IID "ATBVMCPlugin" )
|
||||
#endif
|
||||
|
||||
public:
|
||||
explicit ATBVMCPlugin(QObject *parent = nullptr);
|
||||
virtual ~ATBVMCPlugin();
|
||||
|
||||
virtual const QString & getPluginInfo() override;
|
||||
virtual void setPluginInfo(QString const &info) override;
|
||||
~ATBVMCPlugin();
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// interface:
|
||||
@ -40,7 +36,7 @@ public:
|
||||
QString getLastError() override;
|
||||
QString getLastErrorDescription() override;
|
||||
|
||||
#if 0
|
||||
virtual const QString & getPluginInfo() override;
|
||||
|
||||
// helpers e.g. for debug / log
|
||||
virtual QString getString(RESULT_STATE resultState) override;
|
||||
@ -56,8 +52,6 @@ public slots:
|
||||
virtual void reboot() override;
|
||||
virtual void reset() override;
|
||||
|
||||
#endif
|
||||
|
||||
private:
|
||||
QString m_errorCode;
|
||||
QString m_errorDescription;
|
||||
|
@ -11,8 +11,13 @@
|
||||
|
||||
#include "ATBAPPplugin.h"
|
||||
|
||||
class ATBHMIconfig;
|
||||
class AppControl;
|
||||
class ATBSystem;
|
||||
|
||||
class UnifiedDCVMCInterface : public ATBAPPplugin {
|
||||
class UnifiedDCVMCInterface : public QObject, public ATBAPPplugin {
|
||||
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(ATBAPPplugin)
|
||||
|
||||
public:
|
||||
@ -42,26 +47,18 @@ public:
|
||||
STOP_RECEIPT, // e.g. Szeged Stop
|
||||
};
|
||||
|
||||
explicit UnifiedDCVMCInterface() = default;
|
||||
virtual ~UnifiedDCVMCInterface() = default;
|
||||
|
||||
virtual const QString & getPluginInfo() = 0;
|
||||
|
||||
// mandantory ATBAPP plugin methods:
|
||||
virtual PLUGIN_STATE getState() = 0;
|
||||
virtual QString getLastError() = 0;
|
||||
virtual QString getLastErrorDescription() = 0;
|
||||
explicit UnifiedDCVMCInterface(QObject *parent = nullptr) : QObject(parent) {}
|
||||
virtual ~UnifiedDCVMCInterface() {}
|
||||
|
||||
virtual PLUGIN_STATE initPlugin(QObject *eventReceiver,
|
||||
QObject *atbSystem,
|
||||
QObject *hmiConfig,
|
||||
QSettings const &settings) = 0;
|
||||
|
||||
virtual PLUGIN_STATE initVMCPlugin(QObject *eventReceiver,
|
||||
QObject *atbSystem, QObject *hmiConfig,
|
||||
const QSettings & settings) = 0;
|
||||
|
||||
#if 0
|
||||
// mandantory ATBAPP plugin methods:
|
||||
virtual PLUGIN_STATE getState() = 0;
|
||||
virtual QString getLastError() = 0;
|
||||
virtual QString getLastErrorDescription() = 0;
|
||||
|
||||
virtual QString getString(RESULT_STATE resultState) = 0;
|
||||
|
||||
@ -139,7 +136,7 @@ signals:
|
||||
/* additional variables? */
|
||||
const QString & errorCode,
|
||||
const QString & errorDescription);
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
Q_DECLARE_INTERFACE(UnifiedDCVMCInterface,
|
||||
|
@ -17,23 +17,26 @@ namespace nsVMCInterface {
|
||||
}
|
||||
|
||||
|
||||
class VMCInterface : public QObject, public UnifiedDCVMCInterface {
|
||||
class VMCInterface : public UnifiedDCVMCInterface {
|
||||
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(ATBAPPplugin UnifiedDCVMCInterface)
|
||||
Q_INTERFACES(ATBAPPplugin)
|
||||
Q_INTERFACES(UnifiedDCVMCInterface)
|
||||
|
||||
public:
|
||||
|
||||
explicit VMCInterface(QObject *parent = nullptr) : QObject(parent) {}
|
||||
virtual ~VMCInterface() = default;
|
||||
explicit VMCInterface(QObject *parent = nullptr)
|
||||
: UnifiedDCVMCInterface(parent) {}
|
||||
|
||||
virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, QObject *atbSystem,
|
||||
QObject *hmiConfig, QSettings const &settings) override {
|
||||
return initVMCPlugin(eventReceiver, atbSystem, hmiConfig, settings);
|
||||
}
|
||||
|
||||
virtual ~VMCInterface() {}
|
||||
|
||||
/**
|
||||
* @brief initVMCPlugin
|
||||
* @brief initDCPlugin
|
||||
* @param eventReceiver - QObject to receive ATBMachineEvents or HealthEvents
|
||||
* @param settings
|
||||
* @return
|
||||
@ -41,89 +44,6 @@ public:
|
||||
virtual PLUGIN_STATE initVMCPlugin(QObject *eventReceiver,
|
||||
QObject *atbSystem, QObject *hmiConfig,
|
||||
const QSettings & settings) = 0;
|
||||
|
||||
#if 0
|
||||
|
||||
virtual QString getString(RESULT_STATE resultState) = 0;
|
||||
|
||||
public slots:
|
||||
virtual void onChangedProgramModeToSELL() = 0;
|
||||
virtual void onChangedProgramModeToSERVICE() = 0;
|
||||
virtual void onChangedProgramModeToIDLE() = 0;
|
||||
virtual void onChangedProgramModeToOOO() = 0;
|
||||
|
||||
virtual void startPhysicalLayer() = 0;
|
||||
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);
|
||||
#endif
|
||||
};
|
||||
|
||||
Q_DECLARE_INTERFACE(VMCInterface,
|
||||
"eu.atb.ptu.plugin.VMCInterface/1.0")
|
||||
|
||||
#endif // VMCINTERFACE_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user