Changeset 6801 in ntrip


Ignore:
Timestamp:
Apr 29, 2015, 1:00:00 PM (9 years ago)
Author:
stuerze
Message:

cosmetical changes: order of classe cleared up

File:
1 edited

Legend:

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

    r6799 r6801  
    8686  }
    8787  return success;
     88}
     89
     90//
     91//////////////////////////////////////////////////////////////////////////////
     92QString t_eph::rinexDateStr(const bncTime& tt, const t_prn& prn, double version) {
     93  QString prnStr(prn.toString().c_str());
     94  return rinexDateStr(tt, prnStr, version);
     95}
     96
     97//
     98//////////////////////////////////////////////////////////////////////////////
     99QString t_eph::rinexDateStr(const bncTime& tt, const QString& prnStr, double version) {
     100
     101  QString datStr;
     102
     103  unsigned year, month, day, hour, min;
     104  double   sec;
     105  tt.civil_date(year, month, day);
     106  tt.civil_time(hour, min, sec);
     107
     108  QTextStream out(&datStr);
     109
     110  if (version < 3.0) {
     111    QString prnHlp = prnStr.mid(1,2); if (prnHlp[0] == '0') prnHlp[0] = ' ';
     112    out << prnHlp << QString(" %1 %2 %3 %4 %5%6")
     113      .arg(year % 100, 2, 10, QChar('0'))
     114      .arg(month,      2)
     115      .arg(day,        2)
     116      .arg(hour,       2)
     117      .arg(min,        2)
     118      .arg(sec, 5, 'f',1);
     119  }
     120  else {
     121    out << prnStr << QString(" %1 %2 %3 %4 %5 %6")
     122      .arg(year,     4)
     123      .arg(month,    2, 10, QChar('0'))
     124      .arg(day,      2, 10, QChar('0'))
     125      .arg(hour,     2, 10, QChar('0'))
     126      .arg(min,      2, 10, QChar('0'))
     127      .arg(int(sec), 2, 10, QChar('0'));
     128  }
     129
     130  return datStr;
     131}
     132
     133// Constructor
     134//////////////////////////////////////////////////////////////////////////////
     135t_ephGPS::t_ephGPS(float rnxVersion, const QStringList& lines) {
     136
     137  const int nLines = 8;
     138
     139  if (lines.size() != nLines) {
     140    _checkState = bad;
     141    return;
     142  }
     143
     144  // RINEX Format
     145  // ------------
     146  int fieldLen = 19;
     147
     148  int pos[4];
     149  pos[0] = (rnxVersion <= 2.12) ?  3 :  4;
     150  pos[1] = pos[0] + fieldLen;
     151  pos[2] = pos[1] + fieldLen;
     152  pos[3] = pos[2] + fieldLen;
     153
     154  // Read eight lines
     155  // ----------------
     156  for (int iLine = 0; iLine < nLines; iLine++) {
     157    QString line = lines[iLine];
     158
     159    if      ( iLine == 0 ) {
     160      QTextStream in(line.left(pos[1]).toAscii());
     161
     162      int    year, month, day, hour, min;
     163      double sec;
     164
     165      QString prnStr;
     166      in >> prnStr >> year >> month >> day >> hour >> min >> sec;
     167      if      (prnStr.at(0) == 'G') {
     168        _prn.set('G', prnStr.mid(1).toInt());
     169      }
     170      else if (prnStr.at(0) == 'J') {
     171        _prn.set('J', prnStr.mid(1).toInt());
     172      }
     173      else {
     174        _prn.set('G', prnStr.toInt());
     175      }
     176
     177      if      (year <  80) {
     178        year += 2000;
     179      }
     180      else if (year < 100) {
     181        year += 1900;
     182      }
     183
     184      _TOC.set(year, month, day, hour, min, sec);
     185
     186      if ( readDbl(line, pos[1], fieldLen, _clock_bias     ) ||
     187           readDbl(line, pos[2], fieldLen, _clock_drift    ) ||
     188           readDbl(line, pos[3], fieldLen, _clock_driftrate) ) {
     189        _checkState = bad;
     190        return;
     191      }
     192    }
     193
     194    else if      ( iLine == 1 ) {
     195      if ( readDbl(line, pos[0], fieldLen, _IODE   ) ||
     196           readDbl(line, pos[1], fieldLen, _Crs    ) ||
     197           readDbl(line, pos[2], fieldLen, _Delta_n) ||
     198           readDbl(line, pos[3], fieldLen, _M0     ) ) {
     199        _checkState = bad;
     200        return;
     201      }
     202    }
     203
     204    else if ( iLine == 2 ) {
     205      if ( readDbl(line, pos[0], fieldLen, _Cuc   ) ||
     206           readDbl(line, pos[1], fieldLen, _e     ) ||
     207           readDbl(line, pos[2], fieldLen, _Cus   ) ||
     208           readDbl(line, pos[3], fieldLen, _sqrt_A) ) {
     209        _checkState = bad;
     210        return;
     211      }
     212    }
     213
     214    else if ( iLine == 3 ) {
     215      if ( readDbl(line, pos[0], fieldLen, _TOEsec)  ||
     216           readDbl(line, pos[1], fieldLen, _Cic   )  ||
     217           readDbl(line, pos[2], fieldLen, _OMEGA0)  ||
     218           readDbl(line, pos[3], fieldLen, _Cis   ) ) {
     219        _checkState = bad;
     220        return;
     221      }
     222    }
     223
     224    else if ( iLine == 4 ) {
     225      if ( readDbl(line, pos[0], fieldLen, _i0      ) ||
     226           readDbl(line, pos[1], fieldLen, _Crc     ) ||
     227           readDbl(line, pos[2], fieldLen, _omega   ) ||
     228           readDbl(line, pos[3], fieldLen, _OMEGADOT) ) {
     229        _checkState = bad;
     230        return;
     231      }
     232    }
     233
     234    else if ( iLine == 5 ) {
     235      if ( readDbl(line, pos[0], fieldLen, _IDOT   ) ||
     236           readDbl(line, pos[1], fieldLen, _L2Codes) ||
     237           readDbl(line, pos[2], fieldLen, _TOEweek  ) ||
     238           readDbl(line, pos[3], fieldLen, _L2PFlag) ) {
     239        _checkState = bad;
     240        return;
     241      }
     242    }
     243
     244    else if ( iLine == 6 ) {
     245      if ( readDbl(line, pos[0], fieldLen, _ura   ) ||
     246           readDbl(line, pos[1], fieldLen, _health) ||
     247           readDbl(line, pos[2], fieldLen, _TGD   ) ||
     248           readDbl(line, pos[3], fieldLen, _IODC  ) ) {
     249        _checkState = bad;
     250        return;
     251      }
     252    }
     253
     254    else if ( iLine == 7 ) {
     255      if ( readDbl(line, pos[0], fieldLen, _TOT) ) {
     256        _checkState = bad;
     257        return;
     258      }
     259      readDbl(line, pos[1], fieldLen, _fitInterval); // _fitInterval optional
     260    }
     261  }
    88262}
    89263
     
    231405}
    232406
    233 // Derivative of the state vector using a simple force model (static)
    234 ////////////////////////////////////////////////////////////////////////////
    235 ColumnVector t_ephGlo::glo_deriv(double /* tt */, const ColumnVector& xv,
    236                                  double* acc) {
    237 
    238   // State vector components
    239   // -----------------------
    240   ColumnVector rr = xv.rows(1,3);
    241   ColumnVector vv = xv.rows(4,6);
    242 
    243   // Acceleration
     407// RINEX Format String
     408//////////////////////////////////////////////////////////////////////////////
     409QString t_ephGPS::toString(double version) const {
     410
     411  QString rnxStr = rinexDateStr(_TOC, _prn, version);
     412
     413  QTextStream out(&rnxStr);
     414
     415  out << QString("%1%2%3\n")
     416    .arg(_clock_bias,      19, 'e', 12)
     417    .arg(_clock_drift,     19, 'e', 12)
     418    .arg(_clock_driftrate, 19, 'e', 12);
     419
     420  QString fmt = version < 3.0 ? "   %1%2%3%4\n" : "    %1%2%3%4\n";
     421
     422  out << QString(fmt)
     423    .arg(_IODE,    19, 'e', 12)
     424    .arg(_Crs,     19, 'e', 12)
     425    .arg(_Delta_n, 19, 'e', 12)
     426    .arg(_M0,      19, 'e', 12);
     427
     428  out << QString(fmt)
     429    .arg(_Cuc,    19, 'e', 12)
     430    .arg(_e,      19, 'e', 12)
     431    .arg(_Cus,    19, 'e', 12)
     432    .arg(_sqrt_A, 19, 'e', 12);
     433
     434  out << QString(fmt)
     435    .arg(_TOEsec, 19, 'e', 12)
     436    .arg(_Cic,    19, 'e', 12)
     437    .arg(_OMEGA0, 19, 'e', 12)
     438    .arg(_Cis,    19, 'e', 12);
     439
     440  out << QString(fmt)
     441    .arg(_i0,       19, 'e', 12)
     442    .arg(_Crc,      19, 'e', 12)
     443    .arg(_omega,    19, 'e', 12)
     444    .arg(_OMEGADOT, 19, 'e', 12);
     445
     446  out << QString(fmt)
     447    .arg(_IDOT,    19, 'e', 12)
     448    .arg(_L2Codes, 19, 'e', 12)
     449    .arg(_TOEweek, 19, 'e', 12)
     450    .arg(_L2PFlag, 19, 'e', 12);
     451
     452  out << QString(fmt)
     453    .arg(_ura,    19, 'e', 12)
     454    .arg(_health, 19, 'e', 12)
     455    .arg(_TGD,    19, 'e', 12)
     456    .arg(_IODC,   19, 'e', 12);
     457
     458  out << QString(fmt)
     459    .arg(_TOT,         19, 'e', 12)
     460    .arg(_fitInterval, 19, 'e', 12)
     461    .arg("",           19, QChar(' '))
     462    .arg("",           19, QChar(' '));
     463
     464  return rnxStr;
     465}
     466
     467// Constructor
     468//////////////////////////////////////////////////////////////////////////////
     469t_ephGlo::t_ephGlo(float rnxVersion, const QStringList& lines) {
     470
     471  const int nLines = 4;
     472
     473  if (lines.size() != nLines) {
     474    _checkState = bad;
     475    return;
     476  }
     477
     478  // RINEX Format
    244479  // ------------
    245   static const double gmWGS = 398.60044e12;
    246   static const double AE    = 6378136.0;
    247   static const double OMEGA = 7292115.e-11;
    248   static const double C20   = -1082.6257e-6;
    249 
    250   double rho = rr.norm_Frobenius();
    251   double t1  = -gmWGS/(rho*rho*rho);
    252   double t2  = 3.0/2.0 * C20 * (gmWGS*AE*AE) / (rho*rho*rho*rho*rho);
    253   double t3  = OMEGA * OMEGA;
    254   double t4  = 2.0 * OMEGA;
    255   double z2  = rr(3) * rr(3);
    256 
    257   // Vector of derivatives
    258   // ---------------------
    259   ColumnVector va(6);
    260   va(1) = vv(1);
    261   va(2) = vv(2);
    262   va(3) = vv(3);
    263   va(4) = (t1 + t2*(1.0-5.0*z2/(rho*rho)) + t3) * rr(1) + t4*vv(2) + acc[0];
    264   va(5) = (t1 + t2*(1.0-5.0*z2/(rho*rho)) + t3) * rr(2) - t4*vv(1) + acc[1];
    265   va(6) = (t1 + t2*(3.0-5.0*z2/(rho*rho))     ) * rr(3)            + acc[2];
    266 
    267   return va;
    268 }
    269 
    270 // Compute Glonass Satellite Position (virtual)
    271 ////////////////////////////////////////////////////////////////////////////
    272 t_irc t_ephGlo::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
    273 
    274   if (_checkState == bad) {
    275     return failure;
    276   }
    277 
    278   static const double nominalStep = 10.0;
    279 
    280   memset(xc, 0, 4*sizeof(double));
    281   memset(vv, 0, 3*sizeof(double));
    282 
    283   double dtPos = bncTime(GPSweek, GPSweeks) - _tt;
    284 
    285   if (fabs(dtPos) > 24*3600.0) {
    286     return failure;
    287   }
    288 
    289   int nSteps  = int(fabs(dtPos) / nominalStep) + 1;
    290   double step = dtPos / nSteps;
    291 
    292   double acc[3];
    293   acc[0] = _x_acceleration * 1.e3;
    294   acc[1] = _y_acceleration * 1.e3;
    295   acc[2] = _z_acceleration * 1.e3;
    296   for (int ii = 1; ii <= nSteps; ii++) {
    297     _xv = rungeKutta4(_tt.gpssec(), _xv, step, acc, glo_deriv);
    298     _tt = _tt + step;
    299   }
    300 
    301   // Position and Velocity
    302   // ---------------------
    303   xc[0] = _xv(1);
    304   xc[1] = _xv(2);
    305   xc[2] = _xv(3);
    306 
    307   vv[0] = _xv(4);
    308   vv[1] = _xv(5);
    309   vv[2] = _xv(6);
    310 
    311   // Clock Correction
    312   // ----------------
    313   double dtClk = bncTime(GPSweek, GPSweeks) - _TOC;
    314   xc[3] = -_tau + _gamma * dtClk;
    315 
    316   return success;
    317 }
    318 
    319 // IOD of Glonass Ephemeris (virtual)
    320 ////////////////////////////////////////////////////////////////////////////
    321 int t_ephGlo::IOD() const {
    322   bncTime tMoscow = _TOC - _gps_utc + 3 * 3600.0;
    323   return int(tMoscow.daysec() / 900);
     480  int fieldLen = 19;
     481
     482  int pos[4];
     483  pos[0] = (rnxVersion <= 2.12) ?  3 :  4;
     484  pos[1] = pos[0] + fieldLen;
     485  pos[2] = pos[1] + fieldLen;
     486  pos[3] = pos[2] + fieldLen;
     487
     488  // Read four lines
     489  // ---------------
     490  for (int iLine = 0; iLine < nLines; iLine++) {
     491    QString line = lines[iLine];
     492
     493    if      ( iLine == 0 ) {
     494      QTextStream in(line.left(pos[1]).toAscii());
     495
     496      int    year, month, day, hour, min;
     497      double sec;
     498
     499      QString prnStr;
     500      in >> prnStr >> year >> month >> day >> hour >> min >> sec;
     501      if (prnStr.at(0) == 'R') {
     502        _prn.set('R', prnStr.mid(1).toInt());
     503      }
     504      else {
     505        _prn.set('R', prnStr.toInt());
     506      }
     507
     508      if      (year <  80) {
     509        year += 2000;
     510      }
     511      else if (year < 100) {
     512        year += 1900;
     513      }
     514
     515      _gps_utc = gnumleap(year, month, day);
     516
     517      _TOC.set(year, month, day, hour, min, sec);
     518      _TOC  = _TOC + _gps_utc;
     519
     520      if ( readDbl(line, pos[1], fieldLen, _tau  ) ||
     521           readDbl(line, pos[2], fieldLen, _gamma) ||
     522           readDbl(line, pos[3], fieldLen, _tki  ) ) {
     523        _checkState = bad;
     524        return;
     525      }
     526
     527      _tau = -_tau;
     528    }
     529
     530    else if      ( iLine == 1 ) {
     531      if ( readDbl(line, pos[0], fieldLen, _x_pos         ) ||
     532           readDbl(line, pos[1], fieldLen, _x_velocity    ) ||
     533           readDbl(line, pos[2], fieldLen, _x_acceleration) ||
     534           readDbl(line, pos[3], fieldLen, _health        ) ) {
     535        _checkState = bad;
     536        return;
     537      }
     538    }
     539
     540    else if ( iLine == 2 ) {
     541      if ( readDbl(line, pos[0], fieldLen, _y_pos           ) ||
     542           readDbl(line, pos[1], fieldLen, _y_velocity      ) ||
     543           readDbl(line, pos[2], fieldLen, _y_acceleration  ) ||
     544           readDbl(line, pos[3], fieldLen, _frequency_number) ) {
     545        _checkState = bad;
     546        return;
     547      }
     548    }
     549
     550    else if ( iLine == 3 ) {
     551      if ( readDbl(line, pos[0], fieldLen, _z_pos         )  ||
     552           readDbl(line, pos[1], fieldLen, _z_velocity    )  ||
     553           readDbl(line, pos[2], fieldLen, _z_acceleration)  ||
     554           readDbl(line, pos[3], fieldLen, _E             ) ) {
     555        _checkState = bad;
     556        return;
     557      }
     558    }
     559  }
     560
     561  // Initialize status vector
     562  // ------------------------
     563  _tt = _TOC;
     564  _xv.ReSize(6);
     565  _xv(1) = _x_pos * 1.e3;
     566  _xv(2) = _y_pos * 1.e3;
     567  _xv(3) = _z_pos * 1.e3;
     568  _xv(4) = _x_velocity * 1.e3;
     569  _xv(5) = _y_velocity * 1.e3;
     570  _xv(6) = _z_velocity * 1.e3;
    324571}
    325572
     
    419666}
    420667
     668// Compute Glonass Satellite Position (virtual)
     669////////////////////////////////////////////////////////////////////////////
     670t_irc t_ephGlo::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
     671
     672  if (_checkState == bad) {
     673    return failure;
     674  }
     675
     676  static const double nominalStep = 10.0;
     677
     678  memset(xc, 0, 4*sizeof(double));
     679  memset(vv, 0, 3*sizeof(double));
     680
     681  double dtPos = bncTime(GPSweek, GPSweeks) - _tt;
     682
     683  if (fabs(dtPos) > 24*3600.0) {
     684    return failure;
     685  }
     686
     687  int nSteps  = int(fabs(dtPos) / nominalStep) + 1;
     688  double step = dtPos / nSteps;
     689
     690  double acc[3];
     691  acc[0] = _x_acceleration * 1.e3;
     692  acc[1] = _y_acceleration * 1.e3;
     693  acc[2] = _z_acceleration * 1.e3;
     694  for (int ii = 1; ii <= nSteps; ii++) {
     695    _xv = rungeKutta4(_tt.gpssec(), _xv, step, acc, glo_deriv);
     696    _tt = _tt + step;
     697  }
     698
     699  // Position and Velocity
     700  // ---------------------
     701  xc[0] = _xv(1);
     702  xc[1] = _xv(2);
     703  xc[2] = _xv(3);
     704
     705  vv[0] = _xv(4);
     706  vv[1] = _xv(5);
     707  vv[2] = _xv(6);
     708
     709  // Clock Correction
     710  // ----------------
     711  double dtClk = bncTime(GPSweek, GPSweeks) - _TOC;
     712  xc[3] = -_tau + _gamma * dtClk;
     713
     714  return success;
     715}
     716
     717// RINEX Format String
     718//////////////////////////////////////////////////////////////////////////////
     719QString t_ephGlo::toString(double version) const {
     720
     721  QString rnxStr = rinexDateStr(_TOC-_gps_utc, _prn, version);
     722
     723  QTextStream out(&rnxStr);
     724
     725  out << QString("%1%2%3\n")
     726    .arg(-_tau,  19, 'e', 12)
     727    .arg(_gamma, 19, 'e', 12)
     728    .arg(_tki,   19, 'e', 12);
     729
     730  QString fmt = version < 3.0 ? "   %1%2%3%4\n" : "    %1%2%3%4\n";
     731
     732  out << QString(fmt)
     733    .arg(_x_pos,          19, 'e', 12)
     734    .arg(_x_velocity,     19, 'e', 12)
     735    .arg(_x_acceleration, 19, 'e', 12)
     736    .arg(_health,         19, 'e', 12);
     737
     738  out << QString(fmt)
     739    .arg(_y_pos,            19, 'e', 12)
     740    .arg(_y_velocity,       19, 'e', 12)
     741    .arg(_y_acceleration,   19, 'e', 12)
     742    .arg(_frequency_number, 19, 'e', 12);
     743
     744  out << QString(fmt)
     745    .arg(_z_pos,          19, 'e', 12)
     746    .arg(_z_velocity,     19, 'e', 12)
     747    .arg(_z_acceleration, 19, 'e', 12)
     748    .arg(_E,              19, 'e', 12);
     749
     750  return rnxStr;
     751}
     752
     753// Derivative of the state vector using a simple force model (static)
     754////////////////////////////////////////////////////////////////////////////
     755ColumnVector t_ephGlo::glo_deriv(double /* tt */, const ColumnVector& xv,
     756                                 double* acc) {
     757
     758  // State vector components
     759  // -----------------------
     760  ColumnVector rr = xv.rows(1,3);
     761  ColumnVector vv = xv.rows(4,6);
     762
     763  // Acceleration
     764  // ------------
     765  static const double gmWGS = 398.60044e12;
     766  static const double AE    = 6378136.0;
     767  static const double OMEGA = 7292115.e-11;
     768  static const double C20   = -1082.6257e-6;
     769
     770  double rho = rr.norm_Frobenius();
     771  double t1  = -gmWGS/(rho*rho*rho);
     772  double t2  = 3.0/2.0 * C20 * (gmWGS*AE*AE) / (rho*rho*rho*rho*rho);
     773  double t3  = OMEGA * OMEGA;
     774  double t4  = 2.0 * OMEGA;
     775  double z2  = rr(3) * rr(3);
     776
     777  // Vector of derivatives
     778  // ---------------------
     779  ColumnVector va(6);
     780  va(1) = vv(1);
     781  va(2) = vv(2);
     782  va(3) = vv(3);
     783  va(4) = (t1 + t2*(1.0-5.0*z2/(rho*rho)) + t3) * rr(1) + t4*vv(2) + acc[0];
     784  va(5) = (t1 + t2*(1.0-5.0*z2/(rho*rho)) + t3) * rr(2) - t4*vv(1) + acc[1];
     785  va(6) = (t1 + t2*(3.0-5.0*z2/(rho*rho))     ) * rr(3)            + acc[2];
     786
     787  return va;
     788}
     789
     790// IOD of Glonass Ephemeris (virtual)
     791////////////////////////////////////////////////////////////////////////////
     792int t_ephGlo::IOD() const {
     793  bncTime tMoscow = _TOC - _gps_utc + 3 * 3600.0;
     794  return int(tMoscow.daysec() / 900);
     795}
     796
     797// Constructor
     798//////////////////////////////////////////////////////////////////////////////
     799t_ephGal::t_ephGal(float rnxVersion, const QStringList& lines) {
     800
     801  const int nLines = 8;
     802
     803  if (lines.size() != nLines) {
     804    _checkState = bad;
     805    return;
     806  }
     807
     808  // RINEX Format
     809  // ------------
     810  int fieldLen = 19;
     811  double SVhealth = 0.0;
     812  double datasource = 0.0;
     813
     814  int pos[4];
     815  pos[0] = (rnxVersion <= 2.12) ?  3 :  4;
     816  pos[1] = pos[0] + fieldLen;
     817  pos[2] = pos[1] + fieldLen;
     818  pos[3] = pos[2] + fieldLen;
     819
     820  // Read eight lines
     821  // ----------------
     822  for (int iLine = 0; iLine < nLines; iLine++) {
     823    QString line = lines[iLine];
     824
     825    if      ( iLine == 0 ) {
     826      QTextStream in(line.left(pos[1]).toAscii());
     827
     828      int    year, month, day, hour, min;
     829      double sec;
     830     
     831      QString prnStr;
     832      in >> prnStr >> year >> month >> day >> hour >> min >> sec;
     833      if (prnStr.at(0) == 'E') {
     834        _prn.set('E', prnStr.mid(1).toInt());
     835      }
     836      else {
     837        _prn.set('E', prnStr.toInt());
     838      }
     839
     840      if      (year <  80) {
     841        year += 2000;
     842      }
     843      else if (year < 100) {
     844        year += 1900;
     845      }
     846
     847      _TOC.set(year, month, day, hour, min, sec);
     848
     849      if ( readDbl(line, pos[1], fieldLen, _clock_bias     ) ||
     850           readDbl(line, pos[2], fieldLen, _clock_drift    ) ||
     851           readDbl(line, pos[3], fieldLen, _clock_driftrate) ) {
     852        _checkState = bad;
     853        return;
     854      }
     855    }
     856
     857    else if      ( iLine == 1 ) {
     858      if ( readDbl(line, pos[0], fieldLen, _IODnav ) ||
     859           readDbl(line, pos[1], fieldLen, _Crs    ) ||
     860           readDbl(line, pos[2], fieldLen, _Delta_n) ||
     861           readDbl(line, pos[3], fieldLen, _M0     ) ) {
     862        _checkState = bad;
     863        return;
     864      }
     865    }
     866
     867    else if ( iLine == 2 ) {
     868      if ( readDbl(line, pos[0], fieldLen, _Cuc   ) ||
     869           readDbl(line, pos[1], fieldLen, _e     ) ||
     870           readDbl(line, pos[2], fieldLen, _Cus   ) ||
     871           readDbl(line, pos[3], fieldLen, _sqrt_A) ) {
     872        _checkState = bad;
     873        return;
     874      }
     875    }
     876
     877    else if ( iLine == 3 ) {
     878      if ( readDbl(line, pos[0], fieldLen, _TOEsec)  ||
     879           readDbl(line, pos[1], fieldLen, _Cic   )  ||
     880           readDbl(line, pos[2], fieldLen, _OMEGA0)  ||
     881           readDbl(line, pos[3], fieldLen, _Cis   ) ) {
     882        _checkState = bad;
     883        return;
     884      }
     885    }
     886
     887    else if ( iLine == 4 ) {
     888      if ( readDbl(line, pos[0], fieldLen, _i0      ) ||
     889           readDbl(line, pos[1], fieldLen, _Crc     ) ||
     890           readDbl(line, pos[2], fieldLen, _omega   ) ||
     891           readDbl(line, pos[3], fieldLen, _OMEGADOT) ) {
     892        _checkState = bad;
     893        return;
     894      }
     895    }
     896
     897    else if ( iLine == 5 ) {
     898      if ( readDbl(line, pos[0], fieldLen, _IDOT      ) ||
     899           readDbl(line, pos[1], fieldLen, datasource) ||
     900           readDbl(line, pos[2], fieldLen, _TOEweek   ) ) {
     901        _checkState = bad;
     902        return;
     903      } else {
     904        if        (int(datasource) & (1<<8)) {
     905          _flags |= GALEPHF_FNAV;
     906        } else if (int(datasource) & (1<<9)) {
     907          _flags |= GALEPHF_INAV;
     908        }
     909      }
     910    }
     911
     912    else if ( iLine == 6 ) {
     913      if ( readDbl(line, pos[0], fieldLen, _SISA    ) ||
     914           readDbl(line, pos[1], fieldLen,  SVhealth) ||
     915           readDbl(line, pos[2], fieldLen, _BGD_1_5A) ||
     916           readDbl(line, pos[3], fieldLen, _BGD_1_5B) ) {
     917        _checkState = bad;
     918        return;
     919      } else {
     920        // Bit 0
     921        if (int(SVhealth) & (1<<0)) {
     922          _flags |= GALEPHF_E1DINVALID;
     923        }
     924        // Bit 1-2
     925        _E1_bHS = double((int(SVhealth) >> 1) & 0x2);
     926        // Bit 3
     927        if (int(SVhealth) & (1<<3)) {
     928          _flags |= GALEPHF_E5ADINVALID;
     929        }
     930        // Bit 4-5
     931        _E5aHS = double((int(SVhealth) >> 4) & 0x2);
     932        // Bit 6
     933        if (int(SVhealth) & (1<<6)) {
     934          _flags |= GALEPHF_E5BDINVALID;
     935        }
     936        // Bit 7-8
     937        _E5bHS = double((int(SVhealth) >> 7) & 0x2);
     938      }
     939    }
     940
     941    else if ( iLine == 7 ) {
     942      if ( readDbl(line, pos[0], fieldLen, _TOT) ) {
     943        _checkState = bad;
     944        return;
     945      }
     946    }
     947  }
     948}
     949
    421950// Set Galileo Satellite Position
    422951////////////////////////////////////////////////////////////////////////////
     
    456985  _IDOT     = ee->IDOT;
    457986  _TOEweek  = ee->Week;
    458  
     987
    459988  _SISA = accuracyFromIndex(ee->SISA, type());
    460989  _E5aHS    = ee->E5aHS;
     
    5101039  double xp     = r*cos(u);
    5111040  double yp     = r*sin(u);
    512   double OM     = _OMEGA0 + (_OMEGADOT - omegaEarth)*tk - 
     1041  double OM     = _OMEGA0 + (_OMEGADOT - omegaEarth)*tk -
    5131042                  omegaEarth*_TOEsec;
    514  
     1043
    5151044  double sinom = sin(OM);
    5161045  double cosom = cos(OM);
     
    5191048  xc[0] = xp*cosom - yp*cosi*sinom;
    5201049  xc[1] = xp*sinom + yp*cosi*cosom;
    521   xc[2] = yp*sini;                 
    522  
     1050  xc[2] = yp*sini;
     1051
    5231052  double tc = tt - _TOC;
    5241053  xc[3] = _clock_bias + _clock_drift*tc + _clock_driftrate*tc*tc;
     
    5281057  double tanv2 = tan(v/2);
    5291058  double dEdM  = 1 / (1 - _e*cos(E));
    530   double dotv  = sqrt((1.0 + _e)/(1.0 - _e)) / cos(E/2)/cos(E/2) / (1 + tanv2*tanv2) 
     1059  double dotv  = sqrt((1.0 + _e)/(1.0 - _e)) / cos(E/2)/cos(E/2) / (1 + tanv2*tanv2)
    5311060               * dEdM * n;
    5321061  double dotu  = dotv + (-_Cuc*sin2u0 + _Cus*cos2u0)*2*dotv;
    5331062  double dotom = _OMEGADOT - omegaEarth;
    5341063  double doti  = _IDOT + (-_Cic*sin2u0 + _Cis*cos2u0)*2*dotv;
    535   double dotr  = a0 * _e*sin(E) * dEdM * n 
     1064  double dotr  = a0 * _e*sin(E) * dEdM * n
    5361065                + (-_Crc*sin2u0 + _Crs*cos2u0)*2*dotv;
    5371066  double dotx  = dotr*cos(u) - r*sin(u)*dotu;
     
    5541083
    5551084  return success;
    556 }
    557 
    558 // Constructor
    559 //////////////////////////////////////////////////////////////////////////////
    560 t_ephGPS::t_ephGPS(float rnxVersion, const QStringList& lines) {
    561 
    562   const int nLines = 8;
    563 
    564   if (lines.size() != nLines) {
    565     _checkState = bad;
    566     return;
    567   }
    568 
    569   // RINEX Format
    570   // ------------
    571   int fieldLen = 19;
    572 
    573   int pos[4];
    574   pos[0] = (rnxVersion <= 2.12) ?  3 :  4;
    575   pos[1] = pos[0] + fieldLen;
    576   pos[2] = pos[1] + fieldLen;
    577   pos[3] = pos[2] + fieldLen;
    578 
    579   // Read eight lines
    580   // ----------------
    581   for (int iLine = 0; iLine < nLines; iLine++) {
    582     QString line = lines[iLine];
    583 
    584     if      ( iLine == 0 ) {
    585       QTextStream in(line.left(pos[1]).toAscii());
    586 
    587       int    year, month, day, hour, min;
    588       double sec;
    589      
    590       QString prnStr;
    591       in >> prnStr >> year >> month >> day >> hour >> min >> sec;
    592       if      (prnStr.at(0) == 'G') {
    593         _prn.set('G', prnStr.mid(1).toInt());
    594       }
    595       else if (prnStr.at(0) == 'J') {
    596         _prn.set('J', prnStr.mid(1).toInt());
    597       }
    598       else {
    599         _prn.set('G', prnStr.toInt());
    600       }
    601 
    602       if      (year <  80) {
    603         year += 2000;
    604       }
    605       else if (year < 100) {
    606         year += 1900;
    607       }
    608 
    609       _TOC.set(year, month, day, hour, min, sec);
    610 
    611       if ( readDbl(line, pos[1], fieldLen, _clock_bias     ) ||
    612            readDbl(line, pos[2], fieldLen, _clock_drift    ) ||
    613            readDbl(line, pos[3], fieldLen, _clock_driftrate) ) {
    614         _checkState = bad;
    615         return;
    616       }
    617     }
    618 
    619     else if      ( iLine == 1 ) {
    620       if ( readDbl(line, pos[0], fieldLen, _IODE   ) ||
    621            readDbl(line, pos[1], fieldLen, _Crs    ) ||
    622            readDbl(line, pos[2], fieldLen, _Delta_n) ||
    623            readDbl(line, pos[3], fieldLen, _M0     ) ) {
    624         _checkState = bad;
    625         return;
    626       }
    627     }
    628 
    629     else if ( iLine == 2 ) {
    630       if ( readDbl(line, pos[0], fieldLen, _Cuc   ) ||
    631            readDbl(line, pos[1], fieldLen, _e     ) ||
    632            readDbl(line, pos[2], fieldLen, _Cus   ) ||
    633            readDbl(line, pos[3], fieldLen, _sqrt_A) ) {
    634         _checkState = bad;
    635         return;
    636       }
    637     }
    638 
    639     else if ( iLine == 3 ) {
    640       if ( readDbl(line, pos[0], fieldLen, _TOEsec)  ||
    641            readDbl(line, pos[1], fieldLen, _Cic   )  ||
    642            readDbl(line, pos[2], fieldLen, _OMEGA0)  ||
    643            readDbl(line, pos[3], fieldLen, _Cis   ) ) {
    644         _checkState = bad;
    645         return;
    646       }
    647     }
    648 
    649     else if ( iLine == 4 ) {
    650       if ( readDbl(line, pos[0], fieldLen, _i0      ) ||
    651            readDbl(line, pos[1], fieldLen, _Crc     ) ||
    652            readDbl(line, pos[2], fieldLen, _omega   ) ||
    653            readDbl(line, pos[3], fieldLen, _OMEGADOT) ) {
    654         _checkState = bad;
    655         return;
    656       }
    657     }
    658 
    659     else if ( iLine == 5 ) {
    660       if ( readDbl(line, pos[0], fieldLen, _IDOT   ) ||
    661            readDbl(line, pos[1], fieldLen, _L2Codes) ||
    662            readDbl(line, pos[2], fieldLen, _TOEweek  ) ||
    663            readDbl(line, pos[3], fieldLen, _L2PFlag) ) {
    664         _checkState = bad;
    665         return;
    666       }
    667     }
    668 
    669     else if ( iLine == 6 ) {
    670       if ( readDbl(line, pos[0], fieldLen, _ura   ) ||
    671            readDbl(line, pos[1], fieldLen, _health) ||
    672            readDbl(line, pos[2], fieldLen, _TGD   ) ||
    673            readDbl(line, pos[3], fieldLen, _IODC  ) ) {
    674         _checkState = bad;
    675         return;
    676       }
    677     }
    678 
    679     else if ( iLine == 7 ) {
    680       if ( readDbl(line, pos[0], fieldLen, _TOT) ) {
    681         _checkState = bad;
    682         return;
    683       }
    684       readDbl(line, pos[1], fieldLen, _fitInterval); // _fitInterval optional
    685     }
    686   }
    687 }
    688 
    689 // Constructor
    690 //////////////////////////////////////////////////////////////////////////////
    691 t_ephGlo::t_ephGlo(float rnxVersion, const QStringList& lines) {
    692 
    693   const int nLines = 4;
    694 
    695   if (lines.size() != nLines) {
    696     _checkState = bad;
    697     return;
    698   }
    699 
    700   // RINEX Format
    701   // ------------
    702   int fieldLen = 19;
    703 
    704   int pos[4];
    705   pos[0] = (rnxVersion <= 2.12) ?  3 :  4;
    706   pos[1] = pos[0] + fieldLen;
    707   pos[2] = pos[1] + fieldLen;
    708   pos[3] = pos[2] + fieldLen;
    709 
    710   // Read four lines
    711   // ---------------
    712   for (int iLine = 0; iLine < nLines; iLine++) {
    713     QString line = lines[iLine];
    714 
    715     if      ( iLine == 0 ) {
    716       QTextStream in(line.left(pos[1]).toAscii());
    717 
    718       int    year, month, day, hour, min;
    719       double sec;
    720      
    721       QString prnStr;
    722       in >> prnStr >> year >> month >> day >> hour >> min >> sec;
    723       if (prnStr.at(0) == 'R') {
    724         _prn.set('R', prnStr.mid(1).toInt());
    725       }
    726       else {
    727         _prn.set('R', prnStr.toInt());
    728       }
    729 
    730       if      (year <  80) {
    731         year += 2000;
    732       }
    733       else if (year < 100) {
    734         year += 1900;
    735       }
    736 
    737       _gps_utc = gnumleap(year, month, day);
    738 
    739       _TOC.set(year, month, day, hour, min, sec);
    740       _TOC  = _TOC + _gps_utc;
    741 
    742       if ( readDbl(line, pos[1], fieldLen, _tau  ) ||
    743            readDbl(line, pos[2], fieldLen, _gamma) ||
    744            readDbl(line, pos[3], fieldLen, _tki  ) ) {
    745         _checkState = bad;
    746         return;
    747       }
    748 
    749       _tau = -_tau;
    750     }
    751 
    752     else if      ( iLine == 1 ) {
    753       if ( readDbl(line, pos[0], fieldLen, _x_pos         ) ||
    754            readDbl(line, pos[1], fieldLen, _x_velocity    ) ||
    755            readDbl(line, pos[2], fieldLen, _x_acceleration) ||
    756            readDbl(line, pos[3], fieldLen, _health        ) ) {
    757         _checkState = bad;
    758         return;
    759       }
    760     }
    761 
    762     else if ( iLine == 2 ) {
    763       if ( readDbl(line, pos[0], fieldLen, _y_pos           ) ||
    764            readDbl(line, pos[1], fieldLen, _y_velocity      ) ||
    765            readDbl(line, pos[2], fieldLen, _y_acceleration  ) ||
    766            readDbl(line, pos[3], fieldLen, _frequency_number) ) {
    767         _checkState = bad;
    768         return;
    769       }
    770     }
    771 
    772     else if ( iLine == 3 ) {
    773       if ( readDbl(line, pos[0], fieldLen, _z_pos         )  ||
    774            readDbl(line, pos[1], fieldLen, _z_velocity    )  ||
    775            readDbl(line, pos[2], fieldLen, _z_acceleration)  ||
    776            readDbl(line, pos[3], fieldLen, _E             ) ) {
    777         _checkState = bad;
    778         return;
    779       }
    780     }
    781   }
    782 
    783   // Initialize status vector
    784   // ------------------------
    785   _tt = _TOC;
    786   _xv.ReSize(6);
    787   _xv(1) = _x_pos * 1.e3;
    788   _xv(2) = _y_pos * 1.e3;
    789   _xv(3) = _z_pos * 1.e3;
    790   _xv(4) = _x_velocity * 1.e3;
    791   _xv(5) = _y_velocity * 1.e3;
    792   _xv(6) = _z_velocity * 1.e3;
    793 }
    794 
    795 // Constructor
    796 //////////////////////////////////////////////////////////////////////////////
    797 t_ephGal::t_ephGal(float rnxVersion, const QStringList& lines) {
    798 
    799   const int nLines = 8;
    800 
    801   if (lines.size() != nLines) {
    802     _checkState = bad;
    803     return;
    804   }
    805 
    806   // RINEX Format
    807   // ------------
    808   int fieldLen = 19;
    809   double SVhealth = 0.0;
    810   double datasource = 0.0;
    811 
    812   int pos[4];
    813   pos[0] = (rnxVersion <= 2.12) ?  3 :  4;
    814   pos[1] = pos[0] + fieldLen;
    815   pos[2] = pos[1] + fieldLen;
    816   pos[3] = pos[2] + fieldLen;
    817 
    818   // Read eight lines
    819   // ----------------
    820   for (int iLine = 0; iLine < nLines; iLine++) {
    821     QString line = lines[iLine];
    822 
    823     if      ( iLine == 0 ) {
    824       QTextStream in(line.left(pos[1]).toAscii());
    825 
    826       int    year, month, day, hour, min;
    827       double sec;
    828      
    829       QString prnStr;
    830       in >> prnStr >> year >> month >> day >> hour >> min >> sec;
    831       if (prnStr.at(0) == 'E') {
    832         _prn.set('E', prnStr.mid(1).toInt());
    833       }
    834       else {
    835         _prn.set('E', prnStr.toInt());
    836       }
    837 
    838       if      (year <  80) {
    839         year += 2000;
    840       }
    841       else if (year < 100) {
    842         year += 1900;
    843       }
    844 
    845       _TOC.set(year, month, day, hour, min, sec);
    846 
    847       if ( readDbl(line, pos[1], fieldLen, _clock_bias     ) ||
    848            readDbl(line, pos[2], fieldLen, _clock_drift    ) ||
    849            readDbl(line, pos[3], fieldLen, _clock_driftrate) ) {
    850         _checkState = bad;
    851         return;
    852       }
    853     }
    854 
    855     else if      ( iLine == 1 ) {
    856       if ( readDbl(line, pos[0], fieldLen, _IODnav ) ||
    857            readDbl(line, pos[1], fieldLen, _Crs    ) ||
    858            readDbl(line, pos[2], fieldLen, _Delta_n) ||
    859            readDbl(line, pos[3], fieldLen, _M0     ) ) {
    860         _checkState = bad;
    861         return;
    862       }
    863     }
    864 
    865     else if ( iLine == 2 ) {
    866       if ( readDbl(line, pos[0], fieldLen, _Cuc   ) ||
    867            readDbl(line, pos[1], fieldLen, _e     ) ||
    868            readDbl(line, pos[2], fieldLen, _Cus   ) ||
    869            readDbl(line, pos[3], fieldLen, _sqrt_A) ) {
    870         _checkState = bad;
    871         return;
    872       }
    873     }
    874 
    875     else if ( iLine == 3 ) {
    876       if ( readDbl(line, pos[0], fieldLen, _TOEsec)  ||
    877            readDbl(line, pos[1], fieldLen, _Cic   )  ||
    878            readDbl(line, pos[2], fieldLen, _OMEGA0)  ||
    879            readDbl(line, pos[3], fieldLen, _Cis   ) ) {
    880         _checkState = bad;
    881         return;
    882       }
    883     }
    884 
    885     else if ( iLine == 4 ) {
    886       if ( readDbl(line, pos[0], fieldLen, _i0      ) ||
    887            readDbl(line, pos[1], fieldLen, _Crc     ) ||
    888            readDbl(line, pos[2], fieldLen, _omega   ) ||
    889            readDbl(line, pos[3], fieldLen, _OMEGADOT) ) {
    890         _checkState = bad;
    891         return;
    892       }
    893     }
    894 
    895     else if ( iLine == 5 ) {
    896       if ( readDbl(line, pos[0], fieldLen, _IDOT      ) ||
    897            readDbl(line, pos[1], fieldLen, datasource) ||
    898            readDbl(line, pos[2], fieldLen, _TOEweek   ) ) {
    899         _checkState = bad;
    900         return;
    901       } else {
    902         if        (int(datasource) & (1<<8)) {
    903           _flags |= GALEPHF_FNAV;
    904         } else if (int(datasource) & (1<<9)) {
    905           _flags |= GALEPHF_INAV;
    906         }
    907       }
    908     }
    909 
    910     else if ( iLine == 6 ) {
    911       if ( readDbl(line, pos[0], fieldLen, _SISA    ) ||
    912            readDbl(line, pos[1], fieldLen,  SVhealth) ||
    913            readDbl(line, pos[2], fieldLen, _BGD_1_5A) ||
    914            readDbl(line, pos[3], fieldLen, _BGD_1_5B) ) {
    915         _checkState = bad;
    916         return;
    917       } else {
    918         // Bit 0
    919         if (int(SVhealth) & (1<<0)) {
    920           _flags |= GALEPHF_E1DINVALID;
    921         }
    922         // Bit 1-2
    923         _E1_bHS = double((int(SVhealth) >> 1) & 0x3);
    924         // Bit 3
    925         if (int(SVhealth) & (1<<3)) {
    926           _flags |= GALEPHF_E5ADINVALID;
    927         }
    928         // Bit 4-5
    929         _E5aHS = double((int(SVhealth) >> 4) & 0x3);
    930         // Bit 6
    931         if (int(SVhealth) & (1<<6)) {
    932           _flags |= GALEPHF_E5BDINVALID;
    933         }
    934         // Bit 7-8
    935         _E5bHS = double((int(SVhealth) >> 7) & 0x3);
    936       }
    937     }
    938 
    939     else if ( iLine == 7 ) {
    940       if ( readDbl(line, pos[0], fieldLen, _TOT) ) {
    941         _checkState = bad;
    942         return;
    943       }
    944     }
    945   }
    946 }
    947 
    948 //
    949 //////////////////////////////////////////////////////////////////////////////
    950 QString t_eph::rinexDateStr(const bncTime& tt, const t_prn& prn, double version) {
    951   QString prnStr(prn.toString().c_str());
    952   return rinexDateStr(tt, prnStr, version);
    953 }
    954 
    955 //
    956 //////////////////////////////////////////////////////////////////////////////
    957 QString t_eph::rinexDateStr(const bncTime& tt, const QString& prnStr, double version) {
    958 
    959   QString datStr;
    960  
    961   unsigned year, month, day, hour, min;
    962   double   sec;
    963   tt.civil_date(year, month, day);
    964   tt.civil_time(hour, min, sec);
    965  
    966   QTextStream out(&datStr);
    967 
    968   if (version < 3.0) {
    969     QString prnHlp = prnStr.mid(1,2); if (prnHlp[0] == '0') prnHlp[0] = ' ';
    970     out << prnHlp << QString(" %1 %2 %3 %4 %5%6")
    971       .arg(year % 100, 2, 10, QChar('0'))
    972       .arg(month,      2)
    973       .arg(day,        2)
    974       .arg(hour,       2)
    975       .arg(min,        2)
    976       .arg(sec, 5, 'f',1);
    977   }
    978   else {
    979     out << prnStr << QString(" %1 %2 %3 %4 %5 %6")
    980       .arg(year,     4)
    981       .arg(month,    2, 10, QChar('0'))
    982       .arg(day,      2, 10, QChar('0'))
    983       .arg(hour,     2, 10, QChar('0'))
    984       .arg(min,      2, 10, QChar('0'))
    985       .arg(int(sec), 2, 10, QChar('0'));
    986   }
    987 
    988   return datStr;
    989 }
    990 
    991 // RINEX Format String
    992 //////////////////////////////////////////////////////////////////////////////
    993 QString t_ephGPS::toString(double version) const {
    994 
    995   QString rnxStr = rinexDateStr(_TOC, _prn, version);
    996  
    997   QTextStream out(&rnxStr);
    998  
    999   out << QString("%1%2%3\n")
    1000     .arg(_clock_bias,      19, 'e', 12)
    1001     .arg(_clock_drift,     19, 'e', 12)
    1002     .arg(_clock_driftrate, 19, 'e', 12);
    1003 
    1004   QString fmt = version < 3.0 ? "   %1%2%3%4\n" : "    %1%2%3%4\n";
    1005 
    1006   out << QString(fmt)
    1007     .arg(_IODE,    19, 'e', 12)
    1008     .arg(_Crs,     19, 'e', 12)
    1009     .arg(_Delta_n, 19, 'e', 12)
    1010     .arg(_M0,      19, 'e', 12);
    1011 
    1012   out << QString(fmt)
    1013     .arg(_Cuc,    19, 'e', 12)
    1014     .arg(_e,      19, 'e', 12)
    1015     .arg(_Cus,    19, 'e', 12)
    1016     .arg(_sqrt_A, 19, 'e', 12);
    1017 
    1018   out << QString(fmt)
    1019     .arg(_TOEsec, 19, 'e', 12)
    1020     .arg(_Cic,    19, 'e', 12)
    1021     .arg(_OMEGA0, 19, 'e', 12)
    1022     .arg(_Cis,    19, 'e', 12);
    1023 
    1024   out << QString(fmt)
    1025     .arg(_i0,       19, 'e', 12)
    1026     .arg(_Crc,      19, 'e', 12)
    1027     .arg(_omega,    19, 'e', 12)
    1028     .arg(_OMEGADOT, 19, 'e', 12);
    1029 
    1030   out << QString(fmt)
    1031     .arg(_IDOT,    19, 'e', 12)
    1032     .arg(_L2Codes, 19, 'e', 12)
    1033     .arg(_TOEweek, 19, 'e', 12)
    1034     .arg(_L2PFlag, 19, 'e', 12);
    1035 
    1036   out << QString(fmt)
    1037     .arg(_ura,    19, 'e', 12)
    1038     .arg(_health, 19, 'e', 12)
    1039     .arg(_TGD,    19, 'e', 12)
    1040     .arg(_IODC,   19, 'e', 12);
    1041 
    1042   out << QString(fmt)
    1043     .arg(_TOT,         19, 'e', 12)
    1044     .arg(_fitInterval, 19, 'e', 12)
    1045     .arg("",           19, QChar(' '))
    1046     .arg("",           19, QChar(' '));
    1047 
    1048   return rnxStr;
    1049 }
    1050 
    1051 // RINEX Format String
    1052 //////////////////////////////////////////////////////////////////////////////
    1053 QString t_ephGlo::toString(double version) const {
    1054 
    1055   QString rnxStr = rinexDateStr(_TOC-_gps_utc, _prn, version);
    1056 
    1057   QTextStream out(&rnxStr);
    1058 
    1059   out << QString("%1%2%3\n")
    1060     .arg(-_tau,  19, 'e', 12)
    1061     .arg(_gamma, 19, 'e', 12)
    1062     .arg(_tki,   19, 'e', 12);
    1063 
    1064   QString fmt = version < 3.0 ? "   %1%2%3%4\n" : "    %1%2%3%4\n";
    1065 
    1066   out << QString(fmt)
    1067     .arg(_x_pos,          19, 'e', 12)
    1068     .arg(_x_velocity,     19, 'e', 12)
    1069     .arg(_x_acceleration, 19, 'e', 12)
    1070     .arg(_health,         19, 'e', 12);
    1071 
    1072   out << QString(fmt)
    1073     .arg(_y_pos,            19, 'e', 12)
    1074     .arg(_y_velocity,       19, 'e', 12)
    1075     .arg(_y_acceleration,   19, 'e', 12)
    1076     .arg(_frequency_number, 19, 'e', 12);
    1077 
    1078   out << QString(fmt)
    1079     .arg(_z_pos,          19, 'e', 12)
    1080     .arg(_z_velocity,     19, 'e', 12)
    1081     .arg(_z_acceleration, 19, 'e', 12)
    1082     .arg(_E,              19, 'e', 12);
    1083 
    1084   return rnxStr;
    10851085}
    10861086
     
    11511151  else if ((_flags & GALEPHF_INAV) == GALEPHF_INAV) {
    11521152    dataSource |= (1<<0);
     1153    dataSource |= (1<<1);// not clear but common practice
    11531154    dataSource |= (1<<2);
    11541155    dataSource |= (1<<9);
     
    15971598  _TGD1     = ee->TGD_B1_B3;
    15981599  _TGD2     = ee->TGD_B2_B3;
    1599 
    1600 
    16011600}
    16021601
Note: See TracChangeset for help on using the changeset viewer.