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