source: ntrip/trunk/BNC/bncpppclient.h@ 3385

Last change on this file since 3385 was 3383, checked in by mervart, 13 years ago
File size: 3.9 KB
Line 
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
32class bncModel;
33
34class t_satData {
35 public:
36 t_satData() {
37 indexCode = 0;
38 indexPhase = 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 indexCode;
60 unsigned indexPhase;
61 char system() const {return prn.toAscii()[0];}
62};
63
64class t_epoData {
65 public:
66 t_epoData() {}
67
68 ~t_epoData() {
69 clear();
70 }
71
72 void clear() {
73 QMapIterator<QString, t_satData*> it(satData);
74 while (it.hasNext()) {
75 it.next();
76 delete it.value();
77 }
78 satData.clear();
79 }
80
81 void deepCopy(const t_epoData* from) {
82 clear();
83 tt = from->tt;
84 QMapIterator<QString, t_satData*> it(from->satData);
85 while (it.hasNext()) {
86 it.next();
87 satData[it.key()] = new t_satData(*it.value());
88 }
89 }
90
91 unsigned sizeSys(char system) const {
92 unsigned ans = 0;
93 QMapIterator<QString, t_satData*> it(satData);
94 while (it.hasNext()) {
95 it.next();
96 if (it.value()->system() == system) {
97 ++ans;
98 }
99 }
100 return ans;
101 }
102 unsigned sizeAll() const {return satData.size();}
103
104 bncTime tt;
105 QMap<QString, t_satData*> satData;
106};
107
108class t_bias {
109 public:
110 t_bias() {
111 p1 = 0.0;
112 p2 = 0.0;
113 c1 = 0.0;
114 }
115 bncTime tt;
116 double p1;
117 double p2;
118 double c1;
119};
120
121class bncPPPclient : public bncEphUser {
122 Q_OBJECT
123
124 public:
125 bncPPPclient(QByteArray staID);
126 ~bncPPPclient();
127 void putNewObs(const t_obs& pp);
128 static t_irc applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc,
129 ColumnVector& vv);
130
131 public slots:
132 void slotNewCorrections(QList<QString> corrList);
133
134 signals:
135 void newMessage(QByteArray msg, bool showOnScreen);
136 void newPosition(bncTime time, double x, double y, double z);
137 void newNMEAstr(QByteArray str);
138
139 private:
140 class slipInfo {
141 public:
142 slipInfo() {
143 slipCntL1 = -1;
144 slipCntL2 = -1;
145 slipCntL5 = -1;
146 }
147 ~slipInfo(){}
148 int slipCntL1;
149 int slipCntL2;
150 int slipCntL5;
151 };
152
153 t_irc getSatPos(const bncTime& tt, const QString& prn,
154 ColumnVector& xc, ColumnVector& vv);
155 void processEpochs();
156 void processFrontEpoch();
157 t_irc cmpToT(t_satData* satData);
158
159 QByteArray _staID;
160 QMap<QString, t_corr*> _corr;
161 bncTime _corr_tt;
162 QMap<QString, t_bias*> _bias;
163 std::queue<t_epoData*> _epoData;
164 bncModel* _model;
165 bool _useGlonass;
166 bool _useGalileo;
167 bool _pppMode;
168 QMap<QString, slipInfo> _slips;
169 QString _pppCorrMount;
170};
171
172#endif
Note: See TracBrowser for help on using the repository browser.