Class: Extface::Driver::GenericPos
- Inherits:
-
Extface::Driver
- Object
- ActiveRecord::Base
- Extface::Driver
- Extface::Driver::GenericPos
- Defined in:
- app/models/extface/driver/generic_pos.rb
Direct Known Subclasses
Constant Summary collapse
- NAME =
'Generic Pos Printer (Serial)'.freeze
- GROUP =
Extface::PRINT_DRIVER
- DEVELOPMENT =
driver is not ready for production (not passing all tests or has major bugs)
true
- RAW =
Select driver features
true
- PRINT =
responds to #push(data) and #pull
true
- FISCAL =
POS, slip printers
false
- REPORT =
cash registers, fiscal printers
false
Constants inherited from Extface::Driver
Instance Method Summary collapse
Methods inherited from Extface::Driver
#flush, #handle, has_serial_config, #notify, #pre_handle, #pull, #push, #rpush, #serial?, #set_job
Instance Method Details
#check_status ⇒ Object
48 49 50 |
# File 'app/models/extface/driver/generic_pos.rb', line 48 def check_status return true #just pass end |
#print_test_page(times = 1) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/models/extface/driver/generic_pos.rb', line 17 def print_test_page(times = 1) device.session("Print Test Page") do |s| times.times do |t| s.notify "Printing Test Page #{t}" s.print "******************************\r\n*" s.print "Extface Print Test #{t}".center(28) s.print "*\r\n******************************\r\n" s.notify "Printing driver information" s.print "\r\nDriver:\r\n" s.print "------------------------------\r\n" s.print "#{self.class::NAME}".truncate(30) s.print "\r\n" if try(:serial?) s.notify "Printing serial settings" s.print "\r\nSerial Port Settings:\r\n" s.print "------------------------------\r\n" end s.print "\r\n" s.print "------------------------------\r\n" s.print Time.now.strftime("Printed on %m/%d/%Y %T\r\n").rjust(32) s.print "\r\n\r\n" s.notify "Printing finished" s.try :autocut end end end |