From 6765bb13e5e4b12766756db8196f27597ec96dee Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Wed, 3 May 2023 08:59:17 +0200 Subject: [PATCH] Fixed printing od ticket: dc_printTemplate(). First send dynamic data, then use prn_sendDynamicPrnValues() --- DCPlugin/src/hwapi.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/DCPlugin/src/hwapi.cpp b/DCPlugin/src/hwapi.cpp index 86e1068..be800d3 100644 --- a/DCPlugin/src/hwapi.cpp +++ b/DCPlugin/src/hwapi.cpp @@ -573,10 +573,25 @@ bool hwapi::dc_printTemplate(enum FileTypeJson type, } bool ret = true; + struct T_dynDat dynTicketData; + memset (&dynTicketData, 0x00, sizeof(dynTicketData)); + + // lassen sich auch veraendern + memcpy(&dynTicketData.licensePlate[0], "WEN1230", 8); + memcpy(&dynTicketData.vendingPrice[0], "1234", 8); + memcpy(&dynTicketData.parkingEnd[0], "12:00:00", 8); + memcpy(&dynTicketData.currentTime[0], "14:15:00", 8); + memcpy(&dynTicketData.currentDate[0], "01.01.2023", 8); + for (int i = 0; i < templateIdx.size(); ++i) { - if (prn_printTemplate(templateIdx[i])) { - qDebug() << "printing template" << templateIdx[i]; - std::this_thread::sleep_for(std::chrono::seconds(3)); + // dynamische Daten werden gespeichert + if (prn_sendDynamicPrnValues(&dynTicketData.licensePlate[0])) { + // angabe welches template beim drucken benutzt werden soll + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + if (prn_printTemplate(templateIdx[i])) { + qDebug() << "printing template" << templateIdx[i]; + std::this_thread::sleep_for(std::chrono::seconds(3)); + } } else { ret = false; continue;