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