source: ntrip/trunk/BNC/rinex/rnxobsfile.h@ 3753

Last change on this file since 3753 was 3718, checked in by mervart, 13 years ago
File size: 3.9 KB
RevLine 
[3716]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
[3718]28#include <QtCore>
[3717]29
[3716]30#include <fstream>
31#include <vector>
32#include <map>
33
34#include "newmat.h"
35#include "bncconst.h"
36#include "bnctime.h"
37
38#define MAXPRN_GPS 32
39
40class t_rnxObsFile {
41 public:
42
43 class t_rnxSat {
44 public:
45 char satSys;
46 int satNum;
47 std::vector<double> obs;
48 std::vector<int> lli;
49 std::vector<int> snr;
50 };
51
52 class t_rnxEpo {
53 public:
54 void clear() {
55 rnxSat.clear();
56 }
57 bncTime tt;
58 std::vector<t_rnxSat> rnxSat;
59 };
60
[3717]61 t_rnxObsFile(const QString& fileName);
[3716]62 ~t_rnxObsFile();
63
64 float version() const {return _header._version;}
65 double interval() const {return _header._interval;}
66 int nTypes(char sys) const {return _header.nTypes(sys);}
[3717]67 const QString& fileName() const {return _fileName;}
68 const QString& obsType(char sys, int index) const {return _header.obsType(sys, index);}
69 const QString& antennaName() const {return _header._antennaName;}
70 const QString& markerName() const {return _header._markerName;}
[3716]71 const ColumnVector& xyz() const {return _header._xyz;}
72 const ColumnVector& antNEU() const {return _header._antNEU;}
73 const ColumnVector& antXYZ() const {return _header._antXYZ;}
74 const ColumnVector& antBSG() const {return _header._antBSG;}
75 const t_rnxEpo* nextEpoch();
76 int wlFactorL1(unsigned iPrn) {
77 return iPrn <= MAXPRN_GPS ? _header._wlFactorsL1[iPrn] : 1;
78 }
79 int wlFactorL2(unsigned iPrn) {
80 return iPrn <= MAXPRN_GPS ? _header._wlFactorsL2[iPrn] : 1;
81 }
82
83 protected:
84 t_rnxObsFile() {};
[3717]85 void open(const QString& fileName);
[3716]86 void close();
87
88 private:
89 class t_rnxObsHeader {
90 public:
91 t_rnxObsHeader();
92 ~t_rnxObsHeader();
93
[3718]94 t_irc read(QTextStream* stream, int maxLines = 0);
[3717]95 int nTypes(char sys) const;
96 const QString& obsType(char sys, int index) const;
[3716]97
[3717]98 static const QString _emptyStr;
99 float _version;
100 double _interval;
101 QString _antennaName;
102 QString _markerName;
103 ColumnVector _antNEU;
104 ColumnVector _antXYZ;
105 ColumnVector _antBSG;
106 ColumnVector _xyz;
107 std::vector<QString> _obsTypesV2;
108 std::map<char, std::vector<QString> > _obsTypesV3;
109 int _wlFactorsL1[MAXPRN_GPS+1];
110 int _wlFactorsL2[MAXPRN_GPS+1];
[3716]111 };
112
113 const t_rnxEpo* nextEpochV2();
114 const t_rnxEpo* nextEpochV3();
[3717]115 void handleEpochFlag(int flag, const QString& line);
[3716]116
[3718]117 QFile* _file;
[3717]118 QString _fileName;
[3718]119 QTextStream* _stream;
[3716]120 t_rnxObsHeader _header;
121 t_rnxEpo _currEpo;
122 bool _flgPowerFail;
123};
124
125#endif
Note: See TracBrowser for help on using the repository browser.