source: ntrip/trunk/BNC/src/ephemeris.h@ 6041

Last change on this file since 6041 was 5853, checked in by mervart, 10 years ago
File size: 6.8 KB
RevLine 
[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]11extern "C" {
[2492]12#include "rtcm3torinex.h"
[1807]13}
[1025]14
[5815]15namespace BNC_PPP {
[5749]16 class t_orbCorr;
17 class t_clkCorr;
18}
19
[1025]20class 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
79class 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]139class t_ephGlo : public t_eph {
[5853]140 friend class t_ephEncoder;
[2221]141 public:
[2257]142 t_ephGlo() { _xv.ReSize(6); }
[3659]143 t_ephGlo(float rnxVersion, const QStringList& lines);
[2221]144
145 virtual ~t_ephGlo() {}
146
[4005]147 virtual e_type type() const {return t_eph::GLONASS;}
148
[4013]149 virtual QString toString(double version) const;
150
[2221]151 virtual void position(int GPSweek, double GPSweeks,
152 double* xc,
153 double* vv) const;
154
155 virtual int IOD() const;
156
[5133]157 void set(const glonassephemeris* ee);
[2221]158
[5749]159 virtual int slotNum() const {return int(_frequency_number);}
[3761]160
[2221]161 private:
[2556]162 static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv,
163 double* acc);
[2221]164
[4018]165 mutable bncTime _tt; // time
[2221]166 mutable ColumnVector _xv; // status vector (position, velocity) at time _tt
167
[3255]168 double _gps_utc;
[2221]169 double _tau; // [s]
170 double _gamma; //
[5853]171 mutable double _tki; // message frame time
[4018]172
[2221]173 double _x_pos; // [km]
174 double _x_velocity; // [km/s]
175 double _x_acceleration; // [km/s^2]
[4018]176 double _health; // 0 = O.K.
177
[2221]178 double _y_pos; // [km]
179 double _y_velocity; // [km/s]
180 double _y_acceleration; // [km/s^2]
[4018]181 double _frequency_number; // ICD-GLONASS data position
182
[2221]183 double _z_pos; // [km]
184 double _z_velocity; // [km/s]
185 double _z_acceleration; // [km/s^2]
[4018]186 double _E; // Age of Information [days]
[2221]187};
188
[2770]189class t_ephGal : public t_eph {
[5853]190 friend class t_ephEncoder;
[2770]191 public:
192 t_ephGal() { }
[3659]193 t_ephGal(float rnxVersion, const QStringList& lines);
[2770]194 virtual ~t_ephGal() {}
[4005]195
[4013]196 virtual QString toString(double version) const;
197
[4005]198 virtual e_type type() const {return t_eph::Galileo;}
199
[2770]200 void set(const galileoephemeris* ee);
201
202 virtual void position(int GPSweek, double GPSweeks,
203 double* xc,
204 double* vv) const;
205
206 virtual int IOD() const { return static_cast<int>(_IODnav); }
207
208 private:
209 double _clock_bias; // [s]
210 double _clock_drift; // [s/s]
211 double _clock_driftrate; // [s/s^2]
[4018]212
213 double _IODnav;
[2770]214 double _Crs; // [m]
215 double _Delta_n; // [rad/s]
216 double _M0; // [rad]
[4018]217
[2770]218 double _Cuc; // [rad]
219 double _e; //
220 double _Cus; // [rad]
221 double _sqrt_A; // [m^0.5]
[4018]222
223 double _TOEsec; // [s]
[2770]224 double _Cic; // [rad]
225 double _OMEGA0; // [rad]
226 double _Cis; // [rad]
[4018]227
[2770]228 double _i0; // [rad]
229 double _Crc; // [m]
230 double _omega; // [rad]
231 double _OMEGADOT; // [rad/s]
[4018]232
[2770]233 double _IDOT; // [rad/s]
[4018]234 //
235 double _TOEweek;
236 // spare
237
[4023]238 double _SISA; // Signal In Space Accuracy
239 double _E5aHS; // E5a Health Status
[5541]240 double _E5bHS; // E5a Health Status
[2770]241 double _BGD_1_5A; // group delay [s]
[3255]242 double _BGD_1_5B; // group delay [s]
[2770]243
[4018]244 double _TOT; // [s]
[5539]245
246 int _flags;
[2770]247};
248
[1025]249#endif
Note: See TracBrowser for help on using the repository browser.