-
Notifications
You must be signed in to change notification settings - Fork 9
/
Enumerations.cs
345 lines (340 loc) · 15 KB
/
Enumerations.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
using System;
using System.Collections.Generic;
using System.Text;
namespace GeoFramework.Gps
{
/// <summary>
/// Indicates which devices are being used to obtain a fix, other than the GPS device
/// itself.
/// </summary>
/// <remarks>
/// This enumeration is typically used by the
/// <see cref="Receiver.FixQuality">FixQuaity</see> property of the
/// <see cref="Receiver">Receiver</see> class.
/// </remarks>
/// <example>
/// <code lang="VB">
/// ' Declare a new receiver
/// Private WithEvents MyReceiver As New Receiver()
///
/// ' Raised when the fix quality has changed
/// Private Sub OnFixQualityChanged(ByVal sender As Object, ByVal e As FixQualityEventArgs)
/// ' What is the new fix quality°
/// Select Case e.FixQuality
/// Case FixQuality.NoFix
/// ' No fix is obtained
/// Debug.WriteLine("No fix is currently obtained.")
/// Case FixQuality.GpsFix
/// ' A fix is present
/// Debug.WriteLine("A fix has been obtained using only GPS satellites.")
/// Case FixQuality.DifferentialGpsFix
/// ' A differential fix is present
/// Debug.WriteLine("A fix has been obtained using GPS satellites and correction information from DGPS/WAAS ground stations.")
/// Case FixQuality.Estimated
/// ' A fix is being estimated (not an actual fix)
/// Debug.WriteLine("A fix is currently being estimated. ")
/// End Select
/// End Sub
/// </code>
/// <code lang="C#">
/// // Declare a new receiver
/// Receiver MyReceiver = new Receiver();
///
/// // Raised when the fix quality has changed
/// void OnFixQualityChanged(Object sender, FixQualityEventArgs e)
/// {
/// // What is the new fix quality°
/// switch(e.FixQuality)
/// {
/// case FixQuality.NoFix:
/// // No fix is obtained
/// Debug.WriteLine("No fix is currently obtained.");
/// case FixQuality.GpsFix:
/// // A fix is present
/// Debug.WriteLine("A fix has been obtained using only GPS satellites.");
/// case FixQuality.DifferentialGpsFix:
/// // A differential fix is present
/// Debug.WriteLine("A fix has been obtained using GPS satellites and correction information from DGPS/WAAS ground stations.");
/// case FixQuality.Estimated:
/// // A fix is being estimated (not an actual fix)
/// Debug.WriteLine("A fix is currently being estimated. ");
/// }
/// }
/// </code>
/// </example>
/// <seealso cref="Receiver.FixQuality">FixQuality Property (Receiver Class)</seealso>
public enum FixQuality
{
/// <summary>
/// Not enough information is available to specify the current fix quality.
/// </summary>
Unknown,
/// <summary>No fix is currently obtained.</summary>
NoFix,
/// <summary>A fix is currently obtained using GPS satellites only.</summary>
GpsFix,
/// <summary>A fix is obtained using both GPS satellites and DGPS/WAAS ground
/// stations. Position error is as low as 0.5-5 meters.</summary>
DifferentialGpsFix,
/// <summary>
/// A PPS or pulse-per-second fix. PPS signals very accurately indicate the start of a second.
/// </summary>
PulsePerSecond,
/// <summary>
/// Used for surveying. A fix is obtained with the assistance of a reference station. Position error is as low as 1-5 centimeters.
/// </summary>
FixedRealTimeKinematic,
/// <summary>
/// Used for surveying. A fix is obtained with the assistance of a reference station. Position error is as low as 20cm to 1 meter.
/// </summary>
FloatRealTimeKinematic,
/// <summary>
/// The fix is being estimated.
/// </summary>
Estimated,
/// <summary>
/// The fix is being input manually.
/// </summary>
ManualInput,
/// <summary>
/// The fix is being simulated.
/// </summary>
Simulated
}
/// <summary>
/// Indicates whether a fix is present and if altitude can be calculated along with
/// latitude and longitude.
/// </summary>
/// <remarks>
/// This enumeration is used by the
/// <see cref="Receiver.FixMethod">FixMethod</see> property of the
/// <see cref="Receiver">Receiver</see>
/// class to indicate if altitude measurements are possible. Altitude measurements are
/// possible whenever there are four or more satellites involved in a fix.
/// </remarks>
/// <example>
/// This example demonstrates how to use the FixMethod enumeration to tell if altitude
/// measurements can be made. NOTE: Some devices have built-in altimeters. These devices
/// can report altitude even when there is no fix present. To support such devices, avoid
/// using this property entirely and use any non-zero altitude measurement.
/// <code lang="VB">
/// Private WithEvents MyReceiver As New Receiver()
///
/// ' Raised whenever the fix method has changed
/// Private Sub OnFixMethodChanged(ByVal sender As Object, ByVal e As FixMethodEventArgs)
/// ' What is the new fix method°
/// Select Case e.FixMethod
/// Case FixMethod.NoFix
/// ' We have neither position or altitude
/// Debug.WriteLine("Your position is: Not Yet Available")
/// Debug.WriteLine("Your altitude is: Not Yet Available")
/// Case FixMethod.Fix2D
/// ' We have a position but no altitude
/// Debug.WriteLine("Your position is: " & MyReceiver.Position.ToString)
/// Debug.WriteLine("Your altitude is: Not Yet Available")
/// Case FixMethod.Fix3D
/// ' We have both position and altitude
/// Debug.WriteLine("Your position is: " & MyReceiver.Position.ToString)
/// Debug.WriteLine("Your altitude is: " & MyReceiver.Altitude.ToString)
/// End Select
/// End Sub
/// </code>
/// <code lang="C#">
/// // Declare a new receiver
/// Private WithEvents MyReceiver As New Receiver()
///
/// // Raised whenever the fix method has changed
/// void OnFixMethodChanged(Object sender, FixMethodEventArgs e)
/// {
/// // What is the new fix method°
/// switch(e.FixMethod)
/// {
/// case FixMethod.NoFix:
/// // We have neither position or altitude
/// Debug.WriteLine("Your position is: Not Yet Available");
/// Debug.WriteLine("Your altitude is: Not Yet Available");
/// case FixMethod.Fix2D:
/// // We have a position but no altitude
/// Debug.WriteLine("Your position is: " & MyReceiver.Position.ToString());
/// Debug.WriteLine("Your altitude is: Not Yet Available");
/// case FixMethod.Fix3D:
/// // We have both position and altitude
/// Debug.WriteLine("Your position is: " & MyReceiver.Position.ToString());
/// Debug.WriteLine("Your altitude is: " & MyReceiver.Altitude.ToString());
/// }
/// }
/// </code>
/// </example>
/// <seealso cref="Receiver.FixMethod">FixMethod Property (Receiver Class)</seealso>
public enum FixMethod : int
{
/// <summary>The GPS device does not have a fix on the current position.</summary>
NoFix,
/// <summary>The GPS device is reporting latitude and longitude.</summary>
Fix2D,
/// <summary>The GPS device is reporting latitude, longitude, and altitude.</summary>
Fix3D,
/// <summary>
/// The fix method is not yet known.
/// </summary>
Unknown
}
/// <summary>
/// Indicates whether a satellite fix is currently active.
/// </summary>
public enum FixStatus
{
Unknown,
NoFix,
Fix,
}
/// <summary>
/// Indicates the likelihood that a GPS satellite fix will be obtained or
/// sustained.
/// </summary>
/// <example>
/// This example uses the FixLikelihood enumeration to make a judgement call on the
/// stability of the fix.
/// <code lang="VB">
/// ' Declare a new receiver
/// Private WithEvents MyReceiver As New Receiver()
///
/// Sub Main()
/// ' Start listening for messages
/// MyReceiver.Start
/// End Sub
///
/// Sub OnFixLikelihoodChanged(ByVal sender As Object, ByVal e As FixLikelihoodEventArgs) Handles MyReceiver.FixLikelihoodChanged
/// ' Do we have a fix currently°
/// If MyReceiver.IsFixObtained Then
/// ' Yes. What's the likelihood that the fix will be sustained°
/// Select Case MyReceiver.FixLikelihood
/// Case FixLikelihood.Unlikely
/// Debug.WriteLine("The current fix is about to be lost!")
/// Case FixLikelihood.Possible
/// Debug.WriteLine("The current fix is unstable. Find a more open view of the sky soon.")
/// Case FixLikelihood.Likely
/// Debug.WriteLine("The current fix is nearly stable.")
/// Case FixLikelihood.Certain
/// Debug.WriteLine("The current fix is stable.")
/// End Select
/// Else
/// ' No. What's the likelihood that a fix will be obtained°
/// Select Case MyReceiver.FixLikelihood
/// Case FixLikelihood.Unlikely
/// Debug.WriteLine("A fix is not possible. Find a more open view of the sky.")
/// Case FixLikelihood.Possible
/// Debug.WriteLine("A fix is possible, but satellite signals are still mostly obscured.")
/// Case FixLikelihood.Likely
/// Debug.WriteLine("A fix should occur within the next several seconds.")
/// Case FixLikelihood.Certain
/// Debug.WriteLine("A fix will occur in a few seconds.")
/// End Select
/// End If
/// End Sub
/// </code>
/// <code lang="CS">
/// ' Declare a new receiver
/// Private Receiver MyReceiver = new Receiver();
///
/// void Main()
/// {
/// // Start listening for messages
/// MyReceiver.Start();
/// }
///
/// void OnFixLikelihoodChanged(Object sender, FixLikelihoodEventArgs e)
/// {
/// // Do we have a fix currently°
/// if (MyReceiver.IsFixObtained)
/// {
/// // Yes. What's the likelihood that the fix will be sustained°
/// switch(MyReceiver.FixLikelihood)
/// {
/// case FixLikelihood.Unlikely:
/// Debug.WriteLine("The current fix is about to be lost!");
/// break;
/// case FixLikelihood.Possible:
/// Debug.WriteLine("The current fix is unstable. Find a more open view of the sky soon.");
/// break;
/// case FixLikelihood.Likely:
/// Debug.WriteLine("The current fix is nearly stable.");
/// break;
/// case FixLikelihood.Certain:
/// Debug.WriteLine("The current fix is stable.");
/// break;
/// }
/// }
/// else
/// {
/// // No. What's the likelihood that a fix will be obtained°
/// switch(MyReceiver.FixLikelihood)
/// {
/// case FixLikelihood.Unlikely:
/// Debug.WriteLine("A fix is not possible. Find a more open view of the sky.");
/// break;
/// case FixLikelihood.Possible:
/// Debug.WriteLine("A fix is possible, but satellite signals are still mostly obscured.");
/// break;
/// case FixLikelihood.Likely:
/// Debug.WriteLine("A fix should occur within the next several seconds.");
/// break;
/// case FixLikelihood.Certain:
/// Debug.WriteLine("A fix will occur in a few seconds.");
/// break;
/// }
/// }
/// }
/// </code>
/// </example>
/// <seealso cref="Receiver.FixLikelihood">FixLikelihood Property (Receiver Class)</seealso>
public enum FixLikelihood : int
{
/// <summary>Indicates that a fix would probably be lost if a fix is acquired.</summary>
/// <remarks>When this value is returned, nearly all of the available GPS satellite signals are being obscured by buildings, trees, or other solid objects. The device should be moved into a more open view of the sky.</remarks>
Unlikely = 40,
/// <summary>
/// Indicates that a fix would probably be lost after a short period of time if a fix
/// is acquired.
/// </summary>
/// <remarks>When this value is returned, a few satellite signals are available, but the combined signals are too weak to maintain a fix for long. The device should be moved into a more open view of the sky.</remarks>
Possible = 80,
/// <summary>
/// Indicates that a fix would probably last for a longer period of time if a fix is
/// acquired.
/// </summary>
/// <remarks>When this value is returned, at least three satellite signals are being received clearly. If conditions stay the same or improve, a fix is imminent.</remarks>
Likely = 105,
/// <summary>
/// Indicates that a fix is very likely to be sustained given the current satellite
/// signal strengths.
/// </summary>
/// <remarks>When this value is returned, several satellite signals are being received and are strong enough to maintain a fix.</remarks>
Certain = 135
}
/// <summary>
/// Indicates if the GPS device is automatically deciding between a 2-D and a 3-D
/// fix.
/// </summary>
/// <remarks>
/// This enumeration is used by the
/// <see cref="Receiver.FixMode">FixMode</see> property of the
/// <see cref="Receiver">Receiver</see>
/// class. A vast majority of GPS devices use a setting of Automatic because there is no
/// complicated math behind figuring out if a 2-D fix or 3-D fix is present. If there are
/// three satellites involved in a fix, only the latitude and longitude can be calculated,
/// so the fix is 2-D. If more than three involved, the fix is 3-D.
/// </remarks>
/// <seealso cref="Receiver.FixMode">FixMode Property (Receiver Class)</seealso>
public enum FixMode : int
{
/// <summary>Typical value. The GPS device is automatically deciding between a two- and three-dimensional fix.</summary>
Automatic,
/// <summary>Rare value. The user must specify whether a two- or three-dimensional fix is to be used.</summary>
Manual,
/// <summary>
/// The fix mode is not yet known.
/// </summary>
Unknown
}
}