Compare commits
	
		
			4 Commits
		
	
	
		
			1.1.99
			...
			pu/CoinsNo
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						
						
							
						
						012f3430c5
	
				 | 
					
					
						|||
| 
						
						
							
						
						80c7992d5b
	
				 | 
					
					
						|||
| 
						
						
							
						
						c603313d73
	
				 | 
					
					
						|||
| 
						
						
							
						
						b3ad8e1ee9
	
				 | 
					
					
						
@@ -87,9 +87,10 @@ PLUGIN_STATE ATBDeviceControllerPlugin::initDCPlugin(QObject *eventReceiver, con
 | 
				
			|||||||
    if (this->isMaster) {
 | 
					    if (this->isMaster) {
 | 
				
			||||||
        // open serial port
 | 
					        // open serial port
 | 
				
			||||||
        hw->dc_openSerial(5, "115200", this->serialPortName, 1);
 | 
					        hw->dc_openSerial(5, "115200", this->serialPortName, 1);
 | 
				
			||||||
        hw->dc_autoRequest(true);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    hw->dc_autoRequest(true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    hw->dc_setNewCustomerNumber(PTUSystem::readCustomerNumber());
 | 
					    hw->dc_setNewCustomerNumber(PTUSystem::readCustomerNumber());
 | 
				
			||||||
    hw->dc_setNewMachineNumber(PTUSystem::readMachineNumber());
 | 
					    hw->dc_setNewMachineNumber(PTUSystem::readMachineNumber());
 | 
				
			||||||
    hw->dc_setNewZone(PTUSystem::readZoneNumber());
 | 
					    hw->dc_setNewZone(PTUSystem::readZoneNumber());
 | 
				
			||||||
@@ -176,20 +177,20 @@ void ATBDeviceControllerPlugin::reset()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void ATBDeviceControllerPlugin::onChangedProgramModeToSELL()
 | 
					void ATBDeviceControllerPlugin::onChangedProgramModeToSELL()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    hw->dc_autoRequest(true);
 | 
				
			||||||
    hw->rtc_setDateTime();
 | 
					    hw->rtc_setDateTime();
 | 
				
			||||||
    hw->mdb_switchWake(0);   // wakeup MDB components
 | 
					    hw->mdb_switchWake(0);   // wakeup MDB components
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ATBDeviceControllerPlugin::onChangedProgramModeToSERVICE()
 | 
					void ATBDeviceControllerPlugin::onChangedProgramModeToSERVICE()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    //hw->dc_autoRequest(true);
 | 
					    hw->dc_autoRequest(true);
 | 
				
			||||||
    hw->mdb_switchWake(0);   // wakeup MDB components
 | 
					    hw->mdb_switchWake(0);   // wakeup MDB components
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ATBDeviceControllerPlugin::onChangedProgramModeToIDLE()
 | 
					void ATBDeviceControllerPlugin::onChangedProgramModeToIDLE()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    //hw->dc_autoRequest(false);  // <-- TODO: ???
 | 
					    hw->dc_autoRequest(true);
 | 
				
			||||||
 | 
					 | 
				
			||||||
    this->diag->diagRequest();
 | 
					    this->diag->diagRequest();
 | 
				
			||||||
    hw->mdb_switchWake(1);
 | 
					    hw->mdb_switchWake(1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -609,11 +610,13 @@ void ATBDeviceControllerPlugin::requestPrintTicket(nsDeviceControllerInterface::
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /*
 | 
				
			||||||
    if (!this->hw->dc_isPortOpen()) {
 | 
					    if (!this->hw->dc_isPortOpen()) {
 | 
				
			||||||
        qCritical() << "    ... serial port is not open!";
 | 
					        qCritical() << "    ... serial port is not open!";
 | 
				
			||||||
        this->onPrintFinishedERR();
 | 
					        this->onPrintFinishedERR();
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // TODO: wird hier nur 'licensePlate' gedruckt?
 | 
					    // TODO: wird hier nur 'licensePlate' gedruckt?
 | 
				
			||||||
    if (!this->hw->prn_sendDynamicPrnValues(dynTicketData->licensePlate)) {
 | 
					    if (!this->hw->prn_sendDynamicPrnValues(dynTicketData->licensePlate)) {
 | 
				
			||||||
@@ -750,12 +753,13 @@ void ATBDeviceControllerPlugin::requestPrintTicket(const QHash<QString, QVariant
 | 
				
			|||||||
    // DEBUG
 | 
					    // DEBUG
 | 
				
			||||||
    qCritical() << "ATBDeviceControllerPlugin::requestPrintTicket()";
 | 
					    qCritical() << "ATBDeviceControllerPlugin::requestPrintTicket()";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /*
 | 
				
			||||||
    if (!this->hw->dc_isPortOpen()) {
 | 
					    if (!this->hw->dc_isPortOpen()) {
 | 
				
			||||||
        qCritical() << "    ... serial port is not open!";
 | 
					        qCritical() << "    ... serial port is not open!";
 | 
				
			||||||
        this->onPrintFinishedERR();
 | 
					        this->onPrintFinishedERR();
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // TODO: wird hier nur 'licensePlate' gedruckt?
 | 
					    // TODO: wird hier nur 'licensePlate' gedruckt?
 | 
				
			||||||
    if (!this->hw->prn_sendDynamicPrnValues(dynTicketData->licensePlate)) {
 | 
					    if (!this->hw->prn_sendDynamicPrnValues(dynTicketData->licensePlate)) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -57,6 +57,8 @@ void DeviceControllerDiag::private_startDiag()
 | 
				
			|||||||
    if (this->flagInterruptDiag) {
 | 
					    if (this->flagInterruptDiag) {
 | 
				
			||||||
        qCritical() << "DeviceControllerDiag::private_startDiag() interrupted!";
 | 
					        qCritical() << "DeviceControllerDiag::private_startDiag() interrupted!";
 | 
				
			||||||
        this->private_sendDiagEvent(DeviceController::State::E255);
 | 
					        this->private_sendDiagEvent(DeviceController::State::E255);
 | 
				
			||||||
 | 
					        this->isRequestRunning  = false;
 | 
				
			||||||
 | 
					        this->flagInterruptDiag = false;
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -89,6 +91,8 @@ void DeviceControllerDiag::sys_superviseSystem()
 | 
				
			|||||||
    if (this->flagInterruptDiag) {
 | 
					    if (this->flagInterruptDiag) {
 | 
				
			||||||
        qCritical() << "DeviceControllerDiag::sys_superviseSystem() interrupted!";
 | 
					        qCritical() << "DeviceControllerDiag::sys_superviseSystem() interrupted!";
 | 
				
			||||||
        this->private_sendDiagEvent(DeviceController::State::E255);
 | 
					        this->private_sendDiagEvent(DeviceController::State::E255);
 | 
				
			||||||
 | 
					        this->flagInterruptDiag = false;
 | 
				
			||||||
 | 
					        this->isRequestRunning  = false;
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -97,6 +101,8 @@ void DeviceControllerDiag::sys_superviseSystem()
 | 
				
			|||||||
        // es gibt keinerlei gültige Daten vom DC
 | 
					        // es gibt keinerlei gültige Daten vom DC
 | 
				
			||||||
        qCritical() << "DeviceControllerDiag::sys_superviseSystem() no valid data!";
 | 
					        qCritical() << "DeviceControllerDiag::sys_superviseSystem() no valid data!";
 | 
				
			||||||
        this->private_sendDiagEvent(DeviceController::State::E254);
 | 
					        this->private_sendDiagEvent(DeviceController::State::E254);
 | 
				
			||||||
 | 
					        this->diagRequestTimeoutTimer->stop();
 | 
				
			||||||
 | 
					        this->isRequestRunning  = false;
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -39,13 +39,36 @@ uint32_t CashUtils::getAmountOfInsertedCoins(hwinf* hw)
 | 
				
			|||||||
uint32_t CashUtils::getAmountOfInsertedNotes(hwinf* hw)
 | 
					uint32_t CashUtils::getAmountOfInsertedNotes(hwinf* hw)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    uint32_t result = 0;
 | 
					    uint32_t result = 0;
 | 
				
			||||||
 | 
					    uint8_t numberOfInsertedNotes;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    uint16_t values[MAX_NOTES];
 | 
					    uint16_t beforeArray = 0;
 | 
				
			||||||
    hw->bna_getCurrentNotes(0, values);
 | 
					    uint16_t currentNotes[4];
 | 
				
			||||||
 | 
					    uint16_t afterArray = 0;
 | 
				
			||||||
 | 
					    numberOfInsertedNotes = hw->bna_getCurrentNotes(0, currentNotes);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (int i = 0; i < MAX_COINS; i++) {
 | 
					    if ( (beforeArray != 0) || (afterArray != 0) ) {
 | 
				
			||||||
        result += values[i];
 | 
					        qCritical() << "CashUtils::getAmountOfInsertedNotes() ERROR: Array";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (numberOfInsertedNotes == 99) {
 | 
				
			||||||
 | 
					        // Error
 | 
				
			||||||
 | 
					        qCritical() << "CashUtils::getAmountOfInsertedNotes() ERROR: ";
 | 
				
			||||||
 | 
					        for (int i = 0; i < 4; i++) {
 | 
				
			||||||
 | 
					        qCritical() << "   currentNotes[" << i << "] = " << currentNotes[i];
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    else {
 | 
				
			||||||
 | 
					        // no error
 | 
				
			||||||
 | 
					        result = currentNotes[3];
 | 
				
			||||||
 | 
					        result = ( result << 16 ) | currentNotes[2];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // DEBUG
 | 
				
			||||||
 | 
					    qCritical() << "--------------------------------------------------";
 | 
				
			||||||
 | 
					    qCritical() << "CashUtils::getAmountOfInsertedNotes()";
 | 
				
			||||||
 | 
					    qCritical() << "          numberOfInsertedNotes = " << numberOfInsertedNotes;
 | 
				
			||||||
 | 
					    qCritical() << "                         result = " << result;
 | 
				
			||||||
 | 
					    qCritical() << "--------------------------------------------------";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return result;
 | 
					    return result;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user