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

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