Add signals and add pluginInfoList.

This commit is contained in:
Gerhard Hoffmann 2023-11-16 08:44:25 +01:00
parent cf5d950647
commit b1304df2bf

View File

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