## TkKasse printer configuration file.
## The printer configuration is rather complex, but very flexible,too.
## Please don't be discouraged if something doesn't work out-of-the-box,
## call for support instead.
##
## Please note besides from "printing" into the debug log, only ESC/POS
## capable printers can be handled by TkKasse so far. This applies to a
## lot of POS printers in the market. Please choose your hardware by
## this means.



## The print filters. Basically, there are four classes for four different
## kinds of receipts - order receipts, bills for the guest and receipts which
## act as a protocol for the waiter and the cash desk as a whole.

## The cash register receipt. No options here, just specify it here.
::TkKasse::PrintFilter::CashRegisterReceipt ::printFilterCRR

## The guest receipt. This type covers all the receipt given to the guest.
## Please apply a header and footer text here - you may also specify graphical
## logos if you know the ESC/POS sequence of them.
::TkKasse::PrintFilter::GuestReceipt ::printFilterGR \
	-header_text "Hotel und Restaurant¶Waldschlößchen Schierke¶¶Hermann-Löns-Weg 1, 38879 Schierke¶¶Besuchen und buchen Sie im Internet bei¶www.waldschloesschen-schierke.de" \
	-footer_text "Auf Wiedersehen.¶Ust.-Ident.-Nr.: DE xxxxxxxxxx"

## The order receipts. Two types are available, normal and double size
## The difference is that double size order receipts will arrange data
## differently on the receipt, so double size printing won't break the
## receipt layout. Note that this is not enough to actually print double
## size! For that, you have to specify a single printer *twice*, once with
## a single size initiation sequence and once with double size initiation
## sequence.
::TkKasse::PrintFilter::OrderReceipt ::printFilterOR
::TkKasse::PrintFilter::OrderReceipt ::printFilterORDS

## The waiter receipt. No options here, just specify it here.
::TkKasse::PrintFilter::WaiterReceipt ::printFilterWR



## Now the printer drivers. Each printer may have one or *more* printer
## drivers. E.g. if you need normal and double sized receipts, you need
## two different printer driver settings. Multiple printers may share the
## same driver.
## Options:  autowrap -- 0(default) The printer does *not* insert an automatic newline after last column.
##                       1          The printer inserts an automatic newline after last column.
##           encoding -- defaults to the systems encoding, otherwise a string like CP437, CP850 etc.
##          form_feed -- defaults to ************************cut***************************
##                       specify the form feed (multiple line feed + paper cut command here)
##               init -- specify the printers init string here (e.g \x1b\x40\x1b\x74\x00\x1b\x21\x01) 
##            newline -- specify the code for newline here (e.g \x0a (default))
##              space -- specify a different space character here (default is just space)
##        paper_width -- specify the width of paper in chars here (default is 40)
##                       for double size printing, make sure to replace the by half of the normal width.

## A printer driver configuration for regular size printing on an Epson TM-U2xx.
::TkKasse::PrinterDriver::TextOnly ::printerDriverRS \
	-encoding cp437 \
	-form_feed \x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x1d\x56\x01\x0a\x0a \
	-init \x1b\x40\x1b\x74\x00\x1b\x21\x01

## A printer driver configuration for double width printing on an Epson TM-U2xx.
::TkKasse::PrinterDriver::TextOnly ::printerDriverDS \
	-encoding cp437 \
	-form_feed \x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x1d\x56\x01\x0a\x0a \
	-init \x1b\x40\x1b\x74\x00\x1b\x21\x21 \
	-paper_width 20



## The print spoolers. So far, the only defined classes are piping into
## a command like "lpr" and "printing" into the /var/log/tkkassed file
## for debug and demonstartion purposes.
## Each printer has to specify *exactly one* print spooler, which sends
## the printable receipt data to the correct printers.


## The PipeCommand print spooler takes a special formatted list of
## external commands as an argument.
## The correct printer is chosen by going though the list from first
## to last - the unified display name and service name must match.
## (Unified display name: hostname.domainname:display - the screen
## number is ommited, all must be a 100% match.)
## The command executed gets the printable data on stdin. Make sure
## "lpr" and others are using "literal" mode, where no further filters
## are applied on the raw data.
#::TkKasse::PrintSpooler::PipeCommand ::printSpoolerLPR \
#	-commands [ list \
#		janskiste.localdomain:0,bar {lpr -l -Plp_restaurant} \
#		janskiste.localdomain:0,kitchen {lpr -l -Plp_restaurant} ]
#
## The Debug print spooler takes no arguments.
::TkKasse::PrintSpooler::Debug ::printSpoolerLPR



## The printer records. Remember you may define lutiple "logical" printers
## for one physical printer device. 
## You have to specify all the following parameters:
## displays -- a list of displays the printer is associated width.
##   driver -- exactly one printer driver to use.
##  filters -- a list of filters the printer can be connected to.
## services -- a list of services (bar, kitchen) the printer should print receipts for.
##  spooler -- exactly one print spooler to use.

## A printer definition for printing in normal size.
::TkKasse::Printer ::printerRS \
	-displays janskiste.localdomain:0 \
	-driver ::printerDriverRS \
	-filters {::printFilterCRR ::printFilterGR ::printFilterOR ::printFilterWR} \
	-services bar \
	-spooler ::printSpoolerLPR

## A printer definition for printing in double width for kitchen receipts.
::TkKasse::Printer ::printerDS \
	-displays janskiste.localdomain:0 \
	-driver ::printerDriverDS \
	-filters ::printFilterORDS \
	-services kitchen \
	-spooler ::printSpoolerLPR


# At last, the mainPrintManager. Enumerate the printers here
::TkKasse::PrintManager ::mainPrintManager -printers {::printerRS printerDS}

