source: ntrip/trunk/BNC/RTCM/GPSDecoder.h@ 1218

Last change on this file since 1218 was 1218, checked in by mervart, 15 years ago

Zdenek Lukes:
a) changed logic how the ephemerides are stored for decoding of message 20/21 RTCM 2.3
b) added some debugging output (enabled is macro DEBUG_RTCM2_2021 is defined)

File size: 4.2 KB
RevLine 
[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>
[35]33
[649]34#include "bncconst.h"
35
[622]36class t_obsInternal {
37 public:
[1044]38
39 t_obsInternal() :
40 flags(0),
41 satSys(' '),
42 satNum(0),
43 slot(0),
44 GPSWeek(0),
45 GPSWeeks(0.0),
46 C1(0.0),
47 C2(0.0),
48 P1(0.0),
49 P2(0.0),
50 L1(0.0),
51 L2(0.0),
52 slip_cnt_L1(-1),
53 slip_cnt_L2(-1),
54 lock_timei_L1(-1),
55 lock_timei_L2(-1),
56 S1(0.0),
57 S2(0.0),
58 SNR1(0),
59 SNR2(0) {
60 StatID[0] = '\x0';
61 }
[222]62 int flags;
[1044]63 char StatID[20+1]; // Station ID
64 char satSys; // Satellite System ('G' or 'R')
65 int satNum; // Satellite Number (PRN for GPS NAVSTAR)
66 int slot; // Slot Number (for Glonass)
67 int GPSWeek; // Week of GPS-Time
68 double GPSWeeks; // Second of Week (GPS-Time)
69 double C1; // CA-code pseudorange (meters)
70 double C2; // CA-code pseudorange (meters)
71 double P1; // P1-code pseudorange (meters)
72 double P2; // P2-code pseudorange (meters)
73 double L1; // L1 carrier phase (cycles)
74 double L2; // L2 carrier phase (cycles)
75 int slip_cnt_L1; // L1 cumulative loss of continuity indicator (negative value = undefined)
76 int slip_cnt_L2; // L2 cumulative loss of continuity indicator (negative value = undefined)
77 int lock_timei_L1; // L1 last lock time indicator (negative value = undefined)
78 int lock_timei_L2; // L2 last lock time indicator (negative value = undefined)
79 double S1; // L1 signal-to noise ratio
80 double S2; // L2 signal-to noise ratio
81 int SNR1; // L1 signal-to noise ratio (mapped to integer)
82 int SNR2; // L2 signal-to noise ratio (mapped to integer)
[222]83};
[35]84
[622]85class t_obs : public QObject{
86 public:
[623]87 enum t_obs_status {initial, posted, received};
[621]88
[622]89 t_obs() {
[623]90 _status = initial;
91
[1044]92 _o.flags = 0;
93 _o.StatID[0] = '\0';
94 _o.satSys = 'G';
95 _o.satNum = 0;
96 _o.slot = 0;
97 _o.GPSWeek = 0;
98 _o.GPSWeeks = 0.0;
99 _o.C1 = 0.0;
100 _o.C2 = 0.0;
101 _o.P1 = 0.0;
102 _o.P2 = 0.0;
103 _o.L1 = 0.0;
104 _o.L2 = 0.0;
105 _o.S1 = 0.0;
106 _o.S2 = 0.0;
107 _o.slip_cnt_L1 = -1;
108 _o.slip_cnt_L2 = -1;
109 _o.lock_timei_L1 = -1;
110 _o.lock_timei_L2 = -1;
111 _o.SNR1 = 0;
112 _o.SNR2 = 0;
[622]113 }
114
[626]115 ~t_obs() {}
[625]116
[622]117 t_obsInternal _o;
[623]118 t_obs_status _status;
[622]119};
120
121typedef QPointer<t_obs> p_obs;
122
[35]123class GPSDecoder {
[622]124 public:
[1218]125 virtual t_irc Decode(char* buffer, int bufLen, std::vector<std::string>& errmsg) = 0;
[622]126
127 virtual ~GPSDecoder() {
128 QListIterator<p_obs> it(_obsList);
129 while (it.hasNext()) {
[624]130 p_obs obs = it.next();
[625]131 if (!obs.isNull() && obs->_status == t_obs::initial) {
[624]132 delete obs;
133 }
[622]134 }
135 }
136
137 QList<p_obs> _obsList;
[1184]138 QList<int> _typeList; // RTCMv3 message types
[1130]139 QList<int> _epochList; // Broadcast corrections
[1184]140 QList<char*> _antType; // RTCMv3 antenna descriptor
141 QList<double> _antList5; // RTCMv3 antenna XYZ
142 QList<double> _antList6; // RTCMv3 antenna XYZ & H
[222]143};
[35]144
145#endif
Note: See TracBrowser for help on using the repository browser.