[297] | 1 | // Part of BNC, a utility for retrieving decoding and
|
---|
[464] | 2 | // converting GNSS data streams from NTRIP broadcasters.
|
---|
[297] | 3 | //
|
---|
[464] | 4 | // Copyright (C) 2007
|
---|
[297] | 5 | // German Federal Agency for Cartography and Geodesy (BKG)
|
---|
| 6 | // http://www.bkg.bund.de
|
---|
[464] | 7 | // Czech Technical University Prague, Department of Geodesy
|
---|
[297] | 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.
|
---|
[35] | 24 |
|
---|
[222] | 25 | #ifndef GPSDECODER_H
|
---|
| 26 | #define GPSDECODER_H
|
---|
| 27 |
|
---|
[625] | 28 | #include <iostream>
|
---|
[1218] | 29 | #include <vector>
|
---|
| 30 | #include <string>
|
---|
[621] | 31 | #include <QList>
|
---|
[1239] | 32 | #include <QStringList>
|
---|
[35] | 33 |
|
---|
[649] | 34 | #include "bncconst.h"
|
---|
[3528] | 35 | #include "bncrinex.h"
|
---|
[649] | 36 |
|
---|
[4389] | 37 | extern "C" {
|
---|
| 38 | #include "rtcm3torinex.h"
|
---|
| 39 | }
|
---|
| 40 |
|
---|
[2709] | 41 | class t_obs {
|
---|
| 42 | public:
|
---|
| 43 | t_obs() {
|
---|
[2712] | 44 | StatID[0] = '\x0';
|
---|
[2709] | 45 | satSys = 'G';
|
---|
| 46 | satNum = 0;
|
---|
| 47 | slotNum = 0;
|
---|
| 48 | GPSWeek = 0;
|
---|
| 49 | GPSWeeks = 0.0;
|
---|
[4389] | 50 | _dataflags = 0;
|
---|
| 51 | _dataflags2 = 0;
|
---|
[4403] | 52 | for (int ie = 0; ie < GNSSENTRY_NUMBER; ie++) {
|
---|
| 53 | _measdata[ie] = 0.0;
|
---|
[4389] | 54 | }
|
---|
[2709] | 55 | slip_cnt_L1 = -1;
|
---|
| 56 | slip_cnt_L2 = -1;
|
---|
| 57 | slip_cnt_L5 = -1;
|
---|
[4560] | 58 | snrL1 = 0;
|
---|
| 59 | snrL2 = 0;
|
---|
| 60 | snrL5 = 0;
|
---|
[4608] | 61 | slipL1 = false;
|
---|
| 62 | slipL2 = false;
|
---|
| 63 | slipL5 = false;
|
---|
[2709] | 64 | }
|
---|
| 65 |
|
---|
| 66 | ~t_obs() {}
|
---|
| 67 |
|
---|
[5550] | 68 | double measdata(QString rnxStr, float rnxVer) const;
|
---|
[5367] | 69 | void setMeasdata(QString rnxStr, float rnxVer, double value);
|
---|
[2709] | 70 |
|
---|
[2691] | 71 | char StatID[20+1]; // Station ID
|
---|
| 72 | char satSys; // Satellite System ('G' or 'R')
|
---|
| 73 | int satNum; // Satellite Number (PRN for GPS NAVSTAR)
|
---|
| 74 | int slotNum; // Slot Number (for Glonass)
|
---|
| 75 | int GPSWeek; // Week of GPS-Time
|
---|
| 76 | double GPSWeeks; // Second of Week (GPS-Time)
|
---|
| 77 |
|
---|
| 78 | int slip_cnt_L1; // L1 cumulative loss of continuity indicator (negative value = undefined)
|
---|
| 79 | int slip_cnt_L2; // L2 cumulative loss of continuity indicator (negative value = undefined)
|
---|
| 80 | int slip_cnt_L5; // L5 cumulative loss of continuity indicator (negative value = undefined)
|
---|
[4560] | 81 |
|
---|
| 82 | int snrL1; // signal-to-noise ratio mapped to <1,9>
|
---|
| 83 | int snrL2; // s = int(floor(SNR/6)); if (s > 9) s = 9; if (s < 1) s = 1;
|
---|
| 84 | int snrL5;
|
---|
[4608] | 85 |
|
---|
| 86 | bool slipL1;
|
---|
| 87 | bool slipL2;
|
---|
| 88 | bool slipL5;
|
---|
[4389] | 89 |
|
---|
| 90 | double _measdata[GNSSENTRY_NUMBER]; // data fields */
|
---|
| 91 | unsigned long long _dataflags; // GNSSDF_xxx */
|
---|
| 92 | unsigned int _dataflags2; // GNSSDF2_xxx */
|
---|
[5366] | 93 | QString _codetype[GNSSENTRY_NUMBER];
|
---|
[4403] | 94 |
|
---|
[4774] | 95 | QString rnxStr(int iEntry) const;
|
---|
[4440] | 96 |
|
---|
[4403] | 97 | private:
|
---|
[5551] | 98 | int iEntry(QString rnxStr, float rnxVers, bool cmode=false) const;
|
---|
[222] | 99 | };
|
---|
[35] | 100 |
|
---|
| 101 | class GPSDecoder {
|
---|
[622] | 102 | public:
|
---|
[3528] | 103 | GPSDecoder();
|
---|
[622] | 104 |
|
---|
[3528] | 105 | virtual ~GPSDecoder() {delete _rnx;}
|
---|
[622] | 106 |
|
---|
[3528] | 107 | virtual t_irc Decode(char* buffer, int bufLen,
|
---|
| 108 | std::vector<std::string>& errmsg) = 0;
|
---|
| 109 |
|
---|
| 110 |
|
---|
[1567] | 111 | virtual int corrGPSEpochTime() const {return -1;}
|
---|
| 112 |
|
---|
[3529] | 113 | void initRinex(const QByteArray& staID, const QUrl& mountPoint,
|
---|
| 114 | const QByteArray& latitude, const QByteArray& longitude,
|
---|
| 115 | const QByteArray& nmea, const QByteArray& ntripVersion);
|
---|
| 116 |
|
---|
[3528] | 117 | void dumpRinexEpoch(const t_obs& obs, const QByteArray& format);
|
---|
| 118 |
|
---|
| 119 | void setRinexReconnectFlag(bool flag);
|
---|
| 120 |
|
---|
[1268] | 121 | struct t_antInfo {
|
---|
| 122 | enum t_type { ARP, APC };
|
---|
| 123 |
|
---|
| 124 | t_antInfo() {
|
---|
| 125 | xx = yy = zz = height = 0.0;
|
---|
| 126 | type = ARP;
|
---|
| 127 | height_f = false;
|
---|
| 128 | message = 0;
|
---|
| 129 | };
|
---|
| 130 |
|
---|
| 131 | double xx;
|
---|
| 132 | double yy;
|
---|
| 133 | double zz;
|
---|
| 134 | t_type type;
|
---|
| 135 | double height;
|
---|
| 136 | bool height_f;
|
---|
| 137 | int message;
|
---|
| 138 | };
|
---|
| 139 |
|
---|
[2711] | 140 | QList<t_obs> _obsList;
|
---|
[3528] | 141 | QList<int> _typeList; // RTCM message types
|
---|
| 142 | QStringList _antType; // RTCM antenna descriptor
|
---|
| 143 | QList<t_antInfo> _antList; // RTCM antenna XYZ
|
---|
| 144 | bncRinex* _rnx; // RINEX writer
|
---|
[222] | 145 | };
|
---|
[35] | 146 |
|
---|
| 147 | #endif
|
---|