Changeset 4773 in ntrip for trunk/BNC/src
- Timestamp:
- Oct 26, 2012, 3:28:30 PM (12 years ago)
- Location:
- trunk/BNC/src/RTRover
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/RTRover/bncrtrover.cpp
r4771 r4773 238 238 } 239 239 240 // Auxiliary function - copy observation data 241 //////////////////////////////////////////////////////////////////////////// 242 void copyObs(const t_obs& obsBnc, rtrover_satObs& satObs) { 243 244 } 245 240 246 // 241 247 //////////////////////////////////////////////////////////////////////////// … … 248 254 249 255 bncTime obsTime(obsIn.GPSWeek, obsIn.GPSWeeks); 250 int numSatRover = 1; 256 257 // Find corresponding epoch or create a new one 258 // -------------------------------------------- 259 t_epoData* epoData = 0; 260 for (unsigned ii = 0; ii < _epochs.size(); ii++) { 261 if (_epochs[ii]->_time == obsTime) { 262 epoData = _epochs[ii]; 263 break; 264 } 265 } 266 if (epoData == 0) { 267 if (_epochs.size() == 0 || _epochs.back()->_time < obsTime) { 268 epoData = new t_epoData(); 269 epoData->_time = obsTime; 270 _epochs.push_back(epoData); 271 } 272 else { 273 return; 274 } 275 } 276 277 // Store observation into epoch class 278 // ---------------------------------- 279 if (staID == _roverMount) { 280 epoData->_obsRover.push_back(obsIn); 281 } 282 else if (staID == _baseMount) { 283 epoData->_obsBase.push_back(obsIn); 284 } 285 286 // Wait for observations 287 // --------------------- 288 const double WAITTIME = 5.0; 289 double dt = 0.0; 290 if (_epochs.size() > 1) { 291 dt = _epochs.back()->_time - _epochs.front()->_time; 292 } 293 if (dt < WAITTIME) { 294 return; 295 } 296 297 // Copy observations into rtrover_satObs structures 298 // ------------------------------------------------ 299 t_epoData* frontEpoData = _epochs.front(); 300 _epochs.erase(_epochs.begin()); 301 302 int numSatRover = frontEpoData->_obsRover.size(); 251 303 rtrover_satObs satObsRover[numSatRover]; 252 304 for (int ii = 0; ii < numSatRover; ii++) { 253 254 } 255 305 const t_obs& obsBnc = frontEpoData->_obsRover[ii]; 306 rtrover_satObs& satObs = satObsRover[ii]; 307 copyObs(obsBnc, satObs); 308 } 309 310 int numSatBase = frontEpoData->_obsBase.size(); 311 rtrover_satObs satObsBase[numSatBase]; 312 for (int ii = 0; ii < numSatBase; ii++) { 313 const t_obs& obsBnc = frontEpoData->_obsBase[ii]; 314 rtrover_satObs& satObs = satObsBase[ii]; 315 copyObs(obsBnc, satObs); 316 } 317 318 delete frontEpoData; 319 320 // Process single epoch 321 // -------------------- 256 322 rtrover_output output; 257 323 rtrover_processEpoch(numSatRover, satObsRover, 0, 0, &output); 258 324 325 // Write and free output 326 // --------------------- 259 327 _outputFile.write(output._log); 260 328 _outputFile.flush(); -
trunk/BNC/src/RTRover/bncrtrover.h
r4768 r4773 3 3 4 4 #include <vector> 5 #include <queue>6 5 7 6 #include "RTCM/GPSDecoder.h" … … 30 29 std::vector<t_obs> _obsBase; 31 30 }; 32 QMutex _mutex;33 QByteArray _mode;34 QFile _outputFile;35 QByteArray _roverMount;36 QByteArray _baseMount;37 QByteArray _corrMount;38 std:: queue<t_epoData> _epochs;31 QMutex _mutex; 32 QByteArray _mode; 33 QFile _outputFile; 34 QByteArray _roverMount; 35 QByteArray _baseMount; 36 QByteArray _corrMount; 37 std::vector<t_epoData*> _epochs; 39 38 }; 40 39
Note:
See TracChangeset
for help on using the changeset viewer.