[1025] | 1 | #ifndef EPHEMERIS_H
|
---|
| 2 | #define EPHEMERIS_H
|
---|
| 3 |
|
---|
[2221] | 4 | #include <newmat.h>
|
---|
[3174] | 5 | #include <QtCore>
|
---|
[1025] | 6 | #include <stdio.h>
|
---|
| 7 | #include <string>
|
---|
[4018] | 8 | #include "bnctime.h"
|
---|
[5749] | 9 | #include "bncconst.h"
|
---|
[5776] | 10 | #include "t_prn.h"
|
---|
[6139] | 11 |
|
---|
[1807] | 12 | extern "C" {
|
---|
[6139] | 13 | # include "rtcm3torinex.h"
|
---|
[1807] | 14 | }
|
---|
[1025] | 15 |
|
---|
[6141] | 16 | class t_orbCorr;
|
---|
| 17 | class t_clkCorr;
|
---|
[5749] | 18 |
|
---|
[1025] | 19 | class t_eph {
|
---|
| 20 | public:
|
---|
[4005] | 21 | enum e_type {unknown, GPS, GLONASS, Galileo};
|
---|
| 22 |
|
---|
[5749] | 23 | t_eph();
|
---|
[4018] | 24 | virtual ~t_eph() {};
|
---|
| 25 |
|
---|
[6109] | 26 | virtual e_type type() const = 0;
|
---|
[4013] | 27 | virtual QString toString(double version) const = 0;
|
---|
[6109] | 28 | virtual int IOD() const = 0;
|
---|
| 29 | virtual int slotNum() const {return 0;}
|
---|
| 30 | bool ok() const {return _ok;}
|
---|
[4018] | 31 | bncTime TOC() const {return _TOC;}
|
---|
[6109] | 32 | bool isNewerThan(const t_eph* eph) const {return earlierTime(eph, this);}
|
---|
| 33 | t_prn prn() const {return _prn;}
|
---|
| 34 | t_irc getCrd(const bncTime& tt, ColumnVector& xc, ColumnVector& vv, bool useCorr) const;
|
---|
[6141] | 35 | void setOrbCorr(const t_orbCorr* orbCorr);
|
---|
| 36 | void setClkCorr(const t_clkCorr* clkCorr);
|
---|
[3174] | 37 | const QDateTime& receptDateTime() const {return _receptDateTime;}
|
---|
[6109] | 38 | static QString rinexDateStr(const bncTime& tt, const t_prn& prn, double version);
|
---|
| 39 | static QString rinexDateStr(const bncTime& tt, const QString& prnStr, double version);
|
---|
| 40 | static bool earlierTime(const t_eph* eph1, const t_eph* eph2) {return eph1->_TOC < eph2->_TOC;}
|
---|
[1025] | 41 |
|
---|
[4022] | 42 | protected:
|
---|
[6213] | 43 | virtual t_irc position(int GPSweek, double GPSweeks, double* xc, double* vv) const = 0;
|
---|
[6141] | 44 | t_prn _prn;
|
---|
| 45 | bncTime _TOC;
|
---|
| 46 | QDateTime _receptDateTime;
|
---|
| 47 | bool _ok;
|
---|
| 48 | t_orbCorr* _orbCorr;
|
---|
| 49 | t_clkCorr* _clkCorr;
|
---|
[1025] | 50 | };
|
---|
| 51 |
|
---|
| 52 |
|
---|
| 53 | class t_ephGPS : public t_eph {
|
---|
[5852] | 54 | friend class t_ephEncoder;
|
---|
[1025] | 55 | public:
|
---|
| 56 | t_ephGPS() { }
|
---|
[3659] | 57 | t_ephGPS(float rnxVersion, const QStringList& lines);
|
---|
[2221] | 58 | virtual ~t_ephGPS() {}
|
---|
[4005] | 59 |
|
---|
| 60 | virtual e_type type() const {return t_eph::GPS;}
|
---|
[4013] | 61 | virtual QString toString(double version) const;
|
---|
[6109] | 62 | virtual int IOD() const { return static_cast<int>(_IODC); }
|
---|
[1025] | 63 | void set(const gpsephemeris* ee);
|
---|
[4366] | 64 | double TGD() const {return _TGD;} // Timing Group Delay (P1-P2 DCB)
|
---|
| 65 |
|
---|
[1025] | 66 | private:
|
---|
[6213] | 67 | virtual t_irc position(int GPSweek, double GPSweeks, double* xc, double* vv) const;
|
---|
[6109] | 68 |
|
---|
[4018] | 69 | double _clock_bias; // [s]
|
---|
| 70 | double _clock_drift; // [s/s]
|
---|
| 71 | double _clock_driftrate; // [s/s^2]
|
---|
[1025] | 72 |
|
---|
[4018] | 73 | double _IODE;
|
---|
| 74 | double _Crs; // [m]
|
---|
| 75 | double _Delta_n; // [rad/s]
|
---|
| 76 | double _M0; // [rad]
|
---|
[1025] | 77 |
|
---|
[4018] | 78 | double _Cuc; // [rad]
|
---|
| 79 | double _e; //
|
---|
| 80 | double _Cus; // [rad]
|
---|
| 81 | double _sqrt_A; // [m^0.5]
|
---|
[1025] | 82 |
|
---|
[4018] | 83 | double _TOEsec; // [s]
|
---|
| 84 | double _Cic; // [rad]
|
---|
| 85 | double _OMEGA0; // [rad]
|
---|
| 86 | double _Cis; // [rad]
|
---|
| 87 |
|
---|
| 88 | double _i0; // [rad]
|
---|
| 89 | double _Crc; // [m]
|
---|
| 90 | double _omega; // [rad]
|
---|
| 91 | double _OMEGADOT; // [rad/s]
|
---|
| 92 |
|
---|
| 93 | double _IDOT; // [rad/s]
|
---|
| 94 | double _L2Codes; // Codes on L2 channel
|
---|
| 95 | double _TOEweek;
|
---|
| 96 | double _L2PFlag; // L2 P data flag
|
---|
| 97 |
|
---|
[5852] | 98 | mutable double _ura; // SV accuracy
|
---|
[4018] | 99 | double _health; // SV health
|
---|
| 100 | double _TGD; // [s]
|
---|
| 101 | double _IODC;
|
---|
| 102 |
|
---|
| 103 | double _TOT; // Transmisstion time
|
---|
| 104 | double _fitInterval; // Fit interval
|
---|
[1025] | 105 | };
|
---|
| 106 |
|
---|
[2221] | 107 | class t_ephGlo : public t_eph {
|
---|
[5853] | 108 | friend class t_ephEncoder;
|
---|
[2221] | 109 | public:
|
---|
[2257] | 110 | t_ephGlo() { _xv.ReSize(6); }
|
---|
[3659] | 111 | t_ephGlo(float rnxVersion, const QStringList& lines);
|
---|
[2221] | 112 | virtual ~t_ephGlo() {}
|
---|
| 113 |
|
---|
[4005] | 114 | virtual e_type type() const {return t_eph::GLONASS;}
|
---|
[4013] | 115 | virtual QString toString(double version) const;
|
---|
[2221] | 116 | virtual int IOD() const;
|
---|
[6109] | 117 | virtual int slotNum() const {return int(_frequency_number);}
|
---|
[5133] | 118 | void set(const glonassephemeris* ee);
|
---|
[2221] | 119 |
|
---|
| 120 | private:
|
---|
[6213] | 121 | virtual t_irc position(int GPSweek, double GPSweeks, double* xc, double* vv) const;
|
---|
[6109] | 122 | static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv, double* acc);
|
---|
[2221] | 123 |
|
---|
[4018] | 124 | mutable bncTime _tt; // time
|
---|
[2221] | 125 | mutable ColumnVector _xv; // status vector (position, velocity) at time _tt
|
---|
| 126 |
|
---|
[3255] | 127 | double _gps_utc;
|
---|
[2221] | 128 | double _tau; // [s]
|
---|
| 129 | double _gamma; //
|
---|
[5853] | 130 | mutable double _tki; // message frame time
|
---|
[4018] | 131 |
|
---|
[2221] | 132 | double _x_pos; // [km]
|
---|
| 133 | double _x_velocity; // [km/s]
|
---|
| 134 | double _x_acceleration; // [km/s^2]
|
---|
[4018] | 135 | double _health; // 0 = O.K.
|
---|
| 136 |
|
---|
[2221] | 137 | double _y_pos; // [km]
|
---|
| 138 | double _y_velocity; // [km/s]
|
---|
| 139 | double _y_acceleration; // [km/s^2]
|
---|
[4018] | 140 | double _frequency_number; // ICD-GLONASS data position
|
---|
| 141 |
|
---|
[2221] | 142 | double _z_pos; // [km]
|
---|
| 143 | double _z_velocity; // [km/s]
|
---|
| 144 | double _z_acceleration; // [km/s^2]
|
---|
[4018] | 145 | double _E; // Age of Information [days]
|
---|
[2221] | 146 | };
|
---|
| 147 |
|
---|
[2770] | 148 | class t_ephGal : public t_eph {
|
---|
[5853] | 149 | friend class t_ephEncoder;
|
---|
[2770] | 150 | public:
|
---|
| 151 | t_ephGal() { }
|
---|
[3659] | 152 | t_ephGal(float rnxVersion, const QStringList& lines);
|
---|
[2770] | 153 | virtual ~t_ephGal() {}
|
---|
[4005] | 154 |
|
---|
[4013] | 155 | virtual QString toString(double version) const;
|
---|
[4005] | 156 | virtual e_type type() const {return t_eph::Galileo;}
|
---|
[6109] | 157 | virtual int IOD() const { return static_cast<int>(_IODnav); }
|
---|
[2770] | 158 | void set(const galileoephemeris* ee);
|
---|
| 159 |
|
---|
[6109] | 160 | private:
|
---|
[6213] | 161 | virtual t_irc position(int GPSweek, double GPSweeks, double* xc, double* vv) const;
|
---|
[2770] | 162 |
|
---|
| 163 | double _clock_bias; // [s]
|
---|
| 164 | double _clock_drift; // [s/s]
|
---|
| 165 | double _clock_driftrate; // [s/s^2]
|
---|
[4018] | 166 |
|
---|
| 167 | double _IODnav;
|
---|
[2770] | 168 | double _Crs; // [m]
|
---|
| 169 | double _Delta_n; // [rad/s]
|
---|
| 170 | double _M0; // [rad]
|
---|
[4018] | 171 |
|
---|
[2770] | 172 | double _Cuc; // [rad]
|
---|
| 173 | double _e; //
|
---|
| 174 | double _Cus; // [rad]
|
---|
| 175 | double _sqrt_A; // [m^0.5]
|
---|
[4018] | 176 |
|
---|
| 177 | double _TOEsec; // [s]
|
---|
[2770] | 178 | double _Cic; // [rad]
|
---|
| 179 | double _OMEGA0; // [rad]
|
---|
| 180 | double _Cis; // [rad]
|
---|
[4018] | 181 |
|
---|
[2770] | 182 | double _i0; // [rad]
|
---|
| 183 | double _Crc; // [m]
|
---|
| 184 | double _omega; // [rad]
|
---|
| 185 | double _OMEGADOT; // [rad/s]
|
---|
[4018] | 186 |
|
---|
[2770] | 187 | double _IDOT; // [rad/s]
|
---|
[4018] | 188 | //
|
---|
| 189 | double _TOEweek;
|
---|
| 190 | // spare
|
---|
| 191 |
|
---|
[4023] | 192 | double _SISA; // Signal In Space Accuracy
|
---|
| 193 | double _E5aHS; // E5a Health Status
|
---|
[5541] | 194 | double _E5bHS; // E5a Health Status
|
---|
[2770] | 195 | double _BGD_1_5A; // group delay [s]
|
---|
[3255] | 196 | double _BGD_1_5B; // group delay [s]
|
---|
[2770] | 197 |
|
---|
[4018] | 198 | double _TOT; // [s]
|
---|
[5539] | 199 |
|
---|
| 200 | int _flags;
|
---|
[2770] | 201 | };
|
---|
| 202 |
|
---|
[1025] | 203 | #endif
|
---|