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>
|
---|
29 | #include "newmat.h"
|
---|
30 | #include "bncconst.h"
|
---|
31 | #include "bnctime.h"
|
---|
32 |
|
---|
33 | class t_pppOpt;
|
---|
34 | class bncPPPclient;
|
---|
35 |
|
---|
36 | class t_rnxObsFile {
|
---|
37 |
|
---|
38 | class t_rnxObsHeader {
|
---|
39 | public:
|
---|
40 | t_rnxObsHeader();
|
---|
41 | ~t_rnxObsHeader();
|
---|
42 | t_irc read(QTextStream* stream);
|
---|
43 | float version() const {return _version;}
|
---|
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 | }
|
---|
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;}
|
---|
74 | private:
|
---|
75 | float _version;
|
---|
76 | QString _antennaName;
|
---|
77 | QString _markerName;
|
---|
78 | ColumnVector _antNEU;
|
---|
79 | ColumnVector _xyz;
|
---|
80 | QStringList _obsTypesV2;
|
---|
81 | QMap<char, QStringList> _obsTypesV3;
|
---|
82 | };
|
---|
83 |
|
---|
84 | public:
|
---|
85 | t_rnxObsFile(QString fileName);
|
---|
86 | ~t_rnxObsFile();
|
---|
87 |
|
---|
88 | int nTypes(char sys) const {return _header.nTypes(sys);}
|
---|
89 | QString obsType(char sys, int index) const {return _header.obsType(sys, index);}
|
---|
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 |
|
---|
95 | class t_satObs : public ColumnVector {
|
---|
96 | public:
|
---|
97 | QString prn;
|
---|
98 | int lli;
|
---|
99 | int snr;
|
---|
100 | };
|
---|
101 |
|
---|
102 | class t_epo {
|
---|
103 | public:
|
---|
104 | void clear() {
|
---|
105 | satObs.clear();
|
---|
106 | }
|
---|
107 | bncTime tt;
|
---|
108 | QVector<t_satObs> satObs;
|
---|
109 | };
|
---|
110 |
|
---|
111 | float version() const {return _header.version();}
|
---|
112 | const t_epo* nextEpoch();
|
---|
113 |
|
---|
114 | private:
|
---|
115 | const t_epo* nextEpochV2();
|
---|
116 | const t_epo* nextEpochV3();
|
---|
117 |
|
---|
118 | t_rnxObsHeader _header;
|
---|
119 | QFile* _file;
|
---|
120 | QTextStream* _stream;
|
---|
121 | t_epo _currEpo;
|
---|
122 | };
|
---|
123 |
|
---|
124 | #endif
|
---|