Changeset 2808 in ntrip


Ignore:
Timestamp:
Dec 18, 2010, 11:45:49 AM (13 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncpppclient.cpp

    r2787 r2808  
    9999
    100100  _staID   = staID;
    101   _epoData = 0;
    102101  _model   = new bncModel(staID);
    103102  connect(_model, SIGNAL(newNMEAstr(QByteArray)),
     
    109108bncPPPclient::~bncPPPclient() {
    110109  delete _model;
    111   delete _epoData;
     110  while (!_epoData.empty()) {
     111    delete _epoData.front();
     112    _epoData.pop();
     113  }
    112114  QMapIterator<QString, t_ephPair*> it(_eph);
    113115  while (it.hasNext()) {
     
    143145
    144146  t_satData* satData = new t_satData();
     147  satData->tt = bncTime(obs.GPSWeek, obs.GPSWeeks);
    145148
    146149  // Satellite Number
     
    169172  }
    170173
    171   // Add new Satellite to the epoch
    172   // ------------------------------
    173   bncTime tt(obs.GPSWeek, obs.GPSWeeks);
    174  
    175   if      (!_epoData) {
    176     _epoData = new t_epoData();
    177     _epoData->tt = tt;
    178   }
    179   else if (tt != _epoData->tt) {
    180     processEpoch();
    181     delete _epoData;
    182     _epoData = new t_epoData();
    183     _epoData->tt = tt;
     174  // Add new epoch, process the older ones
     175  // -------------------------------------
     176  if      (_epoData.size() == 0) {
     177    _epoData.push(new t_epoData());
     178    _epoData.back()->tt = satData->tt;
     179  }
     180  else if (satData->tt != _epoData.back()->tt) {
     181    processEpochs();
     182    _epoData.push(new t_epoData());
     183    _epoData.back()->tt = satData->tt;
    184184  }
    185185
     
    210210      satData->lambda3 = c1 * t_CST::c / f1 + c2 * t_CST::c / f2;
    211211
    212       _epoData->satDataGPS[satData->prn] = satData;
     212      _epoData.back()->satDataGPS[satData->prn] = satData;
    213213    }
    214214    else {
     
    243243      satData->lambda3 = c1 * t_CST::c / f1 + c2 * t_CST::c / f2;
    244244
    245       _epoData->satDataGlo[satData->prn] = satData;
     245      _epoData.back()->satDataGlo[satData->prn] = satData;
    246246    }
    247247    else {
     
    266266      satData->L3      = c1 * satData->L1 + c5 * satData->L5;
    267267      satData->lambda3 = c1 * t_CST::c / f1 + c5 * t_CST::c / f5;
    268       _epoData->satDataGal[satData->prn] = satData;
     268      _epoData.back()->satDataGal[satData->prn] = satData;
    269269    }
    270270    else {
     
    552552  for (int ii = 1; ii <= 10; ii++) {
    553553
    554     bncTime ToT = _epoData->tt - prange / t_CST::c - clkSat;
     554    bncTime ToT = satData->tt - prange / t_CST::c - clkSat;
    555555
    556556    ColumnVector xc(4);
     
    576576//
    577577////////////////////////////////////////////////////////////////////////////
    578 void bncPPPclient::processEpoch() {
     578void bncPPPclient::processFrontEpoch() {
    579579
    580580  // Data Pre-Processing
    581581  // -------------------
    582   QMutableMapIterator<QString, t_satData*> iGPS(_epoData->satDataGPS);
     582  QMutableMapIterator<QString, t_satData*> iGPS(_epoData.front()->satDataGPS);
    583583  while (iGPS.hasNext()) {
    584584    iGPS.next();
     
    593593  }
    594594
    595   QMutableMapIterator<QString, t_satData*> iGlo(_epoData->satDataGlo);
     595  QMutableMapIterator<QString, t_satData*> iGlo(_epoData.front()->satDataGlo);
    596596  while (iGlo.hasNext()) {
    597597    iGlo.next();
     
    606606  }
    607607
    608   QMutableMapIterator<QString, t_satData*> iGal(_epoData->satDataGal);
     608  QMutableMapIterator<QString, t_satData*> iGal(_epoData.front()->satDataGal);
    609609  while (iGal.hasNext()) {
    610610    iGal.next();
     
    621621  // Filter Solution
    622622  // ---------------
    623   if (_model->update(_epoData) == success) {
     623  if (_model->update(_epoData.front()) == success) {
    624624    emit newPosition(_model->time(), _model->x(), _model->y(), _model->z());
    625625  }
    626626}
     627
     628//
     629////////////////////////////////////////////////////////////////////////////
     630void bncPPPclient::processEpochs() {
     631  processFrontEpoch();
     632  delete _epoData.front();
     633  _epoData.pop();
     634}
  • trunk/BNC/bncpppclient.h

    r2791 r2808  
    2626#define BNCPPPCLIENT_H
    2727
     28#include <queue>
    2829#include <QtNetwork>
    2930
     
    4445  }
    4546  ~t_satData() {}
     47  bncTime      tt;
    4648  QString      prn;
    4749  double       P1;
     
    178180  t_irc getSatPos(const bncTime& tt, const QString& prn,
    179181                  ColumnVector& xc, ColumnVector& vv);
    180   void processEpoch();
     182  void processEpochs();
     183  void processFrontEpoch();
    181184  void applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc,
    182185                 ColumnVector& vv);
     
    188191  QMap<QString, t_corr*>  _corr;
    189192  QMap<QString, t_bias*>  _bias;
    190   t_epoData*              _epoData;
     193  std::queue<t_epoData*>  _epoData;
    191194  bncModel*               _model;
    192195  bool                    _useGlonass;
Note: See TracChangeset for help on using the changeset viewer.