From cf5d95064756bba1956b69b2d1e467e6e5488f6b Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Thu, 16 Nov 2023 08:41:14 +0100 Subject: [PATCH] Add getState(), getLastError(), getLastErrorDescription(), getString(), onChangedProgramModeToSELL(), onChangedProgramModeToSERVICE(), nChangedProgramModeToIDLE(), onChangedProgramModeToOOO(), startPhysicalLayer(), stopPhysicalLayer(), reboot(), reset(). Add signals printTicketFinished,...,Error. --- src/ATBAPP/DeviceControllerInterface.h | 88 ++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/src/ATBAPP/DeviceControllerInterface.h b/src/ATBAPP/DeviceControllerInterface.h index c8972f9..2adfdec 100644 --- a/src/ATBAPP/DeviceControllerInterface.h +++ b/src/ATBAPP/DeviceControllerInterface.h @@ -63,6 +63,94 @@ public: virtual void requestPrintTicket(TICKET_VARIANT ticketVariant, const QHash & printingData) = 0; virtual void requestPrintReceipt(const QHash & printingData) = 0; virtual void requestPrintReceipt(const QString & printingString) = 0; + + + // mandantory ATBAPP plugin methods: + virtual nsDeviceControllerInterface::PLUGIN_STATE getState() = 0; + virtual const QString & getLastError() = 0; + virtual const QString & getLastErrorDescription() = 0; + + // return a plugin description in JSON or XML + // -> ATBAPPplugin::getPluginInfo() + + // helpers e.g. for debug / log + virtual const QString &getString(nsDeviceControllerInterface::RESULT_STATE resultState) = 0; + +public slots: + virtual void onChangedProgramModeToSELL() = 0; + virtual void onChangedProgramModeToSERVICE() = 0; + virtual void onChangedProgramModeToIDLE() = 0; + virtual void onChangedProgramModeToOOO() = 0; + + virtual void startPhysicalLayer() = 0; + virtual void stopPhysicalLayer() = 0; + virtual void reboot() = 0; + virtual void reset() = 0; + +signals: + void printTicketFinished(nsDeviceControllerInterface::RESULT_STATE resultState, + const QString & errorCode, + const QString & errorDescription); + void printReceiptFinished(nsDeviceControllerInterface::RESULT_STATE resultState, + const QString & errorCode, + const QString & errorDescription); + + /** + * emitted on e.g. a coin input + */ + void cashInputEvent(nsDeviceControllerInterface::RESULT_STATE resultState, + nsDeviceControllerInterface::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(nsDeviceControllerInterface::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 & 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(DeviceControllerInterface,