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 <queue>
|
---|
29 | #include "bncephuser.h"
|
---|
30 | #include "RTCM/GPSDecoder.h"
|
---|
31 |
|
---|
32 | class bncModel;
|
---|
33 | class t_pppOpt;
|
---|
34 |
|
---|
35 | class t_satData {
|
---|
36 | public:
|
---|
37 | t_satData() {
|
---|
38 | obsIndex = 0;
|
---|
39 | }
|
---|
40 | ~t_satData() {}
|
---|
41 | bncTime tt;
|
---|
42 | QString prn;
|
---|
43 | double P1;
|
---|
44 | double P2;
|
---|
45 | double P5;
|
---|
46 | double P3;
|
---|
47 | double L1;
|
---|
48 | double L2;
|
---|
49 | double L5;
|
---|
50 | double L3;
|
---|
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 | unsigned obsIndex;
|
---|
60 | char system() const {return prn.toAscii()[0];}
|
---|
61 | };
|
---|
62 |
|
---|
63 | class t_epoData {
|
---|
64 | public:
|
---|
65 | t_epoData() {}
|
---|
66 |
|
---|
67 | ~t_epoData() {
|
---|
68 | clear();
|
---|
69 | }
|
---|
70 |
|
---|
71 | void clear() {
|
---|
72 | QMapIterator<QString, t_satData*> it(satData);
|
---|
73 | while (it.hasNext()) {
|
---|
74 | it.next();
|
---|
75 | delete it.value();
|
---|
76 | }
|
---|
77 | satData.clear();
|
---|
78 | }
|
---|
79 |
|
---|
80 | void deepCopy(const t_epoData* from) {
|
---|
81 | clear();
|
---|
82 | tt = from->tt;
|
---|
83 | QMapIterator<QString, t_satData*> it(from->satData);
|
---|
84 | while (it.hasNext()) {
|
---|
85 | it.next();
|
---|
86 | satData[it.key()] = new t_satData(*it.value());
|
---|
87 | }
|
---|
88 | }
|
---|
89 |
|
---|
90 | unsigned sizeSys(char system) const {
|
---|
91 | unsigned ans = 0;
|
---|
92 | QMapIterator<QString, t_satData*> it(satData);
|
---|
93 | while (it.hasNext()) {
|
---|
94 | it.next();
|
---|
95 | if (it.value()->system() == system) {
|
---|
96 | ++ans;
|
---|
97 | }
|
---|
98 | }
|
---|
99 | return ans;
|
---|
100 | }
|
---|
101 | unsigned sizeAll() const {return satData.size();}
|
---|
102 |
|
---|
103 | bncTime tt;
|
---|
104 | QMap<QString, t_satData*> satData;
|
---|
105 | };
|
---|
106 |
|
---|
107 | class t_bias {
|
---|
108 | public:
|
---|
109 | t_bias() {
|
---|
110 | p1 = 0.0;
|
---|
111 | p2 = 0.0;
|
---|
112 | c1 = 0.0;
|
---|
113 | }
|
---|
114 | bncTime tt;
|
---|
115 | double p1;
|
---|
116 | double p2;
|
---|
117 | double c1;
|
---|
118 | };
|
---|
119 |
|
---|
120 | class bncPPPclient : public bncEphUser {
|
---|
121 | Q_OBJECT
|
---|
122 |
|
---|
123 | public:
|
---|
124 | bncPPPclient(QByteArray staID, t_pppOpt* opt = 0, bool connectSlots = true);
|
---|
125 | ~bncPPPclient();
|
---|
126 | void putNewObs(const t_obs& pp);
|
---|
127 | static t_irc applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc,
|
---|
128 | ColumnVector& vv);
|
---|
129 | QByteArray staID() const {return _staID;}
|
---|
130 | const t_pppOpt* opt() const {return _opt;}
|
---|
131 | void emitNewMessage(QByteArray msg, bool showOnScreen) {
|
---|
132 | emit newMessage(msg, showOnScreen);
|
---|
133 | }
|
---|
134 | void emitNewNMEAstr(QByteArray str) {
|
---|
135 | emit newNMEAstr(str);
|
---|
136 | }
|
---|
137 |
|
---|
138 | public slots:
|
---|
139 | void slotNewCorrections(QList<QString> corrList);
|
---|
140 |
|
---|
141 | signals:
|
---|
142 | void newMessage(QByteArray msg, bool showOnScreen);
|
---|
143 | void newPosition(bncTime time, double x, double y, double z);
|
---|
144 | void newNMEAstr(QByteArray str);
|
---|
145 |
|
---|
146 | private:
|
---|
147 | class slipInfo {
|
---|
148 | public:
|
---|
149 | slipInfo() {
|
---|
150 | slipCntL1 = -1;
|
---|
151 | slipCntL2 = -1;
|
---|
152 | slipCntL5 = -1;
|
---|
153 | }
|
---|
154 | ~slipInfo(){}
|
---|
155 | int slipCntL1;
|
---|
156 | int slipCntL2;
|
---|
157 | int slipCntL5;
|
---|
158 | };
|
---|
159 |
|
---|
160 | t_irc getSatPos(const bncTime& tt, const QString& prn,
|
---|
161 | ColumnVector& xc, ColumnVector& vv);
|
---|
162 | void processEpochs();
|
---|
163 | void processFrontEpoch();
|
---|
164 | t_irc cmpToT(t_satData* satData);
|
---|
165 |
|
---|
166 | t_pppOpt* _opt;
|
---|
167 | bool _optOwner;
|
---|
168 | QByteArray _staID;
|
---|
169 | QMap<QString, t_corr*> _corr;
|
---|
170 | bncTime _corr_tt;
|
---|
171 | QMap<QString, t_bias*> _bias;
|
---|
172 | std::queue<t_epoData*> _epoData;
|
---|
173 | bncModel* _model;
|
---|
174 | QMap<QString, slipInfo> _slips;
|
---|
175 | };
|
---|
176 |
|
---|
177 | #endif
|
---|