source: ntrip/trunk/BNC/src/bncpppclient.h@ 5577

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