[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 <QPointer>
|
---|
| 32 | #include <QList>
|
---|
[1239] | 33 | #include <QStringList>
|
---|
[35] | 34 |
|
---|
[649] | 35 | #include "bncconst.h"
|
---|
| 36 |
|
---|
[622] | 37 | class t_obsInternal {
|
---|
| 38 | public:
|
---|
[1044] | 39 |
|
---|
[2679] | 40 | t_obsInternal() {
|
---|
| 41 | flags = 0;
|
---|
| 42 | satSys = 'G';
|
---|
| 43 | satNum = 0;
|
---|
| 44 | slotNum = 0;
|
---|
| 45 | GPSWeek = 0;
|
---|
| 46 | GPSWeeks = 0.0;
|
---|
| 47 | C1 = 0.0;
|
---|
| 48 | C2 = 0.0;
|
---|
| 49 | C5 = 0.0;
|
---|
| 50 | P1 = 0.0;
|
---|
| 51 | P2 = 0.0;
|
---|
| 52 | L1 = 0.0;
|
---|
| 53 | L2 = 0.0;
|
---|
| 54 | L5 = 0.0;
|
---|
| 55 | slip_cnt_L1 = -1;
|
---|
| 56 | slip_cnt_L2 = -1;
|
---|
| 57 | slip_cnt_L5 = -1;
|
---|
| 58 | lock_timei_L1 = -1;
|
---|
| 59 | lock_timei_L2 = -1;
|
---|
| 60 | lock_timei_L5 = -1;
|
---|
| 61 | S1 = 0.0;
|
---|
| 62 | S2 = 0.0;
|
---|
| 63 | S5 = 0.0;
|
---|
| 64 | SNR1 = 0;
|
---|
| 65 | SNR2 = 0;
|
---|
| 66 | SNR5 = 0;
|
---|
| 67 | StatID[0] = '\x0';
|
---|
[1044] | 68 | }
|
---|
[2679] | 69 |
|
---|
| 70 | ~t_obsInternal() {}
|
---|
| 71 |
|
---|
[222] | 72 | int flags;
|
---|
[1044] | 73 | char StatID[20+1]; // Station ID
|
---|
| 74 | char satSys; // Satellite System ('G' or 'R')
|
---|
| 75 | int satNum; // Satellite Number (PRN for GPS NAVSTAR)
|
---|
[2667] | 76 | int slotNum; // Slot Number (for Glonass)
|
---|
[1044] | 77 | int GPSWeek; // Week of GPS-Time
|
---|
| 78 | double GPSWeeks; // Second of Week (GPS-Time)
|
---|
| 79 | double C1; // CA-code pseudorange (meters)
|
---|
| 80 | double C2; // CA-code pseudorange (meters)
|
---|
[2679] | 81 | double C5;
|
---|
[1044] | 82 | double P1; // P1-code pseudorange (meters)
|
---|
| 83 | double P2; // P2-code pseudorange (meters)
|
---|
| 84 | double L1; // L1 carrier phase (cycles)
|
---|
| 85 | double L2; // L2 carrier phase (cycles)
|
---|
[2679] | 86 | double L5; // L5 carrier phase (cycles)
|
---|
[1044] | 87 | int slip_cnt_L1; // L1 cumulative loss of continuity indicator (negative value = undefined)
|
---|
| 88 | int slip_cnt_L2; // L2 cumulative loss of continuity indicator (negative value = undefined)
|
---|
[2679] | 89 | int slip_cnt_L5; // L5 cumulative loss of continuity indicator (negative value = undefined)
|
---|
[1044] | 90 | int lock_timei_L1; // L1 last lock time indicator (negative value = undefined)
|
---|
| 91 | int lock_timei_L2; // L2 last lock time indicator (negative value = undefined)
|
---|
[2679] | 92 | int lock_timei_L5; // L5 last lock time indicator (negative value = undefined)
|
---|
[1044] | 93 | double S1; // L1 signal-to noise ratio
|
---|
| 94 | double S2; // L2 signal-to noise ratio
|
---|
[2679] | 95 | double S5; // L5 signal-to noise ratio
|
---|
[1044] | 96 | int SNR1; // L1 signal-to noise ratio (mapped to integer)
|
---|
| 97 | int SNR2; // L2 signal-to noise ratio (mapped to integer)
|
---|
[2679] | 98 | int SNR5; // L5 signal-to noise ratio (mapped to integer)
|
---|
[222] | 99 | };
|
---|
[35] | 100 |
|
---|
[622] | 101 | class t_obs : public QObject{
|
---|
| 102 | public:
|
---|
[623] | 103 | enum t_obs_status {initial, posted, received};
|
---|
[622] | 104 | t_obs() {
|
---|
[623] | 105 | _status = initial;
|
---|
[622] | 106 | }
|
---|
[626] | 107 | ~t_obs() {}
|
---|
[622] | 108 | t_obsInternal _o;
|
---|
[623] | 109 | t_obs_status _status;
|
---|
[622] | 110 | };
|
---|
| 111 |
|
---|
| 112 | typedef QPointer<t_obs> p_obs;
|
---|
| 113 |
|
---|
[35] | 114 | class GPSDecoder {
|
---|
[622] | 115 | public:
|
---|
[1218] | 116 | virtual t_irc Decode(char* buffer, int bufLen, std::vector<std::string>& errmsg) = 0;
|
---|
[622] | 117 |
|
---|
| 118 | virtual ~GPSDecoder() {
|
---|
| 119 | QListIterator<p_obs> it(_obsList);
|
---|
| 120 | while (it.hasNext()) {
|
---|
[624] | 121 | p_obs obs = it.next();
|
---|
[625] | 122 | if (!obs.isNull() && obs->_status == t_obs::initial) {
|
---|
[624] | 123 | delete obs;
|
---|
| 124 | }
|
---|
[622] | 125 | }
|
---|
| 126 | }
|
---|
| 127 |
|
---|
[1567] | 128 | virtual int corrGPSEpochTime() const {return -1;}
|
---|
| 129 |
|
---|
[1268] | 130 | struct t_antInfo {
|
---|
| 131 | enum t_type { ARP, APC };
|
---|
| 132 |
|
---|
| 133 | t_antInfo() {
|
---|
| 134 | xx = yy = zz = height = 0.0;
|
---|
| 135 | type = ARP;
|
---|
| 136 | height_f = false;
|
---|
| 137 | message = 0;
|
---|
| 138 | };
|
---|
| 139 |
|
---|
| 140 | double xx;
|
---|
| 141 | double yy;
|
---|
| 142 | double zz;
|
---|
| 143 | t_type type;
|
---|
| 144 | double height;
|
---|
| 145 | bool height_f;
|
---|
| 146 | int message;
|
---|
| 147 | };
|
---|
| 148 |
|
---|
| 149 | QList<p_obs> _obsList;
|
---|
| 150 | QList<int> _typeList; // RTCM message types
|
---|
[1269] | 151 | QStringList _antType; // RTCM antenna descriptor
|
---|
[1268] | 152 | QList<t_antInfo> _antList; // RTCM antenna XYZ
|
---|
[222] | 153 | };
|
---|
[35] | 154 |
|
---|
| 155 | #endif
|
---|