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

Last change on this file since 3760 was 3659, checked in by mervart, 12 years ago
File size: 5.6 KB
Line 
1#ifndef EPHEMERIS_H
2#define EPHEMERIS_H
3
4#include <newmat.h>
5#include <QtCore>
6#include <stdio.h>
7#include <string>
8extern "C" {
9#include "rtcm3torinex.h"
10}
11
12class t_eph {
13 public:
14 t_eph() {_ok = false;}
15 virtual ~t_eph() {};
16
17 bool ok() const {return _ok;}
18 bool isNewerThan(const t_eph* eph) const;
19 QString prn() const {return _prn;}
20 void setReceptDateTime(const QDateTime& dateTime) {
21 _receptDateTime = dateTime;
22 }
23 const QDateTime& receptDateTime() const {return _receptDateTime;}
24
25 int GPSweek() const { return _GPSweek; }
26 double GPSweeks() const { return _GPSweeks; }
27
28 virtual void position(int GPSweek, double GPSweeks,
29 double* xc, double* vv) const = 0;
30
31 void position(int GPSweek, double GPSweeks,
32 double& xx, double& yy, double& zz, double& cc) const {
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;
45
46 virtual int RTCM3(unsigned char *) = 0;
47
48 protected:
49 QString _prn;
50 int _GPSweek;
51 double _GPSweeks;
52 QDateTime _receptDateTime;
53 bool _ok;
54};
55
56
57class t_ephGPS : public t_eph {
58 public:
59 t_ephGPS() { }
60 t_ephGPS(float rnxVersion, const QStringList& lines);
61 virtual ~t_ephGPS() {}
62 double TOC() const {return _TOC;}
63
64 void set(const gpsephemeris* ee);
65
66 virtual void position(int GPSweek, double GPSweeks,
67 double* xc,
68 double* vv) const;
69
70 virtual int IOD() const { return static_cast<int>(_IODC); }
71
72 virtual int RTCM3(unsigned char *);
73
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]
102 double _health; // SV health
103 double _ura; // SV accuracy
104 double _L2PFlag; // L2 P data flag
105 double _L2Codes; // Codes on L2 channel
106};
107
108class t_ephGlo : public t_eph {
109 public:
110 t_ephGlo() { _xv.ReSize(6); }
111 t_ephGlo(float rnxVersion, const QStringList& lines);
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
121 virtual int RTCM3(unsigned char *);
122
123 void set(const glonassephemeris* ee);
124
125 private:
126 static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv,
127 double* acc);
128
129 mutable double _tt; // time in seconds of GPSweek
130 mutable ColumnVector _xv; // status vector (position, velocity) at time _tt
131
132 double _gps_utc;
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
150class t_ephGal : public t_eph {
151 public:
152 t_ephGal() { }
153 t_ephGal(float rnxVersion, const QStringList& lines);
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
165 virtual int RTCM3(unsigned char *);
166
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]
190 double _BGD_1_5B; // group delay [s]
191 int _SISA; // Signal In Space Accuracy
192 int _E5aHS; // E5a Health Status
193
194};
195
196#endif
Note: See TracBrowser for help on using the repository browser.