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

Last change on this file since 2779 was 2778, checked in by mervart, 15 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 <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 enum codeType {P_CODE, C_CODE};
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 codeType codeTypeF1;
52 codeType codeTypeF2;
53 codeType codeTypeF5;
54 ColumnVector xx;
55 ColumnVector vv;
56 double clk;
57 double eleSat;
58 double azSat;
59 double rho;
60 bool slipFlag;
61 double lambda3;
62};
63
64class t_epoData {
65 public:
66 t_epoData() {}
67 ~t_epoData() {
68 QMapIterator<QString, t_satData*> itGPS(satDataGPS);
69 while (itGPS.hasNext()) {
70 itGPS.next();
71 delete itGPS.value();
72 }
73 QMapIterator<QString, t_satData*> itGlo(satDataGlo);
74 while (itGlo.hasNext()) {
75 itGlo.next();
76 delete itGlo.value();
77 }
78 QMapIterator<QString, t_satData*> itGal(satDataGal);
79 while (itGal.hasNext()) {
80 itGal.next();
81 delete itGal.value();
82 }
83 }
84 unsigned sizeGPS() const {return satDataGPS.size();}
85 unsigned sizeGlo() const {return satDataGlo.size();}
86 unsigned sizeGal() const {return satDataGal.size();}
87 unsigned sizeAll() const {return satDataGPS.size() + satDataGlo.size() +
88 satDataGal.size();}
89 bncTime tt;
90 QMap<QString, t_satData*> satDataGPS;
91 QMap<QString, t_satData*> satDataGlo;
92 QMap<QString, t_satData*> satDataGal;
93};
94
95class t_corr {
96 public:
97 t_corr() {
98 raoSet = false;
99 dClkSet = false;
100 }
101 bool ready() {return raoSet && dClkSet;}
102 bncTime tt;
103 int iod;
104 double dClk;
105 double dotDClk;
106 double dotDotDClk;
107 ColumnVector rao;
108 ColumnVector dotRao;
109 ColumnVector dotDotRao;
110 bool raoSet;
111 bool dClkSet;
112};
113
114class t_bias {
115 public:
116 t_bias() {
117 p1 = 0.0;
118 p2 = 0.0;
119 c1 = 0.0;
120 }
121 bncTime tt;
122 double p1;
123 double p2;
124 double c1;
125};
126
127class bncPPPclient : public QObject {
128 Q_OBJECT
129
130 public:
131 bncPPPclient(QByteArray staID);
132 ~bncPPPclient();
133 void putNewObs(const t_obs& pp);
134
135 public slots:
136 void slotNewEphGPS(gpsephemeris gpseph);
137 void slotNewEphGlonass(glonassephemeris gloeph);
138 void slotNewEphGalileo(galileoephemeris galeph);
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 class t_ephPair {
161 public:
162 t_ephPair() {
163 last = 0;
164 prev = 0;
165 }
166 ~t_ephPair() {
167 delete last;
168 delete prev;
169 }
170 t_eph* last;
171 t_eph* prev;
172 };
173
174 t_irc getSatPos(const bncTime& tt, const QString& prn,
175 ColumnVector& xc, ColumnVector& vv);
176 void processEpoch();
177 void applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc,
178 ColumnVector& vv);
179 t_irc cmpToT(t_satData* satData);
180
181 QByteArray _staID;
182 QMutex _mutex;
183 QMap<QString, t_ephPair*> _eph;
184 QMap<QString, t_corr*> _corr;
185 QMap<QString, t_bias*> _bias;
186 t_epoData* _epoData;
187 bncModel* _model;
188 bool _useGlonass;
189 bool _useGalileo;
190 bool _pppMode;
191 QMap<QString, slipInfo> _slips;
192};
193
194#endif
Note: See TracBrowser for help on using the repository browser.