source: ntrip/trunk/BNS/bnseph.h@ 891

Last change on this file since 891 was 891, checked in by mervart, 16 years ago

* empty log message *

File size: 3.2 KB
Line 
1#ifndef BNSEPH_H
2#define BNSEPH_H
3
4#include <newmat.h>
5
6#include <QtCore>
7#include <QThread>
8#include <QtNetwork>
9
10
11class t_eph {
12 public:
13 virtual ~t_eph() {};
14
15 bool isNewerThan(const t_eph* eph) const;
16 QString prn() const {return _prn;}
17
18 virtual void position(int GPSweek, double GPSweeks, ColumnVector& xc,
19 ColumnVector& vv) const = 0;
20 virtual void read(const QStringList& lines) = 0;
21 virtual int IOD() const = 0;
22 protected:
23 QString _prn;
24 int _GPSweek;
25 double _GPSweeks;
26};
27
28class t_ephGlo : public t_eph {
29 public:
30 t_ephGlo() {
31 _xv.ReSize(6);
32 };
33 virtual ~t_ephGlo() {};
34 virtual void read(const QStringList& lines);
35 virtual void position(int GPSweek, double GPSweeks, ColumnVector& xc,
36 ColumnVector& vv) const;
37 virtual int IOD() const {return int(_GPSweeks);}
38 private:
39 static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv);
40 mutable double _tt; // time in seconds of GPSweek
41 mutable ColumnVector _xv; // status vector (position, velocity) at time _tt
42
43 double _E; // [days]
44 double _tau; // [s]
45 double _gamma; //
46 double _x_pos; // [km]
47 double _x_velocity; // [km/s]
48 double _x_acceleration; // [km/s^2]
49 double _y_pos; // [km]
50 double _y_velocity; // [km/s]
51 double _y_acceleration; // [km/s^2]
52 double _z_pos; // [km]
53 double _z_velocity; // [km/s]
54 double _z_acceleration; // [km/s^2]
55 double _health; // 0 = O.K.
56 double _frequency_number; // ICD-GLONASS data position
57};
58
59
60class t_ephGPS : public t_eph {
61 public:
62 t_ephGPS() {};
63 virtual ~t_ephGPS() {};
64 virtual void read(const QStringList& lines);
65 virtual void position(int GPSweek, double GPSweeks, ColumnVector& xc,
66 ColumnVector& vv) const;
67 virtual int IOD() const {return int(_IODE);}
68
69 private:
70 double _TOW; // [s]
71 double _TOC; // [s]
72 double _TOE; // [s]
73 double _IODE;
74 double _IODC;
75
76 double _clock_bias; // [s]
77 double _clock_drift; // [s/s]
78 double _clock_driftrate; // [s/s^2]
79
80 double _Crs; // [m]
81 double _Delta_n; // [rad/s]
82 double _M0; // [rad]
83 double _Cuc; // [rad]
84 double _e; //
85 double _Cus; // [rad]
86 double _sqrt_A; // [m^0.5]
87 double _Cic; // [rad]
88 double _OMEGA0; // [rad]
89 double _Cis; // [rad]
90 double _i0; // [rad]
91 double _Crc; // [m]
92 double _omega; // [rad]
93 double _OMEGADOT; // [rad/s]
94 double _IDOT; // [rad/s]
95
96 double _TGD; // [s]
97};
98
99class t_bnseph : public QThread {
100 Q_OBJECT
101 public:
102 t_bnseph(QObject* parent = 0);
103 virtual ~t_bnseph();
104 virtual void run();
105
106 signals:
107 void newEph(t_eph* eph);
108 void newMessage(const QByteArray msg);
109 void error(const QByteArray msg);
110
111 private:
112 void reconnect();
113 void readEph();
114 QTcpSocket* _socket;
115};
116#endif
Note: See TracBrowser for help on using the repository browser.