diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.cpp b/src/ATBAPP/ATBDeviceControllerPlugin.cpp index 6e5b546..88083e0 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.cpp +++ b/src/ATBAPP/ATBDeviceControllerPlugin.cpp @@ -14,9 +14,11 @@ -ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) : QObject(parent), +ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) : pluginState(PLUGIN_STATE::NOT_INITIALIZED) { + this->setParent(parent); + this->pluginInfo = QString::fromUtf8(pluginInfoString.c_str()); if (!this->private_loadCashAgentLib("")) { diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.h b/src/ATBAPP/ATBDeviceControllerPlugin.h index 7ffc9bd..3e36777 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.h +++ b/src/ATBAPP/ATBDeviceControllerPlugin.h @@ -24,7 +24,7 @@ using namespace nsDeviceControllerInterface; class QSettings; -class ATBDeviceControllerPlugin : public QObject, +class ATBDeviceControllerPlugin : public DeviceControllerInterface { Q_OBJECT @@ -75,33 +75,6 @@ public slots: signals: - void printTicketFinished(nsDeviceControllerInterface::RESULT_STATE resultState, - const QString & errorCode, - const QString & errorDescription); - - void cashInputEvent(nsDeviceControllerInterface::RESULT_STATE resultState, - nsDeviceControllerInterface::CASH_STATE cashState, - const QString & newCashValue, - const QString & errorCode, - const QString & errorDescription); - - void cashInputFinished(nsDeviceControllerInterface::RESULT_STATE resultState, - const QString & newCashValue, - const QString & errorCode, - const QString & errorDescription); - - void requestModeSERVICE(); - void requestModeIDLE(); - void requestModeOOO(); - - void requestAccountResponse(const QHash & accountData); - - - - void Error( - const QString & errorCode, - const QString & errorDescription); - diff --git a/src/ATBAPP/DeviceControllerInterface.h b/src/ATBAPP/DeviceControllerInterface.h index 094f2ad..72278ab 100644 --- a/src/ATBAPP/DeviceControllerInterface.h +++ b/src/ATBAPP/DeviceControllerInterface.h @@ -15,8 +15,10 @@ namespace nsDeviceControllerInterface { } -class DeviceControllerInterface : public ATBAPPplugin +class DeviceControllerInterface : public QObject + , public ATBAPPplugin { + Q_OBJECT Q_INTERFACES(ATBAPPplugin) public: @@ -71,19 +73,19 @@ public slots: virtual void onChangedProgramModeToOOO() = 0; signals: - virtual void printTicketFinished(nsDeviceControllerInterface::RESULT_STATE resultState, + void printTicketFinished(nsDeviceControllerInterface::RESULT_STATE resultState, const QString & errorCode, - const QString & errorDescription) = 0; + const QString & errorDescription); /** * emitted on e.g. a coin input */ - virtual void cashInputEvent(nsDeviceControllerInterface::RESULT_STATE resultState, + void cashInputEvent(nsDeviceControllerInterface::RESULT_STATE resultState, nsDeviceControllerInterface::CASH_STATE cashState, const QString & newCashValue, /* additional variables? */ const QString & errorCode, - const QString & errorDescription) = 0; + const QString & errorDescription); /** * emitted if cashInput has been stopped, e.g. in result to task requestStopCashInput(): @@ -91,32 +93,32 @@ signals: * -> no cash input is possible * -> coins are in cache */ - virtual void cashInputFinished(nsDeviceControllerInterface::RESULT_STATE resultState, + void cashInputFinished(nsDeviceControllerInterface::RESULT_STATE resultState, const QString & newCashValue, /* additional variables? */ const QString & errorCode, - const QString & errorDescription) = 0; + const QString & errorDescription); /** * emitted e.g. if service door is opened */ - virtual void requestModeSERVICE() = 0; + void requestModeSERVICE(); /** * emitted e.g. if doors are closed */ - virtual void requestModeIDLE() = 0; + void requestModeIDLE(); /** * emitted e.g. on severe errors */ - virtual void requestModeOOO() = 0; + void requestModeOOO(); /** * emitted e.g. if service door is opened */ - virtual void requestAccountResponse(const QHash & accountData) = 0; + void requestAccountResponse(const QHash & accountData); /** * emitted on error @@ -126,10 +128,10 @@ signals: * -> send error event to ISMAS * -> ... */ - virtual void Error( + void Error( /* additional variables? */ const QString & errorCode, - const QString & errorDescription) = 0; + const QString & errorDescription); };