Fixed printing od ticket: dc_printTemplate(). First send dynamic data, then use prn_sendDynamicPrnValues()
This commit is contained in:
parent
ceedf72b34
commit
6765bb13e5
@ -573,10 +573,25 @@ bool hwapi::dc_printTemplate(enum FileTypeJson type,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ret = true;
|
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) {
|
for (int i = 0; i < templateIdx.size(); ++i) {
|
||||||
if (prn_printTemplate(templateIdx[i])) {
|
// dynamische Daten werden gespeichert
|
||||||
qDebug() << "printing template" << templateIdx[i];
|
if (prn_sendDynamicPrnValues(&dynTicketData.licensePlate[0])) {
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(3));
|
// 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 {
|
} else {
|
||||||
ret = false;
|
ret = false;
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user