#ifndef BNCCOMB_H #define BNCCOMB_H #include #include #include #include "bncephuser.h" #include "satObs.h" #include "bncconst.h" #include "../RTCM3/clock_and_orbit/clock_orbit_rtcm.h" #include "../RTCM3/clock_and_orbit/clock_orbit_igs.h" class bncRtnetDecoder; class bncSP3; class bncAntex; class bncComb : public QObject { Q_OBJECT public: bncComb(); virtual ~bncComb(); static bncComb* instance(); int nStreams() const {return _ACs.size();} public slots: void slotProviderIDChanged(QString mountPoint); void slotNewOrbCorrections(QList orbCorrections); void slotNewClkCorrections(QList clkCorrections); void slotNewCodeBiases(QList satCodeBiases); signals: void newMessage(QByteArray msg, bool showOnScreen); void newOrbCorrections(QList); void newClkCorrections(QList); void newCodeBiases(QList); private: enum e_method{singleEpoch, filter}; class cmbParam { public: enum parType {offACgnss, offACSat, clkSat}; cmbParam(parType type_, int index_, const QString& ac_, const QString& prn_); ~cmbParam(); double partial(char sys, const QString& AC_, const QString& prn_); QString toString(char sys) const; parType type; int index; QString AC; QString prn; double xx; double sig0; double sigP; bool epoSpec; const t_eph* eph; }; class cmbAC { public: cmbAC() { weight = 0.0; numObs['G'] = 0; numObs['R'] = 0; numObs['E'] = 0; numObs['C'] = 0; numObs['J'] = 0; numObs['S'] = 0; numObs['I'] = 0; } ~cmbAC() {} QString mountPoint; QString name; double weight; QMap numObs; }; class cmbCorr { public: cmbCorr() { _eph = 0; _iod = 0; _dClkResult = 0.0; _codeBiasIF = 0.0; } ~cmbCorr() {} QString _prn; bncTime _time; unsigned long _iod; t_eph* _eph; t_orbCorr _orbCorr; t_clkCorr _clkCorr; t_satCodeBias _satCodeBias; QString _acName; double _codeBiasIF; double _dClkResult; ColumnVector _diffRao; QString ID() {return _acName + "_" + _prn;} }; class cmbEpoch { public: cmbEpoch() {} ~cmbEpoch() { QVectorIterator it(corrs); while (it.hasNext()) { delete it.next(); } } QVector corrs; }; class t_lcRefSig { public: enum type {dummy = 0, c1, c2, cIF}; static t_frequency::type toFreq(char sys, type tt) { switch (tt) { case c1: if (sys == 'G') return t_frequency::G1; else if (sys == 'R') return t_frequency::R1; else if (sys == 'E') return t_frequency::E1; else if (sys == 'C') return t_frequency::C2; else if (sys == 'J') return t_frequency::J1; else if (sys == 'S') return t_frequency::S1; else return t_frequency::dummy; case c2: if (sys == 'G') return t_frequency::G2; else if (sys == 'R') return t_frequency::R2; else if (sys == 'E') return t_frequency::E5; else if (sys == 'C') return t_frequency::C6; else if (sys == 'J') return t_frequency::J2; else if (sys == 'S') return t_frequency::S5; else return t_frequency::dummy; case dummy: case cIF: return t_frequency::dummy; } return t_frequency::dummy; } static char toAttrib(char sys, type LC) { switch (LC) { case c1: if (sys == 'G') return 'W'; else if (sys == 'R') return 'P'; else if (sys == 'E') return 'C'; else if (sys == 'C') return 'I'; else if (sys == 'J') return 'C'; else if (sys == 'S') return 'C'; break; case c2: if (sys == 'G') return 'W'; else if (sys == 'R') return 'P'; else if (sys == 'E') return 'Q'; else if (sys == 'C') return 'I'; else if (sys == 'J') return 'L'; else if (sys == 'S') return 'Q'; break; case dummy: case cIF: return '_'; break; } return '_'; } static void coeff(char sys, type tLC, double channel, std::map& codeCoeff) { codeCoeff.clear(); t_frequency::type fType1 = toFreq(sys, c1); t_frequency::type fType2 = toFreq(sys, c2); double f1 = t_CST::freq(fType1, channel); double f2 = t_CST::freq(fType2, channel); switch (tLC) { case c1: codeCoeff[fType1] = 1.0; return; case c2: codeCoeff[fType2] = 1.0; return; case cIF: codeCoeff[fType1] = f1 * f1 / (f1 * f1 - f2 * f2); codeCoeff[fType2] = -f2 * f2 / (f1 * f1 - f2 * f2); return; case t_lcRefSig::dummy: return; } return; } }; void processEpoch(char sys); t_irc processEpoch_filter(char sys, QTextStream& out, QMap& resCorr, ColumnVector& dx); t_irc processEpoch_singleEpoch(char sys, QTextStream& out, QMap& resCorr, ColumnVector& dx); t_irc createAmat(char sys, Matrix& AA, ColumnVector& ll, DiagonalMatrix& PP, const ColumnVector& x0, QMap& resCorr); void dumpResults(const QMap& resCorr); void printResults(QTextStream& out, const QMap& resCorr); void switchToLastEph(t_eph* lastEph, cmbCorr* corr); t_irc checkOrbits(char sys, QTextStream& out); QVector& corrs(char sys) {return _buffer[sys][_resTime].corrs;} QMutex _mutex; QList _ACs; bncTime _resTime; QMap> _params; QMap> _buffer; bncRtnetDecoder* _rtnetDecoder; QMap _QQ; QByteArray _log; bncAntex* _antex; double _MAXRES; QMap _masterOrbitAC; QMap _masterMissingEpochs; e_method _method; int _cmbSampl; QString _cmbRefAttributes; QMap > _orbCorrections; QMap > _satCodeBiases; bncEphUser _ephUser; SsrCorr* _ssrCorr; QMap _cmbSysPrn; bool _useGps; bool _useGlo; bool _useGal; bool _useBds; bool _useQzss; bool _useSbas; bool _useIrnss; }; #define BNC_CMB (bncComb::instance()) #endif