Changeset 886 in ntrip


Ignore:
Timestamp:
May 8, 2008, 4:47:15 PM (16 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNS/bnseph.cpp

    r884 r886  
    115115
    116116  emit(newEph(eph));
     117}
     118
     119// Compare Time
     120////////////////////////////////////////////////////////////////////////////
     121bool t_eph::isNewerThan(const t_eph* eph) const {
     122  if (_GPSweek >  eph->_GPSweek ||
     123      (_GPSweek == eph->_GPSweek && _GPSweeks > eph->_GPSweeks)) {
     124    return true;
     125  }
     126  else {
     127    return false;
     128  }
    117129}
    118130
     
    133145      QDateTime dateTime(QDate(int(year), int(month), int(day)),
    134146                         QTime(int(hour), int(minute), int(second)), Qt::UTC);
    135       int week;
    136       GPSweekFromDateAndTime(dateTime, week, _TOC);
    137       _GPSweek = week;
     147
     148      GPSweekFromDateAndTime(dateTime, _GPSweek, _GPSweeks);
     149      _TOC = _GPSweeks;
    138150    }
    139151    else if (ii == 2) {
     
    251263}
    252264
    253 // Compare Time
    254 ////////////////////////////////////////////////////////////////////////////
    255 bool t_ephGPS::isNewerThan(const t_eph* ep) const {
    256 
    257   const t_ephGPS* eph = dynamic_cast<const t_ephGPS*>(ep);
    258   if (!eph) {
    259     return false;
    260   }
    261 
    262   if (_GPSweek >  eph->_GPSweek ||
    263       (_GPSweek == eph->_GPSweek && _TOC > eph->_TOC)) {
    264     return true;
    265   }
    266   else {
    267     return false;
    268   }
    269 }
    270 
    271265//
    272266////////////////////////////////////////////////////////////////////////////
     
    280274      in >> _prn >> year >> month >> day >> hour >> minute >> second
    281275         >> _tau >> _gamma;
     276
     277      _tau = -_tau;
    282278     
    283279      if (year < 100) year += 2000;
     
    285281      QDateTime dateTime(QDate(int(year), int(month), int(day)),
    286282                         QTime(int(hour), int(minute), int(second)), Qt::UTC);
    287       int week;
    288       GPSweekFromDateAndTime(dateTime, week, _GPSTOW);
    289       _GPSweek = week;
     283
     284      GPSweekFromDateAndTime(dateTime, _GPSweek, _GPSweeks);
    290285    }
    291286    else if (ii == 2) {
    292       in >>_x_pos >> _x_velocity >> _x_acceleration >> _flags;
     287      in >>_x_pos >> _x_velocity >> _x_acceleration >> _health;
    293288    }
    294289    else if (ii == 3) {
     
    299294    }
    300295  }
    301 }
    302 
    303 //
    304 ////////////////////////////////////////////////////////////////////////////
    305 bool t_ephGlo::isNewerThan(const t_eph* ep) const {
    306   return false;
    307296}
    308297
  • trunk/BNS/bnseph.h

    r884 r886  
    1212 public:
    1313  virtual ~t_eph() {};
     14
     15  bool    isNewerThan(const t_eph* eph) const;
     16  QString prn() const {return _prn;}
     17
    1418  virtual void position(int GPSweek, double GPSweeks, ColumnVector& xc,
    1519                        ColumnVector& vv) const = 0;
    1620  virtual void read(const QStringList& lines) = 0;
    17   virtual bool isNewerThan(const t_eph* ep) const = 0;
    1821  virtual int  IOD() const = 0;
    19   QString prn() const {return _prn;}
    2022 protected: 
    2123  QString _prn;
     24  int     _GPSweek;
     25  double  _GPSweeks;
    2226};
    2327
     
    3135  virtual void position(int GPSweek, double GPSweeks, ColumnVector& xc,
    3236                        ColumnVector& vv) const;
    33   virtual bool isNewerThan(const t_eph* ep) const;
    3437  virtual int  IOD() const;
    3538 private:
     
    3740  ColumnVector _xv;
    3841
    39   double _GPSweek;
    40   double _GPSTOW;
    4142  double _E;                  /* [days]   */
    4243  double _tau;                /* [s]      */
     
    5152  double _z_velocity;         /* [km/s]   */
    5253  double _z_acceleration;     /* [km/s^2] */
    53   int    _flags;              /* GLOEPHF_xxx */
    54   int    _frequency_number;   /* ICD-GLONASS data position */
     54  double _health;             /* 0 = O.K. */
     55  double _frequency_number;   /* ICD-GLONASS data position */
    5556};
    5657
     
    6768
    6869 private:
    69   double  _GPSweek;         
    7070  double  _TOW;              //  [s]   
    7171  double  _TOC;              //  [s]   
Note: See TracChangeset for help on using the changeset viewer.