Changeset 4891 in ntrip for trunk/BNC/src/RTCM3/ephemeris.cpp


Ignore:
Timestamp:
Jan 20, 2013, 5:59:14 PM (11 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

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

    r4890 r4891  
    992992// Constructor
    993993//////////////////////////////////////////////////////////////////////////////
    994 t_ephGal::t_ephGal(float /* rnxVersion */, const QStringList& /* lines */) {
     994t_ephGal::t_ephGal(float rnxVersion, const QStringList& lines) {
     995
     996  const int nLines = 8;
    995997
    996998  _ok = false;
     999
     1000  if (lines.size() != nLines) {
     1001    return;
     1002  }
     1003
     1004  // RINEX Format
     1005  // ------------
     1006  int fieldLen = 19;
     1007
     1008  int pos[4];
     1009  pos[0] = (rnxVersion <= 2.12) ?  3 :  4;
     1010  pos[1] = pos[0] + fieldLen;
     1011  pos[2] = pos[1] + fieldLen;
     1012  pos[3] = pos[2] + fieldLen;
     1013
     1014  // Read eight lines
     1015  // ----------------
     1016  for (int iLine = 0; iLine < nLines; iLine++) {
     1017    QString line = lines[iLine];
     1018
     1019    if      ( iLine == 0 ) {
     1020      QTextStream in(line.left(pos[1]).toAscii());
     1021
     1022      int    year, month, day, hour, min;
     1023      double sec;
     1024     
     1025      in >> _prn >> year >> month >> day >> hour >> min >> sec;
     1026
     1027      if (_prn.at(0) != 'E') {
     1028        _prn = QString("E%1").arg(_prn.toInt(), 2, 10, QLatin1Char('0'));
     1029      }
     1030   
     1031      if      (year <  80) {
     1032        year += 2000;
     1033      }
     1034      else if (year < 100) {
     1035        year += 1900;
     1036      }
     1037
     1038      _TOC.set(year, month, day, hour, min, sec);
     1039
     1040      if ( readDbl(line, pos[1], fieldLen, _clock_bias     ) ||
     1041           readDbl(line, pos[2], fieldLen, _clock_drift    ) ||
     1042           readDbl(line, pos[3], fieldLen, _clock_driftrate) ) {
     1043        return;
     1044      }
     1045    }
     1046
     1047    else if      ( iLine == 1 ) {
     1048      if ( readDbl(line, pos[0], fieldLen, _IODnav ) ||
     1049           readDbl(line, pos[1], fieldLen, _Crs    ) ||
     1050           readDbl(line, pos[2], fieldLen, _Delta_n) ||
     1051           readDbl(line, pos[3], fieldLen, _M0     ) ) {
     1052        return;
     1053      }
     1054    }
     1055
     1056    else if ( iLine == 2 ) {
     1057      if ( readDbl(line, pos[0], fieldLen, _Cuc   ) ||
     1058           readDbl(line, pos[1], fieldLen, _e     ) ||
     1059           readDbl(line, pos[2], fieldLen, _Cus   ) ||
     1060           readDbl(line, pos[3], fieldLen, _sqrt_A) ) {
     1061        return;
     1062      }
     1063    }
     1064
     1065    else if ( iLine == 3 ) {
     1066      if ( readDbl(line, pos[0], fieldLen, _TOEsec)  ||
     1067           readDbl(line, pos[1], fieldLen, _Cic   )  ||
     1068           readDbl(line, pos[2], fieldLen, _OMEGA0)  ||
     1069           readDbl(line, pos[3], fieldLen, _Cis   ) ) {
     1070        return;
     1071      }
     1072    }
     1073
     1074    else if ( iLine == 4 ) {
     1075      if ( readDbl(line, pos[0], fieldLen, _i0      ) ||
     1076           readDbl(line, pos[1], fieldLen, _Crc     ) ||
     1077           readDbl(line, pos[2], fieldLen, _omega   ) ||
     1078           readDbl(line, pos[3], fieldLen, _OMEGADOT) ) {
     1079        return;
     1080      }
     1081    }
     1082
     1083    else if ( iLine == 5 ) {
     1084      if ( readDbl(line, pos[0], fieldLen, _IDOT    ) ||
     1085           readDbl(line, pos[2], fieldLen, _TOEweek) ) {
     1086        return;
     1087      }
     1088    }
     1089
     1090    else if ( iLine == 6 ) {
     1091      if ( readDbl(line, pos[0], fieldLen, _SISA    ) ||
     1092           readDbl(line, pos[1], fieldLen, _E5aHS   ) ||
     1093           readDbl(line, pos[2], fieldLen, _BGD_1_5A) ||
     1094           readDbl(line, pos[3], fieldLen, _BGD_1_5B) ) {
     1095        return;
     1096      }
     1097    }
     1098
     1099    else if ( iLine == 7 ) {
     1100      if ( readDbl(line, pos[0], fieldLen, _TOT) ) {
     1101        return;
     1102      }
     1103    }
     1104  }
     1105
     1106  _ok = true;
    9971107}
    9981108
Note: See TracChangeset for help on using the changeset viewer.