1 | // Part of BNC, a utility for retrieving decoding and
|
---|
2 | // converting GNSS data streams from NTRIP broadcasters.
|
---|
3 | //
|
---|
4 | // Copyright (C) 2007
|
---|
5 | // German Federal Agency for Cartography and Geodesy (BKG)
|
---|
6 | // http://www.bkg.bund.de
|
---|
7 | // Czech Technical University Prague, Department of Geodesy
|
---|
8 | // http://www.fsv.cvut.cz
|
---|
9 | //
|
---|
10 | // Email: euref-ip@bkg.bund.de
|
---|
11 | //
|
---|
12 | // This program is free software; you can redistribute it and/or
|
---|
13 | // modify it under the terms of the GNU General Public License
|
---|
14 | // as published by the Free Software Foundation, version 2.
|
---|
15 | //
|
---|
16 | // This program is distributed in the hope that it will be useful,
|
---|
17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
19 | // GNU General Public License for more details.
|
---|
20 | //
|
---|
21 | // You should have received a copy of the GNU General Public License
|
---|
22 | // along with this program; if not, write to the Free Software
|
---|
23 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
---|
24 |
|
---|
25 | #ifndef GPSDECODER_H
|
---|
26 | #define GPSDECODER_H
|
---|
27 |
|
---|
28 | #include <iostream>
|
---|
29 | #include <iomanip>
|
---|
30 | #include <vector>
|
---|
31 | #include <string>
|
---|
32 |
|
---|
33 | #include <QtCore>
|
---|
34 |
|
---|
35 | #include "bncconst.h"
|
---|
36 | #include "bnctime.h"
|
---|
37 | #include "satObs.h"
|
---|
38 | #include "crs.h"
|
---|
39 |
|
---|
40 | class bncRinex;
|
---|
41 | using namespace std;
|
---|
42 |
|
---|
43 | class GPSDecoder {
|
---|
44 | public:
|
---|
45 | GPSDecoder();
|
---|
46 | virtual ~GPSDecoder();
|
---|
47 |
|
---|
48 | virtual t_irc Decode(char* buffer, int bufLen,
|
---|
49 | std::vector<std::string>& errmsg) = 0;
|
---|
50 |
|
---|
51 |
|
---|
52 | virtual int corrGPSEpochTime() const {return -1;}
|
---|
53 |
|
---|
54 | void initRinex(const QByteArray& staID, const QUrl& mountPoint,
|
---|
55 | const QByteArray& latitude, const QByteArray& longitude,
|
---|
56 | const QByteArray& nmea, const QByteArray& ntripVersion);
|
---|
57 |
|
---|
58 | void dumpRinexEpoch(const t_satObs& obs, const QByteArray& format);
|
---|
59 |
|
---|
60 | void setRinexReconnectFlag(bool flag);
|
---|
61 |
|
---|
62 | struct t_typeInfo {
|
---|
63 | t_typeInfo() {
|
---|
64 | type = 0;
|
---|
65 | size = 0;
|
---|
66 | };
|
---|
67 | int type;
|
---|
68 | size_t size;
|
---|
69 | };
|
---|
70 |
|
---|
71 |
|
---|
72 | struct t_antRefPoint {
|
---|
73 | enum t_type { ARP, APC };
|
---|
74 |
|
---|
75 | t_antRefPoint() {
|
---|
76 | xx = yy = zz = height = 0.0;
|
---|
77 | type = ARP;
|
---|
78 | height_f = false;
|
---|
79 | message = 0;
|
---|
80 | };
|
---|
81 |
|
---|
82 | double xx;
|
---|
83 | double yy;
|
---|
84 | double zz;
|
---|
85 | t_type type;
|
---|
86 | double height;
|
---|
87 | bool height_f;
|
---|
88 | int message;
|
---|
89 | };
|
---|
90 |
|
---|
91 | struct t_antInfo {
|
---|
92 | t_antInfo() {
|
---|
93 | };
|
---|
94 | char descriptor[256];
|
---|
95 | char serialnumber[256];
|
---|
96 | };
|
---|
97 |
|
---|
98 | struct t_recInfo {
|
---|
99 | t_recInfo() {
|
---|
100 | };
|
---|
101 | char descriptor[256];
|
---|
102 | char serialnumber[256];
|
---|
103 | char firmware[256];
|
---|
104 | };
|
---|
105 |
|
---|
106 | class t_GloBiasInfo {
|
---|
107 | public:
|
---|
108 | t_GloBiasInfo() {
|
---|
109 | clear();
|
---|
110 | };
|
---|
111 | bool operator==(const t_GloBiasInfo& biasInfo2) const {
|
---|
112 | if (staID == biasInfo2.staID &&
|
---|
113 | indicator == biasInfo2.indicator &&
|
---|
114 | L1C_value == biasInfo2.L1C_value &&
|
---|
115 | L1P_value == biasInfo2.L1P_value &&
|
---|
116 | L2C_value == biasInfo2.L2C_value &&
|
---|
117 | L2P_value == biasInfo2.L2P_value ) {
|
---|
118 | return true;
|
---|
119 | }
|
---|
120 | else {
|
---|
121 | return false;
|
---|
122 | }
|
---|
123 | }
|
---|
124 |
|
---|
125 | void set(const t_GloBiasInfo& biasInfo) {
|
---|
126 | staID = biasInfo.staID;
|
---|
127 | indicator = biasInfo.indicator;
|
---|
128 | L1C_value = biasInfo.L1C_value;
|
---|
129 | L1P_value = biasInfo.L1P_value;
|
---|
130 | L2C_value = biasInfo.L2C_value;
|
---|
131 | L2P_value = biasInfo.L2P_value;
|
---|
132 | changed = true;
|
---|
133 | }
|
---|
134 |
|
---|
135 | void clear() {
|
---|
136 | staID = 0;
|
---|
137 | indicator = 0;
|
---|
138 | L1C_value = 0.0;
|
---|
139 | L1P_value = 0.0;
|
---|
140 | L2C_value = 0.0;
|
---|
141 | L2P_value = 0.0;
|
---|
142 | changed = false;
|
---|
143 | }
|
---|
144 | QString toString() {
|
---|
145 | QString biasIndicator = (indicator == 1) ? QString("aligned") : QString("unaligned");
|
---|
146 | QString biasesStr =
|
---|
147 | QString(": GLONASS L1/L2 Code-Phase Biases: staID=%1 indicator=%2 L1C=%3 L1P=%4 L2C=%5 L2P=%6")
|
---|
148 | .arg(staID).arg(biasIndicator)
|
---|
149 | .arg(L1C_value, 0, 'f', 2)
|
---|
150 | .arg(L1P_value, 0, 'f', 2)
|
---|
151 | .arg(L2C_value, 0, 'f', 2)
|
---|
152 | .arg(L2P_value, 0, 'f', 2);
|
---|
153 |
|
---|
154 | return biasesStr;
|
---|
155 | }
|
---|
156 | int staID;
|
---|
157 | int indicator;
|
---|
158 | double L1C_value;
|
---|
159 | double L1P_value;
|
---|
160 | double L2C_value;
|
---|
161 | double L2P_value;
|
---|
162 | bool changed;
|
---|
163 |
|
---|
164 |
|
---|
165 | };
|
---|
166 |
|
---|
167 | /** List of observations */
|
---|
168 | QList<t_satObs> _obsList;
|
---|
169 | QList<t_typeInfo> _typeList; // RTCM message type as message size
|
---|
170 | QList<t_antInfo> _antType; // RTCM antenna descriptor
|
---|
171 | QList<t_recInfo> _recType; // RTCM receiver descriptor
|
---|
172 | QList<t_antRefPoint> _antList; // RTCM antenna XYZ
|
---|
173 | QList<t_helmertPar> _helmertPar; // List of Helmert parameter sets
|
---|
174 | QList<t_serviceCrs> _serviceCrs; // Service CRS
|
---|
175 | QList<t_rtcmCrs> _rtcmCrs; // RTCM CRS
|
---|
176 | QString _gloFrq; // GLONASS slot
|
---|
177 | t_GloBiasInfo _gloBiases; // RTCM GLO bias information message
|
---|
178 | bncRinex* _rnx; // RINEX writer
|
---|
179 | };
|
---|
180 |
|
---|
181 | #endif
|
---|