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

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