[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] | 37 | class bncModel;
|
---|
| 38 |
|
---|
[2039] | 39 | class t_satData {
|
---|
[2035] | 40 | public:
|
---|
[2051] | 41 | enum codeType {P_CODE, C_CODE};
|
---|
[2240] | 42 | QString prn;
|
---|
[2051] | 43 | double P1;
|
---|
| 44 | double P2;
|
---|
[2778] | 45 | double P5;
|
---|
[2051] | 46 | double P3;
|
---|
| 47 | double L1;
|
---|
| 48 | double L2;
|
---|
[2778] | 49 | double L5;
|
---|
[2051] | 50 | double L3;
|
---|
| 51 | codeType codeTypeF1;
|
---|
| 52 | codeType codeTypeF2;
|
---|
[2778] | 53 | codeType codeTypeF5;
|
---|
[2049] | 54 | ColumnVector xx;
|
---|
| 55 | ColumnVector vv;
|
---|
| 56 | double clk;
|
---|
[2065] | 57 | double eleSat;
|
---|
| 58 | double azSat;
|
---|
[2060] | 59 | double rho;
|
---|
[2505] | 60 | bool slipFlag;
|
---|
[2583] | 61 | double lambda3;
|
---|
[2035] | 62 | };
|
---|
| 63 |
|
---|
[2039] | 64 | class t_epoData {
|
---|
| 65 | public:
|
---|
| 66 | t_epoData() {}
|
---|
| 67 | ~t_epoData() {
|
---|
[2231] | 68 | QMapIterator<QString, t_satData*> itGPS(satDataGPS);
|
---|
| 69 | while (itGPS.hasNext()) {
|
---|
| 70 | itGPS.next();
|
---|
| 71 | delete itGPS.value();
|
---|
[2039] | 72 | }
|
---|
[2231] | 73 | QMapIterator<QString, t_satData*> itGlo(satDataGlo);
|
---|
| 74 | while (itGlo.hasNext()) {
|
---|
| 75 | itGlo.next();
|
---|
| 76 | delete itGlo.value();
|
---|
| 77 | }
|
---|
[2778] | 78 | QMapIterator<QString, t_satData*> itGal(satDataGal);
|
---|
| 79 | while (itGal.hasNext()) {
|
---|
| 80 | itGal.next();
|
---|
| 81 | delete itGal.value();
|
---|
| 82 | }
|
---|
[2039] | 83 | }
|
---|
[2231] | 84 | unsigned sizeGPS() const {return satDataGPS.size();}
|
---|
| 85 | unsigned sizeGlo() const {return satDataGlo.size();}
|
---|
[2778] | 86 | unsigned sizeGal() const {return satDataGal.size();}
|
---|
| 87 | unsigned sizeAll() const {return satDataGPS.size() + satDataGlo.size() +
|
---|
| 88 | satDataGal.size();}
|
---|
[2123] | 89 | bncTime tt;
|
---|
[2231] | 90 | QMap<QString, t_satData*> satDataGPS;
|
---|
| 91 | QMap<QString, t_satData*> satDataGlo;
|
---|
[2778] | 92 | QMap<QString, t_satData*> satDataGal;
|
---|
[2039] | 93 | };
|
---|
| 94 |
|
---|
[2035] | 95 | class t_corr {
|
---|
| 96 | public:
|
---|
[2208] | 97 | t_corr() {
|
---|
| 98 | raoSet = false;
|
---|
| 99 | dClkSet = false;
|
---|
| 100 | }
|
---|
| 101 | bool ready() {return raoSet && dClkSet;}
|
---|
[2123] | 102 | bncTime tt;
|
---|
[2044] | 103 | int iod;
|
---|
| 104 | double dClk;
|
---|
[2365] | 105 | double dotDClk;
|
---|
| 106 | double dotDotDClk;
|
---|
[2044] | 107 | ColumnVector rao;
|
---|
[2296] | 108 | ColumnVector dotRao;
|
---|
[2365] | 109 | ColumnVector dotDotRao;
|
---|
[2208] | 110 | bool raoSet;
|
---|
| 111 | bool dClkSet;
|
---|
[2035] | 112 | };
|
---|
| 113 |
|
---|
[2274] | 114 | class t_bias {
|
---|
| 115 | public:
|
---|
| 116 | t_bias() {
|
---|
[2426] | 117 | p1 = 0.0;
|
---|
| 118 | p2 = 0.0;
|
---|
| 119 | c1 = 0.0;
|
---|
[2274] | 120 | }
|
---|
| 121 | bncTime tt;
|
---|
[2426] | 122 | double p1;
|
---|
| 123 | double p2;
|
---|
| 124 | double c1;
|
---|
[2274] | 125 | };
|
---|
| 126 |
|
---|
[2036] | 127 | class bncPPPclient : public QObject {
|
---|
[2035] | 128 | Q_OBJECT
|
---|
| 129 |
|
---|
| 130 | public:
|
---|
| 131 | bncPPPclient(QByteArray staID);
|
---|
| 132 | ~bncPPPclient();
|
---|
[2711] | 133 | void putNewObs(const t_obs& pp);
|
---|
[2035] | 134 |
|
---|
| 135 | public slots:
|
---|
| 136 | void slotNewEphGPS(gpsephemeris gpseph);
|
---|
[2225] | 137 | void slotNewEphGlonass(glonassephemeris gloeph);
|
---|
[2776] | 138 | void slotNewEphGalileo(galileoephemeris galeph);
|
---|
[2035] | 139 | void slotNewCorrections(QList<QString> corrList);
|
---|
| 140 |
|
---|
[2142] | 141 | signals:
|
---|
[2548] | 142 | void newMessage(QByteArray msg, bool showOnScreen);
|
---|
[2145] | 143 | void newPosition(bncTime time, double x, double y, double z);
|
---|
[2182] | 144 | void newNMEAstr(QByteArray str);
|
---|
[2142] | 145 |
|
---|
[2035] | 146 | private:
|
---|
[2505] | 147 | class slipInfo {
|
---|
| 148 | public:
|
---|
| 149 | slipInfo() {
|
---|
| 150 | slipCntL1 = -1;
|
---|
| 151 | slipCntL2 = -1;
|
---|
[2778] | 152 | slipCntL5 = -1;
|
---|
[2505] | 153 | }
|
---|
| 154 | ~slipInfo(){}
|
---|
| 155 | int slipCntL1;
|
---|
| 156 | int slipCntL2;
|
---|
[2778] | 157 | int slipCntL5;
|
---|
[2505] | 158 | };
|
---|
| 159 |
|
---|
[2575] | 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 |
|
---|
[2123] | 174 | t_irc getSatPos(const bncTime& tt, const QString& prn,
|
---|
[2357] | 175 | ColumnVector& xc, ColumnVector& vv);
|
---|
[2035] | 176 | void processEpoch();
|
---|
[2296] | 177 | void applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc,
|
---|
| 178 | ColumnVector& vv);
|
---|
[2240] | 179 | t_irc cmpToT(t_satData* satData);
|
---|
[2042] | 180 |
|
---|
[2505] | 181 | QByteArray _staID;
|
---|
| 182 | QMutex _mutex;
|
---|
[2575] | 183 | QMap<QString, t_ephPair*> _eph;
|
---|
[2505] | 184 | QMap<QString, t_corr*> _corr;
|
---|
| 185 | QMap<QString, t_bias*> _bias;
|
---|
| 186 | t_epoData* _epoData;
|
---|
| 187 | bncModel* _model;
|
---|
| 188 | bool _useGlonass;
|
---|
[2776] | 189 | bool _useGalileo;
|
---|
[2505] | 190 | bool _pppMode;
|
---|
| 191 | QMap<QString, slipInfo> _slips;
|
---|
[2035] | 192 | };
|
---|
| 193 |
|
---|
| 194 | #endif
|
---|