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 <vector>
|
---|
29 | #include "bncephuser.h"
|
---|
30 | #include "GPSDecoder.h"
|
---|
31 |
|
---|
32 |
|
---|
33 | namespace BNC_PPP {
|
---|
34 |
|
---|
35 | class bncModel;
|
---|
36 | class t_pppOptions;
|
---|
37 | class t_satObs;
|
---|
38 | class t_satData;
|
---|
39 | class t_epoData;
|
---|
40 | class t_output;
|
---|
41 | class t_orbCorr;
|
---|
42 | class t_clkCorr;
|
---|
43 |
|
---|
44 | class bncPPPclient : public bncEphUser {
|
---|
45 | public:
|
---|
46 | bncPPPclient(QByteArray staID, const t_pppOptions* opt);
|
---|
47 | ~bncPPPclient();
|
---|
48 | void processEpoch(const std::vector<t_satObs*>& satObs, t_output* output);
|
---|
49 | void putOrbCorrections(const std::vector<t_orbCorr*>& corr);
|
---|
50 | void putClkCorrections(const std::vector<t_clkCorr*>& corr);
|
---|
51 | QByteArray staID() const {return _staID;}
|
---|
52 | const t_pppOptions* opt() const {return _opt;}
|
---|
53 |
|
---|
54 | private:
|
---|
55 | class slipInfo {
|
---|
56 | public:
|
---|
57 | slipInfo() {
|
---|
58 | slipCntL1 = -1;
|
---|
59 | slipCntL2 = -1;
|
---|
60 | slipCntL5 = -1;
|
---|
61 | }
|
---|
62 | ~slipInfo(){}
|
---|
63 | int slipCntL1;
|
---|
64 | int slipCntL2;
|
---|
65 | int slipCntL5;
|
---|
66 | };
|
---|
67 |
|
---|
68 | t_irc getSatPos(const bncTime& tt, const QString& prn, ColumnVector& xc, ColumnVector& vv);
|
---|
69 | void putNewObs(t_satData* satData);
|
---|
70 | t_irc cmpToT(t_satData* satData);
|
---|
71 |
|
---|
72 | const t_pppOptions* _opt;
|
---|
73 | QByteArray _staID;
|
---|
74 | QMap<QString, t_corr*> _corr;
|
---|
75 | bncTime _corr_tt;
|
---|
76 | QMap<QString, t_bias*> _bias;
|
---|
77 | t_epoData* _epoData;
|
---|
78 | bncModel* _model;
|
---|
79 | };
|
---|
80 |
|
---|
81 | class t_satData {
|
---|
82 | public:
|
---|
83 | t_satData() {
|
---|
84 | obsIndex = 0;
|
---|
85 | P1 = 0.0;
|
---|
86 | P2 = 0.0;
|
---|
87 | P5 = 0.0;
|
---|
88 | P3 = 0.0;
|
---|
89 | L1 = 0.0;
|
---|
90 | L2 = 0.0;
|
---|
91 | L5 = 0.0;
|
---|
92 | L3 = 0.0;
|
---|
93 | }
|
---|
94 | ~t_satData() {}
|
---|
95 | bncTime tt;
|
---|
96 | QString prn;
|
---|
97 | double P1;
|
---|
98 | double P2;
|
---|
99 | double P5;
|
---|
100 | double P3;
|
---|
101 | double L1;
|
---|
102 | double L2;
|
---|
103 | double L5;
|
---|
104 | double L3;
|
---|
105 | ColumnVector xx;
|
---|
106 | ColumnVector vv;
|
---|
107 | double clk;
|
---|
108 | double eleSat;
|
---|
109 | double azSat;
|
---|
110 | double rho;
|
---|
111 | bool slipFlag;
|
---|
112 | double lambda3;
|
---|
113 | unsigned obsIndex;
|
---|
114 | char system() const {return prn.toAscii()[0];}
|
---|
115 | };
|
---|
116 |
|
---|
117 | class t_epoData {
|
---|
118 | public:
|
---|
119 | t_epoData() {}
|
---|
120 |
|
---|
121 | ~t_epoData() {
|
---|
122 | clear();
|
---|
123 | }
|
---|
124 |
|
---|
125 | void clear() {
|
---|
126 | QMapIterator<QString, t_satData*> it(satData);
|
---|
127 | while (it.hasNext()) {
|
---|
128 | it.next();
|
---|
129 | delete it.value();
|
---|
130 | }
|
---|
131 | satData.clear();
|
---|
132 | tt.reset();
|
---|
133 | }
|
---|
134 |
|
---|
135 | void deepCopy(const t_epoData* from) {
|
---|
136 | clear();
|
---|
137 | tt = from->tt;
|
---|
138 | QMapIterator<QString, t_satData*> it(from->satData);
|
---|
139 | while (it.hasNext()) {
|
---|
140 | it.next();
|
---|
141 | satData[it.key()] = new t_satData(*it.value());
|
---|
142 | }
|
---|
143 | }
|
---|
144 |
|
---|
145 | unsigned sizeSys(char system) const {
|
---|
146 | unsigned ans = 0;
|
---|
147 | QMapIterator<QString, t_satData*> it(satData);
|
---|
148 | while (it.hasNext()) {
|
---|
149 | it.next();
|
---|
150 | if (it.value()->system() == system) {
|
---|
151 | ++ans;
|
---|
152 | }
|
---|
153 | }
|
---|
154 | return ans;
|
---|
155 | }
|
---|
156 | unsigned sizeAll() const {return satData.size();}
|
---|
157 |
|
---|
158 | bncTime tt;
|
---|
159 | QMap<QString, t_satData*> satData;
|
---|
160 | };
|
---|
161 |
|
---|
162 | }
|
---|
163 |
|
---|
164 | #endif
|
---|