Module: LensProtocol::OMA

Defined in:
lib/lens_protocol/oma.rb,
lib/lens_protocol/oma/types.rb,
lib/lens_protocol/oma/parser.rb,
lib/lens_protocol/oma/record.rb,
lib/lens_protocol/oma/type/r.rb,
lib/lens_protocol/oma/message.rb,
lib/lens_protocol/oma/formatter.rb,
lib/lens_protocol/oma/type/base.rb,
lib/lens_protocol/oma/type/text.rb,
lib/lens_protocol/oma/type/trcfmt.rb,
lib/lens_protocol/oma/type/integer.rb,
lib/lens_protocol/oma/type/numeric.rb

Overview

The API layer of the library.

Defined Under Namespace

Modules: Type Classes: Formatter, Message, Parser, Record

Constant Summary collapse

TYPES =
Hash.new { Type::Text.new }.merge(
  'ACOAT' => Type::Text.new(mode: :chiral),
  'ADD' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'AX' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'BACK' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'BCTHK' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'BEVM' => Type::Integer.new(mode: :chiral),
  'BEVP' => Type::Integer.new(mode: :chiral),
  'BSIZ' => Type::Integer.new(mode: :chiral),
  'BVD' => Type::Integer.new(mode: :chiral),
  'CRIB' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'CTHICK' => Type::Numeric.new(mode: :chiral, decimals: 3),
  'CYL' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'DBL' => Type::Numeric.new,
  'DIA' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'DRILLE' => Type::Text.new(mode: :matrix_of_values),
  'ETYP' => Type::Integer.new,
  'FCOCIN' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'FCOCUP' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'FCSGIN' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'FCSGUP' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'FCRV' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'FED' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'FPINB' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'FRNT' => Type::Numeric.new(mode: :chiral, decimals: 3),
  'FTYP' => Type::Integer.new,
  'FWD' => Type::Numeric.new(mode: :chiral),
  'GDEPTH' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'GWIDTH' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'GRADIENT' => Type::Integer.new(mode: :chiral),
  'HBOX' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'IPD' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'LDADD' => Type::Numeric.new(mode: :chiral),
  'LDDRAX' => Type::Numeric.new(mode: :chiral),
  'LDDRCYL' => Type::Numeric.new(mode: :chiral),
  'LDDRSPH' => Type::Numeric.new(mode: :chiral),
  'LDNAM' => Type::Text.new(mode: :chiral),
  'LDNRAX' => Type::Numeric.new(mode: :chiral),
  'LDNRCYL' => Type::Numeric.new(mode: :chiral),
  'LDNRSPH' => Type::Numeric.new(mode: :chiral),
  'LDVEN' => Type::Text.new(mode: :chiral),
  'LIND' => Type::Numeric.new(mode: :chiral, decimals: 3),
  'LMATID' => Type::Integer.new(mode: :chiral),
  'LMATTYPE' => Type::Text.new(mode: :chiral),
  'LNAM' => Type::Text.new(mode: :chiral),
  'LTYPE' => Type::Text.new(mode: :chiral),
  'MAXFRT' => Type::Numeric.new(mode: :chiral),
  'MBASE' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'MINFRT' => Type::Numeric.new(mode: :chiral),
  'MINEDG' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'MPD' => Type::Integer.new(mode: :chiral),
  'NPD' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'OCHT' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'OPC' => Type::Text.new(mode: :chiral),
  'OPTFRNT' => Type::Numeric.new(mode: :chiral),
  'PANTO' => Type::Integer.new(mode: :chiral),
  'PINB' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'POLAR' => Type::Integer.new(mode: :chiral),
  'PRVA' => Type::Numeric.new(mode: :chiral, decimals: 1),
  'PRVM' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'R' => Type::R.new,
  'SEGHT' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'SGOCIN' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'SGOCUP' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'SPH' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'STATUS' => Type::Integer.new,
  'THKP' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'TINT' => Type::Text.new(mode: :chiral),
  'TRCFMT' => Type::Trcfmt.new(mode: :chiral),
  'VIEWP' => Type::Text.new(mode: :array_of_values),
  'VBOX' => Type::Numeric.new(mode: :chiral, decimals: 2),
  'XSTATUS' => Type::Text.new(mode: :matrix_of_values),
  'ZTILT' => Type::Integer.new(mode: :chiral),
  '_BLANK' => Type::Text.new(mode: :matrix_of_values),
  '_LLVAL' => Type::Integer.new(mode: :chiral),
  '_PRVA1' => Type::Integer.new(mode: :chiral),
  '_PRVA2' => Type::Integer.new(mode: :chiral),
  '_PRVM1' => Type::Numeric.new(mode: :chiral, decimals: 1),
  '_PRVM2' => Type::Numeric.new(mode: :chiral, decimals: 1),
)

Class Method Summary collapse

Class Method Details

.format(*args) ⇒ Object



14
15
16
# File 'lib/lens_protocol/oma.rb', line 14

def format *args
  Formatter.new.format *args
end

.generate(*args) ⇒ Object



10
11
12
# File 'lib/lens_protocol/oma.rb', line 10

def generate *args
  Message.from_hash *args
end

.parse(*args) ⇒ Object



6
7
8
# File 'lib/lens_protocol/oma.rb', line 6

def parse *args
  Parser.new.parse *args
end