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
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;
23 protected:
24 QString _prn;
[886]25 int _GPSweek;
26 double _GPSweeks;
[884]27};
[778]28
[884]29class t_ephGlo : public t_eph {
30 public:
31 t_ephGlo() {
[911]32 _gps_utc = 0.0;
[884]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;
[926]39 virtual int IOD() const;
[1866]40 virtual int RTCM3GLO(unsigned char *);
[884]41 private:
42 static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv);
[891]43 mutable double _tt; // time in seconds of GPSweek
44 mutable ColumnVector _xv; // status vector (position, velocity) at time _tt
[911]45 double _gps_utc; // GPS - UTC in seconds
[778]46
[889]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
[1866]61 double _tki; // message frame time
[884]62};
[778]63
[884]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);}
[1866]73 virtual int RTCM3GPS(unsigned char *);
[884]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]
[1866]102 double _health; // SV health
103 double _ura; // SV accuracy
104 double _L2PFlag; // L2 P data flag
105 double _L2Codes; // Codes on L2 channel
[771]106};
107
[758]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:
[1058]116 void newEph(t_eph* eph, int nBytes);
[758]117 void newMessage(const QByteArray msg);
[760]118 void error(const QByteArray msg);
[758]119
120 private:
[838]121 void reconnect();
[771]122 void readEph();
[759]123 QTcpSocket* _socket;
[1089]124 QFile* _echoFile;
125 QTextStream* _echoStream;
[758]126};
127#endif
Note: See TracBrowser for help on using the repository browser.