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

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