Merge branch 'improveTicketPrint' into pu/integration

This commit is contained in:
Siegfried Siegert 2025-05-13 13:46:48 +02:00
commit e703befb2f
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03

View File

@ -806,7 +806,7 @@ void ATBDeviceControllerPlugin::requestPrintReceipt(const QString & printingStri
this->printResultCheckCounter = 0;
QTimer::singleShot(4000, this, SLOT(onPrinterWaitForPrintingReceipt()));
QTimer::singleShot(2000, this, SLOT(onPrinterWaitForPrintingReceipt()));
//QTimer::singleShot(2000, this, [this](){ hw->prn_cut(3); } );
}
@ -827,7 +827,7 @@ void ATBDeviceControllerPlugin::onPrinterWaitForPrintingReceipt()
"",
"");
hw->prn_switchPower(true);
hw->prn_cut(3);
QTimer::singleShot(200, this, [this](){ hw->prn_cut(3); } );
break;
case 2: // printing finished, Error
qCritical() << "DC Error: wait for printing receipt";
@ -837,15 +837,21 @@ void ATBDeviceControllerPlugin::onPrinterWaitForPrintingReceipt()
emit this->printReceiptFinished(nsDeviceControllerInterface::RESULT_STATE::ERROR_BACKEND,
this->errorCode,
this->errorDescription);
hw->prn_switchPower(true);
QTimer::singleShot(200, this, [this](){ hw->prn_cut(3); } );
break;
default:
qCritical() << "DC Error: wait for printing receipt";
qCritical() << "DC Error: wait for printing receipt: printerResult = " << printerResult;
this->errorCode = "PRINTER"; // TODO: get more detailed error code from low level API
this->errorDescription = "Printer error"; // TODO: get more detailed error description from low level API
this->errorDescription = "Printer error(" + QString(printerResult) + ")";
emit this->printReceiptFinished(nsDeviceControllerInterface::RESULT_STATE::ERROR_BACKEND,
this->errorCode,
this->errorDescription);
// do an emergency cut
hw->prn_switchPower(true);
QTimer::singleShot(200, this, [this](){ hw->prn_cut(3); } );
break;
}