Changeset 4018 in ntrip for trunk/BNC/RTCM3/ephemeris.h


Ignore:
Timestamp:
Apr 22, 2012, 6:50:49 PM (12 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/RTCM3/ephemeris.h

    r4013 r4018  
    66#include <stdio.h>
    77#include <string>
     8#include "bnctime.h"
    89extern "C" {
    910#include "rtcm3torinex.h"
     
    1516  enum e_type {unknown, GPS, GLONASS, Galileo};
    1617
    17   static bool earlierTime(const t_eph* eph1, const t_eph* eph2) {
    18     if      (eph1->_GPSweek < eph2->_GPSweek) {
    19       return true;
    20     }
    21     else if (eph1->_GPSweek == eph2->_GPSweek) {
    22       return eph1->_GPSweeks < eph2->_GPSweeks;
    23     }
    24     else {
    25       return false;
    26     }
    27   }
    28 
    2918  t_eph() {_ok = false;}
    3019  virtual ~t_eph() {};
    3120
     21  static bool earlierTime(const t_eph* eph1, const t_eph* eph2) {
     22    return eph1->_TOC < eph2->_TOC;
     23  }
     24
    3225  virtual e_type type() const = 0;
    33 
    3426  virtual QString toString(double version) const = 0;
    35 
    36   bool     ok() const {return _ok;}
    37   bool     isNewerThan(const t_eph* eph) const;
    38   QString  prn() const {return _prn;}
    39   void    setReceptDateTime(const QDateTime& dateTime) {
     27  virtual void position(int GPSweek, double GPSweeks,
     28                        double* xc, double* vv) const = 0;
     29  virtual int  IOD() const = 0;
     30  virtual int  RTCM3(unsigned char *) = 0;
     31
     32  bool ok() const {return _ok;}
     33  bncTime TOC() const {return _TOC;}
     34  bool isNewerThan(const t_eph* eph) const {
     35    return earlierTime(this, eph);
     36  }
     37  QString prn() const {return _prn;}
     38  void  setReceptDateTime(const QDateTime& dateTime) {
    4039    _receptDateTime = dateTime;
    4140  }
    4241  const QDateTime& receptDateTime() const {return _receptDateTime;}
    43 
    44   int    GPSweek()  const { return _GPSweek; }
    45   double GPSweeks() const { return _GPSweeks; }
    46 
    47   virtual void position(int GPSweek, double GPSweeks,
    48                         double* xc, double* vv) const = 0;
    4942
    5043  void position(int GPSweek, double GPSweeks,
     
    5245    double tmp_xx[4];
    5346    double tmp_vv[4];
    54 
    5547    position(GPSweek, GPSweeks, tmp_xx, tmp_vv);
    5648
     
    6153  }
    6254
    63   virtual int  IOD() const = 0;
    64  
    65   virtual int  RTCM3(unsigned char *) = 0;
    66 
    6755 protected: 
    6856  QString   _prn;
    69   int       _GPSweek;
    70   double    _GPSweeks;
     57  bncTime   _TOC;
    7158  QDateTime _receptDateTime;
    7259  bool      _ok;
     
    8471  virtual QString toString(double version) const;
    8572
    86   double TOC() const {return _TOC;}
    87 
    8873  void set(const gpsephemeris* ee);
    8974
     
    9782
    9883 private:
    99   double  _TOW;              //  [s]   
    100   double  _TOC;              //  [s]   
    101   double  _TOE;              //  [s]   
    102   double  _IODE;             
    103   double  _IODC;             
    104 
     84  double  _clock_bias;      // [s]   
     85  double  _clock_drift;     // [s/s] 
     86  double  _clock_driftrate; // [s/s^2]
     87
     88  double  _IODE;           
     89  double  _Crs;             // [m]   
     90  double  _Delta_n;         // [rad/s]
     91  double  _M0;              // [rad] 
     92
     93  double  _Cuc;             // [rad] 
     94  double  _e;               //       
     95  double  _Cus;             // [rad] 
     96  double  _sqrt_A;          // [m^0.5]
     97
     98  double  _TOEsec;          // [s]   
     99  double  _Cic;             // [rad] 
     100  double  _OMEGA0;          // [rad] 
     101  double  _Cis;             // [rad] 
     102
     103  double  _i0;              // [rad] 
     104  double  _Crc;             // [m]   
     105  double  _omega;           // [rad] 
     106  double  _OMEGADOT;        // [rad/s]
     107
     108  double  _IDOT;            // [rad/s]
     109  double  _L2Codes;         // Codes on L2 channel
     110  double  _TOEweek;
     111  double  _L2PFlag;         // L2 P data flag
     112
     113  double  _ura;             // SV accuracy
     114  double  _health;          // SV health
     115  double  _TGD;             // [s]   
     116  double  _IODC;           
     117
     118  double  _TOT;             // Transmisstion time
     119  double  _fitInterval;     // Fit interval
     120};
     121
     122class t_ephGlo : public t_eph {
     123 public:
     124  t_ephGlo() { _xv.ReSize(6); }
     125  t_ephGlo(float rnxVersion, const QStringList& lines);
     126
     127  virtual ~t_ephGlo() {}
     128
     129  virtual e_type type() const {return t_eph::GLONASS;}
     130
     131  virtual QString toString(double version) const;
     132
     133  virtual void position(int GPSweek, double GPSweeks,
     134                        double* xc,
     135                        double* vv) const;
     136
     137  virtual int  IOD() const;
     138
     139  virtual int  RTCM3(unsigned char *);
     140
     141  void set(const glonassephemeris* ee);
     142
     143  int  slotNum() const {return int(_frequency_number);}
     144
     145 private:
     146  static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv,
     147                                double* acc);
     148
     149  mutable bncTime      _tt;  // time
     150  mutable ColumnVector _xv;  // status vector (position, velocity) at time _tt
     151
     152  double  _gps_utc;
     153  double  _tau;              // [s]     
     154  double  _gamma;            //         
     155  double  _tki;              // message frame time
     156
     157  double  _x_pos;            // [km]     
     158  double  _x_velocity;       // [km/s]   
     159  double  _x_acceleration;   // [km/s^2]
     160  double  _health;           // 0 = O.K.
     161
     162  double  _y_pos;            // [km]     
     163  double  _y_velocity;       // [km/s]   
     164  double  _y_acceleration;   // [km/s^2]
     165  double  _frequency_number; // ICD-GLONASS data position
     166
     167  double  _z_pos;            // [km]     
     168  double  _z_velocity;       // [km/s]   
     169  double  _z_acceleration;   // [km/s^2]
     170  double  _E;                // Age of Information [days]   
     171};
     172
     173class t_ephGal : public t_eph {
     174 public:
     175  t_ephGal() { }
     176  t_ephGal(float rnxVersion, const QStringList& lines);
     177  virtual ~t_ephGal() {}
     178
     179  virtual QString toString(double version) const;
     180
     181  virtual e_type type() const {return t_eph::Galileo;}
     182
     183  void set(const galileoephemeris* ee);
     184
     185  virtual void position(int GPSweek, double GPSweeks,
     186                        double* xc,
     187                        double* vv) const;
     188
     189  virtual int  IOD() const { return static_cast<int>(_IODnav); }
     190
     191  virtual int  RTCM3(unsigned char *);
     192
     193 private:
    105194  double  _clock_bias;       //  [s]   
    106195  double  _clock_drift;      //  [s/s] 
    107196  double  _clock_driftrate;  //  [s/s^2]
    108197
     198  double  _IODnav;             
    109199  double  _Crs;              //  [m]   
    110200  double  _Delta_n;          //  [rad/s]
    111201  double  _M0;               //  [rad] 
     202
    112203  double  _Cuc;              //  [rad] 
    113204  double  _e;                //         
    114205  double  _Cus;              //  [rad] 
    115206  double  _sqrt_A;           //  [m^0.5]
     207
     208  double  _TOEsec;           //  [s]   
    116209  double  _Cic;              //  [rad] 
    117210  double  _OMEGA0;           //  [rad] 
    118211  double  _Cis;              //  [rad] 
     212
    119213  double  _i0;               //  [rad] 
    120214  double  _Crc;              //  [m]   
    121215  double  _omega;            //  [rad] 
    122216  double  _OMEGADOT;         //  [rad/s]
     217
    123218  double  _IDOT;             //  [rad/s]
    124 
    125   double  _TGD;              //  [s]   
    126   double _health;            //  SV health
    127   double _ura;               //  SV accuracy
    128   double _L2PFlag;           //  L2 P data flag
    129   double _L2Codes;           //  Codes on L2 channel
    130 };
    131 
    132 class t_ephGlo : public t_eph {
    133  public:
    134   t_ephGlo() { _xv.ReSize(6); }
    135   t_ephGlo(float rnxVersion, const QStringList& lines);
    136 
    137   virtual ~t_ephGlo() {}
    138 
    139   virtual e_type type() const {return t_eph::GLONASS;}
    140 
    141   virtual QString toString(double version) const;
    142 
    143   virtual void position(int GPSweek, double GPSweeks,
    144                         double* xc,
    145                         double* vv) const;
    146 
    147   virtual int  IOD() const;
    148 
    149   virtual int  RTCM3(unsigned char *);
    150 
    151   void set(const glonassephemeris* ee);
    152 
    153   int  slotNum() const {return int(_frequency_number);}
    154 
    155  private:
    156   static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv,
    157                                 double* acc);
    158 
    159   mutable double       _tt;  // time in seconds of GPSweek
    160   mutable ColumnVector _xv;  // status vector (position, velocity) at time _tt
    161 
    162   double  _gps_utc;
    163   double  _E;                // [days]   
    164   double  _tau;              // [s]     
    165   double  _gamma;            //         
    166   double  _x_pos;            // [km]     
    167   double  _x_velocity;       // [km/s]   
    168   double  _x_acceleration;   // [km/s^2]
    169   double  _y_pos;            // [km]     
    170   double  _y_velocity;       // [km/s]   
    171   double  _y_acceleration;   // [km/s^2]
    172   double  _z_pos;            // [km]     
    173   double  _z_velocity;       // [km/s]   
    174   double  _z_acceleration;   // [km/s^2]
    175   double  _health;           // 0 = O.K.
    176   double  _frequency_number; // ICD-GLONASS data position
    177   double  _tki;              // message frame time
    178 };
    179 
    180 class t_ephGal : public t_eph {
    181  public:
    182   t_ephGal() { }
    183   t_ephGal(float rnxVersion, const QStringList& lines);
    184   virtual ~t_ephGal() {}
    185 
    186   virtual QString toString(double version) const;
    187 
    188   virtual e_type type() const {return t_eph::Galileo;}
    189 
    190   double TOC() const {return _TOC;}
    191 
    192   void set(const galileoephemeris* ee);
    193 
    194   virtual void position(int GPSweek, double GPSweeks,
    195                         double* xc,
    196                         double* vv) const;
    197 
    198   virtual int  IOD() const { return static_cast<int>(_IODnav); }
    199 
    200   virtual int  RTCM3(unsigned char *);
    201 
    202  private:
    203   double  _IODnav;             
    204   double  _TOC;              //  [s]   
    205   double  _TOE;              //  [s]   
    206   double  _clock_bias;       //  [s]   
    207   double  _clock_drift;      //  [s/s] 
    208   double  _clock_driftrate;  //  [s/s^2]
    209   double  _Crs;              //  [m]   
    210   double  _Delta_n;          //  [rad/s]
    211   double  _M0;               //  [rad] 
    212   double  _Cuc;              //  [rad] 
    213   double  _e;                //         
    214   double  _Cus;              //  [rad] 
    215   double  _sqrt_A;           //  [m^0.5]
    216   double  _Cic;              //  [rad] 
    217   double  _OMEGA0;           //  [rad] 
    218   double  _Cis;              //  [rad] 
    219   double  _i0;               //  [rad] 
    220   double  _Crc;              //  [m]   
    221   double  _omega;            //  [rad] 
    222   double  _OMEGADOT;         //  [rad/s]
    223   double  _IDOT;             //  [rad/s]
     219  //
     220  double _TOEweek;
     221  // spare
     222
     223  int     _SISA;             //  Signal In Space Accuracy
     224  int     _E5aHS;            //  E5a Health Status
    224225  double  _BGD_1_5A;         //  group delay [s]
    225226  double  _BGD_1_5B;         //  group delay [s]
    226   int     _SISA;             //  Signal In Space Accuracy
    227   int     _E5aHS;            //  E5a Health Status
    228 
     227
     228  double _TOT;               // [s]
    229229};
    230230
Note: See TracChangeset for help on using the changeset viewer.