Changeset 7474 in ntrip for trunk/BNC/src/rinex/reqcedit.cpp
- Timestamp:
- Sep 29, 2015, 9:29:30 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/reqcedit.cpp
r7280 r7474 35 35 * Created: 11-Apr-2012 36 36 * 37 * Changes: 37 * Changes: 38 38 * 39 39 * -----------------------------------------------------------------------*/ … … 88 88 } 89 89 90 // 90 // 91 91 //////////////////////////////////////////////////////////////////////////// 92 92 void t_reqcEdit::run() { 93 93 94 94 // Open Log File 95 95 // ------------- … … 120 120 << _samplingRate << endl; 121 121 *_log << QByteArray("Start time").leftJustified(15) << ": " 122 << _begTime.datestr().c_str() << ' ' 122 << _begTime.datestr().c_str() << ' ' 123 123 << _begTime.timestr(0).c_str() << endl; 124 124 *_log << QByteArray("End time").leftJustified(15) << ": " 125 << _endTime.datestr().c_str() << ' ' 125 << _endTime.datestr().c_str() << ' ' 126 126 << _endTime.timestr(0).c_str() << endl; 127 127 *_log << QByteArray("Input Obs Files").leftJustified(15) << ": " … … 159 159 // Initialize input observation files, sort them according to start time 160 160 //////////////////////////////////////////////////////////////////////////// 161 void t_reqcEdit::initRnxObsFiles(const QStringList& obsFileNames, 161 void t_reqcEdit::initRnxObsFiles(const QStringList& obsFileNames, 162 162 QVector<t_rnxObsFile*>& rnxObsFiles, 163 163 QTextStream* log) { … … 172 172 QListIterator<QFileInfo> it(dir.entryInfoList(filters)); 173 173 while (it.hasNext()) { 174 QString filePath = it.next().filePath(); 174 QString filePath = it.next().filePath(); 175 175 t_rnxObsFile* rnxObsFile = 0; 176 176 try { … … 199 199 } 200 200 } 201 qStableSort(rnxObsFiles.begin(), rnxObsFiles.end(), 201 qStableSort(rnxObsFiles.begin(), rnxObsFiles.end(), 202 202 t_rnxObsFile::earlierStartTime); 203 203 } 204 204 205 // 205 // 206 206 //////////////////////////////////////////////////////////////////////////// 207 207 void t_reqcEdit::editObservations() { … … 218 218 // ---------------------------------- 219 219 t_rnxObsFile outObsFile(_outObsFileName, t_rnxObsFile::output); 220 220 221 221 // Select observation types 222 222 // ------------------------ … … 296 296 t_rnxObsFile* obsFile = _rnxObsFiles[ii]; 297 297 if (_log) { 298 *_log << "Processing File: " << obsFile->fileName() << " start: " 299 << obsFile->startTime().datestr().c_str() << ' ' 298 *_log << "Processing File: " << obsFile->fileName() << " start: " 299 << obsFile->startTime().datestr().c_str() << ' ' 300 300 << obsFile->startTime().timestr(0).c_str() << endl; 301 301 } … … 320 320 txtMap["COMMENT"] = comment; 321 321 } 322 if (int(_rnxVersion) < int(obsFile->header().version())) { 323 addRnxConversionDetails(obsFile, txtMap); 324 } 322 325 outObsFile.header().write(outObsFile.stream(), &txtMap); 323 326 } … … 331 334 break; 332 335 } 333 334 if (_samplingRate == 0 || 336 337 if (_samplingRate == 0 || 335 338 fmod(round(epo->tt.gpssec()), _samplingRate) == 0) { 336 339 applyLLI(obsFile, epo); … … 347 350 } 348 351 else { 349 qDebug() << str; 352 qDebug() << str; 350 353 } 351 354 return; … … 363 366 } 364 367 365 // Change RINEX Header Content 368 // Change RINEX Header Content 366 369 //////////////////////////////////////////////////////////////////////////// 367 370 void t_reqcEdit::editRnxObsHeader(t_rnxObsFile& obsFile) { … … 372 375 QString newMarkerName = settings.value("reqcNewMarkerName").toString(); 373 376 if (!newMarkerName.isEmpty()) { 374 if (oldMarkerName.isEmpty() || 377 if (oldMarkerName.isEmpty() || 375 378 QRegExp(oldMarkerName).exactMatch(obsFile.markerName())) { 376 379 obsFile.setMarkerName(newMarkerName); … … 381 384 QString newAntennaName = settings.value("reqcNewAntennaName").toString(); 382 385 if (!newAntennaName.isEmpty()) { 383 if (oldAntennaName.isEmpty() || 386 if (oldAntennaName.isEmpty() || 384 387 QRegExp(oldAntennaName).exactMatch(obsFile.antennaName())) { 385 388 obsFile.setAntennaName(newAntennaName); … … 426 429 QString newReceiverType = settings.value("reqcNewReceiverName").toString(); 427 430 if (!newReceiverType.isEmpty()) { 428 if (oldReceiverType.isEmpty() || 431 if (oldReceiverType.isEmpty() || 429 432 QRegExp(oldReceiverType).exactMatch(obsFile.receiverType())) { 430 433 obsFile.setReceiverType(newReceiverType); … … 442 445 } 443 446 444 // 445 //////////////////////////////////////////////////////////////////////////// 446 void t_reqcEdit::rememberLLI(const t_rnxObsFile* obsFile, 447 // 448 //////////////////////////////////////////////////////////////////////////// 449 void t_reqcEdit::rememberLLI(const t_rnxObsFile* obsFile, 447 450 const t_rnxObsFile::t_rnxEpo* epo) { 448 451 … … 467 470 } 468 471 } 469 470 // 471 //////////////////////////////////////////////////////////////////////////// 472 void t_reqcEdit::applyLLI(const t_rnxObsFile* obsFile, 472 473 // 474 //////////////////////////////////////////////////////////////////////////// 475 void t_reqcEdit::applyLLI(const t_rnxObsFile* obsFile, 473 476 t_rnxObsFile::t_rnxEpo* epo) { 474 477 475 478 if (_samplingRate == 0) { 476 479 return; … … 509 512 QListIterator<QFileInfo> it(dir.entryInfoList(filters)); 510 513 while (it.hasNext()) { 511 QString filePath = it.next().filePath(); 514 QString filePath = it.next().filePath(); 512 515 appendEphemerides(filePath, ephs); 513 516 } … … 520 523 } 521 524 522 // 525 // 523 526 //////////////////////////////////////////////////////////////////////////// 524 527 void t_reqcEdit::editEphemerides() { … … 594 597 } 595 598 596 // 599 // 597 600 //////////////////////////////////////////////////////////////////////////// 598 601 void t_reqcEdit::appendEphemerides(const QString& fileName, … … 633 636 } 634 637 } 638 639 void t_reqcEdit::addRnxConversionDetails(const t_rnxObsFile* obsFile, 640 QMap<QString, QString>& txtMap) { 641 642 int key = 0; 643 QString systems = obsFile->header().usedSystems(); 644 QString comment = QString("RINEX 3 => 2 CONVERSION DETAILS:"); 645 QString commentKey = QString("COMMENT %1").arg(key, 3, 10, QChar('0')); 646 txtMap.insert(commentKey, comment); 647 648 for(int ii = 0; ii < obsFile->numSys(); ii++) { 649 key++; 650 char sys = systems[ii].toAscii(); 651 QString preferredAttrib = obsFile->signalPriorities(sys); 652 comment = QString("%1: Signal priority = %2").arg(sys).arg(preferredAttrib); 653 commentKey = QString("COMMENT %1").arg(key, 3, 10, QChar('0')); 654 txtMap.insert(commentKey, comment); 655 QStringList types = obsFile->header().obsTypes(sys); 656 for (int jj = 0; jj < types.size(); jj++) { 657 key++; 658 QString inType = types[jj]; 659 for (int iPref = 0; iPref < preferredAttrib.length(); iPref++) { 660 if (preferredAttrib[iPref] == '?' || 661 (inType.length() == 2 && preferredAttrib[iPref] == '_' ) || 662 (inType.length() == 3 && preferredAttrib[iPref] == inType[2]) ) { 663 QString outType = t_rnxObsFile::type3to2(sys, inType); 664 comment = QString("%1: %2 => %3").arg(sys).arg(inType).arg(outType); 665 commentKey = QString("COMMENT %1").arg(key, 3, 10, QChar('0')); 666 txtMap.insert(commentKey, comment); 667 break; 668 } 669 } 670 } 671 } 672 }
Note:
See TracChangeset
for help on using the changeset viewer.