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 |
|
---|
12 | class bncRtnetDecoder;
|
---|
13 | class bncSP3;
|
---|
14 | class bncAntex;
|
---|
15 |
|
---|
16 | class 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 | numObs['I'] = 0;
|
---|
66 | }
|
---|
67 | ~cmbAC() {}
|
---|
68 | QString mountPoint;
|
---|
69 | QString name;
|
---|
70 | double weight;
|
---|
71 | QMap<char, unsigned> numObs;
|
---|
72 | };
|
---|
73 |
|
---|
74 | class cmbCorr {
|
---|
75 | public:
|
---|
76 | cmbCorr() {
|
---|
77 | _eph = 0;
|
---|
78 | _iod = 0;
|
---|
79 | _dClkResult = 0.0;
|
---|
80 | }
|
---|
81 | ~cmbCorr() {}
|
---|
82 | QString _prn;
|
---|
83 | bncTime _time;
|
---|
84 | unsigned long _iod;
|
---|
85 | t_eph* _eph;
|
---|
86 | t_orbCorr _orbCorr;
|
---|
87 | t_clkCorr _clkCorr;
|
---|
88 | QString _acName;
|
---|
89 | double _dClkResult;
|
---|
90 | ColumnVector _diffRao;
|
---|
91 | QString ID() {return _acName + "_" + _prn;}
|
---|
92 | };
|
---|
93 |
|
---|
94 | class cmbEpoch {
|
---|
95 | public:
|
---|
96 | cmbEpoch() {}
|
---|
97 | ~cmbEpoch() {
|
---|
98 | QVectorIterator<cmbCorr*> it(corrs);
|
---|
99 | while (it.hasNext()) {
|
---|
100 | delete it.next();
|
---|
101 | }
|
---|
102 | }
|
---|
103 | QVector<cmbCorr*> corrs;
|
---|
104 | };
|
---|
105 |
|
---|
106 | void processEpoch(char sys);
|
---|
107 | t_irc processEpoch_filter(char sys, QTextStream& out, QMap<QString, cmbCorr*>& resCorr,
|
---|
108 | ColumnVector& dx);
|
---|
109 | t_irc processEpoch_singleEpoch(char sys, QTextStream& out, QMap<QString, cmbCorr*>& resCorr,
|
---|
110 | ColumnVector& dx);
|
---|
111 | t_irc createAmat(char sys, Matrix& AA, ColumnVector& ll, DiagonalMatrix& PP,
|
---|
112 | const ColumnVector& x0, QMap<QString, cmbCorr*>& resCorr);
|
---|
113 | void dumpResults(const QMap<QString, cmbCorr*>& resCorr);
|
---|
114 | void printResults(QTextStream& out, const QMap<QString, cmbCorr*>& resCorr);
|
---|
115 | void switchToLastEph(t_eph* lastEph, cmbCorr* corr);
|
---|
116 | t_irc checkOrbits(char sys, QTextStream& out);
|
---|
117 | QVector<cmbCorr*>& corrs(char sys) {return _buffer[sys][_resTime].corrs;}
|
---|
118 |
|
---|
119 | QMutex _mutex;
|
---|
120 | QList<cmbAC*> _ACs;
|
---|
121 | bncTime _resTime;
|
---|
122 | QMap<char, QVector<cmbParam*>> _params;
|
---|
123 | QMap<char, QMap<bncTime, cmbEpoch>> _buffer;
|
---|
124 | bncRtnetDecoder* _rtnetDecoder;
|
---|
125 | QMap<char, SymmetricMatrix> _QQ;
|
---|
126 | QByteArray _log;
|
---|
127 | bncAntex* _antex;
|
---|
128 | double _MAXRES;
|
---|
129 | QMap<char, QString> _masterOrbitAC;
|
---|
130 | QMap<char, unsigned> _masterMissingEpochs;
|
---|
131 | e_method _method;
|
---|
132 | int _cmbSampl;
|
---|
133 | QMap<QString, QMap<t_prn, t_orbCorr> > _orbCorrections;
|
---|
134 | bncEphUser _ephUser;
|
---|
135 | SsrCorr* _ssrCorr;
|
---|
136 | QMap<char, unsigned> _cmbSysPrn;
|
---|
137 | bool _useGps;
|
---|
138 | bool _useGlo;
|
---|
139 | bool _useGal;
|
---|
140 | bool _useBds;
|
---|
141 | bool _useQzss;
|
---|
142 | bool _useSbas;
|
---|
143 | bool _useIrnss;
|
---|
144 | };
|
---|
145 |
|
---|
146 | #define BNC_CMB (bncComb::instance())
|
---|
147 |
|
---|
148 | #endif
|
---|