From c59de6cad80c1a04273ad6e6374ed0572d5206c4 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 21 Mar 2024 15:54:58 +0100 Subject: [PATCH 1/2] bugfix: banknotes have been summed with the coins. Now they are handled separately. --- src/storeINdata.cpp | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/src/storeINdata.cpp b/src/storeINdata.cpp index 9aa684b..65e1ec9 100644 --- a/src/storeINdata.cpp +++ b/src/storeINdata.cpp @@ -1773,15 +1773,25 @@ void epi_clearCurrentPayment(void) void gpi_storeCurrentPayment(uint32_t insertedAmount, uint16_t lastCoinType, uint16_t lastCoinValue) { - uint8_t pLC=SharedMem::read()->p_lastCoin; - SharedMem::write()->store_insertedAmount=insertedAmount; - SharedMem::write()->store_lastCoinType[pLC]=lastCoinType; - SharedMem::write()->store_lastCoinValue[pLC]=lastCoinValue; - pLC++; - SharedMem::write()->p_lastCoin=pLC; - SharedMem::write()->store_curPayNewCoin++; + uint8_t pLC; + + // 21.3.24 attention: if bit 15 in lastCoinType is set then we got a bill not a coin + SharedMem::write()->store_insertedAmount=insertedAmount; + if (lastCoinType & 0x8000) + { + // then it's a banknote + //qCritical()<<"gpi_storeCurrentPayment got banknote, total: "<p_lastCoin; + SharedMem::write()->store_lastCoinType[pLC]=lastCoinType; + SharedMem::write()->store_lastCoinValue[pLC]=lastCoinValue; + pLC++; + SharedMem::write()->p_lastCoin=pLC; + SharedMem::write()->store_curPayNewCoin++; + } - //qDebug()<<"gpi_storeCurrentPayment "<store_bnaCollect[nn]; +} +*/ //uint64_t stor_wakSrc; //uint8_t stor_reason; From 3612fc28ee77aa046826697b4202ec0aa30129a5 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 21 Mar 2024 15:55:50 +0100 Subject: [PATCH 2/2] bugfix: banknotes have been summed with the coins. Now they are handled separately. --- src/datIf.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/datIf.cpp b/src/datIf.cpp index 0a10c11..19495f9 100644 --- a/src/datIf.cpp +++ b/src/datIf.cpp @@ -992,20 +992,22 @@ char T_datif::loadRecDataFromFrame() newInsertedAmount=uchar2ulong(receivedData[3],receivedData[2],receivedData[1],receivedData[0]); uitmp=uchar2uint(receivedData[5],receivedData[4]); uit2=uchar2uint(receivedData[7],receivedData[6]); - //if (uitmp>0) // nur 1x bei neuer Münze 6.10.23 aendern: beim Wechsler hat die kleinste Muenze immer coin type 0! - if (uit2>0) + //if (uitmp>0) // nur 1x bei neuer Münze 6.10.23 aendern: + // beim Wechsler hat die kleinste Muenze immer coin type 0! + if (uitmp>10000 || uit2>10000) + { + uitmp=0; + uit2=0; + } + if (newInsertedAmount != lastInsertedAmount) { gpi_storeCurrentPayment(newInsertedAmount, uitmp, uit2); - //void gpi_storeCurrentPayment(uint32_t insertedAmount, uint16_t lastCoinType, uint16_t lastCoinValue) - if (newInsertedAmount != lastInsertedAmount) - { - emit datif_gotNewCoin(); - //qDebug()<<"emit new coin"; - - lastInsertedAmount=newInsertedAmount; - } - // qDebug()<<"datif store new coin"<0 + //qDebug()<<"emit new coin"; + lastInsertedAmount=newInsertedAmount; + //qCritical()<<"datif 112 store and emit new coin "<