Add object variable cashStartAmountInt
Used to track proposed change amount.
This commit is contained in:
		@@ -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<uint32_t>(amount.toUInt());
 | 
			
		||||
    this->cashStartAmountInt = static_cast<uint32_t>(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()
 | 
			
		||||
 
 | 
			
		||||
@@ -111,6 +111,8 @@ private:
 | 
			
		||||
 | 
			
		||||
   DeviceControllerDiag* diag;
 | 
			
		||||
 | 
			
		||||
   uint32_t cashStartAmountInt;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
   QTextCodec *codec;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user