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

Last change on this file since 4560 was 4560, checked in by mervart, 12 years ago
File size: 4.0 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
37extern "C" {
38#include "rtcm3torinex.h"
39}
40
41class t_obs {
42 public:
43 t_obs() {
44 StatID[0] = '\x0';
45 satSys = 'G';
46 satNum = 0;
47 slotNum = 0;
48 GPSWeek = 0;
49 GPSWeeks = 0.0;
50 _dataflags = 0;
51 _dataflags2 = 0;
52 for (int ie = 0; ie < GNSSENTRY_NUMBER; ie++) {
53 _measdata[ie] = 0.0;
54 _codetype[ie] = 0;
55 }
56 slip_cnt_L1 = -1;
57 slip_cnt_L2 = -1;
58 slip_cnt_L5 = -1;
59 snrL1 = 0;
60 snrL2 = 0;
61 snrL5 = 0;
62 }
63
64 ~t_obs() {}
65
66 double measdata(const QString& rnxStr, float rnxVer) const;
67 void setMeasdata(const QString& rnxStr, float rnxVer, double value);
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 int slip_cnt_L1; // L1 cumulative loss of continuity indicator (negative value = undefined)
77 int slip_cnt_L2; // L2 cumulative loss of continuity indicator (negative value = undefined)
78 int slip_cnt_L5; // L5 cumulative loss of continuity indicator (negative value = undefined)
79
80 int snrL1; // signal-to-noise ratio mapped to <1,9>
81 int snrL2; // s = int(floor(SNR/6)); if (s > 9) s = 9; if (s < 1) s = 1;
82 int snrL5;
83
84 double _measdata[GNSSENTRY_NUMBER]; // data fields */
85 unsigned long long _dataflags; // GNSSDF_xxx */
86 unsigned int _dataflags2; // GNSSDF2_xxx */
87 const char* _codetype[GNSSENTRY_NUMBER];
88
89 QString rnxStr(int iEntry);
90
91 private:
92 int iEntry(QString rnxStr, float rnxVer) const;
93};
94
95class GPSDecoder {
96 public:
97 GPSDecoder();
98
99 virtual ~GPSDecoder() {delete _rnx;}
100
101 virtual t_irc Decode(char* buffer, int bufLen,
102 std::vector<std::string>& errmsg) = 0;
103
104
105 virtual int corrGPSEpochTime() const {return -1;}
106
107 void initRinex(const QByteArray& staID, const QUrl& mountPoint,
108 const QByteArray& latitude, const QByteArray& longitude,
109 const QByteArray& nmea, const QByteArray& ntripVersion);
110
111 void dumpRinexEpoch(const t_obs& obs, const QByteArray& format);
112
113 void setRinexReconnectFlag(bool flag);
114
115 struct t_antInfo {
116 enum t_type { ARP, APC };
117
118 t_antInfo() {
119 xx = yy = zz = height = 0.0;
120 type = ARP;
121 height_f = false;
122 message = 0;
123 };
124
125 double xx;
126 double yy;
127 double zz;
128 t_type type;
129 double height;
130 bool height_f;
131 int message;
132 };
133
134 QList<t_obs> _obsList;
135 QList<int> _typeList; // RTCM message types
136 QStringList _antType; // RTCM antenna descriptor
137 QList<t_antInfo> _antList; // RTCM antenna XYZ
138 bncRinex* _rnx; // RINEX writer
139};
140
141#endif
Note: See TracBrowser for help on using the repository browser.