Merge with TS 21.04.23
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#include "src/ATBAPP/ATBDeviceControllerPlugin.h"
|
||||
#include "src/ATBAPP/ATBHealthEvent.h"
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
|
||||
ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) : QObject(parent),
|
||||
pluginState(PLUGIN_STATE::NOT_INITIALIZED)
|
||||
@@ -58,6 +60,14 @@ void ATBDeviceControllerPlugin::requestPrintTicket(const QHash<QString, QVariant
|
||||
{
|
||||
struct T_dynDat *dynTicketData = new T_dynDat;
|
||||
|
||||
qCritical() << "ATBDeviceControllerPlugin::requestPrintTicket( " << endl
|
||||
<< " licenseplate = " << printingData["licenseplate"] << endl
|
||||
<< " amount = " << printingData["amount"] << endl
|
||||
<< " parkingEnd = " << printingData["parkingEnd"] << endl
|
||||
<< " currentTime = " << printingData["currentTime"] << endl
|
||||
<< " currentDate = " << printingData["currentDate"] << endl;
|
||||
|
||||
|
||||
strncpy((char*)dynTicketData->licensePlate, printingData["licenseplate"].toByteArray().data(), 7);
|
||||
strncpy((char*)dynTicketData->vendingPrice, printingData["amount"].toByteArray().data(), 7);
|
||||
strncpy((char*)dynTicketData->parkingEnd, printingData["parkingEnd"].toByteArray().data(), 7);
|
||||
@@ -71,9 +81,11 @@ void ATBDeviceControllerPlugin::requestPrintTicket(const QHash<QString, QVariant
|
||||
emit this->onPrintFinishedERR();
|
||||
}
|
||||
|
||||
if (!this->hw->prn_printDocument(1, dynTicketData)) {
|
||||
this->errorCode = "hwapi::prn_printDocument";
|
||||
this->errorDescription = "hwapi method 'hwapi::prn_printDocument' result is false";
|
||||
|
||||
// TODO: wird hier nur 'licensePlate' gedruckt?
|
||||
if (!this->hw->prn_sendDynamicPrnValues(dynTicketData->licensePlate)) {
|
||||
this->errorCode = "hwapi::prn_sendDynamicPrnValues";
|
||||
this->errorDescription = "hwapi method 'hwapi::prn_sendDynamicPrnValues' result is false";
|
||||
|
||||
qCritical() << "ERROR:";
|
||||
qCritical() << "ATBDeviceControllerPlugin::requestPrintTicket( " << endl
|
||||
@@ -85,10 +97,30 @@ void ATBDeviceControllerPlugin::requestPrintTicket(const QHash<QString, QVariant
|
||||
|
||||
|
||||
emit this->onPrintFinishedERR();
|
||||
return;
|
||||
}
|
||||
|
||||
QTimer::singleShot(1000, this, SLOT(onPrinterDataPrepared()));
|
||||
}
|
||||
|
||||
void ATBDeviceControllerPlugin::onPrinterDataPrepared()
|
||||
{
|
||||
for (int i = 1; i <= 3; ++i) {
|
||||
|
||||
qCritical() << " ... print template " << i;
|
||||
|
||||
if (!this->hw->prn_printTemplate(i)) {
|
||||
this->errorCode = "hwapi::prn_printTemplate";
|
||||
this->errorDescription = QString("hwapi method 'hwapi::prn_printTemplate(%1)' result is false").arg(i);
|
||||
emit this->onPrintFinishedERR();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/************************************************************************************************
|
||||
* private slots, interface to low level hwapi
|
||||
*
|
||||
|
@@ -103,6 +103,7 @@ private:
|
||||
|
||||
|
||||
private slots:
|
||||
void onPrinterDataPrepared();
|
||||
void onPrintFinishedOK();
|
||||
void onPrintFinishedERR();
|
||||
void onGotCoin();
|
||||
|
Reference in New Issue
Block a user