source: ntrip/trunk/BNC/src/combination/bnccomb.h@ 9025

Last change on this file since 9025 was 9025, checked in by stuerze, 4 years ago

some modification to allow encoding and decoding of SSR corrections in RTCM-SSR and IGS-SSR formats

File size: 3.8 KB
Line 
1
2#ifndef BNCCOMB_H
3#define BNCCOMB_H
4
5#include <fstream>
6#include <newmat.h>
7#include "bncephuser.h"
8#include "satObs.h"
9#include "../RTCM3/clock_and_orbit/clock_orbit_rtcm.h"
10#include "../RTCM3/clock_and_orbit/clock_orbit_igs.h"
11
12class bncRtnetDecoder;
13class bncSP3;
14class bncAntex;
15
16class bncComb : public QObject {
17 Q_OBJECT
18 public:
19 bncComb();
20 virtual ~bncComb();
21 static bncComb* instance();
22 int nStreams() const {return _ACs.size();}
23
24 public slots:
25 void slotProviderIDChanged(QString mountPoint);
26 void slotNewOrbCorrections(QList<t_orbCorr> orbCorrections);
27 void slotNewClkCorrections(QList<t_clkCorr> clkCorrections);
28
29 signals:
30 void newMessage(QByteArray msg, bool showOnScreen);
31 void newOrbCorrections(QList<t_orbCorr>);
32 void newClkCorrections(QList<t_clkCorr>);
33
34 private:
35 enum e_method{singleEpoch, filter};
36
37 class cmbParam {
38 public:
39 enum parType {offACgps, offACglo, offACSat, clkSat};
40 cmbParam(parType type_, int index_, const QString& ac_, const QString& prn_);
41 ~cmbParam();
42 double partial(const QString& AC_, const QString& prn_);
43 QString toString() const;
44 parType type;
45 int index;
46 QString AC;
47 QString prn;
48 double xx;
49 double sig0;
50 double sigP;
51 bool epoSpec;
52 const t_eph* eph;
53 };
54
55 class cmbAC {
56 public:
57 cmbAC() {
58 weight = 0.0;
59 numObs = 0;
60 }
61 ~cmbAC() {}
62 QString mountPoint;
63 QString name;
64 double weight;
65 unsigned numObs;
66 };
67
68 class cmbCorr {
69 public:
70 cmbCorr() {
71 _eph = 0;
72 _iod = 0;
73 _dClkResult = 0.0;
74 }
75 ~cmbCorr() {}
76 QString _prn;
77 bncTime _time;
78 unsigned long _iod;
79 t_eph* _eph;
80 t_orbCorr _orbCorr;
81 t_clkCorr _clkCorr;
82 QString _acName;
83 double _dClkResult;
84 ColumnVector _diffRao;
85 QString ID() {return _acName + "_" + _prn;}
86 };
87
88 class cmbEpoch {
89 public:
90 cmbEpoch() {}
91 ~cmbEpoch() {
92 QVectorIterator<cmbCorr*> it(corrs);
93 while (it.hasNext()) {
94 delete it.next();
95 }
96 }
97 QVector<cmbCorr*> corrs;
98 };
99
100 void processEpoch();
101 t_irc processEpoch_filter(QTextStream& out, QMap<QString, cmbCorr*>& resCorr,
102 ColumnVector& dx);
103 t_irc processEpoch_singleEpoch(QTextStream& out, QMap<QString, cmbCorr*>& resCorr,
104 ColumnVector& dx);
105 t_irc createAmat(Matrix& AA, ColumnVector& ll, DiagonalMatrix& PP,
106 const ColumnVector& x0, QMap<QString, cmbCorr*>& resCorr);
107 void dumpResults(const QMap<QString, cmbCorr*>& resCorr);
108 void printResults(QTextStream& out, const QMap<QString, cmbCorr*>& resCorr);
109 void switchToLastEph(t_eph* lastEph, cmbCorr* corr);
110 t_irc checkOrbits(QTextStream& out);
111 QVector<cmbCorr*>& corrs() {return _buffer[_resTime].corrs;}
112
113 QMutex _mutex;
114 QList<cmbAC*> _ACs;
115 bncTime _resTime;
116 QVector<cmbParam*> _params;
117 QMap<bncTime, cmbEpoch> _buffer;
118 bncRtnetDecoder* _rtnetDecoder;
119 SymmetricMatrix _QQ;
120 QByteArray _log;
121 bncAntex* _antex;
122 double _MAXRES;
123 QString _masterOrbitAC;
124 unsigned _masterMissingEpochs;
125 e_method _method;
126 bool _useGlonass;
127 int _cmbSampl;
128 QMap<QString, QMap<t_prn, t_orbCorr> > _orbCorrections;
129 bncEphUser _ephUser;
130 SsrCorr* _ssrCorr;
131};
132
133#define BNC_CMB (bncComb::instance())
134
135#endif
Note: See TracBrowser for help on using the repository browser.