Changeset 9367 in ntrip for trunk/BNC/src/ephemeris.cpp


Ignore:
Timestamp:
Mar 11, 2021, 2:11:20 PM (3 years ago)
Author:
stuerze
Message:

some additions regarding rinexV305: navigation data

File:
1 edited

Legend:

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

    r9290 r9367  
    150150// Constructor
    151151//////////////////////////////////////////////////////////////////////////////
    152 t_ephGPS::t_ephGPS(float rnxVersion, const QStringList& lines) {
     152t_ephGPS::t_ephGPS(double rnxVersion, const QStringList& lines) {
    153153
    154154  const int nLines = 8;
     
    508508// Constructor
    509509//////////////////////////////////////////////////////////////////////////////
    510 t_ephGlo::t_ephGlo(float rnxVersion, const QStringList& lines) {
    511 
    512   const int nLines = 4;
     510t_ephGlo::t_ephGlo(double rnxVersion, const QStringList& lines) {
     511
     512  int nLines = 4;
     513  if (rnxVersion >= 3.05) {
     514    nLines += 1;
     515    _flags_unknown = false;
     516  }
     517  else {
     518    _M_delta_tau = 0.9999e9; // unknown
     519    _M_FT = 1.5e1;           // unknown
     520    _flags_unknown = true;
     521  }
    513522
    514523  if (lines.size() != nLines) {
     
    520529  // ------------
    521530  int fieldLen = 19;
     531  double statusflags = 0.0;
     532  double healthflags = 0.0;
    522533
    523534  int pos[4];
     
    601612        _checkState = bad;
    602613        return;
     614      }
     615    }
     616
     617    else if ( iLine == 4 ) {
     618      if ( readDbl(line, pos[0], fieldLen, statusflags    )  ||
     619           readDbl(line, pos[1], fieldLen, _M_delta_tau   )  ||
     620           readDbl(line, pos[2], fieldLen, _M_FT          )  ||
     621           readDbl(line, pos[3], fieldLen, healthflags    ) ) {
     622        _checkState = bad;
     623        return;
     624      }
     625      else {
     626        // status flags
     627        // ============
     628        // bit 0-1
     629        _M_P  = double(bitExtracted(statusflags, 2, 0));
     630        // bit 2-3
     631        _P1   = double(bitExtracted(statusflags, 2, 2));
     632        // bit 4
     633        _P2   = double(bitExtracted(statusflags, 1, 4));
     634        // bit 5
     635        _P3   = double(bitExtracted(statusflags, 1, 5));
     636        // bit 6
     637        _M_P4 = double(bitExtracted(statusflags, 1, 6));
     638        // bit 7-8
     639        _M_M  = double(bitExtracted(statusflags, 2, 7));
     640        /// GLO M/K exclusive flags/values only valid if flag M is set to '01'
     641        if (!_M_M) {
     642          _M_P4 = 0.0;
     643          _M_P  = 0.0;
     644        }
     645        // health flags
     646        // ============
     647        // bit 0 (is to be ignored, if bit 1 is zero)
     648        _almanac_health = double(bitExtracted(healthflags, 1, 0));
     649        // bit 1
     650        _almanac_health_availablility_indicator = double(bitExtracted(healthflags, 1, 1));
     651        //  bit 2
     652        _M_l3 = double(bitExtracted(healthflags, 1, 2));
    603653      }
    604654    }
     
    699749    .arg(_E,              19, 'e', 12);
    700750
     751  if (version >= 3.05) {
     752    // unknown (RINEX version < 3.05)
     753    if (_flags_unknown) {
     754      out << QString(fmt)
     755        .arg("",            19, QChar(' '))  // statusflags blank if unknown
     756        .arg(_M_delta_tau,  19, 'e', 12)
     757        .arg(_M_FT,         19, 'e', 12)
     758        .arg("",            19, QChar(' ')); // healthflags blank if unknown
     759    }
     760    else {
     761      int statusflags = 0;
     762      // bit 7-8
     763      if (_M_M == 2.0) {
     764        statusflags |= (1<<7);
     765      }
     766      // bit 6
     767      if (_M_P4) {
     768        statusflags |= (1<<6);
     769      }
     770      // bit 5
     771      if (_P3) {
     772        statusflags |= (1<<5);
     773      }
     774      // bit 4
     775      if (_P2) {
     776        statusflags |= (1<<4);
     777      }
     778      // bit 2-3
     779      if      (_P1 == 2.0) {
     780        statusflags |= (1<<2);
     781      }
     782      else if (_P1 == 1.0) {
     783        statusflags |= (1<<3);
     784      }
     785      else if (_P1 == 3.0) {
     786        statusflags |= (1<<2);
     787        statusflags |= (1<<3);
     788      }
     789      // bit 0-1
     790      if       (_M_P == 2.0) {
     791        statusflags |= (1<<0);
     792      }
     793      else if (_M_P == 1.0) {
     794        statusflags |= (1<<1);
     795      }
     796      else if (_M_P == 3.0) {
     797        statusflags |= (1<<0);
     798        statusflags |= (1<<1);
     799      }
     800      // health flags
     801      // ============
     802      int healthflags = 0;
     803      // bit 0 (is to be ignored, if bit 1 is zero)
     804      if (_almanac_health) {
     805        healthflags |= (1<<0);
     806      }
     807      // bit 1
     808      if (_almanac_health_availablility_indicator) {
     809        healthflags |= (1<<1);
     810      }
     811      //  bit 2
     812      if (_M_l3) {
     813        healthflags |= (1<<2);
     814      }
     815      out << QString(fmt)
     816        .arg(double(statusflags), 19, 'e', 12)
     817        .arg(_M_delta_tau,        19, 'e', 12)
     818        .arg(_M_FT,               19, 'e', 12)
     819        .arg(double(healthflags), 19, 'e', 12);
     820    }
     821  }
     822
    701823  return rnxStr;
    702824}
     
    767889// Constructor
    768890//////////////////////////////////////////////////////////////////////////////
    769 t_ephGal::t_ephGal(float rnxVersion, const QStringList& lines) {
     891t_ephGal::t_ephGal(double rnxVersion, const QStringList& lines) {
    770892  int       year, month, day, hour, min;
    771893  double    sec;
     
    8871009      } else {
    8881010        // Bit 0
    889         _e1DataInValid = (int(SVhealth) & (1<<0));
     1011        _e1DataInValid  = (int(SVhealth) & (1<<0));
    8901012        // Bit 1-2
    891         _E1_bHS = double((int(SVhealth) >> 1) & 0x3);
     1013        _E1_bHS         = double((int(SVhealth) >> 1) & 0x3);
    8921014        // Bit 3
    8931015        _e5aDataInValid = (int(SVhealth) & (1<<3));
    8941016        // Bit 4-5
    895         _E5aHS = double((int(SVhealth) >> 4) & 0x3);
     1017        _E5aHS          = double((int(SVhealth) >> 4) & 0x3);
    8961018        // Bit 6
    8971019        _e5bDataInValid = (int(SVhealth) & (1<<6));
    8981020        // Bit 7-8
    899         _E5bHS = double((int(SVhealth) >> 7) & 0x3);
     1021        _E5bHS          = double((int(SVhealth) >> 7) & 0x3);
    9001022
    9011023        if (prnStr.at(0) == 'E') {
     
    11581280// Constructor
    11591281//////////////////////////////////////////////////////////////////////////////
    1160 t_ephSBAS::t_ephSBAS(float rnxVersion, const QStringList& lines) {
     1282t_ephSBAS::t_ephSBAS(double rnxVersion, const QStringList& lines) {
    11611283
    11621284  const int nLines = 4;
     
    13511473// Constructor
    13521474//////////////////////////////////////////////////////////////////////////////
    1353 t_ephBDS::t_ephBDS(float rnxVersion, const QStringList& lines) {
     1475t_ephBDS::t_ephBDS(double rnxVersion, const QStringList& lines) {
    13541476
    13551477  const int nLines = 8;
Note: See TracChangeset for help on using the changeset viewer.