Update interface: DeviceControllerInterface is derived from QObject:

This is for using new connect()-syntax in main application.
Note:
 - signals in interface must not be defined virtual
 - signals in implementation must not override signals defined
   in interface.
This commit is contained in:
Siegfried Siegert 2023-06-20 13:11:40 +02:00
parent 18ff5d42a7
commit 2b71705c81
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03
3 changed files with 19 additions and 42 deletions

View File

@ -14,9 +14,11 @@
ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) : QObject(parent),
ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) :
pluginState(PLUGIN_STATE::NOT_INITIALIZED)
{
this->setParent(parent);
this->pluginInfo = QString::fromUtf8(pluginInfoString.c_str());
if (!this->private_loadCashAgentLib("")) {

View File

@ -24,7 +24,7 @@ using namespace nsDeviceControllerInterface;
class QSettings;
class ATBDeviceControllerPlugin : public QObject,
class ATBDeviceControllerPlugin :
public DeviceControllerInterface
{
Q_OBJECT
@ -75,33 +75,6 @@ public slots:
signals:
void printTicketFinished(nsDeviceControllerInterface::RESULT_STATE resultState,
const QString & errorCode,
const QString & errorDescription);
void cashInputEvent(nsDeviceControllerInterface::RESULT_STATE resultState,
nsDeviceControllerInterface::CASH_STATE cashState,
const QString & newCashValue,
const QString & errorCode,
const QString & errorDescription);
void cashInputFinished(nsDeviceControllerInterface::RESULT_STATE resultState,
const QString & newCashValue,
const QString & errorCode,
const QString & errorDescription);
void requestModeSERVICE();
void requestModeIDLE();
void requestModeOOO();
void requestAccountResponse(const QHash<QString, QVariant> & accountData);
void Error(
const QString & errorCode,
const QString & errorDescription);

View File

@ -15,8 +15,10 @@ namespace nsDeviceControllerInterface {
}
class DeviceControllerInterface : public ATBAPPplugin
class DeviceControllerInterface : public QObject
, public ATBAPPplugin
{
Q_OBJECT
Q_INTERFACES(ATBAPPplugin)
public:
@ -71,19 +73,19 @@ public slots:
virtual void onChangedProgramModeToOOO() = 0;
signals:
virtual void printTicketFinished(nsDeviceControllerInterface::RESULT_STATE resultState,
void printTicketFinished(nsDeviceControllerInterface::RESULT_STATE resultState,
const QString & errorCode,
const QString & errorDescription) = 0;
const QString & errorDescription);
/**
* emitted on e.g. a coin input
*/
virtual void cashInputEvent(nsDeviceControllerInterface::RESULT_STATE resultState,
void cashInputEvent(nsDeviceControllerInterface::RESULT_STATE resultState,
nsDeviceControllerInterface::CASH_STATE cashState,
const QString & newCashValue,
/* additional variables? */
const QString & errorCode,
const QString & errorDescription) = 0;
const QString & errorDescription);
/**
* emitted if cashInput has been stopped, e.g. in result to task requestStopCashInput():
@ -91,32 +93,32 @@ signals:
* -> no cash input is possible
* -> coins are in cache
*/
virtual void cashInputFinished(nsDeviceControllerInterface::RESULT_STATE resultState,
void cashInputFinished(nsDeviceControllerInterface::RESULT_STATE resultState,
const QString & newCashValue,
/* additional variables? */
const QString & errorCode,
const QString & errorDescription) = 0;
const QString & errorDescription);
/**
* emitted e.g. if service door is opened
*/
virtual void requestModeSERVICE() = 0;
void requestModeSERVICE();
/**
* emitted e.g. if doors are closed
*/
virtual void requestModeIDLE() = 0;
void requestModeIDLE();
/**
* emitted e.g. on severe errors
*/
virtual void requestModeOOO() = 0;
void requestModeOOO();
/**
* emitted e.g. if service door is opened
*/
virtual void requestAccountResponse(const QHash<QString, QVariant> & accountData) = 0;
void requestAccountResponse(const QHash<QString, QVariant> & accountData);
/**
* emitted on error
@ -126,10 +128,10 @@ signals:
* -> send error event to ISMAS
* -> ...
*/
virtual void Error(
void Error(
/* additional variables? */
const QString & errorCode,
const QString & errorDescription) = 0;
const QString & errorDescription);
};