source: ntrip/trunk/BNC/RTCM3/ephemeris.h@ 3730

Last change on this file since 3730 was 3659, checked in by mervart, 13 years ago
File size: 5.6 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>
[1807]8extern "C" {
[2492]9#include "rtcm3torinex.h"
[1807]10}
[1025]11
12class t_eph {
13 public:
[3659]14 t_eph() {_ok = false;}
[1025]15 virtual ~t_eph() {};
16
[3659]17 bool ok() const {return _ok;}
[3255]18 bool isNewerThan(const t_eph* eph) const;
19 QString prn() const {return _prn;}
[3174]20 void setReceptDateTime(const QDateTime& dateTime) {
21 _receptDateTime = dateTime;
22 }
23 const QDateTime& receptDateTime() const {return _receptDateTime;}
[1025]24
25 int GPSweek() const { return _GPSweek; }
26 double GPSweeks() const { return _GPSweeks; }
27
28 virtual void position(int GPSweek, double GPSweeks,
[2222]29 double* xc, double* vv) const = 0;
[1025]30
31 void position(int GPSweek, double GPSweeks,
[2221]32 double& xx, double& yy, double& zz, double& cc) const {
[1025]33 double tmp_xx[4];
34 double tmp_vv[4];
35
36 position(GPSweek, GPSweeks, tmp_xx, tmp_vv);
37
38 xx = tmp_xx[0];
39 yy = tmp_xx[1];
40 zz = tmp_xx[2];
41 cc = tmp_xx[3];
42 }
43
44 virtual int IOD() const = 0;
[3255]45
46 virtual int RTCM3(unsigned char *) = 0;
[1025]47
48 protected:
[3255]49 QString _prn;
50 int _GPSweek;
51 double _GPSweeks;
52 QDateTime _receptDateTime;
[3659]53 bool _ok;
[1025]54};
55
56
57class t_ephGPS : public t_eph {
58 public:
59 t_ephGPS() { }
[3659]60 t_ephGPS(float rnxVersion, const QStringList& lines);
[2221]61 virtual ~t_ephGPS() {}
[2040]62 double TOC() const {return _TOC;}
[1025]63
64 void set(const gpsephemeris* ee);
65
[2221]66 virtual void position(int GPSweek, double GPSweeks,
67 double* xc,
68 double* vv) const;
[1025]69
[2221]70 virtual int IOD() const { return static_cast<int>(_IODC); }
[1025]71
[3255]72 virtual int RTCM3(unsigned char *);
73
[1025]74 private:
75 double _TOW; // [s]
76 double _TOC; // [s]
77 double _TOE; // [s]
78 double _IODE;
79 double _IODC;
80
81 double _clock_bias; // [s]
82 double _clock_drift; // [s/s]
83 double _clock_driftrate; // [s/s^2]
84
85 double _Crs; // [m]
86 double _Delta_n; // [rad/s]
87 double _M0; // [rad]
88 double _Cuc; // [rad]
89 double _e; //
90 double _Cus; // [rad]
91 double _sqrt_A; // [m^0.5]
92 double _Cic; // [rad]
93 double _OMEGA0; // [rad]
94 double _Cis; // [rad]
95 double _i0; // [rad]
96 double _Crc; // [m]
97 double _omega; // [rad]
98 double _OMEGADOT; // [rad/s]
99 double _IDOT; // [rad/s]
100
101 double _TGD; // [s]
[3255]102 double _health; // SV health
103 double _ura; // SV accuracy
104 double _L2PFlag; // L2 P data flag
105 double _L2Codes; // Codes on L2 channel
[1025]106};
107
[2221]108class t_ephGlo : public t_eph {
109 public:
[2257]110 t_ephGlo() { _xv.ReSize(6); }
[3659]111 t_ephGlo(float rnxVersion, const QStringList& lines);
[2221]112
113 virtual ~t_ephGlo() {}
114
115 virtual void position(int GPSweek, double GPSweeks,
116 double* xc,
117 double* vv) const;
118
119 virtual int IOD() const;
120
[3255]121 virtual int RTCM3(unsigned char *);
122
[2221]123 void set(const glonassephemeris* ee);
124
125 private:
[2556]126 static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv,
127 double* acc);
[2221]128
129 mutable double _tt; // time in seconds of GPSweek
130 mutable ColumnVector _xv; // status vector (position, velocity) at time _tt
131
[3255]132 double _gps_utc;
[2221]133 double _E; // [days]
134 double _tau; // [s]
135 double _gamma; //
136 double _x_pos; // [km]
137 double _x_velocity; // [km/s]
138 double _x_acceleration; // [km/s^2]
139 double _y_pos; // [km]
140 double _y_velocity; // [km/s]
141 double _y_acceleration; // [km/s^2]
142 double _z_pos; // [km]
143 double _z_velocity; // [km/s]
144 double _z_acceleration; // [km/s^2]
145 double _health; // 0 = O.K.
146 double _frequency_number; // ICD-GLONASS data position
147 double _tki; // message frame time
148};
149
[2770]150class t_ephGal : public t_eph {
151 public:
152 t_ephGal() { }
[3659]153 t_ephGal(float rnxVersion, const QStringList& lines);
[2770]154 virtual ~t_ephGal() {}
155 double TOC() const {return _TOC;}
156
157 void set(const galileoephemeris* ee);
158
159 virtual void position(int GPSweek, double GPSweeks,
160 double* xc,
161 double* vv) const;
162
163 virtual int IOD() const { return static_cast<int>(_IODnav); }
164
[3255]165 virtual int RTCM3(unsigned char *);
166
[2770]167 private:
168 double _IODnav;
169 double _TOC; // [s]
170 double _TOE; // [s]
171 double _clock_bias; // [s]
172 double _clock_drift; // [s/s]
173 double _clock_driftrate; // [s/s^2]
174 double _Crs; // [m]
175 double _Delta_n; // [rad/s]
176 double _M0; // [rad]
177 double _Cuc; // [rad]
178 double _e; //
179 double _Cus; // [rad]
180 double _sqrt_A; // [m^0.5]
181 double _Cic; // [rad]
182 double _OMEGA0; // [rad]
183 double _Cis; // [rad]
184 double _i0; // [rad]
185 double _Crc; // [m]
186 double _omega; // [rad]
187 double _OMEGADOT; // [rad/s]
188 double _IDOT; // [rad/s]
189 double _BGD_1_5A; // group delay [s]
[3255]190 double _BGD_1_5B; // group delay [s]
[2770]191 int _SISA; // Signal In Space Accuracy
192 int _E5aHS; // E5a Health Status
193
194};
195
[1025]196#endif
Note: See TracBrowser for help on using the repository browser.