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


Ignore:
Timestamp:
Jan 27, 2011, 1:57:40 PM (13 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncpppclient.cpp

    r2812 r2905  
    8686          ((bncApp*)qApp), SLOT(slotMessage(const QByteArray,bool)));
    8787
    88   connect(((bncApp*)qApp), SIGNAL(newEphGPS(gpsephemeris)),
    89           this, SLOT(slotNewEphGPS(gpsephemeris)));
    90 
    91   connect(((bncApp*)qApp), SIGNAL(newEphGlonass(glonassephemeris)),
    92           this, SLOT(slotNewEphGlonass(glonassephemeris)));
    93 
    94   connect(((bncApp*)qApp), SIGNAL(newEphGalileo(galileoephemeris)),
    95           this, SLOT(slotNewEphGalileo(galileoephemeris)));
    96 
    9788  connect(((bncApp*)qApp), SIGNAL(newCorrections(QList<QString>)),
    9889          this, SLOT(slotNewCorrections(QList<QString>)));
     
    111102    delete _epoData.front();
    112103    _epoData.pop();
    113   }
    114   QMapIterator<QString, t_ephPair*> it(_eph);
    115   while (it.hasNext()) {
    116     it.next();
    117     delete it.value();
    118104  }
    119105  QMapIterator<QString, t_corr*> ic(_corr);
     
    271257      delete satData;
    272258    }
    273   }
    274 }
    275 
    276 //
    277 ////////////////////////////////////////////////////////////////////////////
    278 void bncPPPclient::slotNewEphGPS(gpsephemeris gpseph) {
    279   QMutexLocker locker(&_mutex);
    280 
    281   QString prn = QString("G%1").arg(gpseph.satellite, 2, 10, QChar('0'));
    282 
    283   if (_eph.contains(prn)) {
    284     t_ephGPS* eLast = static_cast<t_ephGPS*>(_eph.value(prn)->last);
    285     if ( (eLast->GPSweek() <  gpseph.GPSweek) ||
    286          (eLast->GPSweek() == gpseph.GPSweek && 
    287           eLast->TOC()     <  gpseph.TOC) ) {
    288       delete static_cast<t_ephGPS*>(_eph.value(prn)->prev);
    289       _eph.value(prn)->prev = _eph.value(prn)->last;
    290       _eph.value(prn)->last = new t_ephGPS();
    291       static_cast<t_ephGPS*>(_eph.value(prn)->last)->set(&gpseph);
    292     }
    293   }
    294   else {
    295     t_ephGPS* eLast = new t_ephGPS();
    296     eLast->set(&gpseph);
    297     _eph.insert(prn, new t_ephPair());
    298     _eph[prn]->last = eLast;
    299   }
    300 }
    301 
    302 //
    303 ////////////////////////////////////////////////////////////////////////////
    304 void bncPPPclient::slotNewEphGlonass(glonassephemeris gloeph) {
    305   QMutexLocker locker(&_mutex);
    306 
    307   QString prn = QString("R%1").arg(gloeph.almanac_number, 2, 10, QChar('0'));
    308 
    309   if (_eph.contains(prn)) {
    310     int ww  = gloeph.GPSWeek;
    311     int tow = gloeph.GPSTOW;
    312     updatetime(&ww, &tow, gloeph.tb*1000, 0);  // Moscow -> GPS
    313     t_ephGlo* eLast = static_cast<t_ephGlo*>(_eph.value(prn)->last);
    314     if (eLast->GPSweek() < ww ||
    315         (eLast->GPSweek()  == ww &&  eLast->GPSweeks() <  tow)) { 
    316       delete static_cast<t_ephGlo*>(_eph.value(prn)->prev);
    317       _eph.value(prn)->prev = _eph.value(prn)->last;
    318       _eph.value(prn)->last = new t_ephGlo();
    319       static_cast<t_ephGlo*>(_eph.value(prn)->last)->set(&gloeph);
    320     }
    321   }
    322   else {
    323     t_ephGlo* eLast = new t_ephGlo();
    324     eLast->set(&gloeph);
    325     _eph.insert(prn, new t_ephPair());
    326     _eph[prn]->last = eLast;
    327   }
    328 }
    329 
    330 //
    331 ////////////////////////////////////////////////////////////////////////////
    332 void bncPPPclient::slotNewEphGalileo(galileoephemeris galeph) {
    333   QMutexLocker locker(&_mutex);
    334 
    335   QString prn = QString("E%1").arg(galeph.satellite, 2, 10, QChar('0'));
    336 
    337   if (_eph.contains(prn)) {
    338     t_ephGal* eLast = static_cast<t_ephGal*>(_eph.value(prn)->last);
    339     if ( (eLast->GPSweek() <  galeph.Week) ||
    340          (eLast->GPSweek() == galeph.Week && 
    341           eLast->TOC()     <  galeph.TOC) ) {
    342       delete static_cast<t_ephGal*>(_eph.value(prn)->prev);
    343       _eph.value(prn)->prev = _eph.value(prn)->last;
    344       _eph.value(prn)->last = new t_ephGal();
    345       static_cast<t_ephGal*>(_eph.value(prn)->last)->set(&galeph);
    346     }
    347   }
    348   else {
    349     t_ephGal* eLast = new t_ephGal();
    350     eLast->set(&galeph);
    351     _eph.insert(prn, new t_ephPair());
    352     _eph[prn]->last = eLast;
    353259  }
    354260}
Note: See TracChangeset for help on using the changeset viewer.