From 96db7be1262784785a651559d30230f30a7d2f86 Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Thu, 30 Nov 2023 18:16:45 +0100 Subject: [PATCH] Add object variable cashStartAmountInt Used to track proposed change amount. --- src/ATBAPP/ATBDeviceControllerPlugin.cpp | 8 +++++--- src/ATBAPP/ATBDeviceControllerPlugin.h | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.cpp b/src/ATBAPP/ATBDeviceControllerPlugin.cpp index 76ecb26..156a4f3 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.cpp +++ b/src/ATBAPP/ATBDeviceControllerPlugin.cpp @@ -67,6 +67,8 @@ ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) this->currentSelectedTicketType = 0; this->currentCashState = CASH_STATE::CACHE_EMPTY; + + this->cashStartAmountInt = 0; } ATBDeviceControllerPlugin::~ATBDeviceControllerPlugin() {} @@ -201,11 +203,11 @@ void ATBDeviceControllerPlugin::requestStartCashInput(const QString & amount) { qCritical() << "Start Cash vending with amount = " << amount; - uint32_t amountInt = static_cast(amount.toUInt()); + this->cashStartAmountInt = static_cast(amount.toUInt()); - if (amountInt == 0) amountInt = UINT_MAX; + if (this->cashStartAmountInt == 0) this->cashStartAmountInt = UINT_MAX; - hw->cash_startPayment(amountInt); + hw->cash_startPayment(this->cashStartAmountInt); } void ATBDeviceControllerPlugin::requestStopCashInput() diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.h b/src/ATBAPP/ATBDeviceControllerPlugin.h index b07e209..9c1a0cc 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.h +++ b/src/ATBAPP/ATBDeviceControllerPlugin.h @@ -111,6 +111,8 @@ private: DeviceControllerDiag* diag; + uint32_t cashStartAmountInt; + QTextCodec *codec;