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

Last change on this file since 2088 was 2040, checked in by mervart, 15 years ago

* empty log message *

File size: 2.6 KB
Line 
1#ifndef EPHEMERIS_H
2#define EPHEMERIS_H
3
4#include <stdio.h>
5#include <string>
6extern "C" {
7#include "RTCM3/rtcm3torinex.h"
8}
9
10class t_eph {
11 public:
12 virtual ~t_eph() {};
13
14 bool isNewerThan(const t_eph* eph) const;
15 std::string prn() const {return _prn;}
16
17 int GPSweek() const { return _GPSweek; }
18 double GPSweeks() const { return _GPSweeks; }
19
20 virtual void position(int GPSweek, double GPSweeks,
21 double* xc,
22 double* vv) const = 0;
23
24 void position(int GPSweek, double GPSweeks,
25 double& xx, double& yy, double& zz, double& cc) const {
26 double tmp_xx[4];
27 double tmp_vv[4];
28
29 position(GPSweek, GPSweeks, tmp_xx, tmp_vv);
30
31 xx = tmp_xx[0];
32 yy = tmp_xx[1];
33 zz = tmp_xx[2];
34 cc = tmp_xx[3];
35 }
36
37 virtual int IOD() const = 0;
38
39 virtual void print(std::ostream& out) const = 0;
40
41 protected:
42 std::string _prn;
43 int _GPSweek;
44 double _GPSweeks;
45};
46
47
48class t_ephGPS : public t_eph {
49 public:
50 t_ephGPS() { }
51 ~t_ephGPS() {}
52 double TOC() const {return _TOC;}
53
54 void set(const gpsephemeris* ee);
55
56 void set(int prn,
57 int GPSWeek,
58 double toc, double toe, double tot,
59 double IODE, double IODC,
60 double clock_bias, double clock_drift, double clock_driftrate,
61 double OMEGA0, double OMEGADOT,
62 double i0, double IDOT,
63 double omega,
64 double M0, double Delta_n,
65 double sqrt_A,
66 double e,
67 double Crc, double Crs,
68 double Cic, double Cis,
69 double Cuc, double Cus,
70 double TGD,
71 int health);
72
73 void position(int GPSweek, double GPSweeks,
74 double* xc,
75 double* vv) const;
76
77 int IOD() const { return static_cast<int>(_IODC); }
78
79 void print(std::ostream& out) const;
80
81 private:
82 double _TOW; // [s]
83 double _TOC; // [s]
84 double _TOE; // [s]
85 double _IODE;
86 double _IODC;
87
88 double _clock_bias; // [s]
89 double _clock_drift; // [s/s]
90 double _clock_driftrate; // [s/s^2]
91
92 double _Crs; // [m]
93 double _Delta_n; // [rad/s]
94 double _M0; // [rad]
95 double _Cuc; // [rad]
96 double _e; //
97 double _Cus; // [rad]
98 double _sqrt_A; // [m^0.5]
99 double _Cic; // [rad]
100 double _OMEGA0; // [rad]
101 double _Cis; // [rad]
102 double _i0; // [rad]
103 double _Crc; // [m]
104 double _omega; // [rad]
105 double _OMEGADOT; // [rad/s]
106 double _IDOT; // [rad/s]
107
108 double _TGD; // [s]
109};
110
111#endif
Note: See TracBrowser for help on using the repository browser.