nmea_plus 1.0.21 → 1.0.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/nmea_plus/message/ais/vdm_payload/mmsi_info.rb +1 -0
- data/lib/nmea_plus/message/ais/vdm_payload/payload.rb +2 -0
- data/lib/nmea_plus/message/ais/vdm_payload/sub_area.rb +17 -0
- data/lib/nmea_plus/message/ais/vdm_payload/vdm_msg6d1022f61.rb +1 -0
- data/lib/nmea_plus/message/nmea/dcn.rb +1 -0
- data/lib/nmea_plus/message/nmea/dtm.rb +2 -0
- data/lib/nmea_plus/message/nmea/gga.rb +2 -0
- data/lib/nmea_plus/message/nmea/gll.rb +2 -0
- data/lib/nmea_plus/message/nmea/gns.rb +2 -0
- data/lib/nmea_plus/message/nmea/hdg.rb +2 -0
- data/lib/nmea_plus/message/nmea/oln.rb +4 -3
- data/lib/nmea_plus/message/nmea/rma.rb +3 -0
- data/lib/nmea_plus/message/nmea/rmb.rb +2 -0
- data/lib/nmea_plus/message/nmea/rmc.rb +4 -0
- data/lib/nmea_plus/message/nmea/rnn.rb +1 -0
- data/lib/nmea_plus/message/nmea/slc.rb +6 -5
- data/lib/nmea_plus/message/nmea/str.rb +1 -0
- data/lib/nmea_plus/message/nmea/vtg.rb +4 -0
- data/lib/nmea_plus/message/nmea/wpl.rb +2 -0
- data/lib/nmea_plus/message/nmea/zda.rb +1 -0
- data/lib/nmea_plus/version.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7c0c98fc5071f09522c714c193ed0f2ee652f81c4f2691451ddfd67f571b0d7
|
4
|
+
data.tar.gz: 2608a5591399530744687f78a58ddb885984d76d7dfbc7297533ebc432713b5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 794ae47cd9e5a59cbc437dcef6694040e8979d71578d142ab3ed42416185d6efead51231416f7ad87b84221f90328ca3b2d38b66ee571419d9f0e9b863e5bb0c
|
7
|
+
data.tar.gz: 135a44b2005b71cb4834975af78afd0b06fadfd3c9911df8f188126837f6677bcb5f62241b246fc411bea12fe9191ccabb5d2b505ffe448a3b3d3c916a9cd733
|
data/README.md
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/nmea_plus.svg)](https://rubygems.org/gems/nmea_plus)
|
4
4
|
[![Build Status](https://travis-ci.org/ianfixes/nmea_plus.svg)](https://travis-ci.org/ianfixes/nmea_plus)
|
5
|
-
[![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/nmea_plus/1.0.
|
5
|
+
[![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/nmea_plus/1.0.22)
|
6
|
+
[![Documentation completeness](http://inch-ci.org/github/ianfixes/nmea_plus.svg?branch=master)](http://inch-ci.org/github/ianfixes/nmea_plus)
|
6
7
|
|
7
8
|
[NMEA Plus](https://github.com/ianfixes/nmea_plus) is a Ruby gem for parsing and decoding "GPS" messages: NMEA, AIS, and any other similar formats of short messaging typically used by marine equipment. It provides convenient access (by name) to the fields of each message type, and a stream reader designed for use with Ruby Blocks.
|
8
9
|
|
@@ -42,6 +42,8 @@ module NMEAPlus
|
|
42
42
|
end
|
43
43
|
|
44
44
|
# Return an object by its class name, or nil if it isn't defined
|
45
|
+
# @param class_identifier [String] The ruby class identifier
|
46
|
+
# @return [Object] An object of the given class
|
45
47
|
def _object_by_name(class_identifier)
|
46
48
|
Object::const_get(class_identifier).new
|
47
49
|
rescue ::NameError
|
@@ -104,8 +104,25 @@ module NMEAPlus
|
|
104
104
|
|
105
105
|
# Container for bearing / distance
|
106
106
|
class ShapePoint
|
107
|
+
# @overload bearing
|
108
|
+
# @return [Integer]
|
109
|
+
# @overload bearing=(Integer)
|
110
|
+
# Sets bearing
|
111
|
+
# @param [Integer] new value
|
107
112
|
attr_accessor :bearing
|
113
|
+
|
114
|
+
# @overload distance
|
115
|
+
# @return [Integer]
|
116
|
+
# @overload distance=(Integer)
|
117
|
+
# Sets distance
|
118
|
+
# @param [Integer] new value
|
108
119
|
attr_accessor :distance
|
120
|
+
|
121
|
+
# @overload scale_factor
|
122
|
+
# @return [Integer]
|
123
|
+
# @overload scale_factor=(Integer)
|
124
|
+
# Sets scale factor
|
125
|
+
# @param [Integer] new value
|
109
126
|
attr_accessor :scale_factor
|
110
127
|
|
111
128
|
# @!parse attr_reader :distance_meters
|
@@ -8,12 +8,14 @@ module NMEAPlus
|
|
8
8
|
field_reader :code, 1, :_string
|
9
9
|
field_reader :subcode, 2, :_string
|
10
10
|
|
11
|
+
# Latitude offset in degrees
|
11
12
|
# @!parse attr_reader :latitude_offset
|
12
13
|
# @return [Float]
|
13
14
|
def latitude_offset
|
14
15
|
self.class.nsew_signed_float(@fields[3], @fields[4])
|
15
16
|
end
|
16
17
|
|
18
|
+
# Longitude offset in degrees
|
17
19
|
# @!parse attr_reader :longitude_offset
|
18
20
|
# @return [Float]
|
19
21
|
def longitude_offset
|
@@ -8,12 +8,14 @@ module NMEAPlus
|
|
8
8
|
class GGA < NMEAPlus::Message::NMEA::NMEAMessage
|
9
9
|
field_reader :fix_time, 1, :_utctime_hms
|
10
10
|
|
11
|
+
# Latitude in degrees
|
11
12
|
# @!parse attr_reader :latitude
|
12
13
|
# @return [Float]
|
13
14
|
def latitude
|
14
15
|
self.class.degrees_minutes_to_decimal(@fields[2], @fields[3])
|
15
16
|
end
|
16
17
|
|
18
|
+
# Longitude in degrees
|
17
19
|
# @!parse attr_reader :longitude
|
18
20
|
# @return [Float]
|
19
21
|
def longitude
|
@@ -6,12 +6,14 @@ module NMEAPlus
|
|
6
6
|
# GLL - Geographic Position - Latitude/Longitude
|
7
7
|
class GLL < NMEAPlus::Message::NMEA::NMEAMessage
|
8
8
|
|
9
|
+
# Latitude in degrees
|
9
10
|
# @!parse attr_reader :latitude
|
10
11
|
# @return [Float]
|
11
12
|
def latitude
|
12
13
|
self.class.degrees_minutes_to_decimal(@fields[1], @fields[2])
|
13
14
|
end
|
14
15
|
|
16
|
+
# Longitude in degrees
|
15
17
|
# @!parse attr_reader :longitude
|
16
18
|
# @return [Float]
|
17
19
|
def longitude
|
@@ -8,12 +8,14 @@ module NMEAPlus
|
|
8
8
|
class GNS < NMEAPlus::Message::NMEA::NMEAMessage
|
9
9
|
field_reader :fix_time, 1, :_utctime_hms
|
10
10
|
|
11
|
+
# Latitude in degrees
|
11
12
|
# @!parse attr_reader :latitude
|
12
13
|
# @return [Float]
|
13
14
|
def latitude
|
14
15
|
self.class.degrees_minutes_to_decimal(@fields[2], @fields[3])
|
15
16
|
end
|
16
17
|
|
18
|
+
# Longitude in degrees
|
17
19
|
# @!parse attr_reader :longitude
|
18
20
|
# @return [Float]
|
19
21
|
def longitude
|
@@ -6,12 +6,14 @@ module NMEAPlus
|
|
6
6
|
# HDG - Heading - Deviation & Variation
|
7
7
|
class HDG < NMEAPlus::Message::NMEA::HDM
|
8
8
|
|
9
|
+
# Magnetic deviation in degrees
|
9
10
|
# @!parse attr_reader :magnetic_deviation_degrees
|
10
11
|
# @return [Float]
|
11
12
|
def magnetic_deviation_degrees
|
12
13
|
self.class.nsew_signed_float(@fields[2], @fields[3])
|
13
14
|
end
|
14
15
|
|
16
|
+
# Magnetic variation in degrees
|
15
17
|
# @!parse attr_reader :magnetic_variation_degrees
|
16
18
|
# @return [Float]
|
17
19
|
def magnetic_variation_degrees
|
@@ -11,16 +11,17 @@ module NMEAPlus
|
|
11
11
|
# container for Omega lane indicators
|
12
12
|
class OmegaLanePair
|
13
13
|
# @return [String]
|
14
|
-
|
14
|
+
attr_reader :label
|
15
15
|
|
16
16
|
# first item in the pair
|
17
17
|
# @return [Float]
|
18
|
-
|
18
|
+
attr_reader :first
|
19
19
|
|
20
20
|
# second item in the pair
|
21
21
|
# @return [Float]
|
22
|
-
|
22
|
+
attr_reader :second
|
23
23
|
|
24
|
+
# Create an instance of this container class
|
24
25
|
# @param arr [Array] a string and 2 integers
|
25
26
|
def initialize(arr)
|
26
27
|
@label = arr[0]
|
@@ -8,12 +8,14 @@ module NMEAPlus
|
|
8
8
|
|
9
9
|
field_reader :blink_warning, 1, :_av_boolean
|
10
10
|
|
11
|
+
# Latitude in degrees
|
11
12
|
# @!parse attr_reader :latitude
|
12
13
|
# @return [Float]
|
13
14
|
def latitude
|
14
15
|
self.class.degrees_minutes_to_decimal(@fields[2], @fields[3])
|
15
16
|
end
|
16
17
|
|
18
|
+
# Longitude in degrees
|
17
19
|
# @!parse attr_reader :longitude
|
18
20
|
# @return [Float]
|
19
21
|
def longitude
|
@@ -25,6 +27,7 @@ module NMEAPlus
|
|
25
27
|
field_reader :speed_over_ground_knots, 8, :_float
|
26
28
|
field_reader :track_made_good_degrees_true, 9, :_float
|
27
29
|
|
30
|
+
# Magnetic variation in degrees
|
28
31
|
# @!parse attr_reader :magnetic_variation_degrees
|
29
32
|
# @return [Float]
|
30
33
|
def magnetic_variation_degrees
|
@@ -12,12 +12,14 @@ module NMEAPlus
|
|
12
12
|
field_reader :waypoint_to, 4, :_integer
|
13
13
|
field_reader :waypoint_from, 5, :_integer
|
14
14
|
|
15
|
+
# Waypoint latitude in degrees
|
15
16
|
# @!parse attr_reader :waypoint_latitude
|
16
17
|
# @return [Float]
|
17
18
|
def waypoint_latitude
|
18
19
|
self.class.degrees_minutes_to_decimal(@fields[6], @fields[7])
|
19
20
|
end
|
20
21
|
|
22
|
+
# Waypoint longitude in degrees
|
21
23
|
# @!parse attr_reader :waypoint_longitude
|
22
24
|
# @return [Float]
|
23
25
|
def waypoint_longitude
|
@@ -6,6 +6,7 @@ module NMEAPlus
|
|
6
6
|
# RMC - Recommended Minimum Navigation Information
|
7
7
|
class RMC < NMEAPlus::Message::NMEA::NMEAMessage
|
8
8
|
|
9
|
+
# UTC time
|
9
10
|
# @!parse attr_reader :utc_time
|
10
11
|
# @return [Time]
|
11
12
|
def utc_time
|
@@ -14,12 +15,14 @@ module NMEAPlus
|
|
14
15
|
|
15
16
|
field_reader :active?, 2, :_av_boolean
|
16
17
|
|
18
|
+
# Latitude in degrees
|
17
19
|
# @!parse attr_reader :latitude
|
18
20
|
# @return [Float]
|
19
21
|
def latitude
|
20
22
|
self.class.degrees_minutes_to_decimal(@fields[3], @fields[4])
|
21
23
|
end
|
22
24
|
|
25
|
+
# Longitude in degrees
|
23
26
|
# @!parse attr_reader :longitude
|
24
27
|
# @return [Float]
|
25
28
|
def longitude
|
@@ -29,6 +32,7 @@ module NMEAPlus
|
|
29
32
|
field_reader :speed_over_ground_knots, 7, :_float
|
30
33
|
field_reader :track_made_good_degrees_true, 8, :_float
|
31
34
|
|
35
|
+
# Magnetic variation in degrees
|
32
36
|
# @!parse attr_reader :magnetic_variation_degrees
|
33
37
|
# @return [Float]
|
34
38
|
def magnetic_variation_degrees
|
@@ -10,25 +10,26 @@ module NMEAPlus
|
|
10
10
|
class SLCStationReport
|
11
11
|
# Used in lat/lon calculation
|
12
12
|
# @return [Boolean]
|
13
|
-
|
13
|
+
attr_reader :used_in_calculation
|
14
14
|
|
15
15
|
# Status: Blink Warning Flag
|
16
16
|
# @return [Boolean]
|
17
|
-
|
17
|
+
attr_reader :blink_warning
|
18
18
|
|
19
19
|
# Status: Cycle Lock Warning Flag
|
20
20
|
# @return [Boolean]
|
21
|
-
|
21
|
+
attr_reader :cycle_lock_warning
|
22
22
|
|
23
23
|
# Status: SNR Warning Flag
|
24
24
|
# @return [Boolean]
|
25
|
-
|
25
|
+
attr_reader :snr_warning
|
26
26
|
|
27
27
|
# SNR value, 000 to 999
|
28
28
|
# @return [Integer]
|
29
|
-
|
29
|
+
attr_reader :snr
|
30
30
|
|
31
31
|
# @param arr [Array<String, Integer>] a string and 2 integers
|
32
|
+
# @param is_master [Boolean] Whether this station is the master
|
32
33
|
def initialize(arr, is_master)
|
33
34
|
@arr = arr
|
34
35
|
@used_in_calculation = is_master ? true : NMEA::NMEAMessage._av_boolean(arr[0])
|
@@ -13,6 +13,7 @@ module NMEAPlus
|
|
13
13
|
|
14
14
|
field_reader :track_degrees_true, 1, :_float
|
15
15
|
|
16
|
+
# Track in degrees, magnetic
|
16
17
|
# @!parse attr_reader :track_degrees_magnetic
|
17
18
|
# @return [Float]
|
18
19
|
def track_degrees_magnetic
|
@@ -21,6 +22,7 @@ module NMEAPlus
|
|
21
22
|
@fields[f].to_f
|
22
23
|
end
|
23
24
|
|
25
|
+
# Speed in knots
|
24
26
|
# @!parse attr_reader :speed_knots
|
25
27
|
# @return [Float]
|
26
28
|
def speed_knots
|
@@ -29,6 +31,7 @@ module NMEAPlus
|
|
29
31
|
@fields[f].to_f
|
30
32
|
end
|
31
33
|
|
34
|
+
# Speed in km/h
|
32
35
|
# @!parse attr_reader :speed_kmh
|
33
36
|
# @return [Float]
|
34
37
|
def speed_kmh
|
@@ -37,6 +40,7 @@ module NMEAPlus
|
|
37
40
|
@fields[f].to_f
|
38
41
|
end
|
39
42
|
|
43
|
+
# FAA Mode
|
40
44
|
# @!parse attr_reader :faa_mode
|
41
45
|
# @return [String]
|
42
46
|
def faa_mode
|
@@ -5,12 +5,14 @@ module NMEAPlus
|
|
5
5
|
module NMEA
|
6
6
|
# WPL - Waypoint Location
|
7
7
|
class WPL < NMEAPlus::Message::NMEA::NMEAMessage
|
8
|
+
# Latitude in degrees
|
8
9
|
# @!parse attr_reader :latitude
|
9
10
|
# @return [Float]
|
10
11
|
def latitude
|
11
12
|
self.class.degrees_minutes_to_decimal(@fields[1], @fields[2])
|
12
13
|
end
|
13
14
|
|
15
|
+
# Longitude in degrees
|
14
16
|
# @!parse attr_reader :longitude
|
15
17
|
# @return [Float]
|
16
18
|
def longitude
|
data/lib/nmea_plus/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nmea_plus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Katz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: racc
|
@@ -70,20 +70,20 @@ dependencies:
|
|
70
70
|
requirements:
|
71
71
|
- - "~>"
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version:
|
73
|
+
version: 0.50.0
|
74
74
|
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: 0.
|
76
|
+
version: 0.50.0
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
83
|
+
version: 0.50.0
|
84
84
|
- - ">="
|
85
85
|
- !ruby/object:Gem::Version
|
86
|
-
version: 0.
|
86
|
+
version: 0.50.0
|
87
87
|
- !ruby/object:Gem::Dependency
|
88
88
|
name: rspec
|
89
89
|
requirement: !ruby/object:Gem::Requirement
|
@@ -164,20 +164,20 @@ dependencies:
|
|
164
164
|
requirements:
|
165
165
|
- - "~>"
|
166
166
|
- !ruby/object:Gem::Version
|
167
|
-
version:
|
167
|
+
version: 0.9.11
|
168
168
|
- - ">="
|
169
169
|
- !ruby/object:Gem::Version
|
170
|
-
version:
|
170
|
+
version: 0.9.11
|
171
171
|
type: :development
|
172
172
|
prerelease: false
|
173
173
|
version_requirements: !ruby/object:Gem::Requirement
|
174
174
|
requirements:
|
175
175
|
- - "~>"
|
176
176
|
- !ruby/object:Gem::Version
|
177
|
-
version:
|
177
|
+
version: 0.9.11
|
178
178
|
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
180
|
+
version: 0.9.11
|
181
181
|
description: "A pure-ruby parser and decoder toolkit for NMEA messages (GPS, AIS,
|
182
182
|
and other similar formats)\n that provides convenient access
|
183
183
|
to all data fields. All standard NMEA messages,\n nearly
|