Moved enums to ATBAPPplugin.h.

Removed signals.
This commit is contained in:
Gerhard Hoffmann 2023-11-16 08:36:16 +01:00
parent bf59e2d4b9
commit 2313b6bd42

View File

@ -11,49 +11,38 @@
#include "ATBAPPplugin.h"
class UnifiedDCVMCInterface : public QObject, public ATBAPPplugin {
Q_OBJECT
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() {}
virtual ~UnifiedDCVMCInterface() = default;
virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, QSettings const &settings) = 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;
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;
@ -65,83 +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<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;
#endif // UNIFIED_DCVMC_INTERFACE_H_INCLUDED