Changeset 2905 in ntrip


Ignore:
Timestamp:
Jan 27, 2011, 1:57:40 PM (13 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncephuser.h

    r2904 r2905  
    6464  void slotNewEphGalileo(galileoephemeris galeph);
    6565
    66  private:
     66 protected:
    6767
    6868  class t_ephPair {
  • 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}
  • trunk/BNC/bncpppclient.h

    r2809 r2905  
    2727
    2828#include <queue>
    29 #include <QtNetwork>
    30 
    31 #include <newmat.h>
    32 
    33 #include "bncconst.h"
    34 #include "bnctime.h"
     29#include "bncephuser.h"
    3530#include "RTCM/GPSDecoder.h"
    36 #include "RTCM3/ephemeris.h"
    3731
    3832class bncModel;
     
    9993};
    10094
    101 class t_corr {
    102  public:
    103   t_corr() {
    104     raoSet  = false;
    105     dClkSet = false;
    106   }
    107   bool ready() {return raoSet && dClkSet;}
    108   bncTime       tt;
    109   int          iod;
    110   double       dClk;
    111   double       dotDClk;
    112   double       dotDotDClk;
    113   ColumnVector rao;
    114   ColumnVector dotRao;
    115   ColumnVector dotDotRao;
    116   bool         raoSet;
    117   bool         dClkSet;
    118 };
    119 
    12095class t_bias {
    12196 public:
     
    131106};
    132107
    133 class bncPPPclient : public QObject {
     108class bncPPPclient : public bncEphUser {
    134109 Q_OBJECT
    135110
     
    140115
    141116 public slots:
    142   void slotNewEphGPS(gpsephemeris gpseph);
    143   void slotNewEphGlonass(glonassephemeris gloeph);
    144   void slotNewEphGalileo(galileoephemeris galeph);
    145117  void slotNewCorrections(QList<QString> corrList);
    146118
     
    164136  };
    165137
    166   class t_ephPair {
    167    public:
    168     t_ephPair() {
    169       last = 0;
    170       prev = 0;
    171     }
    172     ~t_ephPair() {
    173       delete last;
    174       delete prev;
    175     }
    176     t_eph* last;
    177     t_eph* prev;
    178   };
    179 
    180138  t_irc getSatPos(const bncTime& tt, const QString& prn,
    181139                  ColumnVector& xc, ColumnVector& vv);
     
    187145
    188146  QByteArray              _staID;
    189   QMutex                  _mutex;
    190   QMap<QString, t_ephPair*> _eph;
    191147  QMap<QString, t_corr*>  _corr;
    192148  bncTime                 _corr_tt;
Note: See TracChangeset for help on using the changeset viewer.