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

Last change on this file since 2691 was 2691, checked in by mervart, 14 years ago
File size: 3.9 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 satSys = 'G';
42 satNum = 0;
43 slotNum = 0;
44 GPSWeek = 0;
45 GPSWeeks = 0.0;
46
47 C1 = 0.0;
48 P1 = 0.0;
49 L1 = 0.0;
50 S1 = 0.0;
51
52 C2 = 0.0;
53 P2 = 0.0;
54 L2 = 0.0;
55 S2 = 0.0;
56
57 C5 = 0.0;
58 L5 = 0.0;
59 S5 = 0.0;
60
61 slip_cnt_L1 = -1;
62 slip_cnt_L2 = -1;
63 slip_cnt_L5 = -1;
64 StatID[0] = '\x0';
65 }
66
67 ~t_obsInternal() {}
68
69 int flags;
70 char StatID[20+1]; // Station ID
71 char satSys; // Satellite System ('G' or 'R')
72 int satNum; // Satellite Number (PRN for GPS NAVSTAR)
73 int slotNum; // Slot Number (for Glonass)
74 int GPSWeek; // Week of GPS-Time
75 double GPSWeeks; // Second of Week (GPS-Time)
76
77 double C1; // CA-code pseudorange (meters)
78 double P1; // P1-code pseudorange (meters)
79 double L1; // L1 carrier phase (cycles)
80 double S1; // raw L1 signal strength
81
82 double C2; // CA-code pseudorange (meters)
83 double P2; // P2-code pseudorange (meters)
84 double L2; // L2 carrier phase (cycles)
85 double S2; // raw L2 signal strength
86
87 double C5; // Pseudorange (meters)
88 double L5; // L5 carrier phase (cycles)
89 double S5; // raw L5 signal strength
90
91 int slip_cnt_L1; // L1 cumulative loss of continuity indicator (negative value = undefined)
92 int slip_cnt_L2; // L2 cumulative loss of continuity indicator (negative value = undefined)
93 int slip_cnt_L5; // L5 cumulative loss of continuity indicator (negative value = undefined)
94};
95
96class t_obs : public QObject{
97 public:
98 enum t_obs_status {initial, posted, received};
99 t_obs() {
100 _status = initial;
101 }
102 ~t_obs() {}
103 t_obsInternal _o;
104 t_obs_status _status;
105};
106
107typedef QPointer<t_obs> p_obs;
108
109class GPSDecoder {
110 public:
111 virtual t_irc Decode(char* buffer, int bufLen, std::vector<std::string>& errmsg) = 0;
112
113 virtual ~GPSDecoder() {
114 QListIterator<p_obs> it(_obsList);
115 while (it.hasNext()) {
116 p_obs obs = it.next();
117 if (!obs.isNull() && obs->_status == t_obs::initial) {
118 delete obs;
119 }
120 }
121 }
122
123 virtual int corrGPSEpochTime() const {return -1;}
124
125 struct t_antInfo {
126 enum t_type { ARP, APC };
127
128 t_antInfo() {
129 xx = yy = zz = height = 0.0;
130 type = ARP;
131 height_f = false;
132 message = 0;
133 };
134
135 double xx;
136 double yy;
137 double zz;
138 t_type type;
139 double height;
140 bool height_f;
141 int message;
142 };
143
144 QList<p_obs> _obsList;
145 QList<int> _typeList; // RTCM message types
146 QStringList _antType; // RTCM antenna descriptor
147 QList<t_antInfo> _antList; // RTCM antenna XYZ
148};
149
150#endif
Note: See TracBrowser for help on using the repository browser.