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 |
|
---|
37 | class bncModel;
|
---|
38 |
|
---|
39 | class t_satData {
|
---|
40 | public:
|
---|
41 | enum codeType {P_CODE, C_CODE};
|
---|
42 | QString prn;
|
---|
43 | double P1;
|
---|
44 | double P2;
|
---|
45 | double P3;
|
---|
46 | double L1;
|
---|
47 | double L2;
|
---|
48 | double L3;
|
---|
49 | codeType codeTypeF1;
|
---|
50 | codeType codeTypeF2;
|
---|
51 | ColumnVector xx;
|
---|
52 | ColumnVector vv;
|
---|
53 | double clk;
|
---|
54 | double eleSat;
|
---|
55 | double azSat;
|
---|
56 | double rho;
|
---|
57 | bool slipFlag;
|
---|
58 | };
|
---|
59 |
|
---|
60 | class t_epoData {
|
---|
61 | public:
|
---|
62 | t_epoData() {}
|
---|
63 | ~t_epoData() {
|
---|
64 | QMapIterator<QString, t_satData*> itGPS(satDataGPS);
|
---|
65 | while (itGPS.hasNext()) {
|
---|
66 | itGPS.next();
|
---|
67 | delete itGPS.value();
|
---|
68 | }
|
---|
69 | QMapIterator<QString, t_satData*> itGlo(satDataGlo);
|
---|
70 | while (itGlo.hasNext()) {
|
---|
71 | itGlo.next();
|
---|
72 | delete itGlo.value();
|
---|
73 | }
|
---|
74 | }
|
---|
75 | unsigned sizeGPS() const {return satDataGPS.size();}
|
---|
76 | unsigned sizeGlo() const {return satDataGlo.size();}
|
---|
77 | unsigned sizeAll() const {return satDataGPS.size() + satDataGlo.size();}
|
---|
78 | bncTime tt;
|
---|
79 | QMap<QString, t_satData*> satDataGPS;
|
---|
80 | QMap<QString, t_satData*> satDataGlo;
|
---|
81 | };
|
---|
82 |
|
---|
83 | class t_corr {
|
---|
84 | public:
|
---|
85 | t_corr() {
|
---|
86 | raoSet = false;
|
---|
87 | dClkSet = false;
|
---|
88 | }
|
---|
89 | bool ready() {return raoSet && dClkSet;}
|
---|
90 | bncTime tt;
|
---|
91 | int iod;
|
---|
92 | double dClk;
|
---|
93 | double dotDClk;
|
---|
94 | double dotDotDClk;
|
---|
95 | ColumnVector rao;
|
---|
96 | ColumnVector dotRao;
|
---|
97 | ColumnVector dotDotRao;
|
---|
98 | bool raoSet;
|
---|
99 | bool dClkSet;
|
---|
100 | };
|
---|
101 |
|
---|
102 | class t_bias {
|
---|
103 | public:
|
---|
104 | t_bias() {
|
---|
105 | p1 = 0.0;
|
---|
106 | p2 = 0.0;
|
---|
107 | c1 = 0.0;
|
---|
108 | }
|
---|
109 | bncTime tt;
|
---|
110 | double p1;
|
---|
111 | double p2;
|
---|
112 | double c1;
|
---|
113 | };
|
---|
114 |
|
---|
115 | class bncPPPclient : public QObject {
|
---|
116 | Q_OBJECT
|
---|
117 |
|
---|
118 | public:
|
---|
119 | bncPPPclient(QByteArray staID);
|
---|
120 | ~bncPPPclient();
|
---|
121 | void putNewObs(p_obs pp);
|
---|
122 |
|
---|
123 | public slots:
|
---|
124 | void slotNewEphGPS(gpsephemeris gpseph);
|
---|
125 | void slotNewEphGlonass(glonassephemeris gloeph);
|
---|
126 | void slotNewCorrections(QList<QString> corrList);
|
---|
127 |
|
---|
128 | signals:
|
---|
129 | void newMessage(QByteArray msg, bool showOnScreen);
|
---|
130 | void newPosition(bncTime time, double x, double y, double z);
|
---|
131 | void newNMEAstr(QByteArray str);
|
---|
132 |
|
---|
133 | private:
|
---|
134 | class slipInfo {
|
---|
135 | public:
|
---|
136 | slipInfo() {
|
---|
137 | slipCntL1 = -1;
|
---|
138 | slipCntL2 = -1;
|
---|
139 | }
|
---|
140 | ~slipInfo(){}
|
---|
141 | int slipCntL1;
|
---|
142 | int slipCntL2;
|
---|
143 | };
|
---|
144 |
|
---|
145 | t_irc getSatPos(const bncTime& tt, const QString& prn,
|
---|
146 | ColumnVector& xc, ColumnVector& vv);
|
---|
147 | void processEpoch();
|
---|
148 | void applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc,
|
---|
149 | ColumnVector& vv);
|
---|
150 | t_irc cmpToT(t_satData* satData);
|
---|
151 |
|
---|
152 | QByteArray _staID;
|
---|
153 | QMutex _mutex;
|
---|
154 | QMap<QString, t_eph*> _eph;
|
---|
155 | QMap<QString, t_corr*> _corr;
|
---|
156 | QMap<QString, t_bias*> _bias;
|
---|
157 | t_epoData* _epoData;
|
---|
158 | bncModel* _model;
|
---|
159 | bool _useGlonass;
|
---|
160 | bool _pppMode;
|
---|
161 | QMap<QString, slipInfo> _slips;
|
---|
162 | };
|
---|
163 |
|
---|
164 | #endif
|
---|