[6054] | 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 <queue>
|
---|
| 29 | #include "bncephuser.h"
|
---|
[6055] | 30 | #include "GPSDecoder.h"
|
---|
[6054] | 31 |
|
---|
[6055] | 32 |
|
---|
| 33 | namespace BNC_PPP {
|
---|
| 34 |
|
---|
[6054] | 35 | class bncModel;
|
---|
[6055] | 36 | class t_pppOptions;
|
---|
[6066] | 37 | class t_satData;
|
---|
| 38 | class t_epoData;
|
---|
[6068] | 39 | class t_output;
|
---|
[6054] | 40 |
|
---|
[6066] | 41 | class bncPPPclient : public bncEphUser {
|
---|
| 42 | public:
|
---|
[6067] | 43 | bncPPPclient(QByteArray staID, const t_pppOptions* opt);
|
---|
[6066] | 44 | ~bncPPPclient();
|
---|
[6068] | 45 | void putNewObs(const t_obs& pp, t_output* output);
|
---|
[6066] | 46 | void putNewCorrections(QList<QString> corrList);
|
---|
| 47 | QByteArray staID() const {return _staID;}
|
---|
| 48 | const t_pppOptions* opt() const {return _opt;}
|
---|
| 49 |
|
---|
| 50 | private:
|
---|
| 51 | class slipInfo {
|
---|
| 52 | public:
|
---|
| 53 | slipInfo() {
|
---|
| 54 | slipCntL1 = -1;
|
---|
| 55 | slipCntL2 = -1;
|
---|
| 56 | slipCntL5 = -1;
|
---|
| 57 | }
|
---|
| 58 | ~slipInfo(){}
|
---|
| 59 | int slipCntL1;
|
---|
| 60 | int slipCntL2;
|
---|
| 61 | int slipCntL5;
|
---|
| 62 | };
|
---|
| 63 |
|
---|
| 64 | t_irc getSatPos(const bncTime& tt, const QString& prn, ColumnVector& xc, ColumnVector& vv);
|
---|
[6068] | 65 | void processEpochs(t_output* output);
|
---|
| 66 | void processFrontEpoch(t_output* output);
|
---|
[6066] | 67 | t_irc cmpToT(t_satData* satData);
|
---|
| 68 | static t_irc applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc, ColumnVector& vv);
|
---|
| 69 |
|
---|
| 70 | const t_pppOptions* _opt;
|
---|
| 71 | QByteArray _staID;
|
---|
| 72 | QMap<QString, t_corr*> _corr;
|
---|
| 73 | bncTime _corr_tt;
|
---|
| 74 | QMap<QString, t_bias*> _bias;
|
---|
| 75 | std::queue<t_epoData*> _epoData;
|
---|
| 76 | bncModel* _model;
|
---|
| 77 | QMap<QString, slipInfo> _slips;
|
---|
| 78 | };
|
---|
| 79 |
|
---|
[6054] | 80 | class t_satData {
|
---|
| 81 | public:
|
---|
| 82 | t_satData() {
|
---|
| 83 | obsIndex = 0;
|
---|
| 84 | P1 = 0.0;
|
---|
| 85 | P2 = 0.0;
|
---|
| 86 | P5 = 0.0;
|
---|
| 87 | P3 = 0.0;
|
---|
| 88 | L1 = 0.0;
|
---|
| 89 | L2 = 0.0;
|
---|
| 90 | L5 = 0.0;
|
---|
| 91 | L3 = 0.0;
|
---|
| 92 | }
|
---|
| 93 | ~t_satData() {}
|
---|
| 94 | bncTime tt;
|
---|
| 95 | QString prn;
|
---|
| 96 | double P1;
|
---|
| 97 | double P2;
|
---|
| 98 | double P5;
|
---|
| 99 | double P3;
|
---|
| 100 | double L1;
|
---|
| 101 | double L2;
|
---|
| 102 | double L5;
|
---|
| 103 | double L3;
|
---|
| 104 | ColumnVector xx;
|
---|
| 105 | ColumnVector vv;
|
---|
| 106 | double clk;
|
---|
| 107 | double eleSat;
|
---|
| 108 | double azSat;
|
---|
| 109 | double rho;
|
---|
| 110 | bool slipFlag;
|
---|
| 111 | double lambda3;
|
---|
| 112 | unsigned obsIndex;
|
---|
| 113 | char system() const {return prn.toAscii()[0];}
|
---|
| 114 | };
|
---|
| 115 |
|
---|
| 116 | class t_epoData {
|
---|
| 117 | public:
|
---|
| 118 | t_epoData() {}
|
---|
| 119 |
|
---|
| 120 | ~t_epoData() {
|
---|
| 121 | clear();
|
---|
| 122 | }
|
---|
| 123 |
|
---|
| 124 | void clear() {
|
---|
| 125 | QMapIterator<QString, t_satData*> it(satData);
|
---|
| 126 | while (it.hasNext()) {
|
---|
| 127 | it.next();
|
---|
| 128 | delete it.value();
|
---|
| 129 | }
|
---|
| 130 | satData.clear();
|
---|
| 131 | }
|
---|
| 132 |
|
---|
| 133 | void deepCopy(const t_epoData* from) {
|
---|
| 134 | clear();
|
---|
| 135 | tt = from->tt;
|
---|
| 136 | QMapIterator<QString, t_satData*> it(from->satData);
|
---|
| 137 | while (it.hasNext()) {
|
---|
| 138 | it.next();
|
---|
| 139 | satData[it.key()] = new t_satData(*it.value());
|
---|
| 140 | }
|
---|
| 141 | }
|
---|
| 142 |
|
---|
| 143 | unsigned sizeSys(char system) const {
|
---|
| 144 | unsigned ans = 0;
|
---|
| 145 | QMapIterator<QString, t_satData*> it(satData);
|
---|
| 146 | while (it.hasNext()) {
|
---|
| 147 | it.next();
|
---|
| 148 | if (it.value()->system() == system) {
|
---|
| 149 | ++ans;
|
---|
| 150 | }
|
---|
| 151 | }
|
---|
| 152 | return ans;
|
---|
| 153 | }
|
---|
| 154 | unsigned sizeAll() const {return satData.size();}
|
---|
| 155 |
|
---|
| 156 | bncTime tt;
|
---|
| 157 | QMap<QString, t_satData*> satData;
|
---|
| 158 | };
|
---|
| 159 |
|
---|
[6055] | 160 | }
|
---|
| 161 |
|
---|
[6054] | 162 | #endif
|
---|