source: ntrip/trunk/BNC/bncpppclient.h@ 3831

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