176 lines
4.6 KiB
Plaintext
Executable File
176 lines
4.6 KiB
Plaintext
Executable File
Template for Ticket to be printed
|
|
Max Length 500bytes
|
|
Can be concatenated unless they contain a cut
|
|
|
|
important for the document-numer 1...99 is the :
|
|
"title":"DC2C_pri02", <---- not the file name
|
|
|
|
Never finish file with a TEXT-Line (set a "nl" after it)!!!
|
|
-> TEXT without nl at the end will not be printed
|
|
but with next doc nonsens will be printed [0:0...]
|
|
|
|
|
|
Following keys are used:
|
|
text // drucke Text direkt
|
|
styl // wie soll der Text aussehen
|
|
feed // Papier bewegen
|
|
vari // Werte aus Speicher drucken
|
|
graf // drucke Log, QRcode oder Barcode, rufe Funktionen und stelle Werte bereit
|
|
|
|
|
|
Following value pairs are allowed:
|
|
|
|
|
|
// print a direct textline, max 64bytes, always without "NewLine"
|
|
"text":"Parking Ticket",
|
|
|
|
|
|
// select text style bold on/off, underlined on/off or italic on/off
|
|
// once switched on it's active until next off or end of document
|
|
// not used for appended docs
|
|
"styl":"bold on",
|
|
"styl":"under off",
|
|
"styl":"latin on",
|
|
"styl":"font 12", // select Font-type for the following print,
|
|
/ range: 1...99
|
|
"styl":"size 01", // select Font size for the following print
|
|
// range: 1...99, depends on font-type, selects hight and width
|
|
// 10th:height 1th=width
|
|
"styl":"align c" // 'l' 'c' 'r' // left center right
|
|
"styl":"density25"; // 0....[25]...50 0=blass
|
|
|
|
|
|
// move or cut paper:
|
|
"feed":"cut",
|
|
"feed":"part",
|
|
"feed":"eject", // 5 line forward and cut
|
|
"feed":"line3", // 3 line forward (1..9)
|
|
"feed":"back1", // 1 line back (1..9)
|
|
"feed":"BM", // Blackmark
|
|
"feed":"nl", // NewLine LF & CR (1..9)
|
|
|
|
|
|
"feed":"margin05", // left border in mm
|
|
"feed":"rim05", // right border in mm
|
|
"feed":"speed10", // printer speed *10mm/s
|
|
|
|
|
|
|
|
|
|
// print predefined grafical components like logos, barcodes or QR-Codes
|
|
"graf":"barc8", // kind and content is fixed programmed, 1..9
|
|
"graf":"logo2", // programmed in printer, 1...9
|
|
"graf":"q.r.1", // content is fixed programmed 1..9
|
|
|
|
|
|
// print machine parameters
|
|
"vari":"cunu",
|
|
"vari":"manu",
|
|
"vari":"location",
|
|
"vari":"group",
|
|
"vari":"zone",
|
|
"vari":"alias",
|
|
|
|
// print current date or time
|
|
// ge=german style 15:45 / 31.12.23
|
|
// us=us format 3:45PM / 23/12/31
|
|
// time long: 14:45:58
|
|
// time short: 14:45
|
|
// dow short: Mo
|
|
// dow long: Monday
|
|
"vari":"date ge",
|
|
"vari":"date us",
|
|
"vari":"time long",
|
|
"vari":"wday eng short",
|
|
//"wday eng long" "wday deu short" "wday deu long"
|
|
|
|
#print dynamic values, come per cmd 17 from Master right before printing
|
|
#command contains 8 strings (1..8) with 8bytes each
|
|
#will be printed as they are
|
|
"vari","Dynamic02";
|
|
|
|
|
|
|
|
// following varis not yet installed:
|
|
// Values from current transaction, to come dynamic from master
|
|
"vari":"Amount_bru", // = inserted
|
|
"vari":"Amount_net", // = netto
|
|
"vari":"percent", // tax rate in percent
|
|
"vari":"perc_am", // amount of tax
|
|
"vari":"PE dow__short", short/long
|
|
"vari":"PE date us", ge/us
|
|
"vari":"PE time long", short/long
|
|
"vari":"TickCtr" // print consecutive ticket counter
|
|
"vari":"overpaid",
|
|
"vari":"LicPl", // License Plate
|
|
|
|
|
|
|
|
|
|
Example:
|
|
"styl":"size 1",
|
|
"feed":"NL"
|
|
"text":"parking until:",
|
|
"styl":"size 3",
|
|
"feed":"NL"
|
|
"vari":"parkend date",
|
|
"feed":"NL"
|
|
"vari":"parkend time",
|
|
"styl":"size 1",
|
|
"text":"printed at ",
|
|
"vari":"current date",
|
|
"feed":"NL"
|
|
"vari":"current time",
|
|
"feed":"NL"
|
|
"text":"payed amount: ",
|
|
"vari":"amount",
|
|
"feed":"NL"
|
|
"text":"--------------",
|
|
"feed":"NL"
|
|
|
|
|
|
|
|
|
|
|
|
Umsetzung im Programm bzw Speicherung im Eeprom:
|
|
|
|
Text: einfach rein, alles andere als ESC-Sequenz mit acht bytes (fünf + reserve) speichern
|
|
|
|
STYL: ruft eine Druckerfunktion auf
|
|
<27><s><b><48><32><32><32><32> (Escape, s für style, b für bold (oder u,l,f,s)
|
|
und asc-zahl, hier bold off
|
|
<27><s><f><48><50><32><32><32> Font 2
|
|
|
|
FEED: ruft eine Druckerfunktion auf
|
|
<27><f><c><32><32><32><32><32> f für feed, und c für cut (oder p,e,l,b,B,n)
|
|
|
|
VARI: sucht entspr. Daten, formt sie im string und schickt sie als Text zum Drucker
|
|
<27><v><0x35><0x38><32><32><32><32> v für Vari dann zwei Ziffern
|
|
Variablen werden durchnummeriert von 10..99
|
|
|
|
|
|
Länge: Json Datei max 500byte, dh. sie enthält max400byte text
|
|
Jeder Textspeicher hat 512 Byte, aber Esc-Sequ braucht 8 byte!
|
|
Wenn also viele Varis drin sind wirds knapp, aber dann ist die Json ja auch zur Hälfte mit keys gefüllt.
|
|
Also besser 1k pro Doc vorsehen, Rest immer mit bin-0 gefüllt --->32kB gesamt
|
|
Dann bleiben noch 32 kB übrig:
|
|
Abr.-Datensatz je256byte, also Platz für 128DS
|
|
|
|
Noch 64kB Reserve, evtl von Master zu verwenden
|
|
|
|
(alle settings liegen im int. eeprom)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|