Changeset 6390 in ntrip


Ignore:
Timestamp:
Dec 20, 2014, 10:40:33 AM (9 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
2 edited

Legend:

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

    r6389 r6390  
    11021102// Constructor
    11031103//////////////////////////////////////////////////////////////////////////////
    1104 t_ephSBAS::t_ephSBAS(float /* rnxVersion */, const QStringList& /* lines */) {
    1105   qDebug() << "not yet implemented";
     1104t_ephSBAS::t_ephSBAS(float rnxVersion, const QStringList& lines) {
     1105
     1106  const int nLines = 4;
     1107
     1108  _ok = false;
     1109
     1110  if (lines.size() != nLines) {
     1111    return;
     1112  }
     1113
     1114  // RINEX Format
     1115  // ------------
     1116  int fieldLen = 19;
     1117
     1118  int pos[4];
     1119  pos[0] = (rnxVersion <= 2.12) ?  3 :  4;
     1120  pos[1] = pos[0] + fieldLen;
     1121  pos[2] = pos[1] + fieldLen;
     1122  pos[3] = pos[2] + fieldLen;
     1123
     1124  // Read four lines
     1125  // ---------------
     1126  for (int iLine = 0; iLine < nLines; iLine++) {
     1127    QString line = lines[iLine];
     1128
     1129    if      ( iLine == 0 ) {
     1130      QTextStream in(line.left(pos[1]).toAscii());
     1131
     1132      int    year, month, day, hour, min;
     1133      double sec;
     1134     
     1135      QString prnStr;
     1136      in >> prnStr >> year >> month >> day >> hour >> min >> sec;
     1137      if (prnStr.at(0) == 'S') {
     1138        _prn.set('S', prnStr.mid(1).toInt());
     1139      }
     1140      else {
     1141        _prn.set('S', prnStr.toInt());
     1142      }
     1143
     1144      if      (year <  80) {
     1145        year += 2000;
     1146      }
     1147      else if (year < 100) {
     1148        year += 1900;
     1149      }
     1150
     1151      _TOC.set(year, month, day, hour, min, sec);
     1152
     1153      if ( readDbl(line, pos[1], fieldLen, _agf0 ) ||
     1154           readDbl(line, pos[2], fieldLen, _agf1 ) ||
     1155           readDbl(line, pos[3], fieldLen, _TOW  ) ) {
     1156        return;
     1157      }
     1158    }
     1159
     1160    else if      ( iLine == 1 ) {
     1161      if ( readDbl(line, pos[0], fieldLen, _x_pos         ) ||
     1162           readDbl(line, pos[1], fieldLen, _x_velocity    ) ||
     1163           readDbl(line, pos[2], fieldLen, _x_acceleration) ||
     1164           readDbl(line, pos[3], fieldLen, _health        ) ) {
     1165        return;
     1166      }
     1167    }
     1168
     1169    else if ( iLine == 2 ) {
     1170      if ( readDbl(line, pos[0], fieldLen, _y_pos           ) ||
     1171           readDbl(line, pos[1], fieldLen, _y_velocity      ) ||
     1172           readDbl(line, pos[2], fieldLen, _y_acceleration  ) ||
     1173           readDbl(line, pos[3], fieldLen, _ura             ) ) {
     1174        return;
     1175      }
     1176    }
     1177
     1178    else if ( iLine == 3 ) {
     1179      if ( readDbl(line, pos[0], fieldLen, _z_pos         )  ||
     1180           readDbl(line, pos[1], fieldLen, _z_velocity    )  ||
     1181           readDbl(line, pos[2], fieldLen, _z_acceleration)  ||
     1182           readDbl(line, pos[3], fieldLen, _IODN          ) ) {
     1183        return;
     1184      }
     1185    }
     1186  }
     1187
     1188  _x_pos          *= 1.e3;
     1189  _y_pos          *= 1.e3;
     1190  _z_pos          *= 1.e3;
     1191  _x_velocity     *= 1.e3;
     1192  _y_velocity     *= 1.e3;
     1193  _z_velocity     *= 1.e3;
     1194  _x_acceleration *= 1.e3;
     1195  _y_acceleration *= 1.e3;
     1196  _z_acceleration *= 1.e3;
     1197
     1198  _ok = true;
    11061199}
    11071200
     
    11321225
    11331226  _ura            = ee->URA;
     1227
     1228  _ok     = true;
     1229  _health = 0;
    11341230}
    11351231
     
    11631259
    11641260  out << QString("%1%2%3\n")
    1165     .arg(_agf0,        19, 'e', 12)
    1166     .arg(_agf1,        19, 'e', 12)
    1167     .arg(double(_TOW), 19, 'e', 12);
     1261    .arg(_agf0, 19, 'e', 12)
     1262    .arg(_agf1, 19, 'e', 12)
     1263    .arg(_TOW, 19, 'e', 12);
    11681264
    11691265  QString fmt = version < 3.0 ? "   %1%2%3%4\n" : "    %1%2%3%4\n";
     
    11731269    .arg(1.e-3*_x_velocity,     19, 'e', 12)
    11741270    .arg(1.e-3*_x_acceleration, 19, 'e', 12)
    1175     .arg(0.0,                   19, 'e', 12);
     1271    .arg(_health,               19, 'e', 12);
    11761272
    11771273  out << QString(fmt)
     
    11791275    .arg(1.e-3*_y_velocity,     19, 'e', 12)
    11801276    .arg(1.e-3*_y_acceleration, 19, 'e', 12)
    1181     .arg(double(_ura),          19, 'e', 12);
     1277    .arg(_ura,                  19, 'e', 12);
    11821278
    11831279  out << QString(fmt)
     
    11851281    .arg(1.e-3*_z_velocity,     19, 'e', 12)
    11861282    .arg(1.e-3*_z_acceleration, 19, 'e', 12)
    1187     .arg(double(_IODN),         19, 'e', 12);
     1283    .arg(_IODN,                 19, 'e', 12);
    11881284
    11891285  return rnxStr;
  • trunk/BNC/src/ephemeris.h

    r6387 r6390  
    216216  virtual t_irc position(int GPSweek, double GPSweeks, double* xc, double* vv) const;
    217217
    218   int    _IODN;
    219   int    _TOW;            // not used (set to  0.9999e9)
     218  double _IODN;
     219  double _TOW;            // not used (set to  0.9999e9)
    220220  double _agf0;           // [s]    clock correction
    221221  double _agf1;           // [s/s]  clock correction drift
     
    233233  double _z_acceleration; // [m/s^2]
    234234
    235   int    _ura;
     235  double _ura;
     236  double _health;
    236237};
    237238
Note: See TracChangeset for help on using the changeset viewer.