Changeset 6755 in ntrip


Ignore:
Timestamp:
Apr 1, 2015, 3:03:06 PM (9 years ago)
Author:
stuerze
Message:

different BDS ephemeris sources ( RTCM stream / RINEX file ) are considered now for RINEX file writing

Location:
trunk/BNC/src
Files:
2 edited

Legend:

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

    r6621 r6755  
    13361336  // ------------
    13371337  int fieldLen = 19;
     1338  _URAI = -1; // undefined in RINEX format
    13381339
    13391340  int pos[4];
     
    13421343  pos[2] = pos[1] + fieldLen;
    13431344  pos[3] = pos[2] + fieldLen;
    1344 
    1345   double TOTs;
    1346   double TOEs;
    1347   double TOEw;
    13481345
    13491346  // Read eight lines
     
    14071404
    14081405    else if ( iLine == 3 ) {
    1409       if ( readDbl(line, pos[0], fieldLen, TOEs   )  ||
     1406      if ( readDbl(line, pos[0], fieldLen, _TOEs   )  ||
    14101407           readDbl(line, pos[1], fieldLen, _Cic   )  ||
    14111408           readDbl(line, pos[2], fieldLen, _OMEGA0)  ||
     
    14281425    else if ( iLine == 5 ) {
    14291426      if ( readDbl(line, pos[0], fieldLen, _IDOT    ) ||
    1430            readDbl(line, pos[2], fieldLen, TOEw)    ) {
     1427           readDbl(line, pos[2], fieldLen, _TOEw)    ) {
    14311428        _checkState = bad;
    14321429        return;
     
    14361433    else if ( iLine == 6 ) {
    14371434      double SatH1;
    1438       if ( readDbl(line, pos[1], fieldLen, SatH1) ||
     1435      if ( readDbl(line, pos[0], fieldLen, _URA ) ||
     1436           readDbl(line, pos[1], fieldLen, SatH1) ||
    14391437           readDbl(line, pos[2], fieldLen, _TGD1) ||
    14401438           readDbl(line, pos[3], fieldLen, _TGD2) ) {
     
    14471445    else if ( iLine == 7 ) {
    14481446      double aodc;
    1449       if ( readDbl(line, pos[0], fieldLen, TOTs) ||
     1447      if ( readDbl(line, pos[0], fieldLen, _TOTs) ||
    14501448           readDbl(line, pos[1], fieldLen, aodc) ) {
    14511449        _checkState = bad;
    14521450        return;
    14531451      }
    1454       if (TOTs == 0.9999e9) {  // 0.9999e9 means not known (RINEX standard)
    1455         TOTs = TOEs;
     1452      if (_TOTs == 0.9999e9) {  // 0.9999e9 means not known (RINEX standard)
     1453        _TOTs = _TOEs;
    14561454      }
    14571455      _AODC = int(aodc);
     
    14591457  }
    14601458
    1461   TOEw += 1356;  // BDT -> GPS week number
    1462   _TOE_bdt.set(int(TOEw), TOEs);
     1459  _TOEw += 1356;  // BDT -> GPS week number
     1460  _TOE_bdt.set(int(_TOEw), _TOEs);
    14631461
    14641462  // GPS->BDT
     
    14751473////////////////////////////////////////////////////////////////////////////
    14761474void t_ephBDS::set(const bdsephemeris* ee) {
     1475
     1476  // RINEX File entries
     1477  // --------------------
     1478  _TOTs = 0.0;
     1479  _TOEs = 0.0;
     1480  _TOEw = 0.0;
    14771481
    14781482  _receptDateTime = currentDateAndTimeGPS();
     
    16771681    .arg(_sqrt_A, 19, 'e', 12);
    16781682
    1679   out << QString(fmt)
    1680     .arg(_TOE_bdt.gpssec(), 19, 'e', 12)
    1681     .arg(_Cic,              19, 'e', 12)
    1682     .arg(_OMEGA0,           19, 'e', 12)
    1683     .arg(_Cis,              19, 'e', 12);
     1683  double toes = _TOEs;
     1684  if (!toes) { // RTCM stream input
     1685    toes = _TOE_bdt.gpssec();
     1686  }
     1687  out << QString(fmt)
     1688    .arg(toes,   19, 'e', 12)
     1689    .arg(_Cic,    19, 'e', 12)
     1690    .arg(_OMEGA0, 19, 'e', 12)
     1691    .arg(_Cis,    19, 'e', 12);
    16841692
    16851693  out << QString(fmt)
     
    16891697    .arg(_OMEGADOT, 19, 'e', 12);
    16901698
    1691   out << QString(fmt)
    1692     .arg(_IDOT,                            19, 'e', 12)
    1693     .arg(0.0,                              19, 'e', 12)
    1694     .arg(double(_TOE_bdt.gpsw() - 1356.0), 19, 'e', 12)
    1695     .arg(0.0,                              19, 'e', 12);
    1696 
    1697   double ura = 0.0;
     1699  double toew = _TOEw;
     1700  if (!toew) { // RTCM stream input
     1701    toew = double(_TOE_bdt.gpsw() - 1356.0);
     1702  }
     1703  out << QString(fmt)
     1704    .arg(_IDOT, 19, 'e', 12)
     1705    .arg(0.0,   19, 'e', 12)
     1706    .arg(toew,  19, 'e', 12)
     1707    .arg(0.0,   19, 'e', 12);
     1708
     1709  double ura = _URA; // RINEX file input
    16981710  if ((_URAI <  6) && (_URAI >= 0)) {
    16991711    ura = ceil(10.0 * pow(2.0, ((double)_URAI/2.0) + 1.0)) / 10.0;
     
    17021714    ura = ceil(10.0 * pow(2.0, ((double)_URAI/2.0)      )) / 10.0;
    17031715  }
    1704 
    17051716  out << QString(fmt)
    17061717    .arg(ura,            19, 'e', 12)
     
    17091720    .arg(_TGD2,          19, 'e', 12);
    17101721
    1711   out << QString(fmt)
    1712     .arg(_TOE_bdt.gpssec(), 19, 'e', 12)
    1713     .arg(double(_AODC),     19, 'e', 12)
    1714     .arg("",                19, QChar(' '))
    1715     .arg("",                19, QChar(' '));
     1722  double tots = _TOTs;
     1723  if (!tots) { // RTCM stream input
     1724    tots = _TOE_bdt.gpssec();
     1725  }
     1726  out << QString(fmt)
     1727    .arg(tots,         19, 'e', 12)
     1728    .arg(double(_AODC), 19, 'e', 12)
     1729    .arg("",            19, QChar(' '))
     1730    .arg("",            19, QChar(' '));
    17161731  return rnxStr;
    17171732}
  • trunk/BNC/src/ephemeris.h

    r6620 r6755  
    260260  int     _AODE;
    261261  int     _AODC;
    262   int     _URAI;             //  [0..15]
     262  int     _URAI;             //  [0..15] from RTCM stream
     263  double  _URA;              //  [m]     from RINEX file
    263264  double  _clock_bias;       //  [s]   
    264265  double  _clock_drift;      //  [s/s] 
     
    282283  double  _TGD2;             //  [s]   
    283284  int     _SatH1;            //
     285  double  _TOTs;             //  [s] of BDT week; RINEX file entry
     286  double  _TOEs;             //  [s] of BDT week; RINEX file entry
     287  double  _TOEw;             //  [-] BDT week; RINEX file entry
    284288};
    285289
Note: See TracChangeset for help on using the changeset viewer.