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 |
|
---|
36 | class t_obs {
|
---|
37 | public:
|
---|
38 | t_obs() {
|
---|
39 | StatID[0] = '\x0';
|
---|
40 | satSys = 'G';
|
---|
41 | satNum = 0;
|
---|
42 | slotNum = 0;
|
---|
43 | GPSWeek = 0;
|
---|
44 | GPSWeeks = 0.0;
|
---|
45 | C1 = 0.0;
|
---|
46 | P1 = 0.0;
|
---|
47 | L1C = 0.0;
|
---|
48 | D1C = 0.0;
|
---|
49 | S1C = 0.0;
|
---|
50 | L1P = 0.0;
|
---|
51 | D1P = 0.0;
|
---|
52 | S1P = 0.0;
|
---|
53 | C2 = 0.0;
|
---|
54 | P2 = 0.0;
|
---|
55 | L2C = 0.0;
|
---|
56 | D2C = 0.0;
|
---|
57 | S2C = 0.0;
|
---|
58 | L2P = 0.0;
|
---|
59 | D2P = 0.0;
|
---|
60 | S2P = 0.0;
|
---|
61 | C5 = 0.0;
|
---|
62 | L5 = 0.0;
|
---|
63 | D5 = 0.0;
|
---|
64 | S5 = 0.0;
|
---|
65 | slip_cnt_L1 = -1;
|
---|
66 | slip_cnt_L2 = -1;
|
---|
67 | slip_cnt_L5 = -1;
|
---|
68 | }
|
---|
69 |
|
---|
70 | ~t_obs() {}
|
---|
71 |
|
---|
72 | double L1() const {return (L1P != 0.0 ? L1P : L1C);}
|
---|
73 | double L2() const {return (L2P != 0.0 ? L2P : L2C);}
|
---|
74 | double S1() const {return (L1P != 0.0 ? S1P : S1C);}
|
---|
75 | double S2() const {return (L2P != 0.0 ? S2P : S2C);}
|
---|
76 |
|
---|
77 | char StatID[20+1]; // Station ID
|
---|
78 | char satSys; // Satellite System ('G' or 'R')
|
---|
79 | int satNum; // Satellite Number (PRN for GPS NAVSTAR)
|
---|
80 | int slotNum; // Slot Number (for Glonass)
|
---|
81 | int GPSWeek; // Week of GPS-Time
|
---|
82 | double GPSWeeks; // Second of Week (GPS-Time)
|
---|
83 |
|
---|
84 | double C1; // CA-code pseudorange (meters)
|
---|
85 | double L1C; // L1 carrier phase (cycles)
|
---|
86 | double D1C; // Doppler L1
|
---|
87 | double S1C; // raw L1 signal strength
|
---|
88 | bool has1C() const {return C1 != 0.0 || L1C != 0.0 || D1C != 0.0 || S1C != 0.0;}
|
---|
89 |
|
---|
90 | double P1; // P1-code pseudorange (meters)
|
---|
91 | double L1P; // L1 carrier phase (cycles)
|
---|
92 | double D1P; // Doppler L1
|
---|
93 | double S1P; // raw L1 signal strength
|
---|
94 | bool has1P() const {return P1 != 0.0 || L1P != 0.0 || D1P != 0.0 || S1P != 0.0;}
|
---|
95 |
|
---|
96 | double C2; // CA-code pseudorange (meters)
|
---|
97 | double L2C; // L2 carrier phase (cycles)
|
---|
98 | double D2C; // Doppler L2
|
---|
99 | double S2C; // raw L2 signal strength
|
---|
100 | bool has2C() const {return C2 != 0.0 || L2C != 0.0 || D2C != 0.0 || S2C != 0.0;}
|
---|
101 |
|
---|
102 | double P2; // P2-code pseudorange (meters)
|
---|
103 | double L2P; // L2 carrier phase (cycles)
|
---|
104 | double D2P; // Doppler L2
|
---|
105 | double S2P; // raw L2 signal strength
|
---|
106 | bool has2P() const {return P2 != 0.0 || L2P != 0.0 || D2P != 0.0 || S2P != 0.0;}
|
---|
107 |
|
---|
108 | double C5; // Pseudorange (meters)
|
---|
109 | double L5; // L5 carrier phase (cycles)
|
---|
110 | double D5; // Doppler L5
|
---|
111 | double S5; // raw L5 signal strength
|
---|
112 | bool has5C() const {return C5 != 0.0 || L5 != 0.0 || D5 != 0.0 || S5 != 0.0;}
|
---|
113 |
|
---|
114 | int slip_cnt_L1; // L1 cumulative loss of continuity indicator (negative value = undefined)
|
---|
115 | int slip_cnt_L2; // L2 cumulative loss of continuity indicator (negative value = undefined)
|
---|
116 | int slip_cnt_L5; // L5 cumulative loss of continuity indicator (negative value = undefined)
|
---|
117 | };
|
---|
118 |
|
---|
119 | class GPSDecoder {
|
---|
120 | public:
|
---|
121 | virtual t_irc Decode(char* buffer, int bufLen, std::vector<std::string>& errmsg) = 0;
|
---|
122 |
|
---|
123 | virtual ~GPSDecoder() {}
|
---|
124 |
|
---|
125 | virtual int corrGPSEpochTime() const {return -1;}
|
---|
126 |
|
---|
127 | struct t_antInfo {
|
---|
128 | enum t_type { ARP, APC };
|
---|
129 |
|
---|
130 | t_antInfo() {
|
---|
131 | xx = yy = zz = height = 0.0;
|
---|
132 | type = ARP;
|
---|
133 | height_f = false;
|
---|
134 | message = 0;
|
---|
135 | };
|
---|
136 |
|
---|
137 | double xx;
|
---|
138 | double yy;
|
---|
139 | double zz;
|
---|
140 | t_type type;
|
---|
141 | double height;
|
---|
142 | bool height_f;
|
---|
143 | int message;
|
---|
144 | };
|
---|
145 |
|
---|
146 | QList<t_obs> _obsList;
|
---|
147 | QList<int> _typeList; // RTCM message types
|
---|
148 | QStringList _antType; // RTCM antenna descriptor
|
---|
149 | QList<t_antInfo> _antList; // RTCM antenna XYZ
|
---|
150 | };
|
---|
151 |
|
---|
152 | #endif
|
---|