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