Class: AIXM::Component::Surface
Overview
Surface of a runway, helipad etc
Cheat Sheet in Pseudo Code:
surface = AIXM.surface(
composition: COMPOSITIONS or nil
preparation: PREPARATIONS or nil
condition: CONDITIONS or nil
)
surface.pcn = String or nil
surface.siwl_weight = AIXM.w
surface.siwl_tire_pressure = AIXM.p
surface.auw_weight = AIXM.w
surface.remarks = String or nil
Constants:
-
AIXM::PCN_RE
- regular expression to match PCN notations
Constant Summary collapse
- COMPOSITIONS =
{ ASPH: :asphalt, BITUM: :bitumen, # dug up, bound and rolled ground CONC: :concrete, 'CONC+ASPH': :concrete_and_asphalt, 'CONC+GRS': :concrete_and_grass, GRADE: :graded_earth, # graded or rolled earth possibly with some grass GRASS: :grass, # lawn GRAVE: :gravel, # small and midsize rounded stones MACADAM: :macadam, # small rounded stones METAL: :metal, SAND: :sand, SNOW: :snow, WATER: :water, OTHER: :other # specify in remarks }
- PREPARATIONS =
{ AFSC: :aggregate_friction_seal_coat, GROOVED: :grooved, # cut or plastic grooved NATURAL: :natural, # no treatment OILED: :oiled, PAVED: :paved, PFC: :porous_friction_course, RFSC: :rubberized_friction_seal_coat, ROLLED: :rolled, OTHER: :other }
- CONDITIONS =
{ GOOD: :good, FAIR: :fair, POOR: :poor, OTHER: :other }
Instance Attribute Summary collapse
-
#auw_weight ⇒ AIXM::W?
All-up wheel weight.
-
#composition ⇒ Symbol?
Composition of the surface (see COMPOSITIONS).
-
#condition ⇒ Symbol?
Condition of the surface (see CONDITIONS).
-
#preparation ⇒ Symbol?
Preparation of the surface (see PREPARATIONS).
-
#remarks ⇒ String?
Free text remarks.
-
#siwl_tire_pressure ⇒ AIXM::P?
Single isolated wheel load tire pressure.
-
#siwl_weight ⇒ AIXM::W?
Single isolated wheel load weight.
Instance Method Summary collapse
-
#initialize ⇒ Surface
constructor
A new instance of Surface.
- #inspect ⇒ String
-
#pcn ⇒ String?
Pavement classification number (e.g. “59/F/A/W/T”).
- #pcn=(value) ⇒ Object
-
#to_xml ⇒ String
AIXM or OFMX markup.
Constructor Details
#initialize ⇒ Surface
Returns a new instance of Surface.
83 84 85 |
# File 'lib/aixm/component/surface.rb', line 83 def initialize @pcn = {} end |
Instance Attribute Details
#auw_weight ⇒ AIXM::W?
Returns all-up wheel weight.
78 79 80 |
# File 'lib/aixm/component/surface.rb', line 78 def auw_weight @auw_weight end |
#composition ⇒ Symbol?
Returns composition of the surface (see COMPOSITIONS).
63 64 65 |
# File 'lib/aixm/component/surface.rb', line 63 def composition @composition end |
#condition ⇒ Symbol?
Returns condition of the surface (see CONDITIONS).
69 70 71 |
# File 'lib/aixm/component/surface.rb', line 69 def condition @condition end |
#preparation ⇒ Symbol?
Returns preparation of the surface (see PREPARATIONS).
66 67 68 |
# File 'lib/aixm/component/surface.rb', line 66 def preparation @preparation end |
#remarks ⇒ String?
Returns free text remarks.
81 82 83 |
# File 'lib/aixm/component/surface.rb', line 81 def remarks @remarks end |
#siwl_tire_pressure ⇒ AIXM::P?
Returns single isolated wheel load tire pressure.
75 76 77 |
# File 'lib/aixm/component/surface.rb', line 75 def siwl_tire_pressure @siwl_tire_pressure end |
#siwl_weight ⇒ AIXM::W?
Returns single isolated wheel load weight.
72 73 74 |
# File 'lib/aixm/component/surface.rb', line 72 def siwl_weight @siwl_weight end |
Instance Method Details
#inspect ⇒ String
88 89 90 |
# File 'lib/aixm/component/surface.rb', line 88 def inspect %Q(#<#{self.class} composition=#{composition.inspect} preparation=#{preparation.inspect} condition=#{condition.inspect} pcn=#{pcn.inspect}>) end |
#pcn ⇒ String?
Returns pavement classification number (e.g. “59/F/A/W/T”).
105 106 107 |
# File 'lib/aixm/component/surface.rb', line 105 def pcn @pcn.none? ? nil : @pcn.values.join("/") end |
#pcn=(value) ⇒ Object
109 110 111 112 113 |
# File 'lib/aixm/component/surface.rb', line 109 def pcn=(value) return @pcn = {} if value.nil? fail(ArgumentError, "invalid PCN") unless match = value.to_s.upcase.match(PCN_RE) @pcn = match.named_captures.reject{ _1 == 'pcn' } end |
#to_xml ⇒ String
Returns AIXM or OFMX markup.
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/aixm/component/surface.rb', line 135 def to_xml builder = Builder::XmlMarkup.new(indent: true) builder.codeComposition(COMPOSITIONS.key(composition).to_s) if composition builder.codePreparation(PREPARATIONS.key(preparation).to_s) if preparation builder.codeCondSfc(CONDITIONS.key(condition).to_s) if condition if pcn builder.valPcnClass(@pcn['capacity']) builder.codePcnPavementType(@pcn['type']) builder.codePcnPavementSubgrade(@pcn['subgrade']) builder.codePcnMaxTirePressure(@pcn['tire_pressure']) builder.codePcnEvalMethod(@pcn['evaluation_method']) end builder.txtPcnNote(@remarks) if remarks if siwl_weight builder.valSiwlWeight(siwl_weight.wgt.trim) builder.uomSiwlWeight(siwl_weight.unit.to_s.upcase) end if siwl_tire_pressure builder.valSiwlTirePressure(siwl_tire_pressure.pres.trim) builder.uomSiwlTirePressure(siwl_tire_pressure.unit.to_s.upcase) end if auw_weight builder.valAuwWeight(auw_weight.wgt.trim) builder.uomAuwWeight(auw_weight.unit.to_s.upcase) end builder.target! end |