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
RevLine 
[758]1#ifndef BNSEPH_H
2#define BNSEPH_H
3
[884]4#include <newmat.h>
5
6#include <QtCore>
[758]7#include <QThread>
[759]8#include <QtNetwork>
[758]9
[884]10
11class t_eph {
[778]12 public:
[884]13 virtual ~t_eph() {};
[886]14
15 bool isNewerThan(const t_eph* eph) const;
16 QString prn() const {return _prn;}
17
[884]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;
[886]24 int _GPSweek;
25 double _GPSweeks;
[884]26};
[778]27
[884]28class t_ephGlo : public t_eph {
29 public:
30 t_ephGlo() {
[911]31 _gps_utc = 0.0;
[884]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;
[889]38 virtual int IOD() const {return int(_GPSweeks);}
[884]39 private:
40 static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv);
[891]41 mutable double _tt; // time in seconds of GPSweek
42 mutable ColumnVector _xv; // status vector (position, velocity) at time _tt
[911]43 double _gps_utc; // GPS - UTC in seconds
[778]44
[889]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
[884]59};
[778]60
[884]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]
[771]99};
100
[758]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:
[884]109 void newEph(t_eph* eph);
[758]110 void newMessage(const QByteArray msg);
[760]111 void error(const QByteArray msg);
[758]112
113 private:
[838]114 void reconnect();
[771]115 void readEph();
[759]116 QTcpSocket* _socket;
[758]117};
118#endif
Note: See TracBrowser for help on using the repository browser.