Class: BarcodePrinter
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- BarcodePrinter
- Includes:
- Uuid::Uuidable
- Defined in:
- app/models/barcode_printer.rb
Overview
Represents a barcode printer, where #name is the hostname of the printer eg. d304bc BarcodePrinterType records which label type (eg. tube or plate labels) is loaded in the printer, and ensures that we can: - Correctly filter the list of printers displayed to be suitable for the asset - Send an appropriate label template to the printer
Constant Summary collapse
- BarcodePrinterException =
for labels printing, if printer is not registered in ss
Class.new(ActiveRecord::RecordNotFound)
Instance Attribute Summary collapse
-
#name ⇒ String
The hostname of the printer, eg.
Class Method Summary collapse
Instance Method Summary collapse
- #plate384_printer? ⇒ Boolean
- #register_printer_in_pmb ⇒ Object
- #service ⇒ Object
- #service_url ⇒ Object
Methods included from Uuid::Uuidable
included, #unsaved_uuid!, #uuid
Methods inherited from ApplicationRecord
alias_association, convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!
Methods included from Squishify
Instance Attribute Details
#name ⇒ String
Returns The hostname of the printer, eg. d304bc.
14 |
# File 'app/models/barcode_printer.rb', line 14 belongs_to :barcode_printer_type |
Class Method Details
.verify(_number) ⇒ Object
52 53 54 55 |
# File 'app/models/barcode_printer.rb', line 52 def self.verify(_number) # service.verify(number) 'DEPRECATED' end |
Instance Method Details
#plate384_printer? ⇒ Boolean
32 33 34 |
# File 'app/models/barcode_printer.rb', line 32 def plate384_printer? .name == '384 Well Plate' end |
#register_printer_in_pmb ⇒ Object
36 37 38 |
# File 'app/models/barcode_printer.rb', line 36 def register_printer_in_pmb LabelPrinter::PmbClient.register_printer(name, printer_type) end |
#service ⇒ Object
47 48 49 50 |
# File 'app/models/barcode_printer.rb', line 47 def service # @service ||= self.class.service 'DEPRECATED' end |
#service_url ⇒ Object
42 43 44 45 |
# File 'app/models/barcode_printer.rb', line 42 def service_url # configatron.barcode_service_url 'DEPRECATED' end |