Class: AIXM::Component::FATO
- Inherits:
-
Object
- Object
- AIXM::Component::FATO
- Defined in:
- lib/aixm/component/fato.rb
Overview
FATO (final approach and take-off area) for vertical take-off aircraft such as helicopters.
Cheat Sheet in Pseudo Code:
fato = AIXM.fato(
name: String
)
fato.length = AIXM.d or nil # must use same unit as width
fato.width = AIXM.d or nil # must use same unit as length
fato.surface = AIXM.surface
fato.marking = String or nil
fato.profile = String or nil
fato.status = STATUSES or nil
fato.remarks = String or nil
fato.add_direction(
name: String
) do |direction|
direction.geographic_orientation = AIXM.a[precision=3] or nil
direction.remarks = String or nil
end
Defined Under Namespace
Classes: Direction
Constant Summary collapse
- STATUSES =
{ CLSD: :closed, WIP: :work_in_progress, # e.g. construction work PARKED: :parked_aircraft, # parked or disabled aircraft on FATO FAILAID: :visual_aids_failure, # failure or irregular operation of visual aids SPOWER: :secondary_power, # secondary power supply in operation OTHER: :other # specify in remarks }.freeze
Instance Attribute Summary collapse
-
#airport ⇒ AIXM::Feature::Airport
readonly
Airport this FATO belongs to.
-
#directions ⇒ Hash{String => AIXM::Component::FATO::Direction}
readonly
Maps added direction names to full FATO directions.
-
#length ⇒ AIXM::D?
Length.
-
#marking ⇒ String?
Markings.
-
#name ⇒ String
Full name (e.g. “H1”).
-
#profile ⇒ String?
Profile description.
-
#remarks ⇒ String?
Free text remarks.
-
#status ⇒ Symbol?
Status of the FATO (see STATUSES) or
nilfor normal operation. -
#surface ⇒ AIXM::Component::Surface
readonly
Surface of the FATO.
-
#width ⇒ AIXM::D?
Width.
Instance Method Summary collapse
- #add_direction(name:) {|direction| ... } ⇒ Object
-
#initialize(name:) ⇒ FATO
constructor
A new instance of FATO.
- #inspect ⇒ String
-
#to_uid ⇒ String
UID markup.
-
#to_xml ⇒ String
AIXM or OFMX markup.
Constructor Details
#initialize(name:) ⇒ FATO
Returns a new instance of FATO.
68 69 70 71 72 |
# File 'lib/aixm/component/fato.rb', line 68 def initialize(name:) self.name = name @surface = AIXM.surface @directions = {} end |
Instance Attribute Details
#airport ⇒ AIXM::Feature::Airport
Returns airport this FATO belongs to.
39 40 41 |
# File 'lib/aixm/component/fato.rb', line 39 def airport @airport end |
#directions ⇒ Hash{String => AIXM::Component::FATO::Direction} (readonly)
Returns maps added direction names to full FATO directions.
66 67 68 |
# File 'lib/aixm/component/fato.rb', line 66 def directions @directions end |
#length ⇒ AIXM::D?
Returns length.
45 46 47 |
# File 'lib/aixm/component/fato.rb', line 45 def length @length end |
#marking ⇒ String?
Returns markings.
54 55 56 |
# File 'lib/aixm/component/fato.rb', line 54 def marking @marking end |
#name ⇒ String
Returns full name (e.g. “H1”).
42 43 44 |
# File 'lib/aixm/component/fato.rb', line 42 def name @name end |
#profile ⇒ String?
Returns profile description.
57 58 59 |
# File 'lib/aixm/component/fato.rb', line 57 def profile @profile end |
#remarks ⇒ String?
Returns free text remarks.
63 64 65 |
# File 'lib/aixm/component/fato.rb', line 63 def remarks @remarks end |
#status ⇒ Symbol?
Returns status of the FATO (see STATUSES) or nil for normal operation.
60 61 62 |
# File 'lib/aixm/component/fato.rb', line 60 def status @status end |
#surface ⇒ AIXM::Component::Surface (readonly)
Returns surface of the FATO.
51 52 53 |
# File 'lib/aixm/component/fato.rb', line 51 def surface @surface end |
#width ⇒ AIXM::D?
Returns width.
48 49 50 |
# File 'lib/aixm/component/fato.rb', line 48 def width @width end |
Instance Method Details
#add_direction(name:) {|direction| ... } ⇒ Object
122 123 124 125 126 |
# File 'lib/aixm/component/fato.rb', line 122 def add_direction(name:) direction = Direction.new(fato: self, name: name) yield direction @directions[name] = direction end |
#inspect ⇒ String
75 76 77 |
# File 'lib/aixm/component/fato.rb', line 75 def inspect %Q(#<#{self.class} airport=#{airport&.id.inspect} name=#{name.inspect}>) end |
#to_uid ⇒ String
Returns UID markup.
129 130 131 132 133 134 135 |
# File 'lib/aixm/component/fato.rb', line 129 def to_uid builder = Builder::XmlMarkup.new(indent: 2) builder.FtoUid do |fto_uid| fto_uid << airport.to_uid.indent(2) fto_uid.txtDesig(name) end end |
#to_xml ⇒ String
Returns AIXM or OFMX markup.
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/aixm/component/fato.rb', line 138 def to_xml builder = Builder::XmlMarkup.new(indent: 2) builder.Fto do |fto| fto << to_uid.indent(2) fto.valLen(length.dist.trim) if length fto.valWid(width.dist.trim) if width fto.uomDim(length.unit.to_s.upcase) if length fto.uomDim(width.unit.to_s.upcase) if width && !length unless (xml = surface.to_xml).empty? fto << xml.indent(2) end fto.txtProfile(profile) if profile fto.txtMarking(marking) if marking fto.codeSts(STATUSES.key(status).to_s) if status fto.txtRmk(remarks) if remarks end directions.values.each do |direction| builder << direction.to_xml end builder.target! end |