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

Last change on this file since 1049 was 1025, checked in by zdenek, 16 years ago

Zdenek Lukes: added logic for decoding of messages 20/21 from RTCM2.3 streams

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