nmea_plus 1.0.19 → 1.0.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +23 -4
  3. data/lib/nmea_plus/ais_message_factory.rb +2 -3
  4. data/lib/nmea_plus/message/ais/vdo.rb +14 -0
  5. data/lib/nmea_plus/message/base.rb +17 -9
  6. data/lib/nmea_plus/message/nmea/apa.rb +24 -0
  7. data/lib/nmea_plus/message/nmea/base_nmea.rb +2 -2
  8. data/lib/nmea_plus/message/nmea/bec.rb +12 -0
  9. data/lib/nmea_plus/message/nmea/ber.rb +17 -0
  10. data/lib/nmea_plus/message/nmea/bpi.rb +17 -0
  11. data/lib/nmea_plus/message/nmea/bwr.rb +10 -0
  12. data/lib/nmea_plus/message/nmea/dbk.rb +9 -0
  13. data/lib/nmea_plus/message/nmea/dbs.rb +4 -0
  14. data/lib/nmea_plus/message/nmea/dcn.rb +47 -1
  15. data/lib/nmea_plus/message/nmea/dru.rb +33 -0
  16. data/lib/nmea_plus/message/nmea/gda.rb +39 -0
  17. data/lib/nmea_plus/message/nmea/gdf.rb +19 -0
  18. data/lib/nmea_plus/message/nmea/gdp.rb +19 -0
  19. data/lib/nmea_plus/message/nmea/gla.rb +20 -0
  20. data/lib/nmea_plus/message/nmea/glf.rb +19 -0
  21. data/lib/nmea_plus/message/nmea/glp.rb +19 -0
  22. data/lib/nmea_plus/message/nmea/goa.rb +20 -0
  23. data/lib/nmea_plus/message/nmea/gof.rb +19 -0
  24. data/lib/nmea_plus/message/nmea/gop.rb +19 -0
  25. data/lib/nmea_plus/message/nmea/gtd.rb +12 -0
  26. data/lib/nmea_plus/message/nmea/gxa.rb +14 -18
  27. data/lib/nmea_plus/message/nmea/gxf.rb +19 -0
  28. data/lib/nmea_plus/message/nmea/gxp.rb +19 -0
  29. data/lib/nmea_plus/message/nmea/hcc.rb +17 -0
  30. data/lib/nmea_plus/message/nmea/hcd.rb +28 -0
  31. data/lib/nmea_plus/message/nmea/hdg.rb +0 -1
  32. data/lib/nmea_plus/message/nmea/hdm.rb +5 -0
  33. data/lib/nmea_plus/message/nmea/hdt.rb +2 -0
  34. data/lib/nmea_plus/message/nmea/htc.rb +11 -0
  35. data/lib/nmea_plus/message/nmea/hvd.rb +23 -0
  36. data/lib/nmea_plus/message/nmea/hvm.rb +15 -0
  37. data/lib/nmea_plus/message/nmea/ima.rb +40 -0
  38. data/lib/nmea_plus/message/nmea/mda.rb +44 -0
  39. data/lib/nmea_plus/message/nmea/mhu.rb +22 -0
  40. data/lib/nmea_plus/message/nmea/mmb.rb +19 -0
  41. data/lib/nmea_plus/message/nmea/mta.rb +16 -0
  42. data/lib/nmea_plus/message/nmea/mwh.rb +18 -0
  43. data/lib/nmea_plus/message/nmea/mws.rb +18 -0
  44. data/lib/nmea_plus/message/nmea/oln.rb +42 -3
  45. data/lib/nmea_plus/message/nmea/olw.rb +15 -0
  46. data/lib/nmea_plus/message/nmea/omp.rb +16 -0
  47. data/lib/nmea_plus/message/nmea/onz.rb +14 -0
  48. data/lib/nmea_plus/message/nmea/{pashr.rb → proprietary/pashr.rb} +1 -1
  49. data/lib/nmea_plus/message/nmea/r00.rb +9 -1
  50. data/lib/nmea_plus/message/nmea/rmc.rb +1 -1
  51. data/lib/nmea_plus/message/nmea/rnn.rb +18 -0
  52. data/lib/nmea_plus/message/nmea/sbk.rb +17 -0
  53. data/lib/nmea_plus/message/nmea/scd.rb +22 -0
  54. data/lib/nmea_plus/message/nmea/scy.rb +17 -0
  55. data/lib/nmea_plus/message/nmea/sdb.rb +14 -0
  56. data/lib/nmea_plus/message/nmea/sgd.rb +21 -0
  57. data/lib/nmea_plus/message/nmea/sgr.rb +22 -0
  58. data/lib/nmea_plus/message/nmea/siu.rb +21 -0
  59. data/lib/nmea_plus/message/nmea/slc.rb +66 -0
  60. data/lib/nmea_plus/message/nmea/snc.rb +35 -0
  61. data/lib/nmea_plus/message/nmea/snu.rb +18 -0
  62. data/lib/nmea_plus/message/nmea/sps.rb +14 -0
  63. data/lib/nmea_plus/message/nmea/ssf.rb +29 -0
  64. data/lib/nmea_plus/message/nmea/stc.rb +12 -0
  65. data/lib/nmea_plus/message/nmea/str.rb +38 -0
  66. data/lib/nmea_plus/message/nmea/sys.rb +29 -0
  67. data/lib/nmea_plus/message/nmea/tec.rb +20 -0
  68. data/lib/nmea_plus/message/nmea/tep.rb +14 -0
  69. data/lib/nmea_plus/message/nmea/tga.rb +20 -0
  70. data/lib/nmea_plus/message/nmea/tif.rb +35 -0
  71. data/lib/nmea_plus/message/nmea/trf.rb +17 -1
  72. data/lib/nmea_plus/message/nmea/trp.rb +14 -0
  73. data/lib/nmea_plus/message/nmea/trs.rb +41 -0
  74. data/lib/nmea_plus/message/nmea/vcd.rb +23 -0
  75. data/lib/nmea_plus/message/nmea/vpe.rb +17 -0
  76. data/lib/nmea_plus/message/nmea/vta.rb +23 -0
  77. data/lib/nmea_plus/message/nmea/vti.rb +23 -0
  78. data/lib/nmea_plus/message/nmea/vwe.rb +14 -0
  79. data/lib/nmea_plus/message/nmea/vwr.rb +15 -2
  80. data/lib/nmea_plus/message/nmea/vwt.rb +35 -0
  81. data/lib/nmea_plus/message/nmea/wdc.rb +20 -0
  82. data/lib/nmea_plus/message/nmea/wdr.rb +12 -0
  83. data/lib/nmea_plus/message/nmea/wfm.rb +12 -0
  84. data/lib/nmea_plus/message/nmea/wnc.rb +7 -0
  85. data/lib/nmea_plus/message/nmea/wnr.rb +12 -0
  86. data/lib/nmea_plus/message/nmea/ywp.rb +17 -0
  87. data/lib/nmea_plus/message/nmea/yws.rb +26 -0
  88. data/lib/nmea_plus/message/nmea/zaa.rb +14 -0
  89. data/lib/nmea_plus/message/nmea/zcd.rb +25 -0
  90. data/lib/nmea_plus/message/nmea/zev.rb +25 -0
  91. data/lib/nmea_plus/message/nmea/zfi.rb +15 -0
  92. data/lib/nmea_plus/message/nmea/zfo.rb +1 -1
  93. data/lib/nmea_plus/message/nmea/zlz.rb +19 -0
  94. data/lib/nmea_plus/message/nmea/zpi.rb +15 -0
  95. data/lib/nmea_plus/message/nmea/zta.rb +15 -0
  96. data/lib/nmea_plus/message/nmea/zte.rb +15 -0
  97. data/lib/nmea_plus/message/nmea/zti.rb +12 -0
  98. data/lib/nmea_plus/message/nmea/zwp.rb +12 -0
  99. data/lib/nmea_plus/message/nmea/zzu.rb +15 -0
  100. data/lib/nmea_plus/nmea_message_factory.rb +82 -2
  101. data/lib/nmea_plus/version.rb +1 -1
  102. metadata +79 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4f010527bee0d7b099f325462192d6a4bec777d
4
- data.tar.gz: 3ba3d24e2e9d7c528a715e78bcf75f9a2a8761c7
3
+ metadata.gz: 192fcfbfc6d0cd90c8aba5b8e96d1c32d3f9f914
4
+ data.tar.gz: 10a2a3d25d1adcf9bedc62412dc34bf603cb72b8
5
5
  SHA512:
6
- metadata.gz: 0c8e76585ed77014f380986bb8a096d153bf6623be0bbdfbd4ee995839112441faee45e494a91e23b538803644ed94735e4f4203804c98a879a6591b3d716d3b
7
- data.tar.gz: 13822fff593849931ed44fbcfaddee29799cb7c7cb0cea01f28d40449c4f3aa16b2c7f6c71bb558ba6963b087bdec317887ef5b9ac733759f6eda04e71d0a785
6
+ metadata.gz: 0eaec038db3ae98e857364218759576fe6458aa03d5853dbbd75aae2198d16734cfcaab2b3ca4b15117d047a981af5fa5b84a370c46a7bffb06ed56937b7ef57
7
+ data.tar.gz: f9f82e8c1f3a87778b8662c1825317032fe9a6d1f22310cd93e7833bbeb92e67cf3a5922f1ffaa2a23c9ad97be5ebcb219f40c4c4956eaf9be68a3f8f85a630e
data/README.md CHANGED
@@ -2,7 +2,7 @@
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/ifreecarve/nmea_plus.svg)](https://travis-ci.org/ifreecarve/nmea_plus)
5
- [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/nmea_plus/1.0.19)
5
+ [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/nmea_plus/1.0.20)
6
6
 
7
7
  [NMEA Plus](https://github.com/ifreecarve/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
8
 
@@ -86,12 +86,31 @@ end
86
86
 
87
87
  ## NMEA (GPS) Parsing
88
88
 
89
- This gem was coded to accept the standard NMEA messages defined in the unoffical spec found here:
90
- http://www.catb.org/gpsd/NMEA.txt
89
+ This gem was coded to accept the standard NMEA messages defined in the official and unoffical specs found here:
90
+
91
+ * http://www.catb.org/gpsd/NMEA.txt
92
+ * http://www.nmea.org/Assets/100108_nmea_0183_sentences_not_recommended_for_new_designs.pdf
91
93
 
92
94
  Because the message types are standard, if no override is found for a particular talker ID then the message will parse according to the command (the last 3 characters) of the data type. In other words, `$GPGLL` will use the general `GLL` message type. Currently, the following standard message types are supported:
93
95
 
94
- > AAM, ALM, APA, APB, BOD, BWC, BWR, BWW, DBK, DBS, DBT, DCN, DPT, DTM, FSI, GBS, GGA, GLC, GLL, GNS, GRS, GSA, GST, GSV, GTD, GXA, HDG, HDM, HDT, HFB, HSC, ITS, LCD, MSK, MSS, MTW, MWV, OLN, OSD, R00, RMA, RMB, RMC, ROT, RPM, RSA, RSD, RTE, SFI, STN, TDS, TFI, TPC, TPR, TPT, TRF, TTM, VBW, VDR, VHW, VLW, VPW, VTG, VWR, WCV, WNC, WPL, XDR, XTE, XTR, ZDA, ZFO, ZTG
96
+ > AAM, ALM, APA, APB,
97
+ > BEC, BER, BOD, BPI, BWC, BWR, BWW,
98
+ > DBK, DBS, DBT, DCN, DPT, DRU, DTM,
99
+ > FSI,
100
+ > GBS, GDA, GDF, GDP, GGA, GLA, GLC, GLF, GLL, GLP, GOA, GOF, GOP, GNS, GRS, GSA, GST, GSV, GTD, GXA, GXF, GXP,
101
+ > HCC, HCD, HDG, HDM, HDT, HFB, HSC, HTC, HVD, HVM,
102
+ > IMA, ITS,
103
+ > LCD,
104
+ > MDA, MHU, MMB, MSK, MSS, MTA, MTW, MWH, MWS, MWV,
105
+ > OLN, OLW, OMP, ONZ, OSD,
106
+ > Rnn (R00, R01, ...), RMA, RMB, RMC, RNN, ROT, RPM, RSA, RSD, RTE,
107
+ > SBK, SCD, SCY, SDB, SFI, SGD, SGR, SIU, SLC, SNC, SNU, SPS, SSF, STC, STN, STR, SYS
108
+ > TDS, TEC, TEP, TFI, TGA, TIF, TPC, TPR, TPT, TRF, TRP, TRS, TTM,
109
+ > VBW, VCD, VDR, VHW, VLW, VPE, VPW, VTA, VTG, VTI, VWE, VWR, VWT
110
+ > WCV, WDC, WDR, WFM, WNC, WNR, WPL,
111
+ > XDR, XTE, XTR,
112
+ > YWP, YWS,
113
+ > ZCD, ZDA, ZEV, ZFI, ZFO, ZLZ, ZPI, ZTA, ZTE, ZTG, ZTI, ZWP, ZZU
95
114
 
96
115
  Support for proprietary NMEA messages is also possible. PASHR is included as proof-of-concept.
97
116
 
@@ -2,6 +2,7 @@
2
2
  require_relative 'message_factory'
3
3
 
4
4
  require_relative 'message/ais/vdm'
5
+ require_relative 'message/ais/vdo'
5
6
 
6
7
  module NMEAPlus
7
8
 
@@ -19,9 +20,7 @@ module NMEAPlus
19
20
  # @return [Array] Array of data_type strings that we will attempt to use in decoding the message
20
21
  def self.alternate_data_type(data_type)
21
22
  # match last 3 digits (get rid of talker)
22
- ret = [data_type[2..4]]
23
- ret << "VDM" if data_type == "AIVDO"
24
- ret
23
+ [data_type[2..4]]
25
24
  end
26
25
  end
27
26
  end
@@ -0,0 +1,14 @@
1
+ require_relative "vdm"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module AIS
6
+
7
+ # VDO - Ownship Vessel Data Message
8
+ # This message type thinly wraps AIS payloads.
9
+ # @see NMEAPlus::Message::AIS::VDMPayload::VDMMsg
10
+ class VDO < NMEAPlus::Message::AIS::VDM
11
+ end
12
+ end
13
+ end
14
+ end
@@ -13,6 +13,14 @@ module NMEAPlus
13
13
  # Enable a shortcut syntax for message attribute accessors, in the style of `attr_accessor` metaprogramming.
14
14
  # This is used to create a named field pointing to a specific indexed field in the payload, optionally applying
15
15
  # a specific formatting function.
16
+ #
17
+ # The formatting function MUST be a static method on this class. This is a limitation caused by the desire
18
+ # to both (1) expose the formatters outside this class, and (2) use them for metaprogramming without the
19
+ # having to name the entire function. field_reader is a static method, so if not for the fact that
20
+ # `self.class.methods.include? formatter` fails to work for class methods in this context (unlike
21
+ # `self.methods.include?`, which properly finds instance methods), I would allow either one and just
22
+ # conditionally `self.class_eval` the proper definition
23
+ #
16
24
  # @param name [String] What the accessor will be called
17
25
  # @param field_num [Integer] The index of the field in the payload
18
26
  # @param formatter [Symbol] The symbol for the formatting function to apply to the field (optional)
@@ -24,7 +32,7 @@ module NMEAPlus
24
32
  if formatter.nil?
25
33
  self.class_eval("def #{name};@fields[#{field_num}];end")
26
34
  else
27
- self.class_eval("def #{name};#{formatter}(@fields[#{field_num}]);end")
35
+ self.class_eval("def #{name};self.class.#{formatter}(@fields[#{field_num}]);end")
28
36
  end
29
37
  end
30
38
 
@@ -158,7 +166,7 @@ module NMEAPlus
158
166
  # This function is meant to be passed as a formatter to {field_reader}.
159
167
  # @param field [String] the value in the field to be checked
160
168
  # @return [Integer] The value in the field or nil
161
- def _integer(field)
169
+ def self._integer(field)
162
170
  return nil if field.nil? || field.empty?
163
171
  field.to_i
164
172
  end
@@ -167,7 +175,7 @@ module NMEAPlus
167
175
  # This function is meant to be passed as a formatter to {field_reader}.
168
176
  # @param field [String] the value in the field to be checked
169
177
  # @return [Float] The value in the field or nil
170
- def _float(field)
178
+ def self._float(field)
171
179
  return nil if field.nil? || field.empty?
172
180
  field.to_f
173
181
  end
@@ -176,7 +184,7 @@ module NMEAPlus
176
184
  # This function is meant to be passed as a formatter to {field_reader}.
177
185
  # @param field [String] the value in the field to be checked
178
186
  # @return [String] The value in the field or nil
179
- def _string(field)
187
+ def self._string(field)
180
188
  return nil if field.nil? || field.empty?
181
189
  field
182
190
  end
@@ -185,7 +193,7 @@ module NMEAPlus
185
193
  # This function is meant to be passed as a formatter to {field_reader}.
186
194
  # @param field [String] the value in the field to be checked
187
195
  # @return [Integer] The value in the field or nil
188
- def _hex_to_integer(field)
196
+ def self._hex_to_integer(field)
189
197
  return nil if field.nil? || field.empty?
190
198
  field.hex
191
199
  end
@@ -194,7 +202,7 @@ module NMEAPlus
194
202
  # This function is meant to be passed as a formatter to {field_reader}.
195
203
  # @param field [String] the value in the field to be checked
196
204
  # @return [Time] The value in the field or nil
197
- def _utctime_hms(field)
205
+ def self._utctime_hms(field)
198
206
  return nil if field.nil? || field.empty?
199
207
  re_format = /(\d{2})(\d{2})(\d{2}(\.\d+)?)/
200
208
  now = Time.now
@@ -210,12 +218,12 @@ module NMEAPlus
210
218
  # This function is meant to be passed as a formatter to {field_reader}.
211
219
  # @param field [String] the value in the field to be checked
212
220
  # @return [Time] The value in the field or nil
213
- def _interval_hms(field)
221
+ def self._interval_hms(field)
214
222
  return nil if field.nil? || field.empty?
215
223
  re_format = /(\d{2})(\d{2})(\d{2}(\.\d+)?)/
216
224
  begin
217
225
  hms = re_format.match(field)
218
- Time.new(0, 0, 0, hms[1].to_i, hms[2].to_i, hms[3].to_f, '+00:00')
226
+ Time.new(0, 1, 1, hms[1].to_i, hms[2].to_i, hms[3].to_f, '+00:00')
219
227
  rescue
220
228
  nil
221
229
  end
@@ -225,7 +233,7 @@ module NMEAPlus
225
233
  # @param d_field [String] the date value in the field to be checked
226
234
  # @param t_field [String] the time value in the field to be checked
227
235
  # @return [Time] The value in the fields, or nil if either is not provided
228
- def _utc_date_time(d_field, t_field)
236
+ def self._utc_date_time(d_field, t_field)
229
237
  return nil if t_field.nil? || t_field.empty?
230
238
  return nil if d_field.nil? || d_field.empty?
231
239
 
@@ -4,16 +4,40 @@ module NMEAPlus
4
4
  module Message
5
5
  module NMEA
6
6
  # APA - Autopilot Sentence "A"
7
+ #
8
+ # Commonly used by autopilots this sentence contains navigation receiver warning flag status, cross-track-error, waypoint
9
+ # arrival status and initial bearing from origin waypoint to the destination waypoint for the active navigation leg of the
10
+ # journey.
11
+ # Use of $--APB with additional data fields of heading-to-steer and bearing from present position to destination is
12
+ # recommended.
13
+ # @see APB
7
14
  class APA < NMEAPlus::Message::NMEA::NMEAMessage
15
+ # Data Status: "OR" of Loran-C Blink and SNR warning flags
8
16
  field_reader :no_general_warning?, 1, :_av_boolean
17
+
18
+ # Data status: Loran-C Cycle Lock warning flag
9
19
  field_reader :no_cyclelock_warning?, 2, :_av_boolean
20
+
21
+ # Magnitude of XTE (cross-track-error)
10
22
  field_reader :cross_track_error, 3, :_float
23
+
24
+ # Direction to steer, L/R
11
25
  field_reader :direction_to_steer, 4, :_string
26
+
27
+ # XTE units, nautical miles
12
28
  field_reader :cross_track_units, 5, :_string
29
+
30
+ # Status: arrival circle entered
13
31
  field_reader :arrival_circle_entered?, 6, :_av_boolean
32
+
33
+ # Status: perpendicular passed at waypoint
14
34
  field_reader :perpendicular_passed?, 7, :_av_boolean
35
+
36
+ # Bearing origin to destination, Mag.
15
37
  field_reader :bearing_origin_to_destination, 8, :_float
16
38
  field_reader :compass_type, 9, :_string
39
+
40
+ # Destination waypoint ID
17
41
  field_reader :destination_waypoint_id, 10, :_string
18
42
  end
19
43
  end
@@ -31,7 +31,7 @@ module NMEAPlus
31
31
  # This function is meant to be passed as a formatter to {field_reader}.
32
32
  # @param field [String] the value in the field to be checked
33
33
  # @return [bool] The value in the field or nil
34
- def _av_boolean(field)
34
+ def self._av_boolean(field)
35
35
  case field
36
36
  when 'A' then return true
37
37
  when 'V' then return false
@@ -43,7 +43,7 @@ module NMEAPlus
43
43
  # This function is meant to be passed as a formatter to {field_reader}.
44
44
  # @param field [String] the value in the field to be checked
45
45
  # @return [bool] The value in the field or nil
46
- def _10_boolean(field)
46
+ def self._10_boolean(field)
47
47
  case field
48
48
  when '1' then return true
49
49
  when '0' then return false
@@ -0,0 +1,12 @@
1
+ require_relative "bwr"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # BEC - Bearing & Distance, Great Circle
7
+ # Same fields as BWR
8
+ class BEC < NMEAPlus::Message::NMEA::BWR
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,17 @@
1
+ require_relative "bwr"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # BER - Bearing & Distance to Waypoint, Dead Reckoning, Rhumb Line
7
+ # Same fields as BWR
8
+ #
9
+ # Time (UTC) and distance & bearing to, and location of, a specified waypoint from present position:
10
+ # Calculated along the rhumb line from a dead reckoned present position. The use of
11
+ # $--BEC using great circle calculations is recommended.
12
+ # @see BEC
13
+ class BER < NMEAPlus::Message::NMEA::BWR
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ require_relative "bwr"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # BPI - Bearing & Distance to Point of Interest
7
+ # Same fields as BWR
8
+ #
9
+ # Time (UTC) and distance & bearing to, and location of, a specified waypoint from present position:
10
+ # BPI: Calculated along a great circle path from a measured present position. Redundant with
11
+ # BWC, the use of $--BWC is recommended.
12
+ # @see BWC
13
+ class BPI < NMEAPlus::Message::NMEA::BWR
14
+ end
15
+ end
16
+ end
17
+ end
@@ -5,23 +5,33 @@ module NMEAPlus
5
5
  module NMEA
6
6
  # BWR - Bearing and Distance to Waypoint - Rhumb Line
7
7
  class BWR < NMEAPlus::Message::NMEA::NMEAMessage
8
+ # UTC of observation
8
9
  field_reader :utc_time, 1, :_utctime_hms
9
10
 
11
+ # Waypoint latitude, N/S
10
12
  # @!parse attr_reader :waypoint_latitude
11
13
  # @return [Float]
12
14
  def waypoint_latitude
13
15
  self.class.degrees_minutes_to_decimal(@fields[2], @fields[3])
14
16
  end
15
17
 
18
+ # Waypoint longitude, E/W
16
19
  # @!parse attr_reader :waypoint_longitude
17
20
  # @return [Float]
18
21
  def waypoint_longitude
19
22
  self.class.degrees_minutes_to_decimal(@fields[4], @fields[5])
20
23
  end
21
24
 
25
+ # Bearing, degrees True
22
26
  field_reader :bearing_true, 6, :_float
27
+
28
+ # Bearing, degrees Magnetic
23
29
  field_reader :bearing_magnetic, 8, :_float
30
+
31
+ # Distance, nautical miles
24
32
  field_reader :nautical_miles, 10, :_float
33
+
34
+ # Waypoint ID
25
35
  field_reader :waypoint_id, 12, :_string
26
36
 
27
37
  end
@@ -4,9 +4,18 @@ module NMEAPlus
4
4
  module Message
5
5
  module NMEA
6
6
  # DBK - Depth Below Keel
7
+ #
8
+ # Water depth referenced to the vessel's keel
9
+ # The use of $--DPT is recommended
10
+ # @see DPT
7
11
  class DBK < NMEAPlus::Message::NMEA::NMEAMessage
12
+ # Water depth, feet
8
13
  field_reader :depth_feet, 1, :_float
14
+
15
+ # Water depth, Meters
9
16
  field_reader :depth_meters, 3, :_float
17
+
18
+ # Water depth, Fathoms
10
19
  field_reader :depth_fathoms, 5, :_float
11
20
  end
12
21
  end
@@ -5,6 +5,10 @@ module NMEAPlus
5
5
  module Message
6
6
  module NMEA
7
7
  # DBS - Depth Below Surface
8
+ #
9
+ # Water depth referenced to the water surface
10
+ # The use of $--DPT is recommended
11
+ # @see DPT
8
12
  class DBS < NMEAPlus::Message::NMEA::DBK
9
13
  end
10
14
  end
@@ -3,24 +3,70 @@ require_relative "base_nmea"
3
3
  module NMEAPlus
4
4
  module Message
5
5
  module NMEA
6
- # DCN - Decca Position
6
+ # DCN - DECCA Position
7
+ #
8
+ # Status and lines-of-position for a specified DECCA chain.
7
9
  class DCN < NMEAPlus::Message::NMEA::NMEAMessage
10
+ # DECCA chain identifier
8
11
  field_reader :decca_chain_id, 1, :_integer
12
+
13
+ # Red zone identifier, number-letter
9
14
  field_reader :red_zone_id, 2, :_string
15
+
16
+ # Red line of position (LOP)
10
17
  field_reader :red_position_line, 3, :_float
18
+
19
+ # Status: Red-master line, true = Valid, false = Data not valid
11
20
  field_reader :red_master_line_ok?, 4, :_av_boolean
21
+
22
+ # Green zone identifier, number-letter
12
23
  field_reader :green_zone_id, 5, :_string
24
+
25
+ # Green line of position (LOP)
13
26
  field_reader :green_position_line, 6, :_float
27
+
28
+ # Status: Green-master line, true = Valid, false = Data not valid
14
29
  field_reader :green_master_line_ok?, 7, :_av_boolean
30
+
31
+ # Purple zone identifier, number-letter
15
32
  field_reader :purple_zone_id, 8, :_string
33
+
34
+ # Purple line of position (LOP)
16
35
  field_reader :purple_position_line, 9, :_float
36
+
37
+ # Status: Purple-master line, true = Valid, false = Data not valid
17
38
  field_reader :purple_master_line_ok?, 10, :_av_boolean
39
+
40
+ # Red-line navigation use
18
41
  field_reader :use_red_line_navigation?, 11, :_av_boolean
42
+
43
+ # Green-line navigation use
19
44
  field_reader :use_green_line_navigation?, 12, :_av_boolean
45
+
46
+ # Purple-line navigation use
20
47
  field_reader :use_purple_line_navigation?, 13, :_av_boolean
48
+
49
+ # Position uncertainty, n. miles
21
50
  field_reader :position_uncertainty, 14, :_float
22
51
  field_reader :position_uncertainty_units, 15, :_string
52
+
53
+ # Fix data basis:
54
+ #
55
+ # 1 = Normal pattern
56
+ # 2 = Lane identification pattern
57
+ # 3 = Lane identification transmissions
23
58
  field_reader :fix_data_basis, 16, :_integer
59
+
60
+ # @!parse attr_reader :fix_data_basis_description
61
+ # @return [String]
62
+ def fix_data_basis_description
63
+ case fix_data_basis
64
+ when 1 then return "Normal pattern"
65
+ when 2 then return "Lane identification pattern"
66
+ when 3 then return "Lane identification transmissions"
67
+ end
68
+ nil
69
+ end
24
70
  end
25
71
  end
26
72
  end
@@ -0,0 +1,33 @@
1
+ require_relative "base_nmea"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # DRU - Dual Doppler Auxiliary Data
7
+ #
8
+ # Depth, turn rate and % RPM in support of Doppler velocity systems.
9
+ # The use of $--DPT is recommended for depth data,
10
+ # $--RPM for shaft rotation and
11
+ # $--ROT for rate of turn.
12
+ # @see DPT
13
+ # @see RPM
14
+ # @see ROT
15
+ class DRU < NMEAPlus::Message::NMEA::NMEAMessage
16
+ # Depth, meters
17
+ field_reader :depth_meters, 1, :_float
18
+
19
+ # Status: Depth
20
+ field_reader :depth_valid?, 2, :_av_boolean
21
+
22
+ # Rate of turn, degrees per minute, "-" = port
23
+ field_reader :rate_of_turn_starboard_degrees_per_minute, 3, :_float
24
+
25
+ # Status: Rate of turn
26
+ field_reader :rate_of_turn_valid?, 4, :_av_boolean
27
+
28
+ # Propeller shaft rotation, % of maximum, "-" = astern
29
+ field_reader :rotation_percentage, 5, :_float
30
+ end
31
+ end
32
+ end
33
+ end