Changeset 9868 in ntrip for trunk/BNC/src/upload
- Timestamp:
- Nov 2, 2022, 12:32:22 PM (2 years ago)
- Location:
- trunk/BNC/src/upload
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/upload/bncrtnetuploadcaster.cpp
r9861 r9868 270 270 // Select buffer part that contains last epoch 271 271 // ------------------------------------------- 272 QStringList lines; 273 int iEpoBeg = _rtnetStreamBuffer.lastIndexOf('*'); // begin of last epoch 272 273 // Find the begin of last epoch 274 int iEpoBeg = _rtnetStreamBuffer.lastIndexOf('*'); 274 275 if (iEpoBeg == -1) { 275 276 _rtnetStreamBuffer.clear(); … … 277 278 return; 278 279 } 279 _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoBeg); 280 281 int iEpoEnd = _rtnetStreamBuffer.lastIndexOf("EOE"); // end of last epoch 280 281 // Find the begin of the first epoch 282 int iEpoBegEarlier = _rtnetStreamBuffer.indexOf('*'); 283 if (iEpoBegEarlier != -1 && iEpoBegEarlier < iEpoBeg) { 284 _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoBegEarlier); 285 } 286 else { 287 _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoBeg); 288 } 289 290 // Find End of the last epoch 291 int iEpoEnd = _rtnetStreamBuffer.lastIndexOf("EOE"); 282 292 if (iEpoEnd == -1) { 293 _rtnetStreamBuffer.clear(); 283 294 emit(newMessage("bncRtnetUploadCaster: no EOE found " + _casterID.toLatin1(), false)); 284 295 return; 285 296 } 286 else { 287 lines = _rtnetStreamBuffer.left(iEpoEnd).split('\n', QString::SkipEmptyParts); 288 _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoEnd+3); 289 } 297 298 // If there is there more than 1 epoch line in the buffer 299 while (_rtnetStreamBuffer.count('*') > 1) { 300 emit(newMessage("bncRtnetUploadCaster: more than 1 epoch in buffer: " + _rtnetStreamBuffer.count('*') , false)); 301 QString rtnetStreamBuffer = _rtnetStreamBuffer.mid(1); 302 int nextEpoch = rtnetStreamBuffer.indexOf('*'); 303 cout << "=============" << endl; 304 cout << "nextEpoch: " << nextEpoch << endl; 305 cout << "iEpoEnd : " << iEpoEnd << endl; 306 if (nextEpoch != -1 && nextEpoch < iEpoEnd) { 307 _rtnetStreamBuffer = _rtnetStreamBuffer.mid(nextEpoch); 308 cout << _rtnetStreamBuffer.toStdString().c_str() << endl; 309 } 310 else if (nextEpoch != -1 && nextEpoch >= iEpoEnd) { 311 break; 312 } 313 else { 314 cout << _rtnetStreamBuffer.toStdString().c_str() << endl; 315 } 316 } 317 318 QStringList lines = _rtnetStreamBuffer.left(iEpoEnd).split('\n', QString::SkipEmptyParts); 319 320 _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoEnd + 3); 290 321 291 322 if (lines.size() < 2) { 292 emit(newMessage("bncRtnetUploadCaster: less than 2 lines to decode " + _casterID.toLatin1(), false)); 323 emit(newMessage( 324 "bncRtnetUploadCaster: less than 2 lines to decode " + _casterID.toLatin1(), false)); 293 325 return; 294 326 } 295 327 296 // Keep the last unfinished line in buffer 297 // --------------------------------------- 298 int iLastEOL = _rtnetStreamBuffer.lastIndexOf('\n'); 299 if (iLastEOL != -1) { 300 _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iLastEOL+1); 301 } 328 decodeRtnetEpoch(lines); 329 330 } 331 332 // 333 //////////////////////////////////////////////////////////////////////////// 334 void bncRtnetUploadCaster::decodeRtnetEpoch(QStringList epochLines) { 302 335 303 336 // Read first line (with epoch time) 304 337 // --------------------------------- 305 QTextStream in( lines[0].toLatin1());338 QTextStream in(epochLines[0].toLatin1()); 306 339 QString hlp; 307 340 int year, month, day, hour, min; … … 398 431 phasebias.UpdateInterval = ephUpdInd; 399 432 400 for (int ii = 1; ii < lines.size(); ii++) {433 for (int ii = 1; ii < epochLines.size(); ii++) { 401 434 QString key; // prn or key VTEC, IND (phase bias indicators) 402 435 double rtnUra = 0.0; // [m] … … 408 441 t_prn prn; 409 442 410 QTextStream in( lines[ii].toLatin1());443 QTextStream in(epochLines[ii].toLatin1()); 411 444 412 445 in >> key; … … 951 984 } 952 985 953 _outBuffer += hlpBufferCo + hlpBufferBias + hlpBufferPhaseBias 954 + hlpBufferVtec + '\0'; 986 _outBuffer += hlpBufferCo + hlpBufferBias + hlpBufferPhaseBias + hlpBufferVtec + '\0'; 955 987 } 956 957 988 // 958 989 //////////////////////////////////////////////////////////////////////////// -
trunk/BNC/src/upload/bncrtnetuploadcaster.h
r9652 r9868 43 43 struct SsrCorr::ClockOrbit::SatData* sd, 44 44 QString& outLine); 45 45 void decodeRtnetEpoch(QStringList epochLines); 46 46 bool corrIsOutOfRange(struct SsrCorr::ClockOrbit::SatData* sd); 47 47
Note:
See TracChangeset
for help on using the changeset viewer.