source: ntrip/branches/BNC_LM/bncpppclient.h@ 10160

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