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

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

* empty log message *

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