From c4cbf8918249d209be276c2a0c1159d3e246a735 Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Fri, 16 Jun 2023 15:50:25 +0200 Subject: [PATCH] TEST: try to track currentCashState ... but this is currently useless because we can not detect overpayment here. --- src/ATBAPP/ATBDeviceControllerPlugin.cpp | 5 +++++ src/ATBAPP/ATBDeviceControllerPlugin.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.cpp b/src/ATBAPP/ATBDeviceControllerPlugin.cpp index 0c90c6c..46eeba9 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.cpp +++ b/src/ATBAPP/ATBDeviceControllerPlugin.cpp @@ -40,6 +40,7 @@ ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) : QObject( this->currentSelectedTicketType = 0; + this->currentCashState = CASH_STATE::CACHE_EMPTY; } ATBDeviceControllerPlugin::~ATBDeviceControllerPlugin() {} @@ -120,11 +121,13 @@ void ATBDeviceControllerPlugin::requestStopCashInput() void ATBDeviceControllerPlugin::cashCollect() { hw->vend_success(); + this->currentCashState = CASH_STATE::CACHE_EMPTY; } void ATBDeviceControllerPlugin::cashAbort() { hw->vend_failed(); + this->currentCashState = CASH_STATE::CACHE_EMPTY; } // TASKS: Account ------------------------------------------------------------- @@ -382,6 +385,8 @@ void ATBDeviceControllerPlugin::onCashGotCoin() // DEBUG qCritical() << "ATBDeviceControllerPlugin::onGotCoin()"; + this->currentCashState = CASH_STATE::CACHE_INPUT; + uint32_t amountInt = this->hw->getInsertedAmount(); QString amountString = QString::number(amountInt); diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.h b/src/ATBAPP/ATBDeviceControllerPlugin.h index e9be1e8..c48b6cb 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.h +++ b/src/ATBAPP/ATBDeviceControllerPlugin.h @@ -127,6 +127,8 @@ private: quint8 currentSelectedTicketType; + nsDeviceControllerInterface::CASH_STATE currentCashState; + private slots: // printer