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 BNCPPPCLIENT_H
|
---|
26 | #define BNCPPPCLIENT_H
|
---|
27 |
|
---|
28 | #include <QtNetwork>
|
---|
29 |
|
---|
30 | #include <newmat.h>
|
---|
31 |
|
---|
32 | #include "bncconst.h"
|
---|
33 | #include "bnctime.h"
|
---|
34 | #include "RTCM/GPSDecoder.h"
|
---|
35 | #include "RTCM3/ephemeris.h"
|
---|
36 |
|
---|
37 | class bncModel;
|
---|
38 |
|
---|
39 | class t_satData {
|
---|
40 | public:
|
---|
41 | enum codeType {P_CODE, C_CODE};
|
---|
42 | QString prn;
|
---|
43 | double P1;
|
---|
44 | double P2;
|
---|
45 | double P3;
|
---|
46 | double L1;
|
---|
47 | double L2;
|
---|
48 | double L3;
|
---|
49 | codeType codeTypeF1;
|
---|
50 | codeType codeTypeF2;
|
---|
51 | ColumnVector xx;
|
---|
52 | ColumnVector vv;
|
---|
53 | double clk;
|
---|
54 | double eleSat;
|
---|
55 | double azSat;
|
---|
56 | double rho;
|
---|
57 | bool slipFlag;
|
---|
58 | double lambda3;
|
---|
59 | };
|
---|
60 |
|
---|
61 | class t_epoData {
|
---|
62 | public:
|
---|
63 | t_epoData() {}
|
---|
64 | ~t_epoData() {
|
---|
65 | QMapIterator<QString, t_satData*> itGPS(satDataGPS);
|
---|
66 | while (itGPS.hasNext()) {
|
---|
67 | itGPS.next();
|
---|
68 | delete itGPS.value();
|
---|
69 | }
|
---|
70 | QMapIterator<QString, t_satData*> itGlo(satDataGlo);
|
---|
71 | while (itGlo.hasNext()) {
|
---|
72 | itGlo.next();
|
---|
73 | delete itGlo.value();
|
---|
74 | }
|
---|
75 | }
|
---|
76 | unsigned sizeGPS() const {return satDataGPS.size();}
|
---|
77 | unsigned sizeGlo() const {return satDataGlo.size();}
|
---|
78 | unsigned sizeAll() const {return satDataGPS.size() + satDataGlo.size();}
|
---|
79 | bncTime tt;
|
---|
80 | QMap<QString, t_satData*> satDataGPS;
|
---|
81 | QMap<QString, t_satData*> satDataGlo;
|
---|
82 | };
|
---|
83 |
|
---|
84 | class t_corr {
|
---|
85 | public:
|
---|
86 | t_corr() {
|
---|
87 | raoSet = false;
|
---|
88 | dClkSet = false;
|
---|
89 | }
|
---|
90 | bool ready() {return raoSet && dClkSet;}
|
---|
91 | bncTime tt;
|
---|
92 | int iod;
|
---|
93 | double dClk;
|
---|
94 | double dotDClk;
|
---|
95 | double dotDotDClk;
|
---|
96 | ColumnVector rao;
|
---|
97 | ColumnVector dotRao;
|
---|
98 | ColumnVector dotDotRao;
|
---|
99 | bool raoSet;
|
---|
100 | bool dClkSet;
|
---|
101 | };
|
---|
102 |
|
---|
103 | class t_bias {
|
---|
104 | public:
|
---|
105 | t_bias() {
|
---|
106 | p1 = 0.0;
|
---|
107 | p2 = 0.0;
|
---|
108 | c1 = 0.0;
|
---|
109 | }
|
---|
110 | bncTime tt;
|
---|
111 | double p1;
|
---|
112 | double p2;
|
---|
113 | double c1;
|
---|
114 | };
|
---|
115 |
|
---|
116 | class bncPPPclient : public QObject {
|
---|
117 | Q_OBJECT
|
---|
118 |
|
---|
119 | public:
|
---|
120 | bncPPPclient(QByteArray staID);
|
---|
121 | ~bncPPPclient();
|
---|
122 | void putNewObs(const t_obs& pp);
|
---|
123 |
|
---|
124 | public slots:
|
---|
125 | void slotNewEphGPS(gpsephemeris gpseph);
|
---|
126 | void slotNewEphGlonass(glonassephemeris gloeph);
|
---|
127 | void slotNewCorrections(QList<QString> corrList);
|
---|
128 |
|
---|
129 | signals:
|
---|
130 | void newMessage(QByteArray msg, bool showOnScreen);
|
---|
131 | void newPosition(bncTime time, double x, double y, double z);
|
---|
132 | void newNMEAstr(QByteArray str);
|
---|
133 |
|
---|
134 | private:
|
---|
135 | class slipInfo {
|
---|
136 | public:
|
---|
137 | slipInfo() {
|
---|
138 | slipCntL1 = -1;
|
---|
139 | slipCntL2 = -1;
|
---|
140 | }
|
---|
141 | ~slipInfo(){}
|
---|
142 | int slipCntL1;
|
---|
143 | int slipCntL2;
|
---|
144 | };
|
---|
145 |
|
---|
146 | class t_ephPair {
|
---|
147 | public:
|
---|
148 | t_ephPair() {
|
---|
149 | last = 0;
|
---|
150 | prev = 0;
|
---|
151 | }
|
---|
152 | ~t_ephPair() {
|
---|
153 | delete last;
|
---|
154 | delete prev;
|
---|
155 | }
|
---|
156 | t_eph* last;
|
---|
157 | t_eph* prev;
|
---|
158 | };
|
---|
159 |
|
---|
160 | t_irc getSatPos(const bncTime& tt, const QString& prn,
|
---|
161 | ColumnVector& xc, ColumnVector& vv);
|
---|
162 | void processEpoch();
|
---|
163 | void applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc,
|
---|
164 | ColumnVector& vv);
|
---|
165 | t_irc cmpToT(t_satData* satData);
|
---|
166 |
|
---|
167 | QByteArray _staID;
|
---|
168 | QMutex _mutex;
|
---|
169 | QMap<QString, t_ephPair*> _eph;
|
---|
170 | QMap<QString, t_corr*> _corr;
|
---|
171 | QMap<QString, t_bias*> _bias;
|
---|
172 | t_epoData* _epoData;
|
---|
173 | bncModel* _model;
|
---|
174 | bool _useGlonass;
|
---|
175 | bool _pppMode;
|
---|
176 | QMap<QString, slipInfo> _slips;
|
---|
177 | };
|
---|
178 |
|
---|
179 | #endif
|
---|