[3645] | 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 RNXOBSFILE_H
|
---|
| 26 | #define RNXOBSFILE_H
|
---|
| 27 |
|
---|
| 28 | #include <QtCore>
|
---|
[3672] | 29 | #include "newmat.h"
|
---|
[3645] | 30 | #include "bncconst.h"
|
---|
[3680] | 31 | #include "bnctime.h"
|
---|
[3645] | 32 |
|
---|
| 33 | class t_pppOpt;
|
---|
| 34 | class bncPPPclient;
|
---|
| 35 |
|
---|
| 36 | class t_rnxObsFile {
|
---|
[3646] | 37 |
|
---|
| 38 | class t_rnxObsHeader {
|
---|
| 39 | public:
|
---|
| 40 | t_rnxObsHeader();
|
---|
| 41 | ~t_rnxObsHeader();
|
---|
| 42 | t_irc read(QTextStream* stream);
|
---|
[3672] | 43 | float version() const {return _version;}
|
---|
[3704] | 44 | int nTypes(char sys) const {
|
---|
| 45 | if (_version < 3.0) {
|
---|
| 46 | return _obsTypesV2.size();
|
---|
| 47 | }
|
---|
| 48 | else {
|
---|
| 49 | if (_obsTypesV3.find(sys) != _obsTypesV3.end()) {
|
---|
| 50 | return _obsTypesV3.size();
|
---|
| 51 | }
|
---|
| 52 | else {
|
---|
| 53 | return 0;
|
---|
| 54 | }
|
---|
| 55 | }
|
---|
| 56 | }
|
---|
| 57 | QString obsType(char sys, int index) const {
|
---|
| 58 | if (_version < 3.0) {
|
---|
| 59 | return _obsTypesV2.at(index);
|
---|
| 60 | }
|
---|
| 61 | else {
|
---|
| 62 | if (_obsTypesV3.find(sys) != _obsTypesV3.end()) {
|
---|
| 63 | return _obsTypesV3[sys].at(index);
|
---|
| 64 | }
|
---|
| 65 | else {
|
---|
| 66 | return QString();
|
---|
| 67 | }
|
---|
| 68 | }
|
---|
| 69 | }
|
---|
[3672] | 70 | const QString& antennaName() const {return _antennaName;}
|
---|
| 71 | const QString& markerName() const {return _markerName;}
|
---|
| 72 | const ColumnVector& xyz() const {return _xyz;}
|
---|
| 73 | const ColumnVector& antNEU() const {return _antNEU;}
|
---|
[3646] | 74 | private:
|
---|
[3704] | 75 | float _version;
|
---|
| 76 | QString _antennaName;
|
---|
| 77 | QString _markerName;
|
---|
| 78 | ColumnVector _antNEU;
|
---|
| 79 | ColumnVector _xyz;
|
---|
| 80 | QStringList _obsTypesV2;
|
---|
| 81 | QMap<char, QStringList> _obsTypesV3;
|
---|
[3646] | 82 | };
|
---|
[3645] | 83 |
|
---|
| 84 | public:
|
---|
[3646] | 85 | t_rnxObsFile(QString fileName);
|
---|
[3645] | 86 | ~t_rnxObsFile();
|
---|
| 87 |
|
---|
[3704] | 88 | int nTypes(char sys) const {return _header.nTypes(sys);}
|
---|
| 89 | QString obsType(char sys, int index) const {return _header.obsType(sys, index);}
|
---|
[3680] | 90 | const QString& antennaName() const {return _header.antennaName();}
|
---|
| 91 | const QString& markerName() const {return _header.markerName();}
|
---|
| 92 | const ColumnVector& xyz() const {return _header.xyz();}
|
---|
| 93 | const ColumnVector& antNEU() const {return _header.antNEU();}
|
---|
| 94 |
|
---|
[3676] | 95 | class t_satObs : public ColumnVector {
|
---|
| 96 | public:
|
---|
[3677] | 97 | QString prn;
|
---|
| 98 | int lli;
|
---|
| 99 | int snr;
|
---|
[3676] | 100 | };
|
---|
| 101 |
|
---|
[3675] | 102 | class t_epo {
|
---|
| 103 | public:
|
---|
[3676] | 104 | void clear() {
|
---|
| 105 | satObs.clear();
|
---|
| 106 | }
|
---|
[3680] | 107 | bncTime tt;
|
---|
[3677] | 108 | QVector<t_satObs> satObs;
|
---|
[3675] | 109 | };
|
---|
| 110 |
|
---|
[3673] | 111 | float version() const {return _header.version();}
|
---|
[3675] | 112 | const t_epo* nextEpoch();
|
---|
[3645] | 113 |
|
---|
| 114 | private:
|
---|
[3675] | 115 | const t_epo* nextEpochV2();
|
---|
| 116 | const t_epo* nextEpochV3();
|
---|
[3673] | 117 |
|
---|
[3646] | 118 | t_rnxObsHeader _header;
|
---|
| 119 | QFile* _file;
|
---|
| 120 | QTextStream* _stream;
|
---|
[3675] | 121 | t_epo _currEpo;
|
---|
[3645] | 122 | };
|
---|
| 123 |
|
---|
| 124 | #endif
|
---|