Changeset 2924 in ntrip


Ignore:
Timestamp:
Jan 29, 2011, 12:01:16 PM (13 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/combination
Files:
2 edited

Legend:

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

    r2921 r2924  
    7575  }
    7676
     77  // Reject delayed corrections
     78  // --------------------------
     79  if (_processedBeforeTime.valid() && newCorr->tt < _processedBeforeTime) {
     80    delete newCorr;
     81    return;
     82  }
     83
     84  // Process all older Epochs (if there are any)
     85  // -------------------------------------------
     86  const double waitTime = 5.0; // wait 5 sec
     87  _processedBeforeTime = newCorr->tt - waitTime;
     88  processEpochs();
     89
    7790  // Check Modulo Time
    7891  // -----------------
     
    99112    AC->epochs.append(newEpoch);
    100113  }
    101 
     114 
     115  // Merge or add the correction
     116  // ---------------------------
    102117  if (newEpoch->corr.find(newCorr->prn) != newEpoch->corr.end()) {
    103118    newEpoch->corr[newCorr->prn]->readLine(line); // merge (multiple messages)
     
    106121    newEpoch->corr[newCorr->prn] = newCorr;
    107122  }
    108 
    109   processEpochsBefore(newCorr->tt);
    110123}
    111124
    112125//
    113126////////////////////////////////////////////////////////////////////////////
    114 void bncComb::processEpochsBefore(const bncTime& time) {
    115 
    116   const double waitTime = 10.0; // wait 10 seconds
     127void bncComb::processEpochs() {
    117128
    118129  bool corrProcessed = false;
     
    123134    cmbAC* AC = itAC.value();
    124135
    125 
    126136    QMutableListIterator<cmbEpoch*> itEpo(AC->epochs);
    127137    while (itEpo.hasNext()) {
    128138      cmbEpoch* epoch = itEpo.next();
    129       double dt = time - epoch->time;
    130 
    131       if      (dt == waitTime) {
     139      if (epoch->time < _processedBeforeTime) {
    132140        QMapIterator<QString, t_corr*> itCorr(epoch->corr);
    133141        while (itCorr.hasNext()) {
     
    136144          processSingleCorr(AC, corr);
    137145          corrProcessed = true;
    138         }
    139       }
    140 
    141       if (dt >= waitTime) {
    142         if (dt > waitTime) {
    143           cout << "delete " << AC->name.toAscii().data() << " "
    144                << epoch->time.timestr() << " " << endl;
    145146        }
    146147        delete epoch;
  • trunk/BNC/combination/bnccomb.h

    r2919 r2924  
    4848  };
    4949
    50   void processEpochsBefore(const bncTime& time);
     50  void processEpochs();
    5151  void processSingleCorr(const cmbAC* AC, const t_corr* corr);
    5252  void printResults() const;
    5353
    5454  QMap<QString, cmbAC*> _ACs;   // Analytical Centers (key is mountpoint)
     55  bncTime               _processedBeforeTime;
    5556};
    5657
Note: See TracChangeset for help on using the changeset viewer.