diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.h b/src/ATBAPP/ATBDeviceControllerPlugin.h index eb04dbc..f4abfb1 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.h +++ b/src/ATBAPP/ATBDeviceControllerPlugin.h @@ -13,19 +13,16 @@ #include "interfaces.h" -#include - class DBusControllerInterface; class QTextCodec; -using namespace nsDeviceControllerInterface; +// using namespace nsDeviceControllerInterface; class QSettings; -class ATBDeviceControllerPlugin : - public DeviceControllerInterface +class ATBDeviceControllerPlugin : public DeviceControllerInterface { Q_OBJECT Q_INTERFACES(ATBAPPplugin) @@ -36,11 +33,14 @@ class ATBDeviceControllerPlugin : public: explicit ATBDeviceControllerPlugin(QObject *parent = nullptr); - ~ATBDeviceControllerPlugin(); + virtual ~ATBDeviceControllerPlugin(); // ---------------------------------------------------------------------------- // interface: - PLUGIN_STATE initDCPlugin(QObject *eventReceiver, const QSettings & settings); + 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 initVMCPlugin(QObject *eventReceiver, QObject *atbSystem, QObject *hmiConfig, const QSettings & settings) override; + virtual PLUGIN_STATE initDCPlugin(QObject *eventReceiver, const QSettings & settings) override; // TASKS: Cash handling ------------------------------------------------------- void requestStartCashInput(const QString & amount); @@ -59,13 +59,14 @@ public: // mandantory ATBAPP plugin methods: ------------------------------------------ nsDeviceControllerInterface::PLUGIN_STATE getState() override; - QString getLastError() override; - QString getLastErrorDescription() override; + QString const &getLastError() override; + QString const &getLastErrorDescription() override; - virtual const QString & getPluginInfo() override; + virtual QStringList getPluginInfoList() override; + virtual const QString &getPluginInfo() override; // helpers e.g. for debug / log - virtual QString getString(nsDeviceControllerInterface::RESULT_STATE resultState) override; + virtual QString const &getString(RESULT_STATE resultState) override; public slots: virtual void onChangedProgramModeToSELL() override; @@ -73,21 +74,83 @@ public slots: virtual void onChangedProgramModeToIDLE() override; virtual void onChangedProgramModeToOOO() override; - void startPhysicalLayer() override; - void stopPhysicalLayer() override; - void reboot() override; - void reset() override; + virtual void startPhysicalLayer() override; + virtual void stopPhysicalLayer() override; + virtual void reboot() override; + virtual void reset() override; signals: - // public Signals are defined in interface + 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 & 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); private: QString errorCode; QString errorDescription; QString pluginInfo; + QStringList pluginInfoList; QList templateList;