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

Last change on this file since 2789 was 2788, 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 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 char system() const {return prn.toAscii()[0];}
59};
60
61class t_epoData {
62 public:
63 t_epoData() {}
64 ~t_epoData() {
65 QMapIterator<QString, t_satData*> itGPS(satDataGPS);
66 while (itGPS.hasNext()) {
67 itGPS.next();
68 delete itGPS.value();
69 }
70 QMapIterator<QString, t_satData*> itGlo(satDataGlo);
71 while (itGlo.hasNext()) {
72 itGlo.next();
73 delete itGlo.value();
74 }
75 QMapIterator<QString, t_satData*> itGal(satDataGal);
76 while (itGal.hasNext()) {
77 itGal.next();
78 delete itGal.value();
79 }
80 }
81 unsigned sizeGPS() const {return satDataGPS.size();}
82 unsigned sizeGlo() const {return satDataGlo.size();}
83 unsigned sizeGal() const {return satDataGal.size();}
84 unsigned sizeAll() const {return satDataGPS.size() + satDataGlo.size() +
85 satDataGal.size();}
86 bncTime tt;
87 QMap<QString, t_satData*> satDataGPS;
88 QMap<QString, t_satData*> satDataGlo;
89 QMap<QString, t_satData*> satDataGal;
90};
91
92class t_corr {
93 public:
94 t_corr() {
95 raoSet = false;
96 dClkSet = false;
97 }
98 bool ready() {return raoSet && dClkSet;}
99 bncTime tt;
100 int iod;
101 double dClk;
102 double dotDClk;
103 double dotDotDClk;
104 ColumnVector rao;
105 ColumnVector dotRao;
106 ColumnVector dotDotRao;
107 bool raoSet;
108 bool dClkSet;
109};
110
111class t_bias {
112 public:
113 t_bias() {
114 p1 = 0.0;
115 p2 = 0.0;
116 c1 = 0.0;
117 }
118 bncTime tt;
119 double p1;
120 double p2;
121 double c1;
122};
123
124class bncPPPclient : public QObject {
125 Q_OBJECT
126
127 public:
128 bncPPPclient(QByteArray staID);
129 ~bncPPPclient();
130 void putNewObs(const t_obs& pp);
131
132 public slots:
133 void slotNewEphGPS(gpsephemeris gpseph);
134 void slotNewEphGlonass(glonassephemeris gloeph);
135 void slotNewEphGalileo(galileoephemeris galeph);
136 void slotNewCorrections(QList<QString> corrList);
137
138 signals:
139 void newMessage(QByteArray msg, bool showOnScreen);
140 void newPosition(bncTime time, double x, double y, double z);
141 void newNMEAstr(QByteArray str);
142
143 private:
144 class slipInfo {
145 public:
146 slipInfo() {
147 slipCntL1 = -1;
148 slipCntL2 = -1;
149 slipCntL5 = -1;
150 }
151 ~slipInfo(){}
152 int slipCntL1;
153 int slipCntL2;
154 int slipCntL5;
155 };
156
157 class t_ephPair {
158 public:
159 t_ephPair() {
160 last = 0;
161 prev = 0;
162 }
163 ~t_ephPair() {
164 delete last;
165 delete prev;
166 }
167 t_eph* last;
168 t_eph* prev;
169 };
170
171 t_irc getSatPos(const bncTime& tt, const QString& prn,
172 ColumnVector& xc, ColumnVector& vv);
173 void processEpoch();
174 void applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc,
175 ColumnVector& vv);
176 t_irc cmpToT(t_satData* satData);
177
178 QByteArray _staID;
179 QMutex _mutex;
180 QMap<QString, t_ephPair*> _eph;
181 QMap<QString, t_corr*> _corr;
182 QMap<QString, t_bias*> _bias;
183 t_epoData* _epoData;
184 bncModel* _model;
185 bool _useGlonass;
186 bool _useGalileo;
187 bool _pppMode;
188 QMap<QString, slipInfo> _slips;
189};
190
191#endif
Note: See TracBrowser for help on using the repository browser.