[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 |
|
---|
[2808] | 28 | #include <queue>
|
---|
[2905] | 29 | #include "bncephuser.h"
|
---|
[2035] | 30 | #include "RTCM/GPSDecoder.h"
|
---|
| 31 |
|
---|
[2058] | 32 | class bncModel;
|
---|
| 33 |
|
---|
[2039] | 34 | class t_satData {
|
---|
[2035] | 35 | public:
|
---|
[2791] | 36 | t_satData() {
|
---|
| 37 | indexCode = 0;
|
---|
| 38 | indexPhase = 0;
|
---|
| 39 | }
|
---|
| 40 | ~t_satData() {}
|
---|
[2808] | 41 | bncTime tt;
|
---|
[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;
|
---|
[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;
|
---|
[2791] | 59 | unsigned indexCode;
|
---|
| 60 | unsigned indexPhase;
|
---|
[2788] | 61 | char system() const {return prn.toAscii()[0];}
|
---|
[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 |
|
---|
[2274] | 95 | class t_bias {
|
---|
| 96 | public:
|
---|
| 97 | t_bias() {
|
---|
[2426] | 98 | p1 = 0.0;
|
---|
| 99 | p2 = 0.0;
|
---|
| 100 | c1 = 0.0;
|
---|
[2274] | 101 | }
|
---|
| 102 | bncTime tt;
|
---|
[2426] | 103 | double p1;
|
---|
| 104 | double p2;
|
---|
| 105 | double c1;
|
---|
[2274] | 106 | };
|
---|
| 107 |
|
---|
[2905] | 108 | class bncPPPclient : public bncEphUser {
|
---|
[2035] | 109 | Q_OBJECT
|
---|
| 110 |
|
---|
| 111 | public:
|
---|
| 112 | bncPPPclient(QByteArray staID);
|
---|
| 113 | ~bncPPPclient();
|
---|
[2711] | 114 | void putNewObs(const t_obs& pp);
|
---|
[2035] | 115 |
|
---|
| 116 | public slots:
|
---|
| 117 | void slotNewCorrections(QList<QString> corrList);
|
---|
| 118 |
|
---|
[2142] | 119 | signals:
|
---|
[2548] | 120 | void newMessage(QByteArray msg, bool showOnScreen);
|
---|
[2145] | 121 | void newPosition(bncTime time, double x, double y, double z);
|
---|
[2182] | 122 | void newNMEAstr(QByteArray str);
|
---|
[2142] | 123 |
|
---|
[2035] | 124 | private:
|
---|
[2505] | 125 | class slipInfo {
|
---|
| 126 | public:
|
---|
| 127 | slipInfo() {
|
---|
| 128 | slipCntL1 = -1;
|
---|
| 129 | slipCntL2 = -1;
|
---|
[2778] | 130 | slipCntL5 = -1;
|
---|
[2505] | 131 | }
|
---|
| 132 | ~slipInfo(){}
|
---|
| 133 | int slipCntL1;
|
---|
| 134 | int slipCntL2;
|
---|
[2778] | 135 | int slipCntL5;
|
---|
[2505] | 136 | };
|
---|
| 137 |
|
---|
[2123] | 138 | t_irc getSatPos(const bncTime& tt, const QString& prn,
|
---|
[2357] | 139 | ColumnVector& xc, ColumnVector& vv);
|
---|
[2808] | 140 | void processEpochs();
|
---|
| 141 | void processFrontEpoch();
|
---|
[2296] | 142 | void applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc,
|
---|
| 143 | ColumnVector& vv);
|
---|
[2240] | 144 | t_irc cmpToT(t_satData* satData);
|
---|
[2042] | 145 |
|
---|
[2505] | 146 | QByteArray _staID;
|
---|
| 147 | QMap<QString, t_corr*> _corr;
|
---|
[2809] | 148 | bncTime _corr_tt;
|
---|
[2505] | 149 | QMap<QString, t_bias*> _bias;
|
---|
[2808] | 150 | std::queue<t_epoData*> _epoData;
|
---|
[2505] | 151 | bncModel* _model;
|
---|
| 152 | bool _useGlonass;
|
---|
[2776] | 153 | bool _useGalileo;
|
---|
[2505] | 154 | bool _pppMode;
|
---|
| 155 | QMap<QString, slipInfo> _slips;
|
---|
[2967] | 156 | QString _pppCorrMount;
|
---|
[2035] | 157 | };
|
---|
| 158 |
|
---|
| 159 | #endif
|
---|