1 | #ifndef EPHEMERIS_H
|
---|
2 | #define EPHEMERIS_H
|
---|
3 |
|
---|
4 | #include <newmat.h>
|
---|
5 | #include <QtCore>
|
---|
6 | #include <stdio.h>
|
---|
7 | #include <string>
|
---|
8 | extern "C" {
|
---|
9 | #include "rtcm3torinex.h"
|
---|
10 | }
|
---|
11 |
|
---|
12 | class t_eph {
|
---|
13 | public:
|
---|
14 | virtual ~t_eph() {};
|
---|
15 |
|
---|
16 | bool isNewerThan(const t_eph* eph) const;
|
---|
17 | std::string prn() const {return _prn;}
|
---|
18 | void setReceptDateTime(const QDateTime& dateTime) {
|
---|
19 | _receptDateTime = dateTime;
|
---|
20 | }
|
---|
21 | const QDateTime& receptDateTime() const {return _receptDateTime;}
|
---|
22 |
|
---|
23 | int GPSweek() const { return _GPSweek; }
|
---|
24 | double GPSweeks() const { return _GPSweeks; }
|
---|
25 |
|
---|
26 | virtual void position(int GPSweek, double GPSweeks,
|
---|
27 | double* xc, double* vv) const = 0;
|
---|
28 |
|
---|
29 | void position(int GPSweek, double GPSweeks,
|
---|
30 | double& xx, double& yy, double& zz, double& cc) const {
|
---|
31 | double tmp_xx[4];
|
---|
32 | double tmp_vv[4];
|
---|
33 |
|
---|
34 | position(GPSweek, GPSweeks, tmp_xx, tmp_vv);
|
---|
35 |
|
---|
36 | xx = tmp_xx[0];
|
---|
37 | yy = tmp_xx[1];
|
---|
38 | zz = tmp_xx[2];
|
---|
39 | cc = tmp_xx[3];
|
---|
40 | }
|
---|
41 |
|
---|
42 | virtual int IOD() const = 0;
|
---|
43 |
|
---|
44 | protected:
|
---|
45 | std::string _prn;
|
---|
46 | int _GPSweek;
|
---|
47 | double _GPSweeks;
|
---|
48 | QDateTime _receptDateTime;
|
---|
49 | };
|
---|
50 |
|
---|
51 |
|
---|
52 | class t_ephGPS : public t_eph {
|
---|
53 | public:
|
---|
54 | t_ephGPS() { }
|
---|
55 | virtual ~t_ephGPS() {}
|
---|
56 | double TOC() const {return _TOC;}
|
---|
57 |
|
---|
58 | void set(const gpsephemeris* ee);
|
---|
59 |
|
---|
60 | virtual void position(int GPSweek, double GPSweeks,
|
---|
61 | double* xc,
|
---|
62 | double* vv) const;
|
---|
63 |
|
---|
64 | virtual int IOD() const { return static_cast<int>(_IODC); }
|
---|
65 |
|
---|
66 | private:
|
---|
67 | double _TOW; // [s]
|
---|
68 | double _TOC; // [s]
|
---|
69 | double _TOE; // [s]
|
---|
70 | double _IODE;
|
---|
71 | double _IODC;
|
---|
72 |
|
---|
73 | double _clock_bias; // [s]
|
---|
74 | double _clock_drift; // [s/s]
|
---|
75 | double _clock_driftrate; // [s/s^2]
|
---|
76 |
|
---|
77 | double _Crs; // [m]
|
---|
78 | double _Delta_n; // [rad/s]
|
---|
79 | double _M0; // [rad]
|
---|
80 | double _Cuc; // [rad]
|
---|
81 | double _e; //
|
---|
82 | double _Cus; // [rad]
|
---|
83 | double _sqrt_A; // [m^0.5]
|
---|
84 | double _Cic; // [rad]
|
---|
85 | double _OMEGA0; // [rad]
|
---|
86 | double _Cis; // [rad]
|
---|
87 | double _i0; // [rad]
|
---|
88 | double _Crc; // [m]
|
---|
89 | double _omega; // [rad]
|
---|
90 | double _OMEGADOT; // [rad/s]
|
---|
91 | double _IDOT; // [rad/s]
|
---|
92 |
|
---|
93 | double _TGD; // [s]
|
---|
94 | };
|
---|
95 |
|
---|
96 | class t_ephGlo : public t_eph {
|
---|
97 | public:
|
---|
98 | t_ephGlo() { _xv.ReSize(6); }
|
---|
99 |
|
---|
100 | virtual ~t_ephGlo() {}
|
---|
101 |
|
---|
102 | virtual void position(int GPSweek, double GPSweeks,
|
---|
103 | double* xc,
|
---|
104 | double* vv) const;
|
---|
105 |
|
---|
106 | virtual int IOD() const;
|
---|
107 |
|
---|
108 | void set(const glonassephemeris* ee);
|
---|
109 |
|
---|
110 | private:
|
---|
111 | static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv,
|
---|
112 | double* acc);
|
---|
113 |
|
---|
114 | mutable double _tt; // time in seconds of GPSweek
|
---|
115 | mutable ColumnVector _xv; // status vector (position, velocity) at time _tt
|
---|
116 |
|
---|
117 | double _E; // [days]
|
---|
118 | double _tau; // [s]
|
---|
119 | double _gamma; //
|
---|
120 | double _x_pos; // [km]
|
---|
121 | double _x_velocity; // [km/s]
|
---|
122 | double _x_acceleration; // [km/s^2]
|
---|
123 | double _y_pos; // [km]
|
---|
124 | double _y_velocity; // [km/s]
|
---|
125 | double _y_acceleration; // [km/s^2]
|
---|
126 | double _z_pos; // [km]
|
---|
127 | double _z_velocity; // [km/s]
|
---|
128 | double _z_acceleration; // [km/s^2]
|
---|
129 | double _health; // 0 = O.K.
|
---|
130 | double _frequency_number; // ICD-GLONASS data position
|
---|
131 | double _tki; // message frame time
|
---|
132 | };
|
---|
133 |
|
---|
134 | class t_ephGal : public t_eph {
|
---|
135 | public:
|
---|
136 | t_ephGal() { }
|
---|
137 | virtual ~t_ephGal() {}
|
---|
138 | double TOC() const {return _TOC;}
|
---|
139 |
|
---|
140 | void set(const galileoephemeris* ee);
|
---|
141 |
|
---|
142 | virtual void position(int GPSweek, double GPSweeks,
|
---|
143 | double* xc,
|
---|
144 | double* vv) const;
|
---|
145 |
|
---|
146 | virtual int IOD() const { return static_cast<int>(_IODnav); }
|
---|
147 |
|
---|
148 | private:
|
---|
149 | double _IODnav;
|
---|
150 | double _TOC; // [s]
|
---|
151 | double _TOE; // [s]
|
---|
152 | double _clock_bias; // [s]
|
---|
153 | double _clock_drift; // [s/s]
|
---|
154 | double _clock_driftrate; // [s/s^2]
|
---|
155 | double _Crs; // [m]
|
---|
156 | double _Delta_n; // [rad/s]
|
---|
157 | double _M0; // [rad]
|
---|
158 | double _Cuc; // [rad]
|
---|
159 | double _e; //
|
---|
160 | double _Cus; // [rad]
|
---|
161 | double _sqrt_A; // [m^0.5]
|
---|
162 | double _Cic; // [rad]
|
---|
163 | double _OMEGA0; // [rad]
|
---|
164 | double _Cis; // [rad]
|
---|
165 | double _i0; // [rad]
|
---|
166 | double _Crc; // [m]
|
---|
167 | double _omega; // [rad]
|
---|
168 | double _OMEGADOT; // [rad/s]
|
---|
169 | double _IDOT; // [rad/s]
|
---|
170 | double _BGD_1_5A; // group delay [s]
|
---|
171 | int _SISA; // Signal In Space Accuracy
|
---|
172 | int _E5aHS; // E5a Health Status
|
---|
173 |
|
---|
174 | };
|
---|
175 |
|
---|
176 | #endif
|
---|