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 RNXNAVFILE_H
|
---|
26 | #define RNXNAVFILE_H
|
---|
27 | #include <iostream>
|
---|
28 | #include <queue>
|
---|
29 | #include <QtCore>
|
---|
30 | #include "bncconst.h"
|
---|
31 | #include "bnctime.h"
|
---|
32 | #include "ephemeris.h"
|
---|
33 |
|
---|
34 | class t_pppOpt;
|
---|
35 | class bncPPPclient;
|
---|
36 | class t_eph;
|
---|
37 | using namespace std;
|
---|
38 | #define defaultRnxNavVersion2 2.11
|
---|
39 | #define defaultRnxNavVersion3 3.05
|
---|
40 | #define defaultRnxNavVersion4 4.00
|
---|
41 |
|
---|
42 | class t_rnxNavFile {
|
---|
43 |
|
---|
44 | public:
|
---|
45 | enum e_inpOut {input, output};
|
---|
46 | private:
|
---|
47 | class t_rnxNavHeader {
|
---|
48 | public:
|
---|
49 | t_rnxNavHeader();
|
---|
50 | ~t_rnxNavHeader();
|
---|
51 | t_irc read(QTextStream* stream);
|
---|
52 | double _version;
|
---|
53 | bool _glonass;
|
---|
54 | t_eph::e_type _satSys;
|
---|
55 | QStringList _comments;
|
---|
56 | QStringList _runByDate;
|
---|
57 | };
|
---|
58 |
|
---|
59 | public:
|
---|
60 | t_rnxNavFile(const QString& fileName, e_inpOut inpOut);
|
---|
61 | ~t_rnxNavFile();
|
---|
62 | t_eph* getNextEph(const bncTime& tt, const QMap<QString, unsigned int>* corrIODs);
|
---|
63 | const std::vector<t_eph*> ephs() const {return _ephs;}
|
---|
64 | double version() const {return _header._version;}
|
---|
65 | void setVersion(double version) {_header._version = version;}
|
---|
66 | bool glonass() const {return _header._glonass;}
|
---|
67 | QStringList comments() const {return _header._comments;}
|
---|
68 | QStringList runByDate() const {return _header._runByDate;}
|
---|
69 | t_eph::e_type satSystem() const {return _header._satSys;}
|
---|
70 | void setGlonass(bool glo) {_header._glonass = glo;}
|
---|
71 | void setGnssTypeV3(t_eph::e_type sys) {_header._satSys = sys;}
|
---|
72 | void writeHeader(const QMap<QString, QString>* txtMap = 0, int numMergedFiles = 0, int leapSecs = 0);
|
---|
73 | void writeEph(const t_eph* eph);
|
---|
74 |
|
---|
75 | protected:
|
---|
76 | t_rnxNavFile() {};
|
---|
77 | void openRead(const QString& fileName);
|
---|
78 | void openWrite(const QString& fileName);
|
---|
79 | void close();
|
---|
80 |
|
---|
81 | private:
|
---|
82 | void read(QTextStream* stream);
|
---|
83 |
|
---|
84 | e_inpOut _inpOut;
|
---|
85 | QFile* _file;
|
---|
86 | QString _fileName;
|
---|
87 | QTextStream* _stream;
|
---|
88 | std::vector<t_eph*> _ephs;
|
---|
89 | t_rnxNavHeader _header;
|
---|
90 | };
|
---|
91 |
|
---|
92 | #endif
|
---|