Add enums describing plugin status: PLUGIN_STATE, RESULT_STATE, CASH_STATE,
TICKET_VARIANT, STEP.
This commit is contained in:
parent
7e708d6897
commit
bf59e2d4b9
@ -5,18 +5,63 @@
|
||||
* a simple class with only one method for plugin info
|
||||
*/
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
class ATBAPPplugin
|
||||
{
|
||||
|
||||
public:
|
||||
virtual const QString & getPluginInfo() = 0;
|
||||
struct ATBAPPplugin {
|
||||
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_NETWORK,
|
||||
ERROR_TIMEOUT, // the operation timed out
|
||||
ERROR_PROCESS, // internal plugin error, should not occur (this is a bug in implementation)
|
||||
ERROR_BUSY,
|
||||
ERROR_STATE,
|
||||
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
|
||||
};
|
||||
enum class STEP : quint8 {
|
||||
UP = 1,
|
||||
DOWN = 2
|
||||
};
|
||||
enum class TERMINAL_STATE : quint8 {
|
||||
NOT_AVAILABLE = 1,
|
||||
AVAILABLE,
|
||||
PREPARED_FOR_VENDING,
|
||||
BUSY,
|
||||
NEEDS_MAINTENANCE
|
||||
};
|
||||
|
||||
virtual const QString &getPluginInfo() = 0;
|
||||
virtual QStringList getPluginInfoList() {
|
||||
return QStringList(QString());
|
||||
}
|
||||
};
|
||||
|
||||
using PLUGIN_STATE = ATBAPPplugin::PLUGIN_STATE;
|
||||
using RESULT_STATE = ATBAPPplugin::RESULT_STATE;
|
||||
using CASH_STATE = ATBAPPplugin::CASH_STATE;
|
||||
using TICKET_VARIANT = ATBAPPplugin::TICKET_VARIANT;
|
||||
using STEP = ATBAPPplugin::STEP;
|
||||
using TERMINAL_STATE = ATBAPPplugin::TERMINAL_STATE;
|
||||
|
||||
Q_DECLARE_INTERFACE(ATBAPPplugin,
|
||||
"eu.atb.ptu.plugin.ATBAPPplugin/0.9")
|
||||
|
||||
|
||||
|
||||
#endif // ATBAPPPLUGIN_H
|
||||
|
Loading…
Reference in New Issue
Block a user