source: ntrip/trunk/BNC/src/RTCM/GPSDecoder.h@ 4375

Last change on this file since 4375 was 4375, checked in by mervart, 13 years ago
File size: 5.3 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 <QList>
32#include <QStringList>
33
34#include "bncconst.h"
35#include "bncrinex.h"
36
37class t_obs {
38 public:
39 t_obs() {
40 StatID[0] = '\x0';
41 satSys = 'G';
42 satNum = 0;
43 slotNum = 0;
44 GPSWeek = 0;
45 GPSWeeks = 0.0;
46 C1 = 0.0;
47 P1 = 0.0;
48 L1C = 0.0;
49 D1C = 0.0;
50 S1C = 0.0;
51 L1P = 0.0;
52 D1P = 0.0;
53 S1P = 0.0;
54 C2 = 0.0;
55 P2 = 0.0;
56 L2C = 0.0;
57 D2C = 0.0;
58 S2C = 0.0;
59 L2P = 0.0;
60 D2P = 0.0;
61 S2P = 0.0;
62 C5 = 0.0;
63 L5 = 0.0;
64 D5 = 0.0;
65 S5 = 0.0;
66 slip_cnt_L1 = -1;
67 slip_cnt_L2 = -1;
68 slip_cnt_L5 = -1;
69 codetype = 0;
70 }
71
72 ~t_obs() {}
73
74 double p1() const {return (P1 != 0.0 ? P1 : C1);}
75 double p2() const {return (P2 != 0.0 ? P2 : C2);}
76 double l1() const {return (L1P != 0.0 ? L1P : L1C);}
77 double l2() const {return (L2P != 0.0 ? L2P : L2C);}
78 double s1() const {return (L1P != 0.0 ? S1P : S1C);}
79 double s2() const {return (L2P != 0.0 ? S2P : S2C);}
80
81 char StatID[20+1]; // Station ID
82 char satSys; // Satellite System ('G' or 'R')
83 int satNum; // Satellite Number (PRN for GPS NAVSTAR)
84 int slotNum; // Slot Number (for Glonass)
85 int GPSWeek; // Week of GPS-Time
86 double GPSWeeks; // Second of Week (GPS-Time)
87
88 double C1; // CA-code pseudorange (meters)
89 double L1C; // L1 carrier phase (cycles)
90 double D1C; // Doppler L1
91 double S1C; // raw L1 signal strength
92 bool has1C() const {return C1 != 0.0 || L1C != 0.0 || D1C != 0.0 || S1C != 0.0;}
93
94 double P1; // P1-code pseudorange (meters)
95 double L1P; // L1 carrier phase (cycles)
96 double D1P; // Doppler L1
97 double S1P; // raw L1 signal strength
98 bool has1P() const {return P1 != 0.0 || L1P != 0.0 || D1P != 0.0 || S1P != 0.0;}
99
100 double C2; // CA-code pseudorange (meters)
101 double L2C; // L2 carrier phase (cycles)
102 double D2C; // Doppler L2
103 double S2C; // raw L2 signal strength
104 bool has2C() const {return C2 != 0.0 || L2C != 0.0 || D2C != 0.0 || S2C != 0.0;}
105
106 double P2; // P2-code pseudorange (meters)
107 double L2P; // L2 carrier phase (cycles)
108 double D2P; // Doppler L2
109 double S2P; // raw L2 signal strength
110 bool has2P() const {return P2 != 0.0 || L2P != 0.0 || D2P != 0.0 || S2P != 0.0;}
111
112 double C5; // Pseudorange (meters)
113 double L5; // L5 carrier phase (cycles)
114 double D5; // Doppler L5
115 double S5; // raw L5 signal strength
116 bool has5C() const {return C5 != 0.0 || L5 != 0.0 || D5 != 0.0 || S5 != 0.0;}
117
118 int slip_cnt_L1; // L1 cumulative loss of continuity indicator (negative value = undefined)
119 int slip_cnt_L2; // L2 cumulative loss of continuity indicator (negative value = undefined)
120 int slip_cnt_L5; // L5 cumulative loss of continuity indicator (negative value = undefined)
121
122 const char* codetype;
123};
124
125class GPSDecoder {
126 public:
127 GPSDecoder();
128
129 virtual ~GPSDecoder() {delete _rnx;}
130
131 virtual t_irc Decode(char* buffer, int bufLen,
132 std::vector<std::string>& errmsg) = 0;
133
134
135 virtual int corrGPSEpochTime() const {return -1;}
136
137 void initRinex(const QByteArray& staID, const QUrl& mountPoint,
138 const QByteArray& latitude, const QByteArray& longitude,
139 const QByteArray& nmea, const QByteArray& ntripVersion);
140
141 void dumpRinexEpoch(const t_obs& obs, const QByteArray& format);
142
143 void setRinexReconnectFlag(bool flag);
144
145 struct t_antInfo {
146 enum t_type { ARP, APC };
147
148 t_antInfo() {
149 xx = yy = zz = height = 0.0;
150 type = ARP;
151 height_f = false;
152 message = 0;
153 };
154
155 double xx;
156 double yy;
157 double zz;
158 t_type type;
159 double height;
160 bool height_f;
161 int message;
162 };
163
164 QList<t_obs> _obsList;
165 QList<int> _typeList; // RTCM message types
166 QStringList _antType; // RTCM antenna descriptor
167 QList<t_antInfo> _antList; // RTCM antenna XYZ
168 bncRinex* _rnx; // RINEX writer
169};
170
171#endif
Note: See TracBrowser for help on using the repository browser.