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

Last change on this file since 1184 was 1184, checked in by weber, 15 years ago

* empty log message *

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