Sha256: fe282ad26dc364b528be8a3cae7c2bf03a3200f3ecd998a4f084484818178ad3

Contents?: true

Size: 1.22 KB

Versions: 1

Compression:

Stored size: 1.22 KB

Contents

module Extface
  class PosPrintDriver < Extface::DriverBase
    GROUP = 'POS Printers'.freeze
    def print(buffer)
      raise "Not Impelmented"
    end
    
    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"
        
        if s.try(:autocutter?)
          s.autocut
        end
        end
      end
    end
    
    def print?
      true
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
extface-0.1.0 app/models/extface/pos_print_driver.rb