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

Last change on this file since 3837 was 3761, checked in by mervart, 13 years ago
File size: 5.7 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
[3761]125 int slotNum() const {return int(_frequency_number);}
126
[2221]127 private:
[2556]128 static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv,
129 double* acc);
[2221]130
131 mutable double _tt; // time in seconds of GPSweek
132 mutable ColumnVector _xv; // status vector (position, velocity) at time _tt
133
[3255]134 double _gps_utc;
[2221]135 double _E; // [days]
136 double _tau; // [s]
137 double _gamma; //
138 double _x_pos; // [km]
139 double _x_velocity; // [km/s]
140 double _x_acceleration; // [km/s^2]
141 double _y_pos; // [km]
142 double _y_velocity; // [km/s]
143 double _y_acceleration; // [km/s^2]
144 double _z_pos; // [km]
145 double _z_velocity; // [km/s]
146 double _z_acceleration; // [km/s^2]
147 double _health; // 0 = O.K.
148 double _frequency_number; // ICD-GLONASS data position
149 double _tki; // message frame time
150};
151
[2770]152class t_ephGal : public t_eph {
153 public:
154 t_ephGal() { }
[3659]155 t_ephGal(float rnxVersion, const QStringList& lines);
[2770]156 virtual ~t_ephGal() {}
157 double TOC() const {return _TOC;}
158
159 void set(const galileoephemeris* ee);
160
161 virtual void position(int GPSweek, double GPSweeks,
162 double* xc,
163 double* vv) const;
164
165 virtual int IOD() const { return static_cast<int>(_IODnav); }
166
[3255]167 virtual int RTCM3(unsigned char *);
168
[2770]169 private:
170 double _IODnav;
171 double _TOC; // [s]
172 double _TOE; // [s]
173 double _clock_bias; // [s]
174 double _clock_drift; // [s/s]
175 double _clock_driftrate; // [s/s^2]
176 double _Crs; // [m]
177 double _Delta_n; // [rad/s]
178 double _M0; // [rad]
179 double _Cuc; // [rad]
180 double _e; //
181 double _Cus; // [rad]
182 double _sqrt_A; // [m^0.5]
183 double _Cic; // [rad]
184 double _OMEGA0; // [rad]
185 double _Cis; // [rad]
186 double _i0; // [rad]
187 double _Crc; // [m]
188 double _omega; // [rad]
189 double _OMEGADOT; // [rad/s]
190 double _IDOT; // [rad/s]
191 double _BGD_1_5A; // group delay [s]
[3255]192 double _BGD_1_5B; // group delay [s]
[2770]193 int _SISA; // Signal In Space Accuracy
194 int _E5aHS; // E5a Health Status
195
196};
197
[1025]198#endif
Note: See TracBrowser for help on using the repository browser.