class AIXM::Component::Surface
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
@see gitlab.com/openflightmaps/ofmx/wikis/Airport#rwy-runway
Constants
- COMPOSITIONS
- CONDITIONS
- PREPARATIONS
Attributes
auw_weight[R]
@return [AIXM::W, nil] all-up wheel weight
composition[R]
@return [Symbol, nil] composition of the surface (see {COMPOSITIONS})
condition[R]
@return [Symbol, nil] condition of the surface (see {CONDITIONS})
preparation[R]
@return [Symbol, nil] preparation of the surface (see {PREPARATIONS})
remarks[R]
@return [String, nil] free text remarks
siwl_tire_pressure[R]
@return [AIXM::P, nil] single isolated wheel load tire pressure
siwl_weight[R]
@return [AIXM::W, nil] single isolated wheel load weight
Public Class Methods
new()
click to toggle source
# File lib/aixm/component/surface.rb 83 def initialize 84 @pcn = {} 85 end
Public Instance Methods
auw_weight=(value)
click to toggle source
# File lib/aixm/component/surface.rb 125 def auw_weight=(value) 126 fail(ArgumentError, "invalid auw_weight") unless value.nil? || value.is_a?(AIXM::W) 127 @auw_weight = value 128 end
composition=(value)
click to toggle source
# File lib/aixm/component/surface.rb 92 def composition=(value) 93 @composition = value.nil? ? nil : COMPOSITIONS.lookup(value.to_s.to_sym, nil) || fail(ArgumentError, "invalid composition") 94 end
condition=(value)
click to toggle source
# File lib/aixm/component/surface.rb 100 def condition=(value) 101 @condition = value.nil? ? nil : CONDITIONS.lookup(value.to_s.to_sym, nil) || fail(ArgumentError, "invalid condition") 102 end
inspect()
click to toggle source
@return [String]
# File lib/aixm/component/surface.rb 88 def inspect 89 %Q(#<#{self.class} composition=#{composition.inspect} preparation=#{preparation.inspect} condition=#{condition.inspect} pcn=#{pcn.inspect}>) 90 end
pcn()
click to toggle source
@return [String, nil] pavement classification number (e.g. â59/F/A/W/Tâ)
# File lib/aixm/component/surface.rb 105 def pcn 106 @pcn.none? ? nil : @pcn.values.join("/") 107 end
pcn=(value)
click to toggle source
# File lib/aixm/component/surface.rb 109 def pcn=(value) 110 return @pcn = {} if value.nil? 111 fail(ArgumentError, "invalid PCN") unless match = value.to_s.upcase.match(PCN_RE) 112 @pcn = match.named_captures.reject{ _1 == 'pcn' } 113 end
preparation=(value)
click to toggle source
# File lib/aixm/component/surface.rb 96 def preparation=(value) 97 @preparation = value.nil? ? nil : PREPARATIONS.lookup(value.to_s.to_sym, nil) || fail(ArgumentError, "invalid preparation") 98 end
remarks=(value)
click to toggle source
# File lib/aixm/component/surface.rb 130 def remarks=(value) 131 @remarks = value&.to_s 132 end
siwl_tire_pressure=(value)
click to toggle source
# File lib/aixm/component/surface.rb 120 def siwl_tire_pressure=(value) 121 fail(ArgumentError, "invalid siwl_tire_pressure") unless value.nil? || value.is_a?(AIXM::P) 122 @siwl_tire_pressure = value 123 end
siwl_weight=(value)
click to toggle source
# File lib/aixm/component/surface.rb 115 def siwl_weight=(value) 116 fail(ArgumentError, "invalid siwl_weight") unless value.nil? || value.is_a?(AIXM::W) 117 @siwl_weight = value 118 end
to_xml()
click to toggle source
@return [String] AIXM
or OFMX markup
# File lib/aixm/component/surface.rb 135 def to_xml 136 builder = Builder::XmlMarkup.new(indent: true) 137 builder.codeComposition(COMPOSITIONS.key(composition).to_s) if composition 138 builder.codePreparation(PREPARATIONS.key(preparation).to_s) if preparation 139 builder.codeCondSfc(CONDITIONS.key(condition).to_s) if condition 140 if pcn 141 builder.valPcnClass(@pcn['capacity']) 142 builder.codePcnPavementType(@pcn['type']) 143 builder.codePcnPavementSubgrade(@pcn['subgrade']) 144 builder.codePcnMaxTirePressure(@pcn['tire_pressure']) 145 builder.codePcnEvalMethod(@pcn['evaluation_method']) 146 end 147 builder.txtPcnNote(@remarks) if remarks 148 if siwl_weight 149 builder.valSiwlWeight(siwl_weight.wgt.trim) 150 builder.uomSiwlWeight(siwl_weight.unit.to_s.upcase) 151 end 152 if siwl_tire_pressure 153 builder.valSiwlTirePressure(siwl_tire_pressure.pres.trim) 154 builder.uomSiwlTirePressure(siwl_tire_pressure.unit.to_s.upcase) 155 end 156 if auw_weight 157 builder.valAuwWeight(auw_weight.wgt.trim) 158 builder.uomAuwWeight(auw_weight.unit.to_s.upcase) 159 end 160 builder.target! 161 end