Add debug output for account request

This commit is contained in:
Siegfried Siegert 2023-06-19 16:27:20 +02:00
parent 414dda009e
commit 1467530e3c
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03

View File

@ -152,10 +152,21 @@ void ATBDeviceControllerPlugin::private_startAccount()
// it is not defined which one is the latest account // it is not defined which one is the latest account
hw->log_getHoldAccountNumbers(&nrOfVals, backupedAccNumbers); hw->log_getHoldAccountNumbers(&nrOfVals, backupedAccNumbers);
// DEBUG
qCritical() << "Start account: ";
qCritical() << " nrOfVals = " << nrOfVals;
for (int i=0; i<nrOfVals; ++i) {
qCritical() << " backupedAccNumbers[" << i << "] = " << backupedAccNumbers[0];
}
qsort( backupedAccNumbers, nrOfVals, sizeof (uint16_t), Utils::compare ); qsort( backupedAccNumbers, nrOfVals, sizeof (uint16_t), Utils::compare );
uint16_t latestAccountNumber = backupedAccNumbers[nrOfVals-1]; uint16_t latestAccountNumber = backupedAccNumbers[nrOfVals-1];
// DEBUG
qCritical() << " latestAccountNumber = " << latestAccountNumber;
hw->log_selectVaultRecord(latestAccountNumber); hw->log_selectVaultRecord(latestAccountNumber);
this->accountCheckCounter = 0; this->accountCheckCounter = 0;
@ -164,6 +175,9 @@ void ATBDeviceControllerPlugin::private_startAccount()
void ATBDeviceControllerPlugin::private_checkAccountData() void ATBDeviceControllerPlugin::private_checkAccountData()
{ {
// DEBUG
qCritical() << " --> private_checkAccountData()";
if (hw->log_chkIfVaultRecordAvailable()) { if (hw->log_chkIfVaultRecordAvailable()) {
this->private_getAccountData(); this->private_getAccountData();
} }
@ -184,6 +198,9 @@ void ATBDeviceControllerPlugin::private_checkAccountData()
void ATBDeviceControllerPlugin::private_getAccountData() void ATBDeviceControllerPlugin::private_getAccountData()
{ {
// DEBUG
qCritical() << " --> private_getAccountData()";
struct T_vaultRecord retVR; struct T_vaultRecord retVR;
hw->log_getVaultRecord(&retVR); hw->log_getVaultRecord(&retVR);
@ -195,6 +212,10 @@ void ATBDeviceControllerPlugin::private_getAccountData()
for (uint i = 0; i < sizeof(retVR.coinsInVault); ++i) { for (uint i = 0; i < sizeof(retVR.coinsInVault); ++i) {
accountData.insert("COIN_" + QString::number(i) + "_Quantity", retVR.coinsInVault[i]); accountData.insert("COIN_" + QString::number(i) + "_Quantity", retVR.coinsInVault[i]);
accountData.insert("COIN_" + QString::number(i) + "_Value", retVR.coinDenomination[i]); accountData.insert("COIN_" + QString::number(i) + "_Value", retVR.coinDenomination[i]);
// DEBUG
qCritical() << "COIN_" + QString::number(i) + "_Quantity = " << accountData["COIN_" + QString::number(i) + "_Quantity"];
qCritical() << "COIN_" + QString::number(i) + "_Value = " << accountData["COIN_" + QString::number(i) + "_Value"];
} }
emit requestAccountResponse(accountData); emit requestAccountResponse(accountData);