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