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

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