From 22fb039172d64c3a42268790de355585fe1c698b Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Thu, 16 Nov 2023 08:26:36 +0100 Subject: [PATCH] Moved PLUGIN_STATE, RESULT_STATE, CASH_STATE, TICKET_VARIANT to ATBAPPplugin.h Removed signals. --- src/ATBAPP/UnifiedDCVMCInterface.h | 113 +++-------------------------- 1 file changed, 11 insertions(+), 102 deletions(-) diff --git a/src/ATBAPP/UnifiedDCVMCInterface.h b/src/ATBAPP/UnifiedDCVMCInterface.h index ca33a99..d920b80 100644 --- a/src/ATBAPP/UnifiedDCVMCInterface.h +++ b/src/ATBAPP/UnifiedDCVMCInterface.h @@ -16,54 +16,33 @@ class UnifiedDCVMCInterface : public ATBAPPplugin { Q_INTERFACES(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; - virtual QStringList getPluginInfo() = 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 PLUGIN_STATE initPlugin(QObject *eventReceiver, QObject *atbSystem, QObject *hmiConfig, QSettings const &settings) = 0; + 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, + QObject *atbSystem, QObject *hmiConfig, const QSettings & settings) = 0; -#if 0 - virtual QString getString(RESULT_STATE resultState) = 0; + virtual QString const &getString(RESULT_STATE resultState) = 0; public slots: virtual void onChangedProgramModeToSELL() = 0; @@ -75,79 +54,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 & 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(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; - #endif // UNIFIED_DCVMC_INTERFACE_H_INCLUDED