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

Last change on this file since 2806 was 2791, checked in by mervart, 13 years ago
File size: 4.7 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 <QtNetwork>
29
30#include <newmat.h>
31
32#include "bncconst.h"
33#include "bnctime.h"
34#include "RTCM/GPSDecoder.h"
35#include "RTCM3/ephemeris.h"
36
37class bncModel;
38
39class t_satData {
40 public:
41 t_satData() {
42 indexCode = 0;
43 indexPhase = 0;
44 }
45 ~t_satData() {}
46 QString prn;
47 double P1;
48 double P2;
49 double P5;
50 double P3;
51 double L1;
52 double L2;
53 double L5;
54 double L3;
55 ColumnVector xx;
56 ColumnVector vv;
57 double clk;
58 double eleSat;
59 double azSat;
60 double rho;
61 bool slipFlag;
62 double lambda3;
63 unsigned indexCode;
64 unsigned indexPhase;
65 char system() const {return prn.toAscii()[0];}
66};
67
68class t_epoData {
69 public:
70 t_epoData() {}
71 ~t_epoData() {
72 QMapIterator<QString, t_satData*> itGPS(satDataGPS);
73 while (itGPS.hasNext()) {
74 itGPS.next();
75 delete itGPS.value();
76 }
77 QMapIterator<QString, t_satData*> itGlo(satDataGlo);
78 while (itGlo.hasNext()) {
79 itGlo.next();
80 delete itGlo.value();
81 }
82 QMapIterator<QString, t_satData*> itGal(satDataGal);
83 while (itGal.hasNext()) {
84 itGal.next();
85 delete itGal.value();
86 }
87 }
88 unsigned sizeGPS() const {return satDataGPS.size();}
89 unsigned sizeGlo() const {return satDataGlo.size();}
90 unsigned sizeGal() const {return satDataGal.size();}
91 unsigned sizeAll() const {return satDataGPS.size() + satDataGlo.size() +
92 satDataGal.size();}
93 bncTime tt;
94 QMap<QString, t_satData*> satDataGPS;
95 QMap<QString, t_satData*> satDataGlo;
96 QMap<QString, t_satData*> satDataGal;
97};
98
99class t_corr {
100 public:
101 t_corr() {
102 raoSet = false;
103 dClkSet = false;
104 }
105 bool ready() {return raoSet && dClkSet;}
106 bncTime tt;
107 int iod;
108 double dClk;
109 double dotDClk;
110 double dotDotDClk;
111 ColumnVector rao;
112 ColumnVector dotRao;
113 ColumnVector dotDotRao;
114 bool raoSet;
115 bool dClkSet;
116};
117
118class t_bias {
119 public:
120 t_bias() {
121 p1 = 0.0;
122 p2 = 0.0;
123 c1 = 0.0;
124 }
125 bncTime tt;
126 double p1;
127 double p2;
128 double c1;
129};
130
131class bncPPPclient : public QObject {
132 Q_OBJECT
133
134 public:
135 bncPPPclient(QByteArray staID);
136 ~bncPPPclient();
137 void putNewObs(const t_obs& pp);
138
139 public slots:
140 void slotNewEphGPS(gpsephemeris gpseph);
141 void slotNewEphGlonass(glonassephemeris gloeph);
142 void slotNewEphGalileo(galileoephemeris galeph);
143 void slotNewCorrections(QList<QString> corrList);
144
145 signals:
146 void newMessage(QByteArray msg, bool showOnScreen);
147 void newPosition(bncTime time, double x, double y, double z);
148 void newNMEAstr(QByteArray str);
149
150 private:
151 class slipInfo {
152 public:
153 slipInfo() {
154 slipCntL1 = -1;
155 slipCntL2 = -1;
156 slipCntL5 = -1;
157 }
158 ~slipInfo(){}
159 int slipCntL1;
160 int slipCntL2;
161 int slipCntL5;
162 };
163
164 class t_ephPair {
165 public:
166 t_ephPair() {
167 last = 0;
168 prev = 0;
169 }
170 ~t_ephPair() {
171 delete last;
172 delete prev;
173 }
174 t_eph* last;
175 t_eph* prev;
176 };
177
178 t_irc getSatPos(const bncTime& tt, const QString& prn,
179 ColumnVector& xc, ColumnVector& vv);
180 void processEpoch();
181 void applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc,
182 ColumnVector& vv);
183 t_irc cmpToT(t_satData* satData);
184
185 QByteArray _staID;
186 QMutex _mutex;
187 QMap<QString, t_ephPair*> _eph;
188 QMap<QString, t_corr*> _corr;
189 QMap<QString, t_bias*> _bias;
190 t_epoData* _epoData;
191 bncModel* _model;
192 bool _useGlonass;
193 bool _useGalileo;
194 bool _pppMode;
195 QMap<QString, slipInfo> _slips;
196};
197
198#endif
Note: See TracBrowser for help on using the repository browser.