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

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

* empty log message *

File size: 3.3 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 _gps_utc = 0.0;
32 _xv.ReSize(6);
33 };
34 virtual ~t_ephGlo() {};
35 virtual void read(const QStringList& lines);
36 virtual void position(int GPSweek, double GPSweeks, ColumnVector& xc,
37 ColumnVector& vv) const;
38 virtual int IOD() const {return int(_GPSweeks);}
39 private:
40 static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv);
41 mutable double _tt; // time in seconds of GPSweek
42 mutable ColumnVector _xv; // status vector (position, velocity) at time _tt
43 double _gps_utc; // GPS - UTC in seconds
44
45 double _E; // [days]
46 double _tau; // [s]
47 double _gamma; //
48 double _x_pos; // [km]
49 double _x_velocity; // [km/s]
50 double _x_acceleration; // [km/s^2]
51 double _y_pos; // [km]
52 double _y_velocity; // [km/s]
53 double _y_acceleration; // [km/s^2]
54 double _z_pos; // [km]
55 double _z_velocity; // [km/s]
56 double _z_acceleration; // [km/s^2]
57 double _health; // 0 = O.K.
58 double _frequency_number; // ICD-GLONASS data position
59};
60
61
62class t_ephGPS : public t_eph {
63 public:
64 t_ephGPS() {};
65 virtual ~t_ephGPS() {};
66 virtual void read(const QStringList& lines);
67 virtual void position(int GPSweek, double GPSweeks, ColumnVector& xc,
68 ColumnVector& vv) const;
69 virtual int IOD() const {return int(_IODE);}
70
71 private:
72 double _TOW; // [s]
73 double _TOC; // [s]
74 double _TOE; // [s]
75 double _IODE;
76 double _IODC;
77
78 double _clock_bias; // [s]
79 double _clock_drift; // [s/s]
80 double _clock_driftrate; // [s/s^2]
81
82 double _Crs; // [m]
83 double _Delta_n; // [rad/s]
84 double _M0; // [rad]
85 double _Cuc; // [rad]
86 double _e; //
87 double _Cus; // [rad]
88 double _sqrt_A; // [m^0.5]
89 double _Cic; // [rad]
90 double _OMEGA0; // [rad]
91 double _Cis; // [rad]
92 double _i0; // [rad]
93 double _Crc; // [m]
94 double _omega; // [rad]
95 double _OMEGADOT; // [rad/s]
96 double _IDOT; // [rad/s]
97
98 double _TGD; // [s]
99};
100
101class t_bnseph : public QThread {
102 Q_OBJECT
103 public:
104 t_bnseph(QObject* parent = 0);
105 virtual ~t_bnseph();
106 virtual void run();
107
108 signals:
109 void newEph(t_eph* eph);
110 void newMessage(const QByteArray msg);
111 void error(const QByteArray msg);
112
113 private:
114 void reconnect();
115 void readEph();
116 QTcpSocket* _socket;
117};
118#endif
Note: See TracBrowser for help on using the repository browser.