Merge branch 'improveTicketPrint' into pu/integration
This commit is contained in:
commit
e703befb2f
@ -806,7 +806,7 @@ void ATBDeviceControllerPlugin::requestPrintReceipt(const QString & printingStri
|
|||||||
|
|
||||||
|
|
||||||
this->printResultCheckCounter = 0;
|
this->printResultCheckCounter = 0;
|
||||||
QTimer::singleShot(4000, this, SLOT(onPrinterWaitForPrintingReceipt()));
|
QTimer::singleShot(2000, this, SLOT(onPrinterWaitForPrintingReceipt()));
|
||||||
|
|
||||||
//QTimer::singleShot(2000, this, [this](){ hw->prn_cut(3); } );
|
//QTimer::singleShot(2000, this, [this](){ hw->prn_cut(3); } );
|
||||||
}
|
}
|
||||||
@ -827,7 +827,7 @@ void ATBDeviceControllerPlugin::onPrinterWaitForPrintingReceipt()
|
|||||||
"",
|
"",
|
||||||
"");
|
"");
|
||||||
hw->prn_switchPower(true);
|
hw->prn_switchPower(true);
|
||||||
hw->prn_cut(3);
|
QTimer::singleShot(200, this, [this](){ hw->prn_cut(3); } );
|
||||||
break;
|
break;
|
||||||
case 2: // printing finished, Error
|
case 2: // printing finished, Error
|
||||||
qCritical() << "DC Error: wait for printing receipt";
|
qCritical() << "DC Error: wait for printing receipt";
|
||||||
@ -837,15 +837,21 @@ void ATBDeviceControllerPlugin::onPrinterWaitForPrintingReceipt()
|
|||||||
emit this->printReceiptFinished(nsDeviceControllerInterface::RESULT_STATE::ERROR_BACKEND,
|
emit this->printReceiptFinished(nsDeviceControllerInterface::RESULT_STATE::ERROR_BACKEND,
|
||||||
this->errorCode,
|
this->errorCode,
|
||||||
this->errorDescription);
|
this->errorDescription);
|
||||||
|
hw->prn_switchPower(true);
|
||||||
|
QTimer::singleShot(200, this, [this](){ hw->prn_cut(3); } );
|
||||||
break;
|
break;
|
||||||
default:
|
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->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,
|
emit this->printReceiptFinished(nsDeviceControllerInterface::RESULT_STATE::ERROR_BACKEND,
|
||||||
this->errorCode,
|
this->errorCode,
|
||||||
this->errorDescription);
|
this->errorDescription);
|
||||||
|
// do an emergency cut
|
||||||
|
hw->prn_switchPower(true);
|
||||||
|
QTimer::singleShot(200, this, [this](){ hw->prn_cut(3); } );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user