[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;
|
---|
[3635] | 33 | class t_pppOpt;
|
---|
[2058] | 34 |
|
---|
[2039] | 35 | class t_satData {
|
---|
[2035] | 36 | public:
|
---|
[2791] | 37 | t_satData() {
|
---|
[3408] | 38 | obsIndex = 0;
|
---|
[4784] | 39 | P1 = 0.0;
|
---|
| 40 | P2 = 0.0;
|
---|
| 41 | P5 = 0.0;
|
---|
| 42 | P3 = 0.0;
|
---|
| 43 | L1 = 0.0;
|
---|
| 44 | L2 = 0.0;
|
---|
| 45 | L5 = 0.0;
|
---|
| 46 | L3 = 0.0;
|
---|
[2791] | 47 | }
|
---|
| 48 | ~t_satData() {}
|
---|
[2808] | 49 | bncTime tt;
|
---|
[2240] | 50 | QString prn;
|
---|
[2051] | 51 | double P1;
|
---|
| 52 | double P2;
|
---|
[2778] | 53 | double P5;
|
---|
[2051] | 54 | double P3;
|
---|
| 55 | double L1;
|
---|
| 56 | double L2;
|
---|
[2778] | 57 | double L5;
|
---|
[2051] | 58 | double L3;
|
---|
[2049] | 59 | ColumnVector xx;
|
---|
| 60 | ColumnVector vv;
|
---|
| 61 | double clk;
|
---|
[2065] | 62 | double eleSat;
|
---|
| 63 | double azSat;
|
---|
[2060] | 64 | double rho;
|
---|
[2505] | 65 | bool slipFlag;
|
---|
[2583] | 66 | double lambda3;
|
---|
[3408] | 67 | unsigned obsIndex;
|
---|
[2788] | 68 | char system() const {return prn.toAscii()[0];}
|
---|
[2035] | 69 | };
|
---|
| 70 |
|
---|
[2039] | 71 | class t_epoData {
|
---|
| 72 | public:
|
---|
| 73 | t_epoData() {}
|
---|
[3408] | 74 |
|
---|
[3382] | 75 | ~t_epoData() {
|
---|
[3408] | 76 | clear();
|
---|
| 77 | }
|
---|
| 78 |
|
---|
| 79 | void clear() {
|
---|
| 80 | QMapIterator<QString, t_satData*> it(satData);
|
---|
| 81 | while (it.hasNext()) {
|
---|
| 82 | it.next();
|
---|
| 83 | delete it.value();
|
---|
[3375] | 84 | }
|
---|
[3408] | 85 | satData.clear();
|
---|
| 86 | }
|
---|
| 87 |
|
---|
| 88 | void deepCopy(const t_epoData* from) {
|
---|
| 89 | clear();
|
---|
| 90 | tt = from->tt;
|
---|
| 91 | QMapIterator<QString, t_satData*> it(from->satData);
|
---|
| 92 | while (it.hasNext()) {
|
---|
| 93 | it.next();
|
---|
| 94 | satData[it.key()] = new t_satData(*it.value());
|
---|
[2039] | 95 | }
|
---|
[3408] | 96 | }
|
---|
| 97 |
|
---|
| 98 | unsigned sizeSys(char system) const {
|
---|
| 99 | unsigned ans = 0;
|
---|
| 100 | QMapIterator<QString, t_satData*> it(satData);
|
---|
| 101 | while (it.hasNext()) {
|
---|
| 102 | it.next();
|
---|
| 103 | if (it.value()->system() == system) {
|
---|
| 104 | ++ans;
|
---|
| 105 | }
|
---|
[2231] | 106 | }
|
---|
[3408] | 107 | return ans;
|
---|
[2039] | 108 | }
|
---|
[3408] | 109 | unsigned sizeAll() const {return satData.size();}
|
---|
| 110 |
|
---|
| 111 | bncTime tt;
|
---|
| 112 | QMap<QString, t_satData*> satData;
|
---|
[2039] | 113 | };
|
---|
| 114 |
|
---|
[2905] | 115 | class bncPPPclient : public bncEphUser {
|
---|
[2035] | 116 | Q_OBJECT
|
---|
| 117 |
|
---|
| 118 | public:
|
---|
[3640] | 119 | bncPPPclient(QByteArray staID, t_pppOpt* opt = 0, bool connectSlots = true);
|
---|
[2035] | 120 | ~bncPPPclient();
|
---|
[2711] | 121 | void putNewObs(const t_obs& pp);
|
---|
[3319] | 122 | static t_irc applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc,
|
---|
[3521] | 123 | ColumnVector& vv);
|
---|
[3535] | 124 | QByteArray staID() const {return _staID;}
|
---|
[3638] | 125 | const t_pppOpt* opt() const {return _opt;}
|
---|
| 126 | void emitNewMessage(QByteArray msg, bool showOnScreen) {
|
---|
| 127 | emit newMessage(msg, showOnScreen);
|
---|
| 128 | }
|
---|
| 129 | void emitNewNMEAstr(QByteArray str) {
|
---|
| 130 | emit newNMEAstr(str);
|
---|
| 131 | }
|
---|
[2035] | 132 |
|
---|
| 133 | public slots:
|
---|
| 134 | void slotNewCorrections(QList<QString> corrList);
|
---|
| 135 |
|
---|
[2142] | 136 | signals:
|
---|
[2548] | 137 | void newMessage(QByteArray msg, bool showOnScreen);
|
---|
[2145] | 138 | void newPosition(bncTime time, double x, double y, double z);
|
---|
[2182] | 139 | void newNMEAstr(QByteArray str);
|
---|
[2142] | 140 |
|
---|
[2035] | 141 | private:
|
---|
[2505] | 142 | class slipInfo {
|
---|
| 143 | public:
|
---|
| 144 | slipInfo() {
|
---|
| 145 | slipCntL1 = -1;
|
---|
| 146 | slipCntL2 = -1;
|
---|
[2778] | 147 | slipCntL5 = -1;
|
---|
[2505] | 148 | }
|
---|
| 149 | ~slipInfo(){}
|
---|
| 150 | int slipCntL1;
|
---|
| 151 | int slipCntL2;
|
---|
[2778] | 152 | int slipCntL5;
|
---|
[2505] | 153 | };
|
---|
| 154 |
|
---|
[2123] | 155 | t_irc getSatPos(const bncTime& tt, const QString& prn,
|
---|
[2357] | 156 | ColumnVector& xc, ColumnVector& vv);
|
---|
[2808] | 157 | void processEpochs();
|
---|
| 158 | void processFrontEpoch();
|
---|
[2240] | 159 | t_irc cmpToT(t_satData* satData);
|
---|
[2042] | 160 |
|
---|
[3635] | 161 | t_pppOpt* _opt;
|
---|
| 162 | bool _optOwner;
|
---|
[2505] | 163 | QByteArray _staID;
|
---|
| 164 | QMap<QString, t_corr*> _corr;
|
---|
[2809] | 165 | bncTime _corr_tt;
|
---|
[2505] | 166 | QMap<QString, t_bias*> _bias;
|
---|
[2808] | 167 | std::queue<t_epoData*> _epoData;
|
---|
[2505] | 168 | bncModel* _model;
|
---|
| 169 | QMap<QString, slipInfo> _slips;
|
---|
[2035] | 170 | };
|
---|
| 171 |
|
---|
| 172 | #endif
|
---|