From efe56672fff4cc2f5fb3d0cd1bc9e8fc097f5793 Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Tue, 27 May 2025 12:59:12 +0200 Subject: [PATCH] DCDiag: add dbus interface --- src/ATBAPP/ATBDeviceControllerPlugin.cpp | 2 +- src/ATBAPP/DeviceControllerDiag.cpp | 5 ++++- src/ATBAPP/DeviceControllerDiag.h | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.cpp b/src/ATBAPP/ATBDeviceControllerPlugin.cpp index 40664ce..a391783 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.cpp +++ b/src/ATBAPP/ATBDeviceControllerPlugin.cpp @@ -133,7 +133,7 @@ PLUGIN_STATE ATBDeviceControllerPlugin::initDCPlugin(QObject *eventReceiver, con qCritical() << "ATBDeviceControllerPlugin: Set printer encoding to " << printerEncoding; } - this->diag->init(this->hw, this->eventReceiver); + this->diag->init(this->hw, this->dbus, this->eventReceiver); this->pluginState = PLUGIN_STATE::INITIALIZED; diff --git a/src/ATBAPP/DeviceControllerDiag.cpp b/src/ATBAPP/DeviceControllerDiag.cpp index b2ee32a..b109895 100644 --- a/src/ATBAPP/DeviceControllerDiag.cpp +++ b/src/ATBAPP/DeviceControllerDiag.cpp @@ -8,6 +8,7 @@ #include #include "support/JSON.h" +#include "src/ATBAPP/support/DBusControllerInterface.h" DeviceControllerDiag::DeviceControllerDiag(PersistentData *pData, QObject *parent) @@ -17,6 +18,7 @@ DeviceControllerDiag::DeviceControllerDiag(PersistentData *pData, QObject *paren , eventReceiver(nullptr) , isRequestRunning(false) , flagInterruptDiag(false) + , isDiagBackgroundTask(false) , lastState(DeviceController::State::INITIAL_STATE) , _isErrorState(false) , pData(pData) @@ -29,10 +31,11 @@ DeviceControllerDiag::DeviceControllerDiag(PersistentData *pData, QObject *paren } -void DeviceControllerDiag::init(hwinf *hw, QObject* eventReceiver) +void DeviceControllerDiag::init(hwinf *hw, DBusControllerInterface *dbus, QObject* eventReceiver) { this->hw = hw; this->eventReceiver = eventReceiver; + this->dbus = dbus; // make a system check on startup: QTimer::singleShot(2000, this, &DeviceControllerDiag::diagRequest); diff --git a/src/ATBAPP/DeviceControllerDiag.h b/src/ATBAPP/DeviceControllerDiag.h index a9e47a6..7341e4a 100644 --- a/src/ATBAPP/DeviceControllerDiag.h +++ b/src/ATBAPP/DeviceControllerDiag.h @@ -12,6 +12,7 @@ #include "support/PersistentData.h" +class DBusControllerInterface; namespace DeviceController { Q_NAMESPACE @@ -79,7 +80,7 @@ class DeviceControllerDiag : public QObject public: DeviceControllerDiag(PersistentData *pData, QObject *parent = nullptr); - void init(hwinf* hw, QObject* eventReceiver); + void init(hwinf* hw, DBusControllerInterface *dbus, QObject* eventReceiver); nsDeviceControllerInterface::COIN_PROCESSOR coinProcessorType; nsDeviceControllerInterface::BILL_ACCEPTOR billAcceptor; @@ -118,9 +119,11 @@ signals: private: QObject *eventReceiver; hwinf* hw; + DBusControllerInterface* dbus; bool isRequestRunning; bool flagInterruptDiag; + bool isDiagBackgroundTask; QTimer *diagRequestTimeoutTimer;