source: ntrip/trunk/BNC/src/PPP_free/bncpppclient.h@ 6055

Last change on this file since 6055 was 6055, checked in by mervart, 10 years ago
File size: 4.2 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 BNCPPPCLIENT_H
26#define BNCPPPCLIENT_H
27
28#include <queue>
29#include "bncephuser.h"
30#include "GPSDecoder.h"
31
32
33namespace BNC_PPP {
34
35class bncModel;
36class t_pppOptions;
37
38class t_satData {
39 public:
40 t_satData() {
41 obsIndex = 0;
42 P1 = 0.0;
43 P2 = 0.0;
44 P5 = 0.0;
45 P3 = 0.0;
46 L1 = 0.0;
47 L2 = 0.0;
48 L5 = 0.0;
49 L3 = 0.0;
50 }
51 ~t_satData() {}
52 bncTime tt;
53 QString prn;
54 double P1;
55 double P2;
56 double P5;
57 double P3;
58 double L1;
59 double L2;
60 double L5;
61 double L3;
62 ColumnVector xx;
63 ColumnVector vv;
64 double clk;
65 double eleSat;
66 double azSat;
67 double rho;
68 bool slipFlag;
69 double lambda3;
70 unsigned obsIndex;
71 char system() const {return prn.toAscii()[0];}
72};
73
74class t_epoData {
75 public:
76 t_epoData() {}
77
78 ~t_epoData() {
79 clear();
80 }
81
82 void clear() {
83 QMapIterator<QString, t_satData*> it(satData);
84 while (it.hasNext()) {
85 it.next();
86 delete it.value();
87 }
88 satData.clear();
89 }
90
91 void deepCopy(const t_epoData* from) {
92 clear();
93 tt = from->tt;
94 QMapIterator<QString, t_satData*> it(from->satData);
95 while (it.hasNext()) {
96 it.next();
97 satData[it.key()] = new t_satData(*it.value());
98 }
99 }
100
101 unsigned sizeSys(char system) const {
102 unsigned ans = 0;
103 QMapIterator<QString, t_satData*> it(satData);
104 while (it.hasNext()) {
105 it.next();
106 if (it.value()->system() == system) {
107 ++ans;
108 }
109 }
110 return ans;
111 }
112 unsigned sizeAll() const {return satData.size();}
113
114 bncTime tt;
115 QMap<QString, t_satData*> satData;
116};
117
118class bncPPPclient : public bncEphUser {
119 Q_OBJECT
120
121 public:
122 bncPPPclient(QByteArray staID, t_pppOptions* opt = 0, bool connectSlots = true);
123 ~bncPPPclient();
124 void putNewObs(const t_obs& pp);
125 static t_irc applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc,
126 ColumnVector& vv);
127 QByteArray staID() const {return _staID;}
128 const t_pppOptions* opt() const {return _opt;}
129 void emitNewMessage(QByteArray msg, bool showOnScreen) {
130 emit newMessage(msg, showOnScreen);
131 }
132 void emitNewNMEAstr(QByteArray str) {
133 emit newNMEAstr(str);
134 }
135
136 public slots:
137 void slotNewCorrections(QList<QString> corrList);
138 void slotProviderIDChanged(QString mountPoint);
139
140 signals:
141 void newMessage(QByteArray msg, bool showOnScreen);
142 void newPosition(bncTime time, double x, double y, double z);
143 void newNMEAstr(QByteArray str);
144
145 private:
146 class slipInfo {
147 public:
148 slipInfo() {
149 slipCntL1 = -1;
150 slipCntL2 = -1;
151 slipCntL5 = -1;
152 }
153 ~slipInfo(){}
154 int slipCntL1;
155 int slipCntL2;
156 int slipCntL5;
157 };
158
159 t_irc getSatPos(const bncTime& tt, const QString& prn,
160 ColumnVector& xc, ColumnVector& vv);
161 void processEpochs();
162 void processFrontEpoch();
163 t_irc cmpToT(t_satData* satData);
164
165 t_pppOptions* _opt;
166 bool _optOwner;
167 QByteArray _staID;
168 QMap<QString, t_corr*> _corr;
169 bncTime _corr_tt;
170 QMap<QString, t_bias*> _bias;
171 std::queue<t_epoData*> _epoData;
172 bncModel* _model;
173 QMap<QString, slipInfo> _slips;
174};
175
176}
177
178#endif
Note: See TracBrowser for help on using the repository browser.