Class: IGC::Fix

Inherits:
Object
  • Object
show all
Defined in:
lib/igc/fix.rb

Overview

IGC::Fix represents a single fix in a recorder flight

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFix

Returns a new instance of Fix.



23
24
25
# File 'lib/igc/fix.rb', line 23

def initialize
  @extensions = {}
end

Instance Attribute Details

#air_speedObject

Returns the value of attribute air_speed.



6
7
8
# File 'lib/igc/fix.rb', line 6

def air_speed
  @air_speed
end

#compensated_variomenterObject

Returns the value of attribute compensated_variomenter.



6
7
8
# File 'lib/igc/fix.rb', line 6

def compensated_variomenter
  @compensated_variomenter
end

#extensionsObject

Returns the value of attribute extensions.



6
7
8
# File 'lib/igc/fix.rb', line 6

def extensions
  @extensions
end

#gps_altitudeObject

Returns the value of attribute gps_altitude.



6
7
8
# File 'lib/igc/fix.rb', line 6

def gps_altitude
  @gps_altitude
end

#horizontal_accuracyObject

Returns the value of attribute horizontal_accuracy.



6
7
8
# File 'lib/igc/fix.rb', line 6

def horizontal_accuracy
  @horizontal_accuracy
end

#locationObject

Returns the value of attribute location.



6
7
8
# File 'lib/igc/fix.rb', line 6

def location
  @location
end

#magnetic_headingObject

Returns the value of attribute magnetic_heading.



6
7
8
# File 'lib/igc/fix.rb', line 6

def magnetic_heading
  @magnetic_heading
end

#pressure_altitudeObject

Returns the value of attribute pressure_altitude.



6
7
8
# File 'lib/igc/fix.rb', line 6

def pressure_altitude
  @pressure_altitude
end

#satellite_in_useObject

Returns the value of attribute satellite_in_use.



6
7
8
# File 'lib/igc/fix.rb', line 6

def satellite_in_use
  @satellite_in_use
end

#timeObject

Returns the value of attribute time.



6
7
8
# File 'lib/igc/fix.rb', line 6

def time
  @time
end

#true_headingObject

Returns the value of attribute true_heading.



6
7
8
# File 'lib/igc/fix.rb', line 6

def true_heading
  @true_heading
end

#uncompensated_variometerObject

Returns the value of attribute uncompensated_variometer.



6
7
8
# File 'lib/igc/fix.rb', line 6

def uncompensated_variometer
  @uncompensated_variometer
end

#validityObject

Returns the value of attribute validity.



6
7
8
# File 'lib/igc/fix.rb', line 6

def validity
  @validity
end

#vertical_accuracyObject

Returns the value of attribute vertical_accuracy.



6
7
8
# File 'lib/igc/fix.rb', line 6

def vertical_accuracy
  @vertical_accuracy
end

#wind_directionObject

Returns the value of attribute wind_direction.



6
7
8
# File 'lib/igc/fix.rb', line 6

def wind_direction
  @wind_direction
end

#wind_speedObject

Returns the value of attribute wind_speed.



6
7
8
# File 'lib/igc/fix.rb', line 6

def wind_speed
  @wind_speed
end

Instance Method Details

#assign_known_extensions!Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/igc/fix.rb', line 27

def assign_known_extensions!
  @extensions.each do |key, value|
    case key
    when "HDM"
      @magnetic_heading = value.to_i
    when "HDT"
      @true_heading = value.to_i
    when "IAS"
      @air_speed = value.to_i
    when "SIU"
      @satellite_in_use = value.to_i
    when "WDI"
      @wind_direction = value.to_i
    when "WSP"
      @wind_speed = value.to_i
    when "FXA"
      @horizontal_accuracy = value.to_i
    when "VXA"
      @vertical_accuracy = value.to_i
    when "VAT"
      @compensated_variomenter = value.to_i / 100
    when "VAR"
      @uncompensated_variometer = value.to_i / 100
    end
  end
end