- Timestamp:
- May 8, 2008, 4:47:15 PM (17 years ago)
- Location:
- trunk/BNS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bnseph.cpp
r884 r886 115 115 116 116 emit(newEph(eph)); 117 } 118 119 // Compare Time 120 //////////////////////////////////////////////////////////////////////////// 121 bool 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 } 117 129 } 118 130 … … 133 145 QDateTime dateTime(QDate(int(year), int(month), int(day)), 134 146 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; 138 150 } 139 151 else if (ii == 2) { … … 251 263 } 252 264 253 // Compare Time254 ////////////////////////////////////////////////////////////////////////////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 271 265 // 272 266 //////////////////////////////////////////////////////////////////////////// … … 280 274 in >> _prn >> year >> month >> day >> hour >> minute >> second 281 275 >> _tau >> _gamma; 276 277 _tau = -_tau; 282 278 283 279 if (year < 100) year += 2000; … … 285 281 QDateTime dateTime(QDate(int(year), int(month), int(day)), 286 282 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); 290 285 } 291 286 else if (ii == 2) { 292 in >>_x_pos >> _x_velocity >> _x_acceleration >> _ flags;287 in >>_x_pos >> _x_velocity >> _x_acceleration >> _health; 293 288 } 294 289 else if (ii == 3) { … … 299 294 } 300 295 } 301 }302 303 //304 ////////////////////////////////////////////////////////////////////////////305 bool t_ephGlo::isNewerThan(const t_eph* ep) const {306 return false;307 296 } 308 297 -
trunk/BNS/bnseph.h
r884 r886 12 12 public: 13 13 virtual ~t_eph() {}; 14 15 bool isNewerThan(const t_eph* eph) const; 16 QString prn() const {return _prn;} 17 14 18 virtual void position(int GPSweek, double GPSweeks, ColumnVector& xc, 15 19 ColumnVector& vv) const = 0; 16 20 virtual void read(const QStringList& lines) = 0; 17 virtual bool isNewerThan(const t_eph* ep) const = 0;18 21 virtual int IOD() const = 0; 19 QString prn() const {return _prn;}20 22 protected: 21 23 QString _prn; 24 int _GPSweek; 25 double _GPSweeks; 22 26 }; 23 27 … … 31 35 virtual void position(int GPSweek, double GPSweeks, ColumnVector& xc, 32 36 ColumnVector& vv) const; 33 virtual bool isNewerThan(const t_eph* ep) const;34 37 virtual int IOD() const; 35 38 private: … … 37 40 ColumnVector _xv; 38 41 39 double _GPSweek;40 double _GPSTOW;41 42 double _E; /* [days] */ 42 43 double _tau; /* [s] */ … … 51 52 double _z_velocity; /* [km/s] */ 52 53 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 */ 55 56 }; 56 57 … … 67 68 68 69 private: 69 double _GPSweek;70 70 double _TOW; // [s] 71 71 double _TOC; // [s]
Note:
See TracChangeset
for help on using the changeset viewer.