Changeset 2575 in ntrip for trunk/BNC/bncpppclient.cpp


Ignore:
Timestamp:
Aug 23, 2010, 6:25:26 PM (14 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncpppclient.cpp

    r2550 r2575  
    103103  delete _model;
    104104  delete _epoData;
    105   QMapIterator<QString, t_eph*> it(_eph);
     105  QMapIterator<QString, t_ephPair*> it(_eph);
    106106  while (it.hasNext()) {
    107107    it.next();
     
    250250
    251251  if (_eph.contains(prn)) {
    252     t_ephGPS* ee = static_cast<t_ephGPS*>(_eph.value(prn));
    253     if ( (ee->GPSweek() <  gpseph.GPSweek) ||
    254          (ee->GPSweek() == gpseph.GPSweek && 
    255           ee->TOC()     <  gpseph.TOC) ) { 
    256       ee->set(&gpseph);
    257     }
    258   }
    259   else {
    260     t_ephGPS* ee = new t_ephGPS();
    261     ee->set(&gpseph);
    262     _eph[prn] = ee;
     252    t_ephGPS* eLast = static_cast<t_ephGPS*>(_eph.value(prn)->last);
     253    t_ephGPS* ePrev = static_cast<t_ephGPS*>(_eph.value(prn)->prev);
     254    if ( (eLast->GPSweek() <  gpseph.GPSweek) ||
     255         (eLast->GPSweek() == gpseph.GPSweek && 
     256          eLast->TOC()     <  gpseph.TOC) ) {
     257      delete ePrev;
     258      ePrev = new t_ephGPS(*eLast); 
     259      eLast->set(&gpseph);
     260    }
     261  }
     262  else {
     263    t_ephGPS* eLast = new t_ephGPS();
     264    eLast->set(&gpseph);
     265    _eph.insert(prn, new t_ephPair());
     266    _eph[prn]->last = eLast;
    263267  }
    264268}
     
    275279    int tow = gloeph.GPSTOW;
    276280    updatetime(&ww, &tow, gloeph.tb*1000, 0);  // Moscow -> GPS
    277     t_ephGlo* ee = static_cast<t_ephGlo*>(_eph.value(prn));
    278     if (ee->GPSweek() < ww ||
    279         (ee->GPSweek()  == ww &&  ee->GPSweeks() <  tow)) { 
    280       ee->set(&gloeph);
    281     }
    282   }
    283   else {
    284     t_ephGlo* ee = new t_ephGlo();
    285     ee->set(&gloeph);
    286     _eph[prn] = ee;
     281    t_ephGlo* eLast = static_cast<t_ephGlo*>(_eph.value(prn)->last);
     282    t_ephGlo* ePrev = static_cast<t_ephGlo*>(_eph.value(prn)->prev);
     283    if (eLast->GPSweek() < ww ||
     284        (eLast->GPSweek()  == ww &&  eLast->GPSweeks() <  tow)) { 
     285      delete ePrev;
     286      ePrev = new t_ephGlo(*eLast); 
     287      eLast->set(&gloeph);
     288    }
     289  }
     290  else {
     291    t_ephGlo* eLast = new t_ephGlo();
     292    eLast->set(&gloeph);
     293    _eph.insert(prn, new t_ephPair());
     294    _eph[prn]->last = eLast;
    287295  }
    288296}
     
    426434
    427435  if (_eph.contains(prn)) {
    428     t_eph* ee = _eph.value(prn);
     436    t_eph* ee = _eph.value(prn)->last;
    429437    ee->position(tt.gpsw(), tt.gpssec(), xc.data(), vv.data());
    430438
     
    432440      if (_corr.contains(prn)) {
    433441        t_corr* cc = _corr.value(prn);
    434         if (ee->IOD() == cc->iod && (tt - cc->tt) < MAXAGE) {
     442        if (ee->IOD() == cc->iod && (tt - cc->tt) < MAXAGE) {
    435443          applyCorr(tt, cc, xc, vv);
    436444          return success;
Note: See TracChangeset for help on using the changeset viewer.