From 4a7022fd008b0e8043869a252b15908287d05603 Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Thu, 22 Jun 2023 08:50:10 +0200 Subject: [PATCH] Use diag on closing doors --- src/ATBAPP/ATBDeviceControllerPlugin.cpp | 19 +++++++++++++------ src/ATBAPP/ATBDeviceControllerPlugin.h | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.cpp b/src/ATBAPP/ATBDeviceControllerPlugin.cpp index 526c9d2..ab0b676 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.cpp +++ b/src/ATBAPP/ATBDeviceControllerPlugin.cpp @@ -10,13 +10,16 @@ #include #include #include +#include +#include #include -ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) : - pluginState(PLUGIN_STATE::NOT_INITIALIZED) +ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) + : pluginState(PLUGIN_STATE::NOT_INITIALIZED) + , eventReceiver(nullptr) { this->setParent(parent); @@ -26,9 +29,6 @@ ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) : return; } - - - //connect(dynamic_cast(hw), SIGNAL(hwapi_templatePrintFinished_OK()), this, SLOT(onPrintFinishedOK()), Qt::QueuedConnection); //connect(dynamic_cast(hw), SIGNAL(hwapi_templatePrintFinished_Err()), this, SLOT(onPrintFinishedERR()), Qt::QueuedConnection); @@ -46,6 +46,9 @@ ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) : connect(dynamic_cast(hw), SIGNAL(hwapi_doorAllDoorsClosed()), this, SLOT(onAllDoorsClosed()), Qt::QueuedConnection); // check for errors, switch to mode IDLE + this->diag = new DeviceControllerDiag(this); + + this->currentSelectedTicketType = 0; this->currentCashState = CASH_STATE::CACHE_EMPTY; } @@ -74,7 +77,7 @@ PLUGIN_STATE ATBDeviceControllerPlugin::initDCPlugin(QObject *eventReceiver, con // text encoding for printer this->codec = QTextCodec::codecForName(printerEncoding); - + this->diag->init(this->hw, this->eventReceiver); this->pluginState = PLUGIN_STATE::INITIALIZED; @@ -271,6 +274,8 @@ void ATBDeviceControllerPlugin::onCBinAndAllDoorsClosed() { qCritical() << "ATBDeviceControllerPlugin::onCBinAndAllDoorsClosed()"; + this->diag->diagRequest(); + // TODO: Stop background task "ACCOUNT" QTimer::singleShot(2000, this, SIGNAL(requestModeIDLE())); @@ -695,6 +700,8 @@ const QString ATBDeviceControllerPlugin::getString(nsDeviceControllerInterface:: } + + /************************************************************************************************ * ... end */ diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.h b/src/ATBAPP/ATBDeviceControllerPlugin.h index 074f08d..24c78cc 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.h +++ b/src/ATBAPP/ATBDeviceControllerPlugin.h @@ -39,7 +39,7 @@ public: // ---------------------------------------------------------------------------- // interface: - PLUGIN_STATE initDCPlugin(QObject *healthEventReceiver, const QSettings & settings); + PLUGIN_STATE initDCPlugin(QObject *eventReceiver, const QSettings & settings); // TASKS: Cash handling ------------------------------------------------------- void requestStartCashInput(const QString & amount);