- Timestamp:
- Sep 12, 2006, 8:39:13 PM (18 years ago)
- Location:
- trunk/BNC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bnccaster.cpp
r142 r160 83 83 long newTime = obs->GPSWeek * 7*24*3600 + obs->GPSWeeks; 84 84 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 85 98 // First time, set the _lastDumpSec immediately 86 99 // -------------------------------------------- … … 98 111 } 99 112 100 // Rename the station and save the observation 101 // ------------------------------------------- 102 strncpy(obs->StatID, staID.constData(),sizeof(obs->StatID)); 113 // Save the observation 114 // -------------------- 103 115 _epochs->insert(newTime, obs); 104 116 … … 196 208 } 197 209 } 198 199 // Prepare RINEX Output200 // --------------------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);206 210 } 207 211 … … 210 214 first = false; 211 215 } 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 260 260 // Write One Epoch into the RINEX File 261 261 //////////////////////////////////////////////////////////////////////////// 262 void bncRinex::dumpEpoch() { 262 void 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 } 263 275 264 276 // Easy Return 265 277 // ----------- 266 if ( _obs.isEmpty()) {278 if (dumpList.isEmpty()) { 267 279 return; 268 280 } … … 270 282 // Time of Epoch 271 283 // ------------- 272 Observation* firstObs = * _obs.begin();284 Observation* firstObs = *dumpList.begin(); 273 285 274 286 QDateTime datTim = dateAndTimeFromGPSweek( firstObs->GPSWeek, … … 290 302 291 303 _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; 295 307 while (it.hasNext()) { 296 308 iSat++; … … 320 332 321 333 _out.flush(); 322 _obs.clear();323 334 } 324 335 -
trunk/BNC/bncrinex.h
r157 r160 17 17 ~bncRinex(); 18 18 void deepCopy(const Observation* obs); 19 void dumpEpoch( );19 void dumpEpoch(long maxTime); 20 20 21 21 private:
Note:
See TracChangeset
for help on using the changeset viewer.