Merge branch 'master' of git.mimbach49.de:GerhardHoffmann/DCLibraries
This commit is contained in:
		@@ -992,20 +992,22 @@ char T_datif::loadRecDataFromFrame()
 | 
				
			|||||||
        newInsertedAmount=uchar2ulong(receivedData[3],receivedData[2],receivedData[1],receivedData[0]);
 | 
					        newInsertedAmount=uchar2ulong(receivedData[3],receivedData[2],receivedData[1],receivedData[0]);
 | 
				
			||||||
        uitmp=uchar2uint(receivedData[5],receivedData[4]);
 | 
					        uitmp=uchar2uint(receivedData[5],receivedData[4]);
 | 
				
			||||||
        uit2=uchar2uint(receivedData[7],receivedData[6]);
 | 
					        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 (uitmp>0) // nur 1x bei neuer Münze  6.10.23 aendern:
 | 
				
			||||||
        if (uit2>0)
 | 
					                        // beim Wechsler hat die kleinste Muenze immer coin type 0!
 | 
				
			||||||
 | 
					        if (uitmp>10000 || uit2>10000)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            gpi_storeCurrentPayment(newInsertedAmount, uitmp, uit2);
 | 
					            uitmp=0;
 | 
				
			||||||
            //void gpi_storeCurrentPayment(uint32_t insertedAmount, uint16_t lastCoinType, uint16_t lastCoinValue)
 | 
					            uit2=0;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        if (newInsertedAmount != lastInsertedAmount)
 | 
					        if (newInsertedAmount != lastInsertedAmount)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
                emit datif_gotNewCoin();
 | 
					            gpi_storeCurrentPayment(newInsertedAmount, uitmp, uit2);
 | 
				
			||||||
 | 
					            emit datif_gotNewCoin();    // OR BILL  if (uitmp & 0x8000)>0
 | 
				
			||||||
            //qDebug()<<"emit new coin";
 | 
					            //qDebug()<<"emit new coin";
 | 
				
			||||||
 | 
					 | 
				
			||||||
            lastInsertedAmount=newInsertedAmount;
 | 
					            lastInsertedAmount=newInsertedAmount;
 | 
				
			||||||
 | 
					            //qCritical()<<"datif 112 store and emit new coin "<<newInsertedAmount<<" "<<uitmp<<" "<<uit2;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
              // qDebug()<<"datif   store new coin"<<newInsertedAmount<<" "<<uitmp<<" "<<uit2;
 | 
					
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    case 113:       // get wake source, 8byte
 | 
					    case 113:       // get wake source, 8byte
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1773,15 +1773,25 @@ void epi_clearCurrentPayment(void)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void gpi_storeCurrentPayment(uint32_t insertedAmount, uint16_t lastCoinType, uint16_t lastCoinValue)
 | 
					void gpi_storeCurrentPayment(uint32_t insertedAmount, uint16_t lastCoinType, uint16_t lastCoinValue)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    uint8_t pLC=SharedMem::read()->p_lastCoin;
 | 
					    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;
 | 
					    SharedMem::write()->store_insertedAmount=insertedAmount;
 | 
				
			||||||
 | 
					    if (lastCoinType & 0x8000)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        // then it's a banknote
 | 
				
			||||||
 | 
					        //qCritical()<<"gpi_storeCurrentPayment got banknote, total: "<<insertedAmount;
 | 
				
			||||||
 | 
					    } else
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        //qCritical()<<"gpi_storeCurrentPayment "<<insertedAmount<<" " << lastCoinType<<" " << lastCoinValue;
 | 
				
			||||||
 | 
					        pLC=SharedMem::read()->p_lastCoin;
 | 
				
			||||||
        SharedMem::write()->store_lastCoinType[pLC]=lastCoinType;
 | 
					        SharedMem::write()->store_lastCoinType[pLC]=lastCoinType;
 | 
				
			||||||
        SharedMem::write()->store_lastCoinValue[pLC]=lastCoinValue;
 | 
					        SharedMem::write()->store_lastCoinValue[pLC]=lastCoinValue;
 | 
				
			||||||
        pLC++;
 | 
					        pLC++;
 | 
				
			||||||
        SharedMem::write()->p_lastCoin=pLC;
 | 
					        SharedMem::write()->p_lastCoin=pLC;
 | 
				
			||||||
        SharedMem::write()->store_curPayNewCoin++;
 | 
					        SharedMem::write()->store_curPayNewCoin++;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //qDebug()<<"gpi_storeCurrentPayment "<<insertedAmount<<" " << lastCoinType<<" " << lastCoinValue;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
uint32_t epi_CurrentPaymentGetAmount(void)
 | 
					uint32_t epi_CurrentPaymentGetAmount(void)
 | 
				
			||||||
@@ -1819,6 +1829,13 @@ bool epi_CurrentPaymentGetAllCoins(uint16_t *types, uint16_t *values)
 | 
				
			|||||||
    return true;
 | 
					    return true;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/*
 | 
				
			||||||
 | 
					int nn;
 | 
				
			||||||
 | 
					for (nn=0; nn<8; nn++)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    data[nn]=SharedMem::read()->store_bnaCollect[nn];
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//uint64_t stor_wakSrc;
 | 
					//uint64_t stor_wakSrc;
 | 
				
			||||||
//uint8_t  stor_reason;
 | 
					//uint8_t  stor_reason;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user