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

Last change on this file since 9258 was 9258, checked in by stuerze, 10 months ago

combination adapted to work system by system

File size: 4.0 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 {offACgnss, offACSat, clkSat};
40 cmbParam(parType type_, int index_, const QString& ac_, const QString& prn_);
41 ~cmbParam();
42 double partial(char sys, const QString& AC_, const QString& prn_);
43 QString toString(char sys) 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['G'] = 0;
60 numObs['R'] = 0;
61 numObs['E'] = 0;
62 numObs['C'] = 0;
63 numObs['J'] = 0;
64 numObs['S'] = 0;
65 }
66 ~cmbAC() {}
67 QString mountPoint;
68 QString name;
69 double weight;
70 QMap<char, unsigned> numObs;
71 };
72
73 class cmbCorr {
74 public:
75 cmbCorr() {
76 _eph = 0;
77 _iod = 0;
78 _dClkResult = 0.0;
79 }
80 ~cmbCorr() {}
81 QString _prn;
82 bncTime _time;
83 unsigned long _iod;
84 t_eph* _eph;
85 t_orbCorr _orbCorr;
86 t_clkCorr _clkCorr;
87 QString _acName;
88 double _dClkResult;
89 ColumnVector _diffRao;
90 QString ID() {return _acName + "_" + _prn;}
91 };
92
93 class cmbEpoch {
94 public:
95 cmbEpoch() {}
96 ~cmbEpoch() {
97 QVectorIterator<cmbCorr*> it(corrs);
98 while (it.hasNext()) {
99 delete it.next();
100 }
101 }
102 QVector<cmbCorr*> corrs;
103 };
104
105 void processEpoch(char sys);
106 t_irc processEpoch_filter(char sys, QTextStream& out, QMap<QString, cmbCorr*>& resCorr,
107 ColumnVector& dx);
108 t_irc processEpoch_singleEpoch(char sys, QTextStream& out, QMap<QString, cmbCorr*>& resCorr,
109 ColumnVector& dx);
110 t_irc createAmat(char sys, Matrix& AA, ColumnVector& ll, DiagonalMatrix& PP,
111 const ColumnVector& x0, QMap<QString, cmbCorr*>& resCorr);
112 void dumpResults(const QMap<QString, cmbCorr*>& resCorr);
113 void printResults(QTextStream& out, const QMap<QString, cmbCorr*>& resCorr);
114 void switchToLastEph(t_eph* lastEph, cmbCorr* corr);
115 t_irc checkOrbits(char sys, QTextStream& out);
116 QVector<cmbCorr*>& corrs(char sys) {return _buffer[sys][_resTime].corrs;}
117
118 QMutex _mutex;
119 QList<cmbAC*> _ACs;
120 bncTime _resTime;
121 QMap<char, QVector<cmbParam*>> _params;
122 QMap<char, QMap<bncTime, cmbEpoch>> _buffer;
123 bncRtnetDecoder* _rtnetDecoder;
124 QMap<char, SymmetricMatrix> _QQ;
125 QByteArray _log;
126 bncAntex* _antex;
127 double _MAXRES;
128 QMap<char, QString> _masterOrbitAC;
129 QMap<char, unsigned> _masterMissingEpochs;
130 e_method _method;
131 int _cmbSampl;
132 QMap<QString, QMap<t_prn, t_orbCorr> > _orbCorrections;
133 bncEphUser _ephUser;
134 SsrCorr* _ssrCorr;
135 QMap<char, unsigned> _cmbSysPrn;
136};
137
138#define BNC_CMB (bncComb::instance())
139
140#endif
Note: See TracBrowser for help on using the repository browser.