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

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