Changeset 6384 in ntrip for trunk


Ignore:
Timestamp:
Dec 19, 2014, 3:56:52 PM (10 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
2 edited

Legend:

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

    r6383 r6384  
    9393    _galileoEph[ii-PRN_GALILEO_START] = 0;
    9494  }
     95  for (int ii = PRN_SBAS_START; ii <= PRN_SBAS_END; ii++) {
     96    _sbasEph[ii-PRN_SBAS_START] = 0;
     97  }
    9598
    9699  // Eph file(s)
     
    103106  _ephFileGalileo   = 0;
    104107  _ephStreamGalileo = 0;
     108  _ephFileSBAS      = 0;
     109  _ephStreamSBAS    = 0;
    105110
    106111  _port    = 0;
     
    155160  for (int ii = PRN_GALILEO_START; ii <= PRN_GALILEO_END; ii++) {
    156161    delete _galileoEph[ii-PRN_GALILEO_START];
     162  }
     163  for (int ii = PRN_SBAS_START; ii <= PRN_SBAS_END; ii++) {
     164    delete _sbasEph[ii-PRN_SBAS_START];
    157165  }
    158166
     
    403411      _galileoEph[ii-PRN_GALILEO_START] = 0;
    404412    }
     413    for (int ii = PRN_SBAS_START; ii <= PRN_SBAS_END; ii++) {
     414      delete _sbasEph[ii-PRN_SBAS_START];
     415      _sbasEph[ii-PRN_SBAS_START] = 0;
     416    }
    405417
    406418    delete _ephStreamGPS;
     
    409421    QFlags<QIODevice::OpenModeFlag> appendFlagGPS;
    410422    QFlags<QIODevice::OpenModeFlag> appendFlagGlonass;
    411     QFlags<QIODevice::OpenModeFlag> appendFlagGalileo;
    412423
    413424    if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked &&
     
    426437      _ephFileGalileo   = _ephFileGPS;
    427438      _ephStreamGalileo = _ephStreamGPS;
     439      _ephFileSBAS      = _ephFileGPS;
     440      _ephStreamSBAS    = _ephStreamGPS;
    428441    }
    429442    else if (_rinexVers == 2) {
     
    814827  QMutexLocker locker(&_mutex);
    815828
    816   qDebug() << "t_bncCore::slotNewSBASEph";
    817 }
     829  // Check wrong Ephemerides
     830  // -----------------------
     831  if (sbaseph->x_pos == 0.0 &&
     832      sbaseph->y_pos == 0.0 &&
     833      sbaseph->z_pos == 0.0) {
     834    delete sbaseph;
     835    return;
     836  }
     837
     838  sbasephemeris copy_sbaseph = *sbaseph;
     839  emit newEphSBAS(copy_sbaseph);
     840
     841  printEphHeader();
     842
     843  sbasephemeris** ee = &_sbasEph[sbaseph->satellite - PRN_SBAS_START];
     844
     845  bool replace = false;
     846  if (*ee != 0) {
     847    bncTime oldTime((*ee)->GPSweek_TOE,   double((*ee)->TOE));
     848    bncTime newTime(sbaseph->GPSweek_TOE, double(sbaseph->TOE));
     849    if (newTime > oldTime) {
     850      replace = true;
     851    }
     852  }
     853
     854  if ( *ee == 0 || replace) {
     855    delete *ee;
     856    *ee = sbaseph;
     857    printSBASEph(sbaseph, true);
     858  }
     859  else {
     860    printSBASEph(sbaseph, false);
     861    delete sbaseph;
     862  }
     863}
     864
     865// Print One SBAS Ephemeris
     866////////////////////////////////////////////////////////////////////////////
     867void t_bncCore::printSBASEph(sbasephemeris* ep, bool printFile) {
     868
     869  t_ephSBAS eph;
     870  eph.set(ep);
     871
     872  QString strV2 = eph.toString(t_rnxNavFile::defaultRnxNavVersion2);
     873  QString strV3 = eph.toString(t_rnxObsHeader::defaultRnxObsVersion3);
     874
     875  printOutput(printFile, _ephStreamSBAS, strV2, strV3);
     876}
  • trunk/BNC/src/bnccore.h

    r6383 r6384  
    8989  void newEphGlonass(glonassephemeris glonasseph);
    9090  void newEphGalileo(galileoephemeris galileoeph);
     91  void newEphSBAS(sbasephemeris sbaseph);
    9192  void newOrbCorrections(QList<t_orbCorr> orbCorr);
    9293  void newClkCorrections(QList<t_clkCorr> clkCorr);
     
    108109  void printGlonassEph(glonassephemeris* ep, bool printFile, const QString& staID);
    109110  void printGalileoEph(galileoephemeris* ep, bool printFile);
     111  void printSBASEph(sbasephemeris* ep, bool printFile);
    110112  void printOutput(bool printFile, QTextStream* stream,
    111113                   const QString& strV2, const QString& strV3);
     
    128130  QFile*                 _ephFileGalileo;
    129131  QTextStream*           _ephStreamGalileo;
     132  QFile*                 _ephFileSBAS;
     133  QTextStream*           _ephStreamSBAS;
    130134  gpsephemeris*          _gpsEph[PRN_GPS_END - PRN_GPS_START + 1];
    131135  gpsephemeris*          _qzssEph[PRN_QZSS_END - PRN_QZSS_START + 1];
    132136  glonassephemeris*      _glonassEph[PRN_GLONASS_END - PRN_GLONASS_START + 1];
    133137  galileoephemeris*      _galileoEph[PRN_GALILEO_END - PRN_GALILEO_START + 1];
     138  sbasephemeris*         _sbasEph[PRN_SBAS_END - PRN_SBAS_START + 1];
    134139  QString                _userName;
    135140  QString                _pgmName;
Note: See TracChangeset for help on using the changeset viewer.