Account: read bill stacker values

This commit is contained in:
Siegfried Siegert 2023-11-29 16:10:38 +01:00
parent 49a13fd333
commit f938a75742
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03

View File

@ -342,7 +342,7 @@ void ATBDeviceControllerPlugin::private_getAccountData()
// COINS in Vault: -------------------------------------------------------- // COINS in Vault: --------------------------------------------------------
int numberOfCoinVariants = sizeof(retVR.coinsInVault); int numberOfCoinVariants = sizeof(retVR.coinsInVault)/sizeof(retVR.coinsInVault[0]);
// DEBUG // DEBUG
qCritical() << " NumberOfCoinVariants = " << numberOfCoinVariants; qCritical() << " NumberOfCoinVariants = " << numberOfCoinVariants;
@ -351,18 +351,18 @@ void ATBDeviceControllerPlugin::private_getAccountData()
if (numberOfCoinVariants > 16) { numberOfCoinVariants = 16; } if (numberOfCoinVariants > 16) { numberOfCoinVariants = 16; }
accountData.insert("NumberOfCoinVariants", numberOfCoinVariants); accountData.insert("NumberOfCoinVariants", numberOfCoinVariants);
for (int i = 1; i <= numberOfCoinVariants; ++i) { for (int i = 0; i < numberOfCoinVariants; ++i) {
accountData.insert("COIN_" + QString::number(i) + "_Quantity", retVR.coinsInVault[i]); accountData.insert("COIN_" + QString::number(i+1) + "_Quantity", retVR.coinsInVault[i]);
accountData.insert("COIN_" + QString::number(i) + "_Value", retVR.coinDenomination[i]); accountData.insert("COIN_" + QString::number(i+1) + "_Value", retVR.coinDenomination[i]);
// DEBUG // DEBUG
qCritical() << "COIN_" + QString::number(i) + "_Quantity = " << accountData["COIN_" + QString::number(i) + "_Quantity"]; qCritical() << "COIN_" + QString::number(i+1) + "_Quantity = " << accountData["COIN_" + QString::number(i) + "_Quantity"];
qCritical() << "COIN_" + QString::number(i) + "_Value = " << accountData["COIN_" + QString::number(i) + "_Value"]; qCritical() << "COIN_" + QString::number(i+1) + "_Value = " << accountData["COIN_" + QString::number(i) + "_Value"];
} }
// NOTES in stacker: -------------------------------------------------------- // NOTES in stacker: --------------------------------------------------------
int numberOfBillVariants = sizeof(retVR.billsInStacker); int numberOfBillVariants = sizeof(retVR.billsInStacker)/sizeof(retVR.billsInStacker[0]);
// DEBUG // DEBUG
qCritical() << " numberOfBillVariants = " << numberOfBillVariants; qCritical() << " numberOfBillVariants = " << numberOfBillVariants;
@ -371,18 +371,17 @@ void ATBDeviceControllerPlugin::private_getAccountData()
if (numberOfBillVariants > 16) { numberOfBillVariants = 16; } if (numberOfBillVariants > 16) { numberOfBillVariants = 16; }
accountData.insert("NumberOfBillVariants", numberOfBillVariants); accountData.insert("NumberOfBillVariants", numberOfBillVariants);
for (int i = 1; i <= numberOfBillVariants; ++i) { for (int i = 0; i < numberOfBillVariants; ++i) {
accountData.insert("NOTE_" + QString::number(i) + "_Quantity", retVR.coinsInVault[i]); accountData.insert("NOTE_" + QString::number(i+1) + "_Quantity", retVR.billsInStacker[i]);
accountData.insert("NOET_" + QString::number(i) + "_Value", retVR.coinDenomination[i]); accountData.insert("NOTE_" + QString::number(i+1) + "_Value", retVR.billDenom[i]);
// DEBUG // DEBUG
qCritical() << "NOTE_" + QString::number(i) + "_Quantity = " << accountData["COIN_" + QString::number(i) + "_Quantity"]; qCritical() << "NOTE_" + QString::number(i+1) + "_Quantity = " << accountData["NOTE_" + QString::number(i+1) + "_Quantity"];
qCritical() << "NOTE_" + QString::number(i) + "_Value = " << accountData["COIN_" + QString::number(i) + "_Value"]; qCritical() << "NOTE_" + QString::number(i+1) + "_Value = " << accountData["NOTE_" + QString::number(i+1) + "_Value"];
} }
emit requestAccountResponse(accountData); emit requestAccountResponse(accountData);
} }