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