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

Last change on this file since 2586 was 2583, checked in by mervart, 14 years ago
File size: 4.1 KB
RevLine 
[2035]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"
[2123]33#include "bnctime.h"
[2035]34#include "RTCM/GPSDecoder.h"
35#include "RTCM3/ephemeris.h"
36
[2058]37class bncModel;
38
[2039]39class t_satData {
[2035]40 public:
[2051]41 enum codeType {P_CODE, C_CODE};
[2240]42 QString prn;
[2051]43 double P1;
44 double P2;
45 double P3;
46 double L1;
47 double L2;
48 double L3;
49 codeType codeTypeF1;
50 codeType codeTypeF2;
[2049]51 ColumnVector xx;
52 ColumnVector vv;
53 double clk;
[2065]54 double eleSat;
55 double azSat;
[2060]56 double rho;
[2505]57 bool slipFlag;
[2583]58 double lambda3;
[2035]59};
60
[2039]61class t_epoData {
62 public:
63 t_epoData() {}
64 ~t_epoData() {
[2231]65 QMapIterator<QString, t_satData*> itGPS(satDataGPS);
66 while (itGPS.hasNext()) {
67 itGPS.next();
68 delete itGPS.value();
[2039]69 }
[2231]70 QMapIterator<QString, t_satData*> itGlo(satDataGlo);
71 while (itGlo.hasNext()) {
72 itGlo.next();
73 delete itGlo.value();
74 }
[2039]75 }
[2231]76 unsigned sizeGPS() const {return satDataGPS.size();}
77 unsigned sizeGlo() const {return satDataGlo.size();}
78 unsigned sizeAll() const {return satDataGPS.size() + satDataGlo.size();}
[2123]79 bncTime tt;
[2231]80 QMap<QString, t_satData*> satDataGPS;
81 QMap<QString, t_satData*> satDataGlo;
[2039]82};
83
[2035]84class t_corr {
85 public:
[2208]86 t_corr() {
87 raoSet = false;
88 dClkSet = false;
89 }
90 bool ready() {return raoSet && dClkSet;}
[2123]91 bncTime tt;
[2044]92 int iod;
93 double dClk;
[2365]94 double dotDClk;
95 double dotDotDClk;
[2044]96 ColumnVector rao;
[2296]97 ColumnVector dotRao;
[2365]98 ColumnVector dotDotRao;
[2208]99 bool raoSet;
100 bool dClkSet;
[2035]101};
102
[2274]103class t_bias {
104 public:
105 t_bias() {
[2426]106 p1 = 0.0;
107 p2 = 0.0;
108 c1 = 0.0;
[2274]109 }
110 bncTime tt;
[2426]111 double p1;
112 double p2;
113 double c1;
[2274]114};
115
[2036]116class bncPPPclient : public QObject {
[2035]117 Q_OBJECT
118
119 public:
120 bncPPPclient(QByteArray staID);
121 ~bncPPPclient();
122 void putNewObs(p_obs pp);
123
124 public slots:
125 void slotNewEphGPS(gpsephemeris gpseph);
[2225]126 void slotNewEphGlonass(glonassephemeris gloeph);
[2035]127 void slotNewCorrections(QList<QString> corrList);
128
[2142]129 signals:
[2548]130 void newMessage(QByteArray msg, bool showOnScreen);
[2145]131 void newPosition(bncTime time, double x, double y, double z);
[2182]132 void newNMEAstr(QByteArray str);
[2142]133
[2035]134 private:
[2505]135 class slipInfo {
136 public:
137 slipInfo() {
138 slipCntL1 = -1;
139 slipCntL2 = -1;
140 }
141 ~slipInfo(){}
142 int slipCntL1;
143 int slipCntL2;
144 };
145
[2575]146 class t_ephPair {
147 public:
148 t_ephPair() {
149 last = 0;
150 prev = 0;
151 }
152 ~t_ephPair() {
153 delete last;
154 delete prev;
155 }
156 t_eph* last;
157 t_eph* prev;
158 };
159
[2123]160 t_irc getSatPos(const bncTime& tt, const QString& prn,
[2357]161 ColumnVector& xc, ColumnVector& vv);
[2035]162 void processEpoch();
[2296]163 void applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc,
164 ColumnVector& vv);
[2240]165 t_irc cmpToT(t_satData* satData);
[2042]166
[2505]167 QByteArray _staID;
168 QMutex _mutex;
[2575]169 QMap<QString, t_ephPair*> _eph;
[2505]170 QMap<QString, t_corr*> _corr;
171 QMap<QString, t_bias*> _bias;
172 t_epoData* _epoData;
173 bncModel* _model;
174 bool _useGlonass;
175 bool _pppMode;
176 QMap<QString, slipInfo> _slips;
[2035]177};
178
179#endif
Note: See TracBrowser for help on using the repository browser.