diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.cpp b/src/ATBAPP/ATBDeviceControllerPlugin.cpp index 0c81437..0219fb5 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.cpp +++ b/src/ATBAPP/ATBDeviceControllerPlugin.cpp @@ -14,8 +14,13 @@ ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) : QObject( connect(dynamic_cast(hw), SIGNAL(hwapi_templatePrintFinished_OK()), this, SLOT(onPrintFinishedOK())); connect(dynamic_cast(hw), SIGNAL(hwapi_templatePrintFinished_Err()), this, SLOT(onPrintFinishedERR())); - connect(dynamic_cast(hw), SIGNAL(hwapi_gotNewCoin()), this, SLOT(onCashGotCoin())); - connect(dynamic_cast(hw), SIGNAL(hwapi_vendStopByMax()), this, SLOT(onCashVendStopByMax())); + + connect(dynamic_cast(hw), SIGNAL(hwapi_gotNewCoin()), this, SLOT(onCashGotCoin())); + connect(dynamic_cast(hw), SIGNAL(hwapi_payStopByMax()), this, SLOT(onCashPayStopByMax())); + connect(dynamic_cast(hw), SIGNAL(hwapi_payStopByEscrow()), this, SLOT(onCashPayStopByEscrow())); + connect(dynamic_cast(hw), SIGNAL(hwapi_payStopByError()), this, SLOT(onCashPayStopByError())); + connect(dynamic_cast(hw), SIGNAL(hwapi_payStopByTimeout()), this, SLOT(onCashPayStopByTimeout())); + } ATBDeviceControllerPlugin::~ATBDeviceControllerPlugin() {} @@ -235,7 +240,7 @@ void ATBDeviceControllerPlugin::onCashGotCoin() } -void ATBDeviceControllerPlugin::onCashVendStopByMax() +void ATBDeviceControllerPlugin::onCashPayStopByMax() { // DEBUG qCritical() << "ATBDeviceControllerPlugin::onCashVendStopByMax()"; @@ -251,6 +256,55 @@ void ATBDeviceControllerPlugin::onCashVendStopByMax() } +void ATBDeviceControllerPlugin::onCashPayStopByEscrow() +{ + // DEBUG + qCritical() << "ATBDeviceControllerPlugin::onCashPayStopByEscrow()"; + + uint32_t amountInt = this->hw->getInsertedAmount(); + + QString amountString = QString::number(amountInt); + + emit this->cashInputFinished(nsDeviceControllerInterface::RESULT_STATE::ERROR_BACKEND, + amountString, + "", + ""); +} + +void ATBDeviceControllerPlugin::onCashPayStopByError() +{ + // DEBUG + qCritical() << "ATBDeviceControllerPlugin::onCashPayStopByError()"; + + uint32_t amountInt = this->hw->getInsertedAmount(); + + QString amountString = QString::number(amountInt); + + emit this->cashInputFinished(nsDeviceControllerInterface::RESULT_STATE::ERROR_BACKEND, + amountString, + "", + ""); +} + +void ATBDeviceControllerPlugin::onCashPayStopByTimeout() +{ + // DEBUG + qCritical() << "ATBDeviceControllerPlugin::onCashPayStopByTimeout()"; + + uint32_t amountInt = this->hw->getInsertedAmount(); + + QString amountString = QString::number(amountInt); + + emit this->cashInputFinished(nsDeviceControllerInterface::RESULT_STATE::ERROR_BACKEND, + amountString, + "", + ""); +} + + + + + /************************************************************************************************ * Mandatory plugin methods * diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.h b/src/ATBAPP/ATBDeviceControllerPlugin.h index 6e8285b..d7e833d 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.h +++ b/src/ATBAPP/ATBDeviceControllerPlugin.h @@ -119,7 +119,10 @@ private slots: // cash payment void onCashGotCoin(); - void onCashVendStopByMax(); + void onCashPayStopByMax(); + void onCashPayStopByEscrow(); + void onCashPayStopByError(); + void onCashPayStopByTimeout(); }; #endif // ATBDEVICECONTROLLERPLUGIN_H