Changeset 9760 in ntrip for trunk/BNC/src/bnccore.cpp


Ignore:
Timestamp:
Jun 9, 2022, 5:10:10 PM (23 months ago)
Author:
stuerze
Message:

initial changes to consider RINEX Version 4 in future

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bnccore.cpp

    r9675 r9760  
    288288  if (_rinexVers == 0) {
    289289
    290     if ( Qt::CheckState(settings.value("ephV2").toInt()) == Qt::Checked) {
    291       _rinexVers = 2;
    292     }
    293     else {
    294       _rinexVers = 3;
    295     }
     290    _rinexVers = settings.value("ephVersion").toInt();
    296291
    297292    _ephPath = settings.value("ephPath").toString();
     
    313308    QString ephFileNameGPS = _ephPath + "BRDC";
    314309
    315     bool ephV2 = (_rinexVers == 2)? true : false;
    316 
    317310    QString hlpStr = bncRinex::nextEpochStr(datTim,
    318                          settings.value("ephIntr").toString(), ephV2);
    319 
    320     if (_rinexVers == 3) {
     311                         settings.value("ephIntr").toString(), _rinexVers);
     312
     313    if (_rinexVers > 2) {
    321314      QString country = "WRD"; // WORLD
    322315      QString monNum = "0";
     
    359352    _ephStreamGPS->setDevice(_ephFileGPS);
    360353
    361     if      (_rinexVers == 3) {
     354    if      (_rinexVers > 2) {
    362355      _ephFileGlonass   = _ephFileGPS;
    363356      _ephStreamGlonass = _ephStreamGPS;
     
    367360      _ephStreamSBAS    = _ephStreamGPS;
    368361    }
    369     else if (_rinexVers == 2) {
     362    else {
    370363      QString ephFileNameGlonass = _ephPath + "BRDC" +
    371364          QString("%1").arg(datTim.date().dayOfYear(), 3, 10, QChar('0')) +
     
    388381    // Header - RINEX Version 3
    389382    // ------------------------
    390     if (_rinexVers == 3) {
     383    if (_rinexVers > 2) {
    391384      if ( ! (appendFlagGPS & QIODevice::Append)) {
    392385        QString line = QString().asprintf("%9.2f%11sN: GNSS NAV DATA    M: Mixed%12sRINEX VERSION / TYPE\n",
     
    415408    // Headers - RINEX Version 2
    416409    // -------------------------
    417     else if (_rinexVers == 2) {
     410    else {
    418411      if (! (appendFlagGPS & QIODevice::Append)) {
    419412        QString line = QString().asprintf("%9.2f%11sN: GPS NAV DATA%25sRINEX VERSION / TYPE\n",
     
    470463  QString strV2 = eph.toString(defaultRnxNavVersion2);
    471464  QString strV3 = eph.toString(defaultRnxNavVersion3);
     465  QString strV4 = eph.toString(defaultRnxNavVersion4);
    472466
    473467  if     (_rinexVers == 2 && eph.type() == t_eph::GLONASS) {
    474     printOutputEph(printFile, _ephStreamGlonass, strV2, strV3);
     468    printOutputEph(printFile, _ephStreamGlonass, strV2, strV3, strV4);
    475469  }
    476470  else if(_rinexVers == 2 && eph.type() == t_eph::GPS)  {
    477     printOutputEph(printFile, _ephStreamGPS, strV2, strV3);
     471    printOutputEph(printFile, _ephStreamGPS, strV2, strV3, strV4);
    478472  }
    479473  else if (_rinexVers == 3) {
    480     printOutputEph(printFile, _ephStreamGPS, strV2, strV3);
     474    printOutputEph(printFile, _ephStreamGPS, strV2, strV3, strV4);
    481475  }
    482476}
     
    485479////////////////////////////////////////////////////////////////////////////
    486480void t_bncCore::printOutputEph(bool printFile, QTextStream* stream,
    487                                const QString& strV2, const QString& strV3) {
     481                               const QString& strV2, const QString& strV3,
     482                               const QString& strV4) {
    488483
    489484  // Output into file
    490485  // ----------------
    491486  if (printFile && stream) {
    492     if (_rinexVers == 2) {
     487    if     (_rinexVers == 2) {
    493488      *stream << strV2.toLatin1();
    494489    }
    495     else {
     490    else if (_rinexVers == 3) {
    496491      *stream << strV3.toLatin1();
     492    }
     493    else if (_rinexVers == 4) {
     494      *stream << strV4.toLatin1();
    497495    }
    498496    stream->flush();
Note: See TracChangeset for help on using the changeset viewer.