1 | #if ! defined( NMEA_0183_HEADER )
|
---|
2 |
|
---|
3 | #define NMEA_0183_HEADER
|
---|
4 |
|
---|
5 | /*
|
---|
6 | ** Author: Samuel R. Blackburn
|
---|
7 | ** Internet: sam_blackburn@pobox.com
|
---|
8 | **q
|
---|
9 | ** You can use it any way you like as long as you don't try to sell it.
|
---|
10 | **
|
---|
11 | ** Copyright, 1998, Samuel R. Blackburn
|
---|
12 | **
|
---|
13 | ** $Workfile: nmea0183.h $
|
---|
14 | ** $Revision: 6 $
|
---|
15 | ** $Modtime: 10/13/98 6:37a $
|
---|
16 | */
|
---|
17 |
|
---|
18 | /*
|
---|
19 | ** Updates : Maria Alwan & G�rald Dherbomez
|
---|
20 | ** Date : 14/09/2005
|
---|
21 | ** purpose : use of Qt API instead of MFC
|
---|
22 | ** source code may be compatible with Windows, Linux and Mac
|
---|
23 | ** tested with Qt3.3.3 API under Windows
|
---|
24 | */
|
---|
25 |
|
---|
26 | #include <stdio.h>
|
---|
27 |
|
---|
28 | #ifdef WIN32
|
---|
29 | #include <windows.h>
|
---|
30 | #endif
|
---|
31 |
|
---|
32 | #include <QString>
|
---|
33 | #include <QVector>
|
---|
34 | #include <QDateTime>
|
---|
35 |
|
---|
36 | #ifndef FALSE
|
---|
37 | #define FALSE 0
|
---|
38 | #endif
|
---|
39 |
|
---|
40 | #ifndef TRUE
|
---|
41 | #define TRUE 1
|
---|
42 | #endif
|
---|
43 |
|
---|
44 | /*
|
---|
45 | ** Now include the math stuff for some calculations in the COORDINATE class
|
---|
46 | */
|
---|
47 |
|
---|
48 | #include <math.h>
|
---|
49 |
|
---|
50 | /*
|
---|
51 | ** Turn off the warning about precompiled headers, it is rather annoying
|
---|
52 | */
|
---|
53 |
|
---|
54 | #pragma warning( disable : 4699 )
|
---|
55 |
|
---|
56 | #if ! defined( CARRIAGE_RETURN )
|
---|
57 | #define CARRIAGE_RETURN 0x0D
|
---|
58 | #endif
|
---|
59 |
|
---|
60 | #if ! defined( LINE_FEED )
|
---|
61 | #define LINE_FEED 0x0A
|
---|
62 | #endif
|
---|
63 |
|
---|
64 | typedef enum _NMEA0183_BOOLEAN
|
---|
65 | {
|
---|
66 | NMEA_Unknown = 0,
|
---|
67 | True,
|
---|
68 | False
|
---|
69 | } NMEA0183_BOOLEAN;
|
---|
70 |
|
---|
71 | typedef enum _leftright
|
---|
72 | {
|
---|
73 | LR_Unknown = 0,
|
---|
74 | Left,
|
---|
75 | Right
|
---|
76 | } LEFTRIGHT;
|
---|
77 |
|
---|
78 | typedef enum _eastwest
|
---|
79 | {
|
---|
80 | EW_Unknown = 0,
|
---|
81 | East,
|
---|
82 | West
|
---|
83 | } EASTWEST;
|
---|
84 |
|
---|
85 | typedef enum
|
---|
86 | {
|
---|
87 | NS_Unknown = 0,
|
---|
88 | North,
|
---|
89 | South
|
---|
90 | } NORTHSOUTH;
|
---|
91 |
|
---|
92 | typedef enum
|
---|
93 | {
|
---|
94 | ReferenceUnknown = 0,
|
---|
95 | BottomTrackingLog,
|
---|
96 | ManuallyEntered,
|
---|
97 | WaterReferenced,
|
---|
98 | RadarTrackingOfFixedTarget,
|
---|
99 | PositioningSystemGroundReference
|
---|
100 | } REFERENCE;
|
---|
101 |
|
---|
102 | typedef enum
|
---|
103 | {
|
---|
104 | CommunicationsModeUnknown = 0,
|
---|
105 | F3E_G3E_SimplexTelephone = 'd',
|
---|
106 | F3E_G3E_DuplexTelephone = 'e',
|
---|
107 | J3E_Telephone = 'm',
|
---|
108 | H3E_Telephone = 'o',
|
---|
109 | F1B_J2B_FEC_NBDP_TelexTeleprinter = 'q',
|
---|
110 | F1B_J2B_ARQ_NBDP_TelexTeleprinter = 's',
|
---|
111 | F1B_J2B_ReceiveOnlyTeleprinterDSC = 'w',
|
---|
112 | A1A_MorseTapeRecorder = 'x',
|
---|
113 | A1A_MorseKeyHeadset = '{',
|
---|
114 | F1C_F2C_F3C_FaxMachine = '|'
|
---|
115 | } COMMUNICATIONS_MODE;
|
---|
116 |
|
---|
117 | typedef enum
|
---|
118 | {
|
---|
119 | TransducerUnknown = 0,
|
---|
120 | AngularDisplacementTransducer = 'A',
|
---|
121 | TemperatureTransducer = 'C',
|
---|
122 | LinearDisplacementTransducer = 'D',
|
---|
123 | FrequencyTransducer = 'F',
|
---|
124 | HumidityTransducer = 'H',
|
---|
125 | ForceTransducer = 'N',
|
---|
126 | PressureTransducer = 'P',
|
---|
127 | FlowRateTransducer = 'R',
|
---|
128 | TachometerTransducer = 'T',
|
---|
129 | VolumeTransducer = 'V'
|
---|
130 | } TRANSDUCER_TYPE;
|
---|
131 |
|
---|
132 | /*
|
---|
133 | ** Misc Function Prototypes
|
---|
134 | */
|
---|
135 |
|
---|
136 | unsigned int HexValue( const char *hex_string );
|
---|
137 |
|
---|
138 | QString expand_talker_id( const QString & );
|
---|
139 | QString Hex( unsigned int value );
|
---|
140 | QString talker_id( const QString& sentence );
|
---|
141 |
|
---|
142 | #ifndef BOOL
|
---|
143 | #define BOOL bool
|
---|
144 | #endif
|
---|
145 |
|
---|
146 | #include "nmea0183.hpp"
|
---|
147 |
|
---|
148 | #endif // NMEA0183_HEADER
|
---|