source: ntrip/trunk/BNC/src/GPSDecoder.h@ 10757

Last change on this file since 10757 was 10692, checked in by stuerze, 8 months ago

RTCM message 1230 (on-change) and the size of each RTCM message is added in scanRTCM

File size: 5.1 KB
RevLine 
[297]1// Part of BNC, a utility for retrieving decoding and
[464]2// converting GNSS data streams from NTRIP broadcasters.
[297]3//
[464]4// Copyright (C) 2007
[297]5// German Federal Agency for Cartography and Geodesy (BKG)
6// http://www.bkg.bund.de
[464]7// Czech Technical University Prague, Department of Geodesy
[297]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.
[35]24
[222]25#ifndef GPSDECODER_H
26#define GPSDECODER_H
27
[625]28#include <iostream>
[10533]29#include <iomanip>
[1218]30#include <vector>
31#include <string>
[35]32
[5884]33#include <QtCore>
34
[649]35#include "bncconst.h"
[5884]36#include "bnctime.h"
[6137]37#include "satObs.h"
[10533]38#include "crs.h"
[649]39
[5884]40class bncRinex;
[10533]41using namespace std;
[5884]42
[35]43class GPSDecoder {
[622]44 public:
[3528]45 GPSDecoder();
[5884]46 virtual ~GPSDecoder();
[622]47
[8197]48 virtual t_irc Decode(char* buffer, int bufLen,
[3528]49 std::vector<std::string>& errmsg) = 0;
50
51
[1567]52 virtual int corrGPSEpochTime() const {return -1;}
53
[3529]54 void initRinex(const QByteArray& staID, const QUrl& mountPoint,
[8197]55 const QByteArray& latitude, const QByteArray& longitude,
[3529]56 const QByteArray& nmea, const QByteArray& ntripVersion);
57
[6137]58 void dumpRinexEpoch(const t_satObs& obs, const QByteArray& format);
[3528]59
60 void setRinexReconnectFlag(bool flag);
61
[10688]62 struct t_typeInfo {
63 t_typeInfo() {
[10692]64 _type = 0;
65 _size = 0;
[10688]66 };
[10692]67 int _type;
68 size_t _size;
[10688]69 };
70
71
[8235]72 struct t_antRefPoint {
[1268]73 enum t_type { ARP, APC };
74
[8235]75 t_antRefPoint() {
[10692]76 _xx = _yy = _zz = _height = 0.0;
77 _type = ARP;
78 _height_f = false;
79 _message = 0;
[1268]80 };
81
[10692]82 double _xx;
83 double _yy;
84 double _zz;
85 t_type _type;
86 double _height;
87 bool _height_f;
88 int _message;
[1268]89 };
90
[8235]91 struct t_antInfo {
92 t_antInfo() {
93 };
[10692]94 char _descriptor[256];
95 char _serialnumber[256];
[8235]96 };
97
98 struct t_recInfo {
99 t_recInfo() {
100 };
[10692]101 char _descriptor[256];
102 char _serialnumber[256];
103 char _firmware[256];
[8235]104 };
105
[10688]106 class t_GloBiasInfo {
107 public:
108 t_GloBiasInfo() {
[10692]109 init();
[10688]110 };
[10692]111 bool operator!=(const t_GloBiasInfo& gloBiasInfo2) {
112
113 if (_staID != gloBiasInfo2._staID ||
114 _indicator != gloBiasInfo2._indicator ||
115 (fabs(_L1C_value - gloBiasInfo2._L1C_value) > 0.000000000001 ) ||
116 (fabs(_L1P_value - gloBiasInfo2._L1P_value) > 0.000000000001 ) ||
117 (fabs(_L2C_value - gloBiasInfo2._L2C_value) > 0.000000000001 ) ||
118 (fabs(_L2P_value - gloBiasInfo2._L2P_value) > 0.000000000001 ) ) {
119 setChanged(true);
[10688]120 return true;
121 }
122 else {
[10692]123 setChanged(false);
[10688]124 return false;
125 }
126 }
127
[10692]128 void set(const t_GloBiasInfo& gloBiasInfo) {
129 _staID = gloBiasInfo._staID;
130 _indicator = gloBiasInfo._indicator;
131 _L1C_value = gloBiasInfo._L1C_value;
132 _L1P_value = gloBiasInfo._L1P_value;
133 _L2C_value = gloBiasInfo._L2C_value;
134 _L2P_value = gloBiasInfo._L2P_value;
[10688]135 }
[10692]136 void setChanged(bool changed) {
137 _changed = changed;
[10688]138 }
[10692]139 bool changed() {return _changed;};
140 void init() {
141 _staID = 0;
142 _indicator = 1;
143 _L1C_value = 0.0;
144 _L1P_value = 0.0;
145 _L2C_value = 0.0;
146 _L2P_value = 0.0;
147 _changed = false;
148 }
[10688]149 QString toString() {
[10692]150 QString biasIndicator = (_indicator == 1) ? QString("aligned") : QString("unaligned");
[10688]151 QString biasesStr =
152 QString(": GLONASS L1/L2 Code-Phase Biases: staID=%1 indicator=%2 L1C=%3 L1P=%4 L2C=%5 L2P=%6")
[10692]153 .arg(_staID).arg(biasIndicator)
154 .arg(_L1C_value, 0, 'f', 2)
155 .arg(_L1P_value, 0, 'f', 2)
156 .arg(_L2C_value, 0, 'f', 2)
157 .arg(_L2P_value, 0, 'f', 2);
[10688]158
159 return biasesStr;
160 }
161
[10692]162 int _staID;
163 int _indicator;
164 double _L1C_value;
165 double _L1P_value;
166 double _L2C_value;
167 double _L2P_value;
168 bool _changed;
[10688]169
[10692]170
[10688]171 };
172
[6812]173 /** List of observations */
[10533]174 QList<t_satObs> _obsList;
[10688]175 QList<t_typeInfo> _typeList; // RTCM message type as message size
[10533]176 QList<t_antInfo> _antType; // RTCM antenna descriptor
177 QList<t_recInfo> _recType; // RTCM receiver descriptor
178 QList<t_antRefPoint> _antList; // RTCM antenna XYZ
[10619]179 QList<t_helmertPar> _helmertPar; // List of Helmert parameter sets
[10533]180 QList<t_serviceCrs> _serviceCrs; // Service CRS
181 QList<t_rtcmCrs> _rtcmCrs; // RTCM CRS
182 QString _gloFrq; // GLONASS slot
[10692]183 t_GloBiasInfo _gloBiasInfo; // RTCM GLO bias information message
[10533]184 bncRinex* _rnx; // RINEX writer
[222]185};
[35]186
187#endif
Note: See TracBrowser for help on using the repository browser.