- Timestamp:
- Jun 20, 2022, 4:54:59 PM (2 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/RTCM3/RTCM3Decoder.cpp
r9541 r9765 1091 1091 eph._fitInterval = fitIntervalFromFlag(fitIntervalFalg, eph._IODC, eph.type()); 1092 1092 eph._TOT = 0.9999e9; 1093 eph._navType = t_eph::LNAV; 1093 1094 1094 1095 emit newGPSEph(eph); … … 1216 1217 _gloFrq = QString("%1 %2").arg(eph._prn.toString().c_str()).arg(eph._frequency_number, 2, 'f', 0); 1217 1218 1219 eph._navType = t_eph::FDMA; 1220 1218 1221 emit newGlonassEph(eph); 1219 1222 decoded = true; … … 1299 1302 eph._fitInterval = fitIntervalFromFlag(fitIntervalFalg, eph._IODC, eph.type()); 1300 1303 eph._TOT = 0.9999e9; 1304 eph._navType = t_eph::LNAV; 1301 1305 1302 1306 emit newGPSEph(eph); … … 1390 1394 SKIPBITS(2) 1391 1395 eph._TOT = 0.9999e9; 1396 eph._navType = t_eph::LNAV; 1392 1397 1393 1398 emit newGPSEph(eph); … … 1445 1450 eph._TOT = 0.9999E9; 1446 1451 eph._health = 0; 1452 eph._navType = t_eph::SBASL1; 1447 1453 1448 1454 emit newSBASEph(eph); … … 1529 1535 return false; 1530 1536 } 1537 eph._navType = t_eph::INAF; 1531 1538 } 1532 1539 else { … … 1540 1547 GETBITS(eph._E5aHS, 2) 1541 1548 GETBITS(eph._e5aDataInValid, 1) 1549 eph._navType = t_eph::FNAV; 1542 1550 } 1543 1551 eph._TOT = 0.9999e9; … … 1562 1570 bool RTCM3Decoder::DecodeBDSEphemeris(unsigned char* data, int size) { 1563 1571 bool decoded = false; 1572 const double iMaxGEO = 10.0 / 180.0 * M_PI; 1564 1573 1565 1574 if (size == 70) { … … 1622 1631 1623 1632 eph._TOT = 0.9999E9; 1633 if (eph._i0 > iMaxGEO) { 1634 eph._navType = t_eph::D1; 1635 } 1636 else { 1637 eph._navType = t_eph::D2; 1638 } 1639 1640 1624 1641 emit newBDSEph(eph); 1625 1642 decoded = true; -
trunk/BNC/src/bncconst.h
r8629 r9765 41 41 R4, // G1a / 1600.995 42 42 R2, // G2 / 1246 + k * 7/16 (k = -7 .. +12) 43 R6, // G 1b/ 1248.0643 R6, // G2a / 1248.06 44 44 R3, // G3 / 1202.025 45 45 // Galileo … … 55 55 J6, // L6 / 1278.75 56 56 // BDS 57 C2, // B1 -2 / 1561.09858 C1, // B1 59 C5, // B2a 60 C7, // B2 b/ 1207.14 (BDS-2 signals)61 C8, // B2 (B2a +B2b) / 1191.795 (BDS-3 signals)62 C6, // B3 57 C2, // B1 / 1561.098 (BDS 2/3 signals) 58 C1, // B1C, B1A / 1575.42 (BDS-3 signals) 59 C5, // B2a / 1176.45 (BDS-3 signals) 60 C7, // B2, B2b / 1207.14 (BDS-2 signals) 61 C8, // B2(B2a+B2b) / 1191.795 (BDS-3 signals) 62 C6, // B3,B3A / 1268.52 63 63 // IRNSS 64 64 I5, // L5 / 1176.45 -
trunk/BNC/src/bnccore.cpp
r9760 r9765 203 203 #ifdef BNC_DEBUG_BCEP 204 204 if (eph->checkState() == t_eph::bad) { 205 messagePrivate(QString("%1: WRONG EPHEMERIS: %2")205 messagePrivate(QString("%1: WRONG %2:%3") 206 206 .arg(eph->receptStaID()) 207 .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 3.0)).toLatin1()); 207 .arg(eph->navTypeString(eph->navType(), eph->prn(), 99.0)) 208 .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 99.0)).toLatin1()); 208 209 return failure; 209 210 } 210 211 else if (eph->checkState() == t_eph::outdated) { 211 messagePrivate(QString("%1: OUTDATED EPHEMERIS: %2")212 messagePrivate(QString("%1: OUTDATED %2:%3") 212 213 .arg(eph->receptStaID()) 213 .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 3.0)).toLatin1()); 214 .arg(eph->navTypeString(eph->navType(), eph->prn(), 99.0)) 215 .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 99.0)).toLatin1()); 214 216 return failure; 215 217 } 216 218 else if (eph->checkState() == t_eph::unhealthy) { 217 messagePrivate(QString("%1: UNHEALTHY EPHEMERIS: %2")219 messagePrivate(QString("%1: UNHEALTHY %2:%3") 218 220 .arg(eph->receptStaID()) 219 .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 3.0)).toLatin1()); 221 .arg(eph->navTypeString(eph->navType(), eph->prn(), 99.0)) 222 .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 99.0)).toLatin1()); 220 223 } 221 224 #endif … … 383 386 if (_rinexVers > 2) { 384 387 if ( ! (appendFlagGPS & QIODevice::Append)) { 388 double rinexVersion = defaultRnxNavVersion4; 389 if (_rinexVers < 4.0) { 390 rinexVersion = defaultRnxNavVersion3; 391 } 385 392 QString line = QString().asprintf("%9.2f%11sN: GNSS NAV DATA M: Mixed%12sRINEX VERSION / TYPE\n", 386 defaultRnxNavVersion3, "", "");393 rinexVersion, "", ""); 387 394 *_ephStreamGPS << line; 388 395 line.clear(); … … 397 404 while (it.hasNext()) { 398 405 *_ephStreamGPS << it.next().trimmed().left(60).leftJustified(60) << "COMMENT\n"; 406 } 407 408 if (_rinexVers == 4) { 409 int leapSecs = gnumleap(datTim.date().year(), datTim.date().month(), datTim.date().day()); 410 *_ephStreamGPS << QString("%1").arg(leapSecs, 6, 10, QLatin1Char(' ')).left(60).leftJustified(60) 411 << "LEAP SECONDS\n"; 399 412 } 400 413 … … 471 484 printOutputEph(printFile, _ephStreamGPS, strV2, strV3, strV4); 472 485 } 473 else if (_rinexVers == 3) {486 else if (_rinexVers >= 3) { 474 487 printOutputEph(printFile, _ephStreamGPS, strV2, strV3, strV4); 475 488 } -
trunk/BNC/src/ephemeris.cpp
r9367 r9765 21 21 t_eph::t_eph() { 22 22 _checkState = unchecked; 23 _navType = undefined; 23 24 _orbCorr = 0; 24 25 _clkCorr = 0; … … 104 105 return success; 105 106 } 107 108 109 // 110 ////////////////////////////////////////////////////////////////////////////// 111 t_irc t_eph::setNavType(QString navTypeStr) { 112 if (navTypeStr == "LNAV") {_navType = t_eph::LNAV;} 113 else if (navTypeStr == "FDMA") {_navType = t_eph::FDMA;} 114 else if (navTypeStr == "FNAV") {_navType = t_eph::FNAV;} 115 else if (navTypeStr == "INAF") {_navType = t_eph::INAF;} 116 else if (navTypeStr == "D1") {_navType = t_eph::D1;} 117 else if (navTypeStr == "D2") {_navType = t_eph::D2;} 118 else if (navTypeStr == "SBAS") {_navType = t_eph::SBASL1;} 119 else if (navTypeStr == "CNAV") {_navType = t_eph::CNAV;} 120 else if (navTypeStr == "CNV1") {_navType = t_eph::CNV1;} 121 else if (navTypeStr == "CNV2") {_navType = t_eph::CNV2;} 122 else if (navTypeStr == "CNV3") {_navType = t_eph::CNV3;} 123 else {_navType = t_eph::undefined; return failure;} 124 125 return success; 126 } 127 128 // 129 ////////////////////////////////////////////////////////////////////////////// 130 QString t_eph::navTypeString(e_navType navType, const t_prn& prn, double version) { 131 QString navTypeString = ""; 132 QString epochStart; 133 QString eolStr; 134 135 if (version < 4.0) { 136 return navTypeString; 137 } 138 139 if (version == 99.0) { 140 epochStart = ""; 141 eolStr = ""; 142 } 143 else { 144 epochStart = "> "; 145 eolStr = "\n"; 146 } 147 148 QString ephStr = QString("EPH %1 ").arg(prn.toString().c_str()); 149 switch (navType) { 150 case undefined: 151 navTypeString = epochStart + ephStr + "unknown" + eolStr; 152 break; 153 case LNAV: 154 navTypeString = epochStart + ephStr + "LNAV" + eolStr; 155 break; 156 case FDMA: 157 navTypeString = epochStart + ephStr + "FDMA" + eolStr; 158 break; 159 case FNAV: 160 navTypeString = epochStart + ephStr + "FNAV" + eolStr; 161 break; 162 case INAF: 163 navTypeString = epochStart + ephStr + "INAV" + eolStr; 164 break; 165 case D1: 166 navTypeString = epochStart + ephStr + "D1" + eolStr; 167 break; 168 case D2: 169 navTypeString = epochStart + ephStr + "D2" + eolStr; 170 break; 171 case SBASL1: 172 navTypeString = epochStart + ephStr + "SBAS" + eolStr; 173 break; 174 case CNAV: 175 navTypeString = epochStart + ephStr + "CNAV" + eolStr; 176 break; 177 case CNV1: 178 navTypeString = epochStart + ephStr + "CNV1" + eolStr; 179 break; 180 case CNV2: 181 navTypeString = epochStart + ephStr + "CNV2" + eolStr; 182 break; 183 case CNV3: 184 navTypeString = epochStart + ephStr + "CNV3" + eolStr; 185 break; 186 } 187 return navTypeString; 188 } 106 189 107 190 // … … 134 217 .arg(min, 2) 135 218 .arg(sec, 5, 'f',1); 219 } 220 else if (version == 99) { 221 out << QString(" %1 %2 %3 %4 %5 %6") 222 .arg(year, 4) 223 .arg(month, 2, 10, QChar('0')) 224 .arg(day, 2, 10, QChar('0')) 225 .arg(hour, 2, 10, QChar('0')) 226 .arg(min, 2, 10, QChar('0')) 227 .arg(int(sec), 2, 10, QChar('0')); 136 228 } 137 229 else { … … 413 505 QString t_ephGPS::toString(double version) const { 414 506 415 QString rnxStr = rinexDateStr(_TOC, _prn, version); 507 QString navStr = navTypeString(_navType, _prn, version); 508 QString rnxStr = navStr + rinexDateStr(_TOC, _prn, version); 416 509 417 510 QTextStream out(&rnxStr); … … 720 813 QString t_ephGlo::toString(double version) const { 721 814 722 QString rnxStr = rinexDateStr(_TOC -_gps_utc, _prn, version); 815 QString navStr = navTypeString(_navType, _prn, version); 816 QString rnxStr = navStr + rinexDateStr(_TOC -_gps_utc, _prn, version); 723 817 int nd = int((_TOC - _gps_utc).gpssec()) / (24.0*60.0*60.0); 724 818 QTextStream out(&rnxStr); … … 1139 1233 QString t_ephGal::toString(double version) const { 1140 1234 1141 QString rnxStr = rinexDateStr(_TOC, _prn, version); 1235 QString navStr = navTypeString(_navType, _prn, version); 1236 QString rnxStr = navStr + rinexDateStr(_TOC, _prn, version); 1142 1237 1143 1238 QTextStream out(&rnxStr); … … 1439 1534 QString t_ephSBAS::toString(double version) const { 1440 1535 1441 QString rnxStr = rinexDateStr(_TOC, _prn, version); 1536 QString navStr = navTypeString(_navType, _prn, version); 1537 QString rnxStr = navStr + rinexDateStr(_TOC, _prn, version); 1442 1538 1443 1539 QTextStream out(&rnxStr); … … 1794 1890 QString t_ephBDS::toString(double version) const { 1795 1891 1796 QString rnxStr = rinexDateStr(_TOC-14.0, _prn, version); 1892 QString navStr = navTypeString(_navType, _prn, version); 1893 QString rnxStr = navStr + rinexDateStr(_TOC-14.0, _prn, version); 1797 1894 1798 1895 QTextStream out(&rnxStr); -
trunk/BNC/src/ephemeris.h
r9673 r9765 19 19 enum e_type {unknown, GPS, QZSS, GLONASS, Galileo, SBAS, BDS, IRNSS}; 20 20 enum e_checkState {unchecked, ok, bad, outdated, unhealthy}; 21 enum e_navType {undefined, LNAV, FDMA, FNAV, INAF, D1, D2, SBASL1, CNAV, CNV1, CNV2, CNV3}; 21 22 22 23 t_eph(); … … 30 31 bncTime TOC() const {return _TOC;} 31 32 bool isNewerThan(const t_eph* eph) const {return earlierTime(eph, this);} 33 void setCheckState(e_checkState checkState) {_checkState = checkState;} 32 34 e_checkState checkState() const {return _checkState;} 33 35 QString checkStateToString() { 34 36 switch (_checkState) { 35 case unchecked: 36 return "unchecked"; 37 case ok: 38 return "ok"; 39 case bad: 40 return "bad"; 41 case outdated: 42 return "outdated"; 43 case unhealthy: 44 return "unhealthy"; 45 default: 46 return "unknown"; 37 case unchecked: return "unchecked"; 38 case ok: return "ok"; 39 case bad: return "bad"; 40 case outdated: return "outdated"; 41 case unhealthy: return "unhealthy"; 42 default: return "unknown"; 47 43 } 48 44 } 49 void setCheckState(e_checkState checkState) {_checkState = checkState;} 45 e_navType navType() const {return _navType;} 46 t_irc setNavType(QString navTypeStr); 47 50 48 t_prn prn() const {return _prn;} 51 49 t_irc getCrd(const bncTime& tt, ColumnVector& xc, ColumnVector& vv, bool useCorr) const; … … 56 54 static QString rinexDateStr(const bncTime& tt, const t_prn& prn, double version); 57 55 static QString rinexDateStr(const bncTime& tt, const QString& prnStr, double version); 56 static QString navTypeString(e_navType navType, const t_prn& prn, double version); 58 57 static bool earlierTime(const t_eph* eph1, const t_eph* eph2) {return eph1->_TOC < eph2->_TOC;} 59 58 static bool prnSort(const t_eph* eph1, const t_eph* eph2) {return eph1->prn() < eph2->prn();} … … 61 60 protected: 62 61 virtual t_irc position(int GPSweek, double GPSweeks, double* xc, double* vv) const = 0; 63 t_prn _prn;64 bncTime _TOC;65 QDateTime _receptDateTime;66 QString _receptStaID;67 e_checkState _checkState;68 t_orbCorr* _orbCorr;69 t_ clkCorr* _clkCorr;70 };71 62 t_prn _prn; 63 bncTime _TOC; 64 QDateTime _receptDateTime; 65 QString _receptStaID; 66 e_checkState _checkState; 67 e_navType _navType; // defined in RINEX 4 68 t_orbCorr* _orbCorr; 69 t_clkCorr* _clkCorr; 70 }; 72 71 73 72 class t_ephGPS : public t_eph { -
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.