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

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