source: ntrip/branches/BNC_LM/RTCM3/ephemeris.h@ 8474

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