Changeset 3699 in ntrip for trunk/BNC/RTCM3/ephemeris.cpp


Ignore:
Timestamp:
Feb 16, 2012, 1:29:28 PM (12 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

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

    r3668 r3699  
    794794t_ephGPS::t_ephGPS(float rnxVersion, const QStringList& lines) {
    795795
     796  const int nLines = 8;
     797
    796798  _ok = false;
    797799
    798   if (lines.size() != 8) {
     800  if (lines.size() != nLines) {
    799801    return;
    800802  }
     
    812814  // Read eight lines
    813815  // ----------------
    814   for (unsigned iLine = 0; iLine < 8; iLine++) {
     816  for (int iLine = 0; iLine < nLines; iLine++) {
    815817    QString line = lines[iLine];
    816818
     
    918920t_ephGlo::t_ephGlo(float rnxVersion, const QStringList& lines) {
    919921
     922  const int nLines = 4;
     923
    920924  _ok = false;
     925
     926  if (lines.size() != nLines) {
     927    return;
     928  }
     929
     930  // RINEX Format
     931  // ------------
     932  int fieldLen = 19;
     933
     934  int pos[4];
     935  pos[0] = (rnxVersion <= 2.12) ?  3 :  4;
     936  pos[1] = pos[0] + fieldLen;
     937  pos[2] = pos[1] + fieldLen;
     938  pos[3] = pos[2] + fieldLen;
     939
     940  // Read four lines
     941  // ---------------
     942  for (int iLine = 0; iLine < nLines; iLine++) {
     943    QString line = lines[iLine];
     944
     945    if      ( iLine == 0 ) {
     946      QTextStream in(line.left(pos[1]).toAscii());
     947
     948      int    year, month, day, hour, min;
     949      double sec;
     950     
     951      in >> _prn >> year >> month >> day >> hour >> min >> sec;
     952
     953      if (_prn.at(0) != 'R') {
     954        _prn = QString("R%1").arg(_prn.toInt(), 2, 10, QLatin1Char('0'));
     955      }
     956   
     957      if      (year <  80) {
     958        year += 2000;
     959      }
     960      else if (year < 100) {
     961        year += 1900;
     962      }
     963
     964      bncTime hlpTime;
     965      hlpTime.set(year, month, day, hour, min, sec);
     966      _GPSweek  = hlpTime.gpsw();
     967      _GPSweeks = hlpTime.gpssec();
     968
     969      _gps_utc = gnumleap(year, month, day);
     970      // double  _tki;              // message frame time
     971
     972      double second_tot;
     973      if ( readDbl(line, pos[1], fieldLen, _tau      ) ||
     974           readDbl(line, pos[2], fieldLen, _gamma    ) ||
     975           readDbl(line, pos[3], fieldLen, second_tot) ) {
     976        return;
     977      }
     978    }
     979
     980    else if      ( iLine == 1 ) {
     981      if ( readDbl(line, pos[0], fieldLen, _x_pos         ) ||
     982           readDbl(line, pos[1], fieldLen, _x_velocity    ) ||
     983           readDbl(line, pos[2], fieldLen, _x_acceleration) ||
     984           readDbl(line, pos[3], fieldLen, _health        ) ) {
     985        return;
     986      }
     987    }
     988
     989    else if ( iLine == 2 ) {
     990      if ( readDbl(line, pos[0], fieldLen, _y_pos           ) ||
     991           readDbl(line, pos[1], fieldLen, _y_velocity      ) ||
     992           readDbl(line, pos[2], fieldLen, _y_acceleration  ) ||
     993           readDbl(line, pos[3], fieldLen, _frequency_number) ) {
     994        return;
     995      }
     996    }
     997
     998    else if ( iLine == 3 ) {
     999      if ( readDbl(line, pos[0], fieldLen, _z_pos         )  ||
     1000           readDbl(line, pos[1], fieldLen, _z_velocity    )  ||
     1001           readDbl(line, pos[2], fieldLen, _z_acceleration)  ||
     1002           readDbl(line, pos[3], fieldLen, _E             ) ) {
     1003        return;
     1004      }
     1005    }
     1006  }
     1007
     1008  // Initialize status vector
     1009  // ------------------------
     1010  _tt = _GPSweeks;
     1011
     1012   _xv.ReSize(6);
     1013
     1014  _xv(1) = _x_pos * 1.e3;
     1015  _xv(2) = _y_pos * 1.e3;
     1016  _xv(3) = _z_pos * 1.e3;
     1017  _xv(4) = _x_velocity * 1.e3;
     1018  _xv(5) = _y_velocity * 1.e3;
     1019  _xv(6) = _z_velocity * 1.e3;
     1020
     1021  _ok = true;
    9211022}
    9221023
    9231024// Constructor
    9241025//////////////////////////////////////////////////////////////////////////////
    925 t_ephGal::t_ephGal(float rnxVersion, const QStringList& lines) {
     1026t_ephGal::t_ephGal(float /* rnxVersion */, const QStringList& /* lines */) {
    9261027
    9271028  _ok = false;
Note: See TracChangeset for help on using the changeset viewer.