Class: Jeti::Log::Data::MGPSData
- Inherits:
-
Object
- Object
- Jeti::Log::Data::MGPSData
- Defined in:
- lib/jeti/log/data/mgps_data.rb
Instance Attribute Summary collapse
-
#azimuth ⇒ Object
readonly
Returns the value of attribute azimuth.
-
#course ⇒ Object
readonly
Returns the value of attribute course.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#distance(unit = :meters) ⇒ Float
readonly
Gets the distance from point of origin, in desired unit.
-
#impulse ⇒ Object
readonly
Returns the value of attribute impulse.
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
-
#quality ⇒ Object
readonly
Returns the value of attribute quality.
-
#satellite_count ⇒ Object
readonly
Returns the value of attribute satellite_count.
-
#speed(unit = :mps) ⇒ Float
readonly
Gets the ground speed, in desired unit.
-
#stamp ⇒ Object
readonly
Returns the value of attribute stamp.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#altitude(unit = :meters) ⇒ Float
Gets the altitude, in desired unit.
-
#initialize(time, fields) ⇒ MGPSData
constructor
A new instance of MGPSData.
-
#relative_altitude(unit = :meters) ⇒ Float
Gets the relative altitude, in desired unit.
-
#trip(unit = :meters) ⇒ Float
Gets the traveled path length, in desired unit.
Constructor Details
#initialize(time, fields) ⇒ MGPSData
Returns a new instance of MGPSData.
18 19 20 21 22 23 24 |
# File 'lib/jeti/log/data/mgps_data.rb', line 18 def initialize(time, fields) raise ArgumentError unless fields.length == 14 @time = time @stamp, @latitude, @longitude, @quality, @satellite_count, @altitude, @distance, @speed, @relative_altitude, @course, @azimuth, @impulse, @trip, @date = fields end |
Instance Attribute Details
#azimuth ⇒ Object (readonly)
Returns the value of attribute azimuth.
14 15 16 |
# File 'lib/jeti/log/data/mgps_data.rb', line 14 def azimuth @azimuth end |
#course ⇒ Object (readonly)
Returns the value of attribute course.
13 14 15 |
# File 'lib/jeti/log/data/mgps_data.rb', line 13 def course @course end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
16 17 18 |
# File 'lib/jeti/log/data/mgps_data.rb', line 16 def date @date end |
#distance(unit = :meters) ⇒ Float (readonly)
Gets the distance from point of origin, in desired unit.
38 39 40 |
# File 'lib/jeti/log/data/mgps_data.rb', line 38 def distance @distance end |
#impulse ⇒ Object (readonly)
Returns the value of attribute impulse.
15 16 17 |
# File 'lib/jeti/log/data/mgps_data.rb', line 15 def impulse @impulse end |
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
7 8 9 |
# File 'lib/jeti/log/data/mgps_data.rb', line 7 def latitude @latitude end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
8 9 10 |
# File 'lib/jeti/log/data/mgps_data.rb', line 8 def longitude @longitude end |
#quality ⇒ Object (readonly)
Returns the value of attribute quality.
9 10 11 |
# File 'lib/jeti/log/data/mgps_data.rb', line 9 def quality @quality end |
#satellite_count ⇒ Object (readonly)
Returns the value of attribute satellite_count.
10 11 12 |
# File 'lib/jeti/log/data/mgps_data.rb', line 10 def satellite_count @satellite_count end |
#speed(unit = :mps) ⇒ Float (readonly)
Gets the ground speed, in desired unit.
54 55 56 |
# File 'lib/jeti/log/data/mgps_data.rb', line 54 def speed @speed end |
#stamp ⇒ Object (readonly)
Returns the value of attribute stamp.
6 7 8 |
# File 'lib/jeti/log/data/mgps_data.rb', line 6 def stamp @stamp end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
5 6 7 |
# File 'lib/jeti/log/data/mgps_data.rb', line 5 def time @time end |
Instance Method Details
#altitude(unit = :meters) ⇒ Float
Gets the altitude, in desired unit.
30 31 32 |
# File 'lib/jeti/log/data/mgps_data.rb', line 30 def altitude(unit = :meters) convert_length(@altitude, unit) end |
#relative_altitude(unit = :meters) ⇒ Float
Gets the relative altitude, in desired unit.
46 47 48 |
# File 'lib/jeti/log/data/mgps_data.rb', line 46 def relative_altitude(unit = :meters) convert_length(@relative_altitude, unit) end |
#trip(unit = :meters) ⇒ Float
Gets the traveled path length, in desired unit.
62 63 64 |
# File 'lib/jeti/log/data/mgps_data.rb', line 62 def trip(unit = :meters) convert_length(@trip, unit) end |