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

Last change on this file since 2686 was 2679, checked in by mervart, 14 years ago
File size: 4.6 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 <vector>
30#include <string>
31#include <QPointer>
32#include <QList>
33#include <QStringList>
34
35#include "bncconst.h"
36
37class t_obsInternal {
38 public:
39
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';
68 }
69
70 ~t_obsInternal() {}
71
72 int flags;
73 char StatID[20+1]; // Station ID
74 char satSys; // Satellite System ('G' or 'R')
75 int satNum; // Satellite Number (PRN for GPS NAVSTAR)
76 int slotNum; // Slot Number (for Glonass)
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)
81 double C5;
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)
86 double L5; // L5 carrier phase (cycles)
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)
89 int slip_cnt_L5; // L5 cumulative loss of continuity indicator (negative value = undefined)
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)
92 int lock_timei_L5; // L5 last lock time indicator (negative value = undefined)
93 double S1; // L1 signal-to noise ratio
94 double S2; // L2 signal-to noise ratio
95 double S5; // L5 signal-to noise ratio
96 int SNR1; // L1 signal-to noise ratio (mapped to integer)
97 int SNR2; // L2 signal-to noise ratio (mapped to integer)
98 int SNR5; // L5 signal-to noise ratio (mapped to integer)
99};
100
101class t_obs : public QObject{
102 public:
103 enum t_obs_status {initial, posted, received};
104 t_obs() {
105 _status = initial;
106 }
107 ~t_obs() {}
108 t_obsInternal _o;
109 t_obs_status _status;
110};
111
112typedef QPointer<t_obs> p_obs;
113
114class GPSDecoder {
115 public:
116 virtual t_irc Decode(char* buffer, int bufLen, std::vector<std::string>& errmsg) = 0;
117
118 virtual ~GPSDecoder() {
119 QListIterator<p_obs> it(_obsList);
120 while (it.hasNext()) {
121 p_obs obs = it.next();
122 if (!obs.isNull() && obs->_status == t_obs::initial) {
123 delete obs;
124 }
125 }
126 }
127
128 virtual int corrGPSEpochTime() const {return -1;}
129
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
151 QStringList _antType; // RTCM antenna descriptor
152 QList<t_antInfo> _antList; // RTCM antenna XYZ
153};
154
155#endif
Note: See TracBrowser for help on using the repository browser.