Changeset 9770 in ntrip


Ignore:
Timestamp:
Jun 22, 2022, 3:18:32 PM (22 months ago)
Author:
stuerze
Message:

minor changes to handle RINEX 2,3,4

Location:
trunk/BNC/src
Files:
4 edited

Legend:

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

    r9768 r9770  
    493493                               const QString& strV2, const QString& strV3,
    494494                               const QString& strV4) {
     495  QString strVx;
     496  if     (_rinexVers == 2) {
     497    strVx = strV2;
     498  }
     499  else if (_rinexVers == 3) {
     500    strVx = strV3;
     501  }
     502  else if (_rinexVers == 4) {
     503    strVx = strV4;
     504  }
    495505
    496506  // Output into file
    497507  // ----------------
    498508  if (printFile && stream) {
    499     if     (_rinexVers == 2) {
    500       *stream << strV2.toLatin1();
    501     }
    502     else if (_rinexVers == 3) {
    503       *stream << strV3.toLatin1();
    504     }
    505     else if (_rinexVers == 4) {
    506       *stream << strV4.toLatin1();
    507     }
     509    *stream << strVx.toLatin1();
    508510    stream->flush();
    509511  }
     
    516518      QTcpSocket* sock = is.next();
    517519      if (sock->state() == QAbstractSocket::ConnectedState) {
    518         if (sock->write(strV3.toLatin1()) == -1) {
     520        if (sock->write(strVx.toLatin1()) == -1) {
    519521          delete sock;
    520522          is.remove();
  • trunk/BNC/src/rinex/reqcedit.cpp

    r9765 r9770  
    6666    _rnxVersion = defaultRnxObsVersion2;
    6767  }
    68   if (version == 3) {
     68  else if (version == 3) {
    6969    _rnxVersion = defaultRnxObsVersion3;
    7070  }
    71   if (version == 4) {
     71  else if (version == 4) {
    7272    _rnxVersion = defaultRnxObsVersion4;
    7373  }
  • trunk/BNC/src/rinex/rnxobsfile.cpp

    r9760 r9770  
    6565  bncSettings settings;
    6666  _writeRinexOnlyWithSklObsTypes = settings.value("rnxOnlyWithSKL").toBool();
     67
    6768}
    6869
     
    7172t_rnxObsHeader::~t_rnxObsHeader() {
    7273}
     74
     75double t_rnxObsHeader::versionFromInt(int version) {
     76  switch (version) {
     77    case 2:
     78      return defaultRnxObsVersion2;
     79    case 3:
     80      return defaultRnxObsVersion3;
     81    case 4:
     82      return defaultRnxObsVersion4;
     83    default:
     84      return defaultRnxObsVersion3;
     85  }
     86}
     87
    7388
    7489// Read Header
     
    175190    else if (key == "# / TYPES OF OBSERV") {
    176191      if (_version == 0.0) {
    177         _version = defaultRnxObsVersion3;
     192        _version = defaultRnxObsVersion2;
    178193      }
    179194      QTextStream* in = new QTextStream(value.toLatin1(), QIODevice::ReadOnly);
     
    199214    else if (key == "SYS / # / OBS TYPES") {
    200215      if (_version == 0.0) {
    201         _version = defaultRnxObsVersion3;
     216        bncSettings settings;
     217        _version = versionFromInt(settings.value("rnxVersion").toInt());
    202218      }
    203219      QTextStream* in = new QTextStream(value.toLatin1(), QIODevice::ReadOnly);
     
    315331  _markerName = markerName;
    316332
    317   if (version == 2) {
    318     _version = defaultRnxObsVersion2;
    319   }
    320   else if (version == 3) {
    321     _version = defaultRnxObsVersion3;
    322   }
    323   else if (version == 4) {
    324     _version = defaultRnxObsVersion4;
    325   }
     333  _version = versionFromInt(version);
    326334
    327335  _comments << "Default set of observation types used";
  • trunk/BNC/src/rinex/rnxobsfile.h

    r9760 r9770  
    5252
    5353  double      version() const {return _version;}
     54  double      versionFromInt(int version);
    5455  t_irc       read(QTextStream* stream, int maxLines = 0);
    5556  void        setDefault(const QString& markerName, int version);
Note: See TracChangeset for help on using the changeset viewer.