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