- Timestamp:
- Dec 15, 2022, 11:06:12 PM (21 months ago)
- Location:
- trunk/BNC/src/rinex
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/reqcedit.cpp
r9893 r9945 224 224 t_rnxObsFile outObsFile(_outObsFileName, t_rnxObsFile::output); 225 225 226 227 // Put together all run by date entries 228 // ------------------------------------ 229 QStringList runByDate; 230 if (_rnxVersion >= 4.0 && _rnxObsFiles.size() > 1) { 231 for (int ii = 0; ii < _rnxObsFiles.size(); ii++) { 232 t_rnxObsFile* rnxObsFile = _rnxObsFiles[ii]; 233 QStringListIterator itRunByDt(rnxObsFile->runByDate()); 234 while (itRunByDt.hasNext()) { 235 runByDate.append(itRunByDt.next()); 236 } 237 } 238 runByDate.removeDuplicates(); 239 } 240 226 241 // Select observation types 227 242 // ------------------------ … … 307 322 if (ii == 0) { 308 323 outObsFile.setHeader(obsFile->header(), int(_rnxVersion), &useObsTypes, 309 &phaseShifts, &gloBiases, &gloSlots );324 &phaseShifts, &gloBiases, &gloSlots, &runByDate); 310 325 if (_begTime.valid() && _begTime > outObsFile.startTime()) { 311 326 outObsFile.setStartTime(_begTime); … … 403 418 } 404 419 } 405 406 420 407 421 const ColumnVector& obsFileAntNEU = obsFile.antNEU(); … … 539 553 return; 540 554 } 541 // Concatenate all comments 542 // ------------------------ 555 // Concatenate all comments and all run by date lines 556 // -------------------------------------------------- 543 557 QStringList comments; 558 QStringList runByDate; 544 559 bncSettings settings; 545 560 QString comment = settings.value("reqcComment").toString(); … … 555 570 comments.append(itCmnt.next()); 556 571 } 572 QStringListIterator itRunByDt(rnxNavFile.runByDate()); 573 while (itRunByDt.hasNext()) { 574 runByDate.append(itRunByDt.next()); 575 } 557 576 } 558 577 comments.removeDuplicates(); 578 runByDate.removeDuplicates(); 559 579 560 580 // Read Ephemerides … … 611 631 outNavFile.setVersion(defaultRnxNavVersion2); 612 632 } 633 if (!haveGPS && haveGlonass) { 634 outNavFile.setVersion(defaultRnxNavVersion2); 635 } 613 636 } 614 637 … … 634 657 if (!runBy.isEmpty()) { 635 658 txtMap["RUN BY"] = runBy; 659 } 660 if (!runByDate.empty()) { 661 txtMap["RUN BY DATE"] = runByDate.join("\\n"); 636 662 } 637 663 if (!comments.isEmpty()) { … … 667 693 continue; 668 694 } 695 696 if (outNavFile.version() < 3.0) { 697 if (outNavFile.glonass() && eph->type() != t_eph::GLONASS) { 698 continue; 699 } 700 if (!outNavFile.glonass() && eph->type() != t_eph::GPS) { 701 continue; 702 } 703 } 704 705 if (outNavFile.version() < 4.0) { 706 if (eph->navType() == t_eph::CNAV || 707 eph->navType() == t_eph::CNV1 || 708 eph->navType() == t_eph::CNV2 || 709 eph->navType() == t_eph::CNV3) { 710 continue; 711 } 712 } 713 669 714 if (outNavFile.version() >= 4.0 && 670 715 eph->navType() == t_eph::undefined) { // input files < version 4.0 671 716 continue; 672 717 } 718 673 719 outNavFile.writeEph(eph); 674 720 } -
trunk/BNC/src/rinex/rnxnavfile.cpp
r9788 r9945 82 82 else if (key == "COMMENT") { 83 83 _comments.append(value.trimmed()); 84 } 85 else if (key == "PGM / RUN BY / DATE") { 86 _runByDate.append(value.trimmed()); 84 87 } 85 88 } … … 303 306 QString runBy = BNC_CORE->userName(); 304 307 QStringList comments; 308 QStringList runByDate; 305 309 306 310 if (txtMap) { … … 310 314 if (it.key() == "RUN BY") { 311 315 runBy = it.value(); 316 } 317 else if (it.key() == "RUN BY DATE") { 318 runByDate = it.value().split("\\n", QString::SkipEmptyParts); 312 319 } 313 320 else if (it.key() == "COMMENT") { … … 370 377 371 378 if (version() >= 4.0) { 379 QStringListIterator itRunByDt(runByDate); 380 while (itRunByDt.hasNext()) { 381 *_stream << itRunByDt.next().trimmed().left(60).leftJustified(60) 382 << "PGM / RUN BY / DATE\n"; 383 } 372 384 *_stream << QString("%1").arg(leapSecs, 6, 10, QLatin1Char(' ')).left(60).leftJustified(60) 373 385 << "LEAP SECONDS\n"; … … 382 394 } 383 395 384 385 396 *_stream << QString() 386 397 .leftJustified(60) … … 391 402 //////////////////////////////////////////////////////////////////////////// 392 403 void t_rnxNavFile::writeEph(const t_eph* eph) { 393 if (version() < 4.0) {394 if (eph->navType() == t_eph::CNAV ||395 eph->navType() == t_eph::CNV1 ||396 eph->navType() == t_eph::CNV2 ||397 eph->navType() == t_eph::CNV3) {398 return;399 }400 }401 404 *_stream << eph->toString(version()); 402 405 } -
trunk/BNC/src/rinex/rnxnavfile.h
r9765 r9945 54 54 t_eph::e_type _satSys; 55 55 QStringList _comments; 56 QStringList _runByDate; 56 57 }; 57 58 … … 65 66 bool glonass() const {return _header._glonass;} 66 67 QStringList comments() const {return _header._comments;} 68 QStringList runByDate() const {return _header._runByDate;} 67 69 t_eph::e_type satSystem() const {return _header._satSys;} 68 70 void setGlonass(bool glo) {_header._glonass = glo;} -
trunk/BNC/src/rinex/rnxobsfile.cpp
r9870 r9945 110 110 in >> _version; 111 111 } 112 else if (key == "PGM / RUN BY / DATE") { 113 _runByDate.append(value.trimmed()); 114 } 112 115 else if (key == "MARKER NAME") { 113 116 _markerName = value; … … 320 323 _usedSystems += QChar(it.key()); 321 324 } 322 325 323 326 return success; 324 327 } … … 406 409 const QStringList* phaseShifts, 407 410 const QStringList* gloBiases, 408 const QStringList* gloSlots) { 411 const QStringList* gloSlots, 412 const QStringList* runByDate) { 409 413 410 414 _version = versionFromInt(version); … … 596 600 } 597 601 } 602 if (_version >= 4.0) { 603 // set run by date entries 604 if (!runByDate || runByDate->empty()) { 605 _runByDate = header._runByDate; 606 } 607 else { 608 foreach (const QString &str, *runByDate) { 609 _runByDate.append(str); 610 } 611 } 612 } 613 598 614 } 599 615 … … 604 620 605 621 QStringList newComments; 622 QStringList runByDate; 606 623 QString runBy = BNC_CORE->userName(); 607 624 608 625 if (txtMap) { 609 QMapIterator<QString, QString> it(*txtMap);626 QMapIterator<QString, QString> it(*txtMap); 610 627 while (it.hasNext()) { 611 628 it.next(); 612 629 if (it.key() == "RUN BY") { 613 630 runBy = it.value(); 631 } 632 else if (it.key() == "RUN BY DATE") { 633 runByDate = it.value().split("\\n", QString::SkipEmptyParts); 614 634 } 615 635 else if ((it.key().indexOf("COMMENT")) != -1) { … … 634 654 << "PGM / RUN BY / DATE\n"; 635 655 656 if (_version >= 4.0) { 657 QStringListIterator itRunByDt(_runByDate); 658 while (itRunByDt.hasNext()) { 659 *stream << itRunByDt.next().trimmed().left(60).leftJustified(60) 660 << "PGM / RUN BY / DATE\n"; 661 } 662 } 636 663 QStringListIterator itCmnt(_comments + newComments); 637 664 while (itCmnt.hasNext()) { … … 882 909 } 883 910 911 // 912 //////////////////////////////////////////////////////////////////////////// 884 913 QStringList t_rnxObsHeader::obsTypes(char sys) const { 885 914 if (_obsTypes.contains(sys)) { -
trunk/BNC/src/rinex/rnxobsfile.h
r9770 r9945 57 57 void set(const t_rnxObsHeader& header, int version, 58 58 const QStringList* useObsTypes = 0, const QStringList* phaseShifts = 0, 59 const QStringList* gloBiases = 0, const QStringList* gloSlots = 0); 59 const QStringList* gloBiases = 0, const QStringList* gloSlots = 0, 60 const QStringList* runByDate = 0); 60 61 int numSys() const; 61 62 char system(int iSys) const; … … 69 70 QStringList gloBiases() const; 70 71 QStringList gloSlots() const; 72 QStringList runByDate() const {return _runByDate;} 71 73 void write(QTextStream* stream, const QMap<QString, QString>* txtMap = 0) const; 72 74 bncTime startTime() const {return _startTime;} … … 93 95 QStringList _stationInformation; 94 96 QStringList _comments; 97 QStringList _runByDate; 95 98 ColumnVector _antNEU; 96 99 ColumnVector _antXYZ; … … 162 165 QStringList gloBiases() const {return _header.gloBiases();} 163 166 QStringList gloSlots() const {return _header.gloSlots();} 167 QStringList runByDate() const {return _header.runByDate();} 164 168 const QString& antennaName() const {return _header._antennaName;} 165 169 const QString& antennaNumber() const {return _header._antennaNumber;} … … 192 196 const ColumnVector& antBSG() const {return _header._antBSG;} 193 197 194 const bncTime& 198 const bncTime& startTime() const {return _header._startTime;} 195 199 void setStartTime(const bncTime& startTime) {_header._startTime = startTime;} 196 200 … … 208 212 void setHeader(const t_rnxObsHeader& header, int version, 209 213 const QStringList* useObsTypes = 0, const QStringList* phaseShifts = 0, 210 const QStringList* gloBiases = 0, const QStringList* gloSlots = 0 ) {211 _header.set(header, version, useObsTypes, phaseShifts, gloBiases, gloSlots );214 const QStringList* gloBiases = 0, const QStringList* gloSlots = 0, const QStringList* runByDate = 0) { 215 _header.set(header, version, useObsTypes, phaseShifts, gloBiases, gloSlots, runByDate); 212 216 } 213 217
Note:
See TracChangeset
for help on using the changeset viewer.