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

Last change on this file since 3377 was 3377, checked in by mervart, 13 years ago
File size: 4.6 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(const t_epoData& ed) {
69 tt = ed.tt;
70 QMapIterator<QString, t_satData*> itGPS(ed.satDataGPS);
71 while (itGPS.hasNext()) {
72 itGPS.next();
73 satDataGPS[itGPS.key()] = new t_satData(*itGPS.value());
74 }
75 QMapIterator<QString, t_satData*> itGlo(ed.satDataGlo);
76 while (itGlo.hasNext()) {
77 itGlo.next();
78 satDataGlo[itGlo.key()] = new t_satData(*itGlo.value());
79 }
80 QMapIterator<QString, t_satData*> itGal(ed.satDataGal);
81 while (itGal.hasNext()) {
82 itGal.next();
83 satDataGal[itGal.key()] = new t_satData(*itGal.value());
84 }
85 }
86
87 ~t_epoData() {
88 QMapIterator<QString, t_satData*> itGPS(satDataGPS);
89 while (itGPS.hasNext()) {
90 itGPS.next();
91 delete itGPS.value();
92 }
93 QMapIterator<QString, t_satData*> itGlo(satDataGlo);
94 while (itGlo.hasNext()) {
95 itGlo.next();
96 delete itGlo.value();
97 }
98 QMapIterator<QString, t_satData*> itGal(satDataGal);
99 while (itGal.hasNext()) {
100 itGal.next();
101 delete itGal.value();
102 }
103 }
104 unsigned sizeGPS() const {return satDataGPS.size();}
105 unsigned sizeGlo() const {return satDataGlo.size();}
106 unsigned sizeGal() const {return satDataGal.size();}
107 unsigned sizeAll() const {return satDataGPS.size() + satDataGlo.size() +
108 satDataGal.size();}
109 bncTime tt;
110 QMap<QString, t_satData*> satDataGPS;
111 QMap<QString, t_satData*> satDataGlo;
112 QMap<QString, t_satData*> satDataGal;
113};
114
115class t_bias {
116 public:
117 t_bias() {
118 p1 = 0.0;
119 p2 = 0.0;
120 c1 = 0.0;
121 }
122 bncTime tt;
123 double p1;
124 double p2;
125 double c1;
126};
127
128class bncPPPclient : public bncEphUser {
129 Q_OBJECT
130
131 public:
132 bncPPPclient(QByteArray staID);
133 ~bncPPPclient();
134 void putNewObs(const t_obs& pp);
135 static t_irc applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc,
136 ColumnVector& vv);
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 QByteArray _staID;
167 QMap<QString, t_corr*> _corr;
168 bncTime _corr_tt;
169 QMap<QString, t_bias*> _bias;
170 std::queue<t_epoData*> _epoData;
171 bncModel* _model;
172 bool _useGlonass;
173 bool _useGalileo;
174 bool _pppMode;
175 QMap<QString, slipInfo> _slips;
176 QString _pppCorrMount;
177};
178
179#endif
Note: See TracBrowser for help on using the repository browser.