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 <unistd.h>
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<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:
QString errorCode;
QString errorDescription;
QString pluginInfo;
QStringList pluginInfoList;
QList<int> templateList;