Changeset 3429 in ntrip


Ignore:
Timestamp:
Sep 21, 2011, 4:49:05 PM (13 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/combination/bnccomb.cpp

    r3426 r3429  
    3636// Constructor
    3737////////////////////////////////////////////////////////////////////////////
    38 cmbParam::cmbParam(cmbParam::parType type_, int index_,
    39                    const QString& ac_, const QString& prn_,
    40                    double sig_0_, double sig_P_) {
     38cmbParam::cmbParam(parType type_, int index_,
     39                   const QString& ac_, const QString& prn_) {
    4140
    4241  type  = type_;
     
    4443  AC    = ac_;
    4544  prn   = prn_;
    46   sig_0 = sig_0_;
    47   sig_P = sig_P_;
    4845  xx    = 0.0;
     46
     47  if      (type == offAC) {
     48    sig_0 = 1000.0;
     49    sig_P = 1000.0;
     50  }
     51  else if (type == offACSat) {
     52    sig_0 = 100.0;
     53    sig_P =   0.0;
     54  }
     55  else if (type == clkSat) {
     56    sig_0 = 100.0;
     57    sig_P = 100.0;
     58  }
    4959}
    5060
     
    5666// Partial
    5767////////////////////////////////////////////////////////////////////////////
    58 double cmbParam::partial(const QString& AC_, t_corr* corr) {
     68double cmbParam::partial(const QString& AC_, const QString& prn_) {
    5969 
    60   if      (type == AC_offset) {
     70  if      (type == offAC) {
    6171    if (AC == AC_) {
    6272      return 1.0;
    6373    }
    6474  }
    65   else if (type == Sat_offset) {
    66     if (AC == AC_ && prn == corr->prn) {
     75  else if (type == offACSat) {
     76    if (AC == AC_ && prn == prn_) {
    6777      return 1.0;
    6878    }
    6979  }
    70   else if (type == clk) {
    71     if (prn == corr->prn) {
     80  else if (type == clkSat) {
     81    if (prn == prn_) {
    7282      return 1.0;
    7383    }
     
    8393  QString outStr;
    8494 
    85   if      (type == AC_offset) {
     95  if      (type == offAC) {
    8696    outStr = "AC offset " + AC;
    8797  }
    88   else if (type == Sat_offset) {
     98  else if (type == offACSat) {
    8999    outStr = "Sat Offset " + AC + " " + prn;
    90100  }
    91   else if (type == clk) {
     101  else if (type == clkSat) {
    92102    outStr = "Clk Corr " + prn;
    93103  }
     
    112122      newAC->name       = hlp[1];
    113123      newAC->weight     = hlp[2].toDouble();
    114       if (_masterAC.isEmpty()) {
    115         _masterAC = newAC->name;
    116       }
    117       _ACs[newAC->mountPoint] = newAC;
     124      _ACs.append(newAC);
    118125    }
    119126  }
     
    124131          ((bncApp*)qApp), SLOT(slotMessage(const QByteArray,bool)));
    125132
    126 
    127   // A Priori Sigmas (in Meters)
    128   // ---------------------------
    129   double sigAC_0  = 1000.0;
    130   double sigAC_P  = 1000.0;
    131   double sigSat_0 = 100.0;
    132   double sigSat_P =   0.0;
    133   double sigClk_0 = 100.0;
    134   double sigClk_P = 100.0;
    135133
    136134  // Initialize Parameters (model: Clk_Corr = AC_Offset + Sat_Offset + Clk)
    137135  // ----------------------------------------------------------------------
    138136  int nextPar = 0;
    139   QMapIterator<QString, cmbAC*> it(_ACs);
     137  QListIterator<cmbAC*> it(_ACs);
    140138  while (it.hasNext()) {
    141     it.next();
    142     cmbAC* AC = it.value();
    143     _params.push_back(new cmbParam(cmbParam::AC_offset, ++nextPar,
    144                                    AC->name, "", sigAC_0, sigAC_P));
     139    cmbAC* AC = it.next();
     140    _params.push_back(new cmbParam(cmbParam::offAC, ++nextPar, AC->name, ""));
    145141    for (int iGps = 1; iGps <= MAXPRN_GPS; iGps++) {
    146142      QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
    147       _params.push_back(new cmbParam(cmbParam::Sat_offset, ++nextPar,
    148                                      AC->name, prn, sigSat_0, sigSat_P));
     143      _params.push_back(new cmbParam(cmbParam::offACSat, ++nextPar,
     144                                     AC->name, prn));
    149145    }
    150146  }
    151147  for (int iGps = 1; iGps <= MAXPRN_GPS; iGps++) {
    152148    QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
    153     _params.push_back(new cmbParam(cmbParam::clk, ++nextPar, "", prn,
    154                                    sigClk_0, sigClk_P));
     149    _params.push_back(new cmbParam(cmbParam::clkSat, ++nextPar, "", prn));
    155150  }
    156151
     
    192187////////////////////////////////////////////////////////////////////////////
    193188bncComb::~bncComb() {
    194   QMapIterator<QString, cmbAC*> it(_ACs);
    195   while (it.hasNext()) {
    196     it.next();
    197     delete it.value();
     189  QListIterator<cmbAC*> icAC(_ACs);
     190  while (icAC.hasNext()) {
     191    delete icAC.next();
    198192  }
    199193  delete _rtnetDecoder;
     
    202196    delete _params[iPar-1];
    203197  }
     198  QListIterator<cmbCorr*> itCorr(_corrs);
     199  while (itCorr.hasNext()) {
     200    delete itCorr.next();
     201  }
    204202}
    205203
     
    209207  QMutexLocker locker(&_mutex);
    210208
    211   // Find the relevant instance of cmbAC class
    212   // -----------------------------------------
    213   if (_ACs.find(staID) == _ACs.end()) {
    214     return;
    215   }
    216   cmbAC* AC = _ACs[staID];
    217 
    218209  // Read the Correction
    219210  // -------------------
    220   t_corr* newCorr = new t_corr();
     211  cmbCorr* newCorr = new cmbCorr();
     212  newCorr->acName = staID;
    221213  if (!newCorr->readLine(line) == success) {
    222214    delete newCorr;
     
    232224  }
    233225
    234   // Remember last correction time
    235   // -----------------------------
    236   if (!_lastCorrTime.valid() || _lastCorrTime < newCorr->tt) {
    237     _lastCorrTime = newCorr->tt;
    238   }
    239 
    240   bncTime processTime = _lastCorrTime - 1.5 * moduloTime;
    241 
    242226  // Delete old corrections
    243227  // ----------------------
    244   if (newCorr->tt < processTime) {
     228  if (newCorr->tt < _resTime) {
    245229    delete newCorr;
    246230    return;
     
    261245    else if (prevEph && prevEph->IOD() == newCorr->iod) {
    262246      newCorr->eph = prevEph;
     247      switchToLastEph(lastEph, newCorr);
    263248    }
    264249    else {
     
    268253  }
    269254
    270   // Process all older Epochs (if there are any)
    271   // -------------------------------------------
    272   QList<cmbEpoch*> epochsToProcess;
    273   QMapIterator<QString, cmbAC*> itAC(_ACs);
    274   while (itAC.hasNext()) {
    275     itAC.next();
    276     cmbAC* AC = itAC.value();
    277     QMutableListIterator<cmbEpoch*> itEpo(AC->epochs);
    278     while (itEpo.hasNext()) {
    279       cmbEpoch* epoch = itEpo.next();
    280       if (epoch->time <= processTime) {
    281         epochsToProcess.append(epoch);
    282         itEpo.remove();
    283       }
    284     }
    285   }
    286 
    287   if (epochsToProcess.size()) {
    288     processEpochs(epochsToProcess);
    289   }
    290 
    291   // Find/Create the instance of cmbEpoch class
    292   // ------------------------------------------
    293   cmbEpoch* newEpoch = 0;
    294   QListIterator<cmbEpoch*> it(AC->epochs);
    295   while (it.hasNext()) {
    296     cmbEpoch* hlpEpoch = it.next();
    297     if (hlpEpoch->time == newCorr->tt) {
    298       newEpoch = hlpEpoch;
    299       break;
    300     }
    301   }
    302   if (newEpoch == 0) {
    303     newEpoch = new cmbEpoch(AC->name);
    304     newEpoch->time = newCorr->tt;
    305     AC->epochs.append(newEpoch);
    306   }
    307  
     255  // Process previous Epoch
     256  // ----------------------
     257  if (_resTime.valid() && _resTime < newCorr->tt) {
     258    processEpoch();
     259  }
     260
     261  // Remember last correction time
     262  // -----------------------------
     263  _resTime = newCorr->tt;
     264
    308265  // Merge or add the correction
    309266  // ---------------------------
    310   if (newEpoch->corr.find(newCorr->prn) != newEpoch->corr.end()) {
    311     newEpoch->corr[newCorr->prn]->readLine(line); // merge (multiple messages)
     267  cmbCorr* existingCorr = 0;
     268  QListIterator<cmbCorr*> itCorr(_corrs);
     269  while (itCorr.hasNext()) {
     270    cmbCorr* hlp = itCorr.next();
     271    if (hlp->prn == newCorr->prn && hlp->acName == newCorr->prn) {
     272      existingCorr = hlp;
     273      break;
     274    }
     275  }
     276  if (existingCorr) {
    312277    delete newCorr;
     278    existingCorr->readLine(line); // merge (multiple messages)
    313279  }
    314280  else {
    315     newEpoch->corr[newCorr->prn] = newCorr;
     281    _corrs.append(newCorr);
    316282  }
    317283}
     
    320286////////////////////////////////////////////////////////////////////////////
    321287void bncComb::switchToLastEph(const t_eph* lastEph, t_corr* corr) {
     288
     289  if (corr->eph == lastEph) {
     290    return;
     291  }
    322292
    323293  ColumnVector oldXC(4);
     
    354324}
    355325
    356 // Process Epochs
    357 ////////////////////////////////////////////////////////////////////////////
    358 void bncComb::processEpochs(const QList<cmbEpoch*>& epochs) {
     326// Process Epoch
     327////////////////////////////////////////////////////////////////////////////
     328void bncComb::processEpoch() {
     329
     330  int nPar = _params.size();
     331  int nObs = _corrs.size();
     332
     333  if (nObs == 0) {
     334    return;
     335  }
    359336
    360337  _log.clear();
     
    365342      << "------------------------------" << endl;
    366343
    367   // Check whether master AC present
    368   // -------------------------------
    369   if (epochs.first()->acName != _masterAC) {
    370     if (true) {  // version with master switch
    371       cmbEpoch* epo     = epochs.first();
    372       bncTime   epoTime = epo->time;
    373       out << "Switching Master AC "
    374           << epo->acName.toAscii().data() << " --> "
    375           << _masterAC.toAscii().data()   << " "
    376           << epoTime.datestr().c_str()    << " "
    377           << epoTime.timestr().c_str()    << endl;
    378       _masterAC = epo->acName;
    379     }
    380     else {       // original version
    381       QListIterator<cmbEpoch*> itEpo(epochs);
    382       while (itEpo.hasNext()) {
    383         cmbEpoch* epo = itEpo.next();
    384         bncTime   epoTime = epo->time;
    385         out << epo->acName.toAscii().data() << " "
    386             << epoTime.datestr().c_str()    << " "
    387             << epoTime.timestr().c_str() << endl;
    388         delete epo;
    389       }
    390       out << "Missing Master AC" << endl;
    391       emit newMessage(_log, false);
    392       return;
    393     }
    394   }
    395 
    396   // Predict Parameters Values, Add White Noise
    397   // ------------------------------------------
    398   for (int iPar = 1; iPar <= _params.size(); iPar++) {
    399     cmbParam* pp = _params[iPar-1];
    400     if (pp->sig_P != 0.0) {
    401       pp->xx = 0.0;
    402       for (int jj = 1; jj <= _params.size(); jj++) {
    403         _QQ(iPar, jj) = 0.0;
    404       }
    405       _QQ(iPar,iPar) = pp->sig_P * pp->sig_P;
    406     }
    407   }
    408 
    409   bncTime                resTime = epochs.first()->time;
    410   QMap<QString, t_corr*> resCorr;
    411 
    412   int nPar = _params.size();
    413   int nObs = 0; 
    414 
     344  // Prediction Step
     345  // ---------------
    415346  ColumnVector x0(nPar);
    416347  for (int iPar = 1; iPar <= _params.size(); iPar++) {
    417348    cmbParam* pp = _params[iPar-1];
     349    _QQ(iPar,iPar) += pp->sig_P * pp->sig_P;
    418350    x0(iPar) = pp->xx;
    419351  }
    420352
    421   // Count Observations
    422   // ------------------
    423   QListIterator<cmbEpoch*> itEpo(epochs);
    424   while (itEpo.hasNext()) {
    425     cmbEpoch* epo     = itEpo.next();
    426     bncTime   epoTime = epo->time;
    427     out << epo->acName.toAscii().data() << " "
    428         << epoTime.datestr().c_str()    << " "
    429         << epoTime.timestr().c_str() << endl;
    430 
    431     QMutableMapIterator<QString, t_corr*> itCorr(epo->corr);
    432     while (itCorr.hasNext()) {
    433       itCorr.next();
    434       t_corr* corr = itCorr.value();
    435 
    436       // Switch to last ephemeris
    437       // ------------------------
    438       t_eph* lastEph = _eph[corr->prn]->last;
    439       if (lastEph == corr->eph) {     
    440         ++nObs;
    441       }
    442       else {
    443         if (corr->eph == _eph[corr->prn]->prev) {
    444           switchToLastEph(lastEph, corr);
    445           ++nObs;
    446         }
    447         else {
    448           itCorr.remove();
     353  // Create First Design Matrix and Vector of Measurements
     354  // -----------------------------------------------------
     355  const double Pl = 1.0 / (0.05 * 0.05);
     356
     357  const int nCon = (_firstReg == false) ? 1 + MAXPRN_GPS : 1;
     358  Matrix         AA(nObs+nCon, nPar);  AA = 0.0;
     359  ColumnVector   ll(nObs+nCon);        ll = 0.0;
     360  DiagonalMatrix PP(nObs+nCon);        PP = Pl;
     361
     362  int iObs = 0;
     363
     364  QMap<QString, t_corr*> resCorr;
     365
     366  QListIterator<cmbCorr*> itCorr(_corrs);
     367  while (itCorr.hasNext()) {
     368    cmbCorr* corr = itCorr.next();
     369    QString  prn  = corr->prn;
     370    switchToLastEph(_eph[prn]->last, corr);
     371    ++iObs;
     372
     373    if (resCorr.find(prn) == resCorr.end()) {
     374      resCorr[prn] = new t_corr(*corr);
     375    }
     376
     377    for (int iPar = 1; iPar <= _params.size(); iPar++) {
     378      cmbParam* pp = _params[iPar-1];
     379      AA(iObs, iPar) = pp->partial(corr->acName, prn);
     380    }
     381
     382    ll(iObs) = corr->dClk * t_CST::c - DotProduct(AA.Row(iObs), x0);
     383  }
     384
     385  // Regularization
     386  // --------------
     387  const double Ph = 1.e6;
     388  int iCond = 1;
     389  PP(nObs+iCond)          = Ph;
     390  for (int iPar = 1; iPar <= _params.size(); iPar++) {
     391    cmbParam* pp = _params[iPar-1];
     392    if (pp->type == cmbParam::clkSat &&
     393        AA.Column(iPar).maximum_absolute_value() > 0.0) {
     394      AA(nObs+iCond, iPar) = 1.0;
     395    }
     396  }
     397
     398  if (!_firstReg) {
     399    _firstReg = true;
     400    for (int iGps = 1; iGps <= MAXPRN_GPS; iGps++) {
     401      ++iCond;
     402      QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
     403      PP(nObs+1+iGps)       = Ph;
     404      for (int iPar = 1; iPar <= _params.size(); iPar++) {
     405        cmbParam* pp = _params[iPar-1];
     406        if (pp->type == cmbParam::offACSat && pp->prn == prn) {
     407          AA(nObs+iCond, iPar) = 1.0;
    449408        }
    450409      }
     
    452411  }
    453412
    454   if (nObs > 0) {
    455     const double Pl = 1.0 / (0.05 * 0.05);
    456 
    457     const int nCon = (_firstReg == false) ? 1 + MAXPRN_GPS : 1;
    458     Matrix         AA(nObs+nCon, nPar);  AA = 0.0;
    459     ColumnVector   ll(nObs+nCon);        ll = 0.0;
    460     DiagonalMatrix PP(nObs+nCon);        PP = Pl;
    461 
    462     int iObs = 0;
    463     QListIterator<cmbEpoch*> itEpo(epochs);
    464     QVector<t_llInfo> llInfo(ll.Nrows());
    465     while (itEpo.hasNext()) {
    466       cmbEpoch* epo = itEpo.next();
    467       QMapIterator<QString, t_corr*> itCorr(epo->corr);
    468    
    469       while (itCorr.hasNext()) {
    470         itCorr.next();
    471         ++iObs;
    472         t_corr* corr = itCorr.value();
    473 
    474         if (epo->acName == _masterAC) {
    475           resCorr[corr->prn] = new t_corr(*corr);
    476         }
    477 
    478         for (int iPar = 1; iPar <= _params.size(); iPar++) {
    479           cmbParam* pp = _params[iPar-1];
    480           AA(iObs, iPar) = pp->partial(epo->acName, corr);
    481         }
    482 
    483         ll(iObs) = corr->dClk * t_CST::c - DotProduct(AA.Row(iObs), x0);
    484         llInfo[iObs-1].AC  = epo->acName;
    485         llInfo[iObs-1].prn = corr->prn;
     413  ColumnVector dx;
     414  SymmetricMatrix QQ_sav = _QQ;
     415
     416  for (int ii = 1; ii < 10; ii++) {
     417    bncModel::kalman(AA, ll, PP, _QQ, dx);
     418    ColumnVector vv = ll - AA * dx;
     419
     420    int     maxResIndex;
     421    double  maxRes = vv.maximum_absolute_value1(maxResIndex);   
     422    out.setRealNumberNotation(QTextStream::FixedNotation);
     423    out.setRealNumberPrecision(3); 
     424    out << _resTime.datestr().c_str() << " " << _resTime.timestr().c_str()
     425        << " Maximum Residuum " << maxRes << ' ' << endl;
     426//        << llInfo[maxResIndex-1].AC << ' ' << llInfo[maxResIndex-1].prn;
     427//
     428//    if (maxRes > _MAXRES) {
     429//      for (int iPar = 1; iPar <= _params.size(); iPar++) {
     430//        cmbParam* pp = _params[iPar-1];
     431//        if (pp->type == cmbParam::offACSat     &&
     432//            pp->AC   == llInfo[maxResIndex-1].AC &&
     433//            pp->prn  == llInfo[maxResIndex-1].prn) {
     434//          QQ_sav.Row(iPar)    = 0.0;
     435//          QQ_sav.Column(iPar) = 0.0;
     436//          QQ_sav(iPar,iPar)   = pp->sig_0 * pp->sig_0;
     437//        }
     438//      }
     439//
     440//      out << "  Outlier" << endl;
     441//      _QQ = QQ_sav;
     442//      AA.Row(maxResIndex) = 0.0;
     443//      ll.Row(maxResIndex) = 0.0;
     444//    }
     445//    else {
     446//      out << "  OK" << endl;
     447//      break;
     448//    }
     449  }
     450
     451  for (int iPar = 1; iPar <= _params.size(); iPar++) {
     452    cmbParam* pp = _params[iPar-1];
     453    pp->xx += dx(iPar);
     454    if (pp->type == cmbParam::clkSat) {
     455      if (resCorr.find(pp->prn) != resCorr.end()) {
     456        resCorr[pp->prn]->dClk = pp->xx / t_CST::c;
    486457      }
    487458    }
    488 
    489     // Regularization
    490     // --------------
    491     const double Ph = 1.e6;
    492     int iCond = 1;
    493     PP(nObs+iCond)          = Ph;
    494     llInfo[nObs+iCond-1].AC = "regularization";
    495     for (int iPar = 1; iPar <= _params.size(); iPar++) {
    496       cmbParam* pp = _params[iPar-1];
    497       if (pp->type == cmbParam::clk &&
    498           AA.Column(iPar).maximum_absolute_value() > 0.0) {
    499         AA(nObs+iCond, iPar) = 1.0;
    500       }
    501     }
    502 
    503     if (!_firstReg) {
    504       _firstReg = true;
    505       for (int iGps = 1; iGps <= MAXPRN_GPS; iGps++) {
    506         ++iCond;
    507         QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
    508         PP(nObs+1+iGps)       = Ph;
    509         llInfo[nObs+iGps].AC  = "regularization";
    510         llInfo[nObs+iGps].prn = prn;
    511         for (int iPar = 1; iPar <= _params.size(); iPar++) {
    512           cmbParam* pp = _params[iPar-1];
    513           if (pp->type == cmbParam::Sat_offset && pp->prn == prn) {
    514             AA(nObs+iCond, iPar) = 1.0;
    515           }
    516         }
    517       }
    518     }
    519 
    520     ColumnVector dx;
    521     SymmetricMatrix QQ_sav = _QQ;
    522 
    523     for (int ii = 1; ii < 10; ii++) {
    524       bncModel::kalman(AA, ll, PP, _QQ, dx);
    525       ColumnVector vv = ll - AA * dx;
    526 
    527       int     maxResIndex;
    528       double  maxRes = vv.maximum_absolute_value1(maxResIndex);   
    529       out.setRealNumberNotation(QTextStream::FixedNotation);
    530       out.setRealNumberPrecision(3); 
    531       out << resTime.datestr().c_str() << " " << resTime.timestr().c_str()
    532           << " Maximum Residuum " << maxRes << ' '
    533           << llInfo[maxResIndex-1].AC << ' ' << llInfo[maxResIndex-1].prn;
    534 
    535       if (maxRes > _MAXRES) {
    536         for (int iPar = 1; iPar <= _params.size(); iPar++) {
    537           cmbParam* pp = _params[iPar-1];
    538           if (pp->type == cmbParam::Sat_offset     &&
    539               pp->AC   == llInfo[maxResIndex-1].AC &&
    540               pp->prn  == llInfo[maxResIndex-1].prn) {
    541             QQ_sav.Row(iPar)    = 0.0;
    542             QQ_sav.Column(iPar) = 0.0;
    543             QQ_sav(iPar,iPar)   = pp->sig_0 * pp->sig_0;
    544           }
    545         }
    546 
    547         out << "  Outlier" << endl;
    548         _QQ = QQ_sav;
    549         AA.Row(maxResIndex) = 0.0;
    550         ll.Row(maxResIndex) = 0.0;
    551       }
    552       else {
    553         out << "  OK" << endl;
    554         break;
    555       }
    556     }
    557 
    558     for (int iPar = 1; iPar <= _params.size(); iPar++) {
    559       cmbParam* pp = _params[iPar-1];
    560       pp->xx += dx(iPar);
    561       if (pp->type == cmbParam::clk) {
    562         if (resCorr.find(pp->prn) != resCorr.end()) {
    563           resCorr[pp->prn]->dClk = pp->xx / t_CST::c;
    564         }
    565       }
    566       out << resTime.datestr().c_str() << " "
    567           << resTime.timestr().c_str() << " ";
    568       out.setRealNumberNotation(QTextStream::FixedNotation);
    569       out.setFieldWidth(8);
    570       out.setRealNumberPrecision(4);
    571       out << pp->toString() << " "
    572           << pp->xx << " +- " << sqrt(_QQ(pp->index,pp->index)) << endl;
    573       out.setFieldWidth(0);
    574     }
    575   }
    576 
    577   printResults(out, resTime, resCorr);
    578   dumpResults(resTime, resCorr);
     459    out << _resTime.datestr().c_str() << " "
     460        << _resTime.timestr().c_str() << " ";
     461    out.setRealNumberNotation(QTextStream::FixedNotation);
     462    out.setFieldWidth(8);
     463    out.setRealNumberPrecision(4);
     464    out << pp->toString() << " "
     465        << pp->xx << " +- " << sqrt(_QQ(pp->index,pp->index)) << endl;
     466    out.setFieldWidth(0);
     467  }
     468
     469  printResults(out, resCorr);
     470  dumpResults(resCorr);
    579471
    580472  emit newMessage(_log, false);
    581473
    582   QListIterator<cmbEpoch*> itEpo2(epochs);
    583   while (itEpo2.hasNext()) {
    584     cmbEpoch* epo = itEpo2.next();
    585     delete epo;
    586   }
     474  QListIterator<cmbCorr*> it(_corrs);
     475  while (it.hasNext()) {
     476    delete it.next();
     477  }
     478  _corrs.clear();
    587479}
    588480
    589481// Print results
    590482////////////////////////////////////////////////////////////////////////////
    591 void bncComb::printResults(QTextStream& out, const bncTime& resTime,
     483void bncComb::printResults(QTextStream& out,
    592484                           const QMap<QString, t_corr*>& resCorr) {
    593485
     
    599491    if (eph) {
    600492      double xx, yy, zz, cc;
    601       eph->position(resTime.gpsw(), resTime.gpssec(), xx, yy, zz, cc);
    602 
    603       out << resTime.datestr().c_str() << " "
    604           << resTime.timestr().c_str() << " ";
     493      eph->position(_resTime.gpsw(), _resTime.gpssec(), xx, yy, zz, cc);
     494
     495      out << _resTime.datestr().c_str() << " "
     496          << _resTime.timestr().c_str() << " ";
    605497      out.setFieldWidth(3);
    606498      out << "Full Clock " << corr->prn << " " << corr->iod << " ";
     
    617509// Send results to RTNet Decoder and directly to PPP Client
    618510////////////////////////////////////////////////////////////////////////////
    619 void bncComb::dumpResults(const bncTime& resTime,
    620                           const QMap<QString, t_corr*>& resCorr) {
     511void bncComb::dumpResults(const QMap<QString, t_corr*>& resCorr) {
    621512
    622513  ostringstream out; out.setf(std::ios::fixed);
     
    625516  unsigned year, month, day, hour, minute;
    626517  double   sec;
    627   resTime.civil_date(year, month, day);
    628   resTime.civil_time(hour, minute, sec);
     518  _resTime.civil_date(year, month, day);
     519  _resTime.civil_time(hour, minute, sec);
    629520
    630521  out << "*  "
     
    646537    for (int iTime = 1; iTime <= 2; iTime++) {
    647538
    648       bncTime time12 = (iTime == 1) ? resTime : resTime + dT;
     539      bncTime time12 = (iTime == 1) ? _resTime : _resTime + dT;
    649540
    650541      ColumnVector xc(4);
Note: See TracChangeset for help on using the changeset viewer.