Changeset 9765 in ntrip for trunk/BNC/src/rinex
- Timestamp:
- Jun 20, 2022, 4:54:59 PM (3 years ago)
- Location:
- trunk/BNC/src/rinex
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/reqcedit.cpp
r9639 r9765 63 63 _outNavFileName = settings.value("reqcOutNavFile").toString(); 64 64 int version = settings.value("reqcRnxVersion").toInt(); 65 if (version < 3) {65 if (version == 2) { 66 66 _rnxVersion = defaultRnxObsVersion2; 67 67 } 68 else{68 if (version == 3) { 69 69 _rnxVersion = defaultRnxObsVersion3; 70 } 71 if (version == 4) { 72 _rnxVersion = defaultRnxObsVersion4; 70 73 } 71 74 _samplingRate = settings.value("reqcSampling").toString().split("sec").first().toDouble(); … … 601 604 outNavFile.setGlonass(haveGlonass); 602 605 603 if ( (haveGPS && haveGlonass) || _rnxVersion >= 3.0) { 606 if (_rnxVersion < 3.0) { 607 if (haveGPS && haveGlonass) { 608 outNavFile.setVersion(defaultRnxNavVersion3); 609 } 610 if (haveGPS && !haveGlonass) { 611 outNavFile.setVersion(defaultRnxNavVersion2); 612 } 613 } 614 615 if (_rnxVersion >= 3.0 && _rnxVersion < 4.0) { 604 616 outNavFile.setVersion(defaultRnxNavVersion3); 605 617 } 606 else { 607 outNavFile.setVersion(defaultRnxNavVersion2); 618 619 if (_rnxVersion >= 4.0) { 620 outNavFile.setVersion(defaultRnxNavVersion4); 608 621 } 609 622 … … 626 639 } 627 640 628 outNavFile.writeHeader(&txtMap); 641 int mergedNavFiles = _navFileNames.size(); 642 unsigned year, month, day; 643 int gps_utc = 0; 644 if (_ephs.size()) { 645 _ephs.at(0)->TOC().civil_date(year, month, day); 646 gps_utc = gnumleap(year, month, day); 647 } 648 outNavFile.writeHeader(&txtMap, mergedNavFiles, gps_utc); 629 649 630 650 // Loop over all ephemerides … … 645 665 } 646 666 if (eph->checkState() == t_eph::bad) { 667 continue; 668 } 669 if (outNavFile.version() >= 4.0 && 670 eph->navType() == t_eph::undefined) { // input files < version 4.0 647 671 continue; 648 672 } -
trunk/BNC/src/rinex/rnxnavfile.cpp
r9366 r9765 146 146 //////////////////////////////////////////////////////////////////////////// 147 147 void t_rnxNavFile::read(QTextStream* stream) { 148 QString navTypeStr; 148 149 149 150 while (stream->status() == QTextStream::Ok && !stream->atEnd()) { 151 150 152 QString line = stream->readLine(); 151 153 if (line.isEmpty()) { 152 154 continue; 153 155 } 156 154 157 QStringList hlp = line.split(QRegExp("\\s+"), QString::SkipEmptyParts); 158 QString firstStr = hlp.at(0); 155 159 QString prn; 156 if (version() >= 3.0) { 157 prn = hlp.at(0); 160 161 if (version() >= 3.0 && firstStr != ">") { 162 prn = firstStr; 163 } 164 else if (version() >= 4.0 && firstStr == ">") { 165 int lines2skip = 0; 166 QString key = hlp.at(1); 167 // EPH is used 168 if (key == "EPH") { 169 navTypeStr = hlp.at(3); 170 } 171 // all others are currently ignored 172 else if (key == "STO") { 173 lines2skip = 2; 174 } 175 else if (key == "EOP" || key == "ION") { 176 lines2skip = 3; 177 } 178 if (lines2skip) { 179 for (int ii = 1; ii < lines2skip; ii++) { 180 stream->readLine(); 181 } 182 } 183 continue; 158 184 } 159 185 else { … … 213 239 } 214 240 eph = new t_ephGPS(version(), lines); 241 } 242 else { 243 continue; 244 } 245 if (version() >= 4.0) { 246 if (eph->setNavType(navTypeStr) != success) { 247 delete eph; 248 continue; 249 } 215 250 } 216 251 _ephs.push_back(eph); … … 264 299 // 265 300 //////////////////////////////////////////////////////////////////////////// 266 void t_rnxNavFile::writeHeader(const QMap<QString, QString>* txtMap) { 301 void t_rnxNavFile::writeHeader(const QMap<QString, QString>* txtMap, int numMergedFiles, int leapSecs) { 267 302 268 303 QString runBy = BNC_CORE->userName(); … … 334 369 << "PGM / RUN BY / DATE\n"; 335 370 371 if (version() >= 4.0) { 372 *_stream << QString("%1").arg(leapSecs, 6, 10, QLatin1Char(' ')).left(60).leftJustified(60) 373 << "LEAP SECONDS\n"; 374 375 *_stream << QString("%1").arg(numMergedFiles, 19, 10, QLatin1Char(' ')).leftJustified(60) 376 << "MERGED FILE\n"; 377 } 378 336 379 QStringListIterator itCmnt(comments); 337 380 while (itCmnt.hasNext()) { … … 339 382 } 340 383 384 341 385 *_stream << QString() 342 386 .leftJustified(60) -
trunk/BNC/src/rinex/rnxnavfile.h
r9760 r9765 25 25 #ifndef RNXNAVFILE_H 26 26 #define RNXNAVFILE_H 27 27 #include <iostream> 28 28 #include <queue> 29 29 #include <QtCore> … … 35 35 class bncPPPclient; 36 36 class t_eph; 37 37 using namespace std; 38 38 #define defaultRnxNavVersion2 2.11 39 39 #define defaultRnxNavVersion3 3.05 … … 68 68 void setGlonass(bool glo) {_header._glonass = glo;} 69 69 void setGnssTypeV3(t_eph::e_type sys) {_header._satSys = sys;} 70 void writeHeader(const QMap<QString, QString>* txtMap = 0); 70 void writeHeader(const QMap<QString, QString>* txtMap = 0, int numMergedFiles = 0, int leapSecs = 0); 71 71 void writeEph(const t_eph* eph); 72 72
Note:
See TracChangeset
for help on using the changeset viewer.