Changeset 160 in ntrip for trunk


Ignore:
Timestamp:
Sep 12, 2006, 8:39:13 PM (18 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bnccaster.cpp

    r142 r160  
    8383  long newTime = obs->GPSWeek * 7*24*3600 + obs->GPSWeeks;
    8484
     85  // Rename the Station
     86  // ------------------
     87  strncpy(obs->StatID, staID.constData(),sizeof(obs->StatID));
     88       
     89  // Prepare RINEX Output
     90  // --------------------
     91  if (_rinexWriters.find(obs->StatID) == _rinexWriters.end()) {
     92    _rinexWriters.insert(obs->StatID, new bncRinex(obs->StatID));
     93  }
     94  bncRinex* rnx = _rinexWriters.find(obs->StatID).value();
     95  rnx->deepCopy(obs);
     96  rnx->dumpEpoch(newTime);
     97
    8598  // First time, set the _lastDumpSec immediately
    8699  // --------------------------------------------
     
    98111  }
    99112
    100   // Rename the station and save the observation
    101   // -------------------------------------------
    102   strncpy(obs->StatID, staID.constData(),sizeof(obs->StatID));
     113  // Save the observation
     114  // --------------------
    103115  _epochs->insert(newTime, obs);
    104116
     
    196208          }
    197209        }
    198        
    199         // Prepare RINEX Output
    200         // --------------------
    201         if (_rinexWriters.find(obs->StatID) == _rinexWriters.end()) {
    202           _rinexWriters.insert(obs->StatID, new bncRinex(obs->StatID));
    203         }
    204         bncRinex* rnx = _rinexWriters.find(obs->StatID).value();
    205         rnx->deepCopy(obs);
    206210      }
    207211
     
    210214      first = false;
    211215    }
    212 
    213     // Write RINEX Files
    214     // -----------------
    215     QMapIterator<QString, bncRinex*> ir(_rinexWriters);
    216     while (ir.hasNext()) {
    217       bncRinex* rnx = ir.next().value();
    218       rnx->dumpEpoch();
    219     }
    220   }
    221 }
     216  }
     217}
  • trunk/BNC/bncrinex.cpp

    r159 r160  
    260260// Write One Epoch into the RINEX File
    261261////////////////////////////////////////////////////////////////////////////
    262 void bncRinex::dumpEpoch() {
     262void bncRinex::dumpEpoch(long maxTime) {
     263
     264  // Select observations older than maxTime
     265  // --------------------------------------
     266  QList<Observation*> dumpList;
     267  QMutableListIterator<Observation*> mIt(_obs);
     268  while (mIt.hasNext()) {
     269    Observation* ob = mIt.next();
     270    if (ob->GPSWeek * 7*24*3600 + ob->GPSWeeks < maxTime) {
     271      dumpList.push_back(ob);
     272      mIt.remove();
     273    }
     274  }
    263275
    264276  // Easy Return
    265277  // -----------
    266   if (_obs.isEmpty()) {
     278  if (dumpList.isEmpty()) {
    267279    return;
    268280  }
     
    270282  // Time of Epoch
    271283  // -------------
    272   Observation* firstObs = *_obs.begin();
     284  Observation* firstObs = *dumpList.begin();
    273285
    274286  QDateTime datTim = dateAndTimeFromGPSweek( firstObs->GPSWeek,
     
    290302
    291303  _out << datTim.toString(" yy MM dd hh mm ss.zzz0000").toAscii().data()
    292        << "  " << 0 << setw(3)  << _obs.size();
    293 
    294   QListIterator<Observation*> it(_obs); int iSat = 0;
     304       << "  " << 0 << setw(3)  << dumpList.size();
     305
     306  QListIterator<Observation*> it(dumpList); int iSat = 0;
    295307  while (it.hasNext()) {
    296308    iSat++;
     
    320332
    321333  _out.flush();
    322   _obs.clear();
    323334}
    324335
  • trunk/BNC/bncrinex.h

    r157 r160  
    1717   ~bncRinex();
    1818   void deepCopy(const Observation* obs);
    19    void dumpEpoch();
     19   void dumpEpoch(long maxTime);
    2020
    2121 private:
Note: See TracChangeset for help on using the changeset viewer.