DCDiag: add dbus interface
This commit is contained in:
parent
58c99753a9
commit
efe56672ff
@ -133,7 +133,7 @@ PLUGIN_STATE ATBDeviceControllerPlugin::initDCPlugin(QObject *eventReceiver, con
|
|||||||
qCritical() << "ATBDeviceControllerPlugin: Set printer encoding to " << printerEncoding;
|
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;
|
this->pluginState = PLUGIN_STATE::INITIALIZED;
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
|
||||||
#include "support/JSON.h"
|
#include "support/JSON.h"
|
||||||
|
#include "src/ATBAPP/support/DBusControllerInterface.h"
|
||||||
|
|
||||||
|
|
||||||
DeviceControllerDiag::DeviceControllerDiag(PersistentData *pData, QObject *parent)
|
DeviceControllerDiag::DeviceControllerDiag(PersistentData *pData, QObject *parent)
|
||||||
@ -17,6 +18,7 @@ DeviceControllerDiag::DeviceControllerDiag(PersistentData *pData, QObject *paren
|
|||||||
, eventReceiver(nullptr)
|
, eventReceiver(nullptr)
|
||||||
, isRequestRunning(false)
|
, isRequestRunning(false)
|
||||||
, flagInterruptDiag(false)
|
, flagInterruptDiag(false)
|
||||||
|
, isDiagBackgroundTask(false)
|
||||||
, lastState(DeviceController::State::INITIAL_STATE)
|
, lastState(DeviceController::State::INITIAL_STATE)
|
||||||
, _isErrorState(false)
|
, _isErrorState(false)
|
||||||
, pData(pData)
|
, 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->hw = hw;
|
||||||
this->eventReceiver = eventReceiver;
|
this->eventReceiver = eventReceiver;
|
||||||
|
this->dbus = dbus;
|
||||||
|
|
||||||
// make a system check on startup:
|
// make a system check on startup:
|
||||||
QTimer::singleShot(2000, this, &DeviceControllerDiag::diagRequest);
|
QTimer::singleShot(2000, this, &DeviceControllerDiag::diagRequest);
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include "support/PersistentData.h"
|
#include "support/PersistentData.h"
|
||||||
|
|
||||||
|
class DBusControllerInterface;
|
||||||
|
|
||||||
namespace DeviceController {
|
namespace DeviceController {
|
||||||
Q_NAMESPACE
|
Q_NAMESPACE
|
||||||
@ -79,7 +80,7 @@ class DeviceControllerDiag : public QObject
|
|||||||
public:
|
public:
|
||||||
DeviceControllerDiag(PersistentData *pData, QObject *parent = nullptr);
|
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::COIN_PROCESSOR coinProcessorType;
|
||||||
nsDeviceControllerInterface::BILL_ACCEPTOR billAcceptor;
|
nsDeviceControllerInterface::BILL_ACCEPTOR billAcceptor;
|
||||||
@ -118,9 +119,11 @@ signals:
|
|||||||
private:
|
private:
|
||||||
QObject *eventReceiver;
|
QObject *eventReceiver;
|
||||||
hwinf* hw;
|
hwinf* hw;
|
||||||
|
DBusControllerInterface* dbus;
|
||||||
|
|
||||||
bool isRequestRunning;
|
bool isRequestRunning;
|
||||||
bool flagInterruptDiag;
|
bool flagInterruptDiag;
|
||||||
|
bool isDiagBackgroundTask;
|
||||||
|
|
||||||
QTimer *diagRequestTimeoutTimer;
|
QTimer *diagRequestTimeoutTimer;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user