Changeset 6556 in ntrip for trunk


Ignore:
Timestamp:
Jan 19, 2015, 6:57:52 PM (9 years ago)
Author:
stuerze
Message:

separate consideration of ssr update interval

Location:
trunk/BNC/src
Files:
6 edited

Legend:

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

    r6553 r6556  
    191191      if (irc == GCOBR_OK || irc == GCOBR_MESSAGEFOLLOWS ) {
    192192
    193         setReferenceTime(); // sets _lastTime
     193        setEpochTime(); // sets _lastTime
    194194 
    195195        if (_lastTime.valid()) {
     
    238238      t_orbCorr orbCorr;
    239239      orbCorr._prn.set(sysCh, _clkOrb.Sat[ii].ID);
    240       orbCorr._staID    = _staID.toAscii().data();
    241       orbCorr._iod      = _clkOrb.Sat[ii].IOD;
    242       orbCorr._time     = _lastTime;
    243       orbCorr._system   = 'R';
    244       orbCorr._xr[0]    = _clkOrb.Sat[ii].Orbit.DeltaRadial;
    245       orbCorr._xr[1]    = _clkOrb.Sat[ii].Orbit.DeltaAlongTrack;
    246       orbCorr._xr[2]    = _clkOrb.Sat[ii].Orbit.DeltaCrossTrack;
    247       orbCorr._dotXr[0] = _clkOrb.Sat[ii].Orbit.DotDeltaRadial;
    248       orbCorr._dotXr[1] = _clkOrb.Sat[ii].Orbit.DotDeltaAlongTrack;
    249       orbCorr._dotXr[2] = _clkOrb.Sat[ii].Orbit.DotDeltaCrossTrack;
     240      orbCorr._staID     = _staID.toAscii().data();
     241      orbCorr._iod       = _clkOrb.Sat[ii].IOD;
     242      orbCorr._time      = _lastTime;
     243      orbCorr._updateInt = _clkOrb.UpdateInterval;
     244      orbCorr._system    = 'R';
     245      orbCorr._xr[0]     = _clkOrb.Sat[ii].Orbit.DeltaRadial;
     246      orbCorr._xr[1]     = _clkOrb.Sat[ii].Orbit.DeltaAlongTrack;
     247      orbCorr._xr[2]     = _clkOrb.Sat[ii].Orbit.DeltaCrossTrack;
     248      orbCorr._dotXr[0]  = _clkOrb.Sat[ii].Orbit.DotDeltaRadial;
     249      orbCorr._dotXr[1]  = _clkOrb.Sat[ii].Orbit.DotDeltaAlongTrack;
     250      orbCorr._dotXr[2]  = _clkOrb.Sat[ii].Orbit.DotDeltaCrossTrack;
    250251
    251252      _orbCorrections[_lastTime].push_back(orbCorr);
     
    265266      clkCorr._staID      = _staID.toAscii().data();
    266267      clkCorr._time       = _lastTime;
     268      clkCorr._updateInt  = _clkOrb.UpdateInterval;
    267269      clkCorr._dClk       = _clkOrb.Sat[ii].Clock.DeltaA0 / t_CST::c;
    268270      clkCorr._dotDClk    = _clkOrb.Sat[ii].Clock.DeltaA1 / t_CST::c;
     
    285287      if (_lastClkCorrections.contains(prn)) {
    286288        t_clkCorr clkCorr;
    287         clkCorr        = _lastClkCorrections[prn];
    288         clkCorr._time  = _lastTime;
    289         clkCorr._dClk  +=_clkOrb.Sat[ii].hrclock / t_CST::c;
     289        clkCorr            = _lastClkCorrections[prn];
     290        clkCorr._time      = _lastTime;
     291        clkCorr._updateInt = _clkOrb.UpdateInterval;
     292        clkCorr._dClk     += _clkOrb.Sat[ii].hrclock / t_CST::c;
    290293        if (_IODs.contains(clkCorr._prn)) {
    291294          clkCorr._iod = _IODs[clkCorr._prn];
     
    311314    t_satCodeBias satCodeBias;
    312315    satCodeBias._prn.set(sysCh, _codeBias.Sat[ii].ID);
    313     satCodeBias._staID = _staID.toAscii().data();
    314     satCodeBias._time  = _lastTime;
     316    satCodeBias._staID     = _staID.toAscii().data();
     317    satCodeBias._time      = _lastTime;
     318    satCodeBias._updateInt = _codeBias.UpdateInterval;
    315319    for (unsigned jj = 0; jj < _codeBias.Sat[ii].NumberOfCodeBiases; jj++) {
    316320      const CodeBias::BiasSat::CodeBiasEntry& biasEntry = _codeBias.Sat[ii].Biases[jj];
     
    342346    satPhaseBias._staID      = _staID.toAscii().data();
    343347    satPhaseBias._time       = _lastTime;
     348    satPhaseBias._updateInt  = _phaseBias.UpdateInterval;
    344349    satPhaseBias._yawDeg     = _phaseBias.Sat[ii].YawAngle * 180.0 / M_PI;
    345350    satPhaseBias._yawDegRate = _phaseBias.Sat[ii].YawRate * 180.0 / M_PI;
     
    363368  if (_vTEC.NumLayers > 0) {
    364369    _vTecMap[_lastTime]._time  = _lastTime;
     370    _vTecMap[_lastTime]._updateInt =  _vTEC.UpdateInterval;
    365371    _vTecMap[_lastTime]._staID = _staID.toAscii().data();
    366372    for (unsigned ii = 0; ii < _vTEC.NumLayers; ii++) {
     
    463469//
    464470////////////////////////////////////////////////////////////////////////////
    465 void RTCM3coDecoder::setReferenceTime() {
     471void RTCM3coDecoder::setEpochTime() {
    466472
    467473  _lastTime.reset();
    468474
    469   const QVector<int> updateInt = QVector<int>()  << 1 << 2 << 5 << 10 << 15 << 30
    470                                                  << 60 << 120 << 240 << 300 << 600
    471                                                  << 900 << 1800 << 3600 << 7200
    472                                                  << 10800;
    473475  double epoSecGPS = -1.0;
    474476  double epoSecGlo = -1.0;
    475477  if      (_clkOrb.NumberOfSat[CLOCKORBIT_SATGPS] > 0) {
    476478    epoSecGPS = _clkOrb.EpochTime[CLOCKORBIT_SATGPS];        // 0 .. 604799 s
    477     if (_clkOrb.UpdateInterval) {
    478       epoSecGPS += 0.5 * updateInt[_clkOrb.UpdateInterval];
    479     }
    480479  }
    481480  else if (_codeBias.NumberOfSat[CLOCKORBIT_SATGPS] > 0) {
    482481    epoSecGPS = _codeBias.EpochTime[CLOCKORBIT_SATGPS];      // 0 .. 604799 s 
    483     if (_codeBias.UpdateInterval) {
    484       epoSecGPS += 0.5 * updateInt[_codeBias.UpdateInterval];
    485     }
    486482  }
    487483  else if (_phaseBias.NumberOfSat[CLOCKORBIT_SATGPS] > 0) {
    488484    epoSecGPS = _phaseBias.EpochTime[CLOCKORBIT_SATGPS];     // 0 .. 604799 s 
    489     if (_phaseBias.UpdateInterval) {
    490       epoSecGPS += 0.5 * updateInt[_phaseBias.UpdateInterval];
    491     }
    492485  }
    493486  else if (_vTEC.NumLayers > 0) {
    494487    epoSecGPS = _vTEC.EpochTime;                             // 0 .. 604799 s 
    495     if (_vTEC.UpdateInterval) {
    496       epoSecGPS += 0.5 * updateInt[_vTEC.UpdateInterval];
    497     }
    498488  }
    499489  else if (_clkOrb.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) {
    500490    epoSecGlo = _clkOrb.EpochTime[CLOCKORBIT_SATGLONASS];    // 0 .. 86399 s
    501     if (_clkOrb.UpdateInterval) {
    502       epoSecGlo += 0.5 * updateInt[_clkOrb.UpdateInterval];
    503     }
    504491  }
    505492  else if (_codeBias.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) {
    506493    epoSecGlo = _codeBias.EpochTime[CLOCKORBIT_SATGLONASS];  // 0 .. 86399 s
    507     if (_codeBias.UpdateInterval) {
    508       epoSecGlo += 0.5 * updateInt[_codeBias.UpdateInterval];
    509     }
    510494  }
    511495  else if (_phaseBias.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) {
    512496    epoSecGlo = _phaseBias.EpochTime[CLOCKORBIT_SATGLONASS]; // 0 .. 86399 s
    513     if (_phaseBias.UpdateInterval) {
    514       epoSecGlo += 0.5 * updateInt[_phaseBias.UpdateInterval];
    515     }
    516497  }
    517498
  • trunk/BNC/src/RTCM3/RTCM3coDecoder.h

    r6553 r6556  
    5454 private:
    5555  void reset();
    56   void setReferenceTime();
     56  void setEpochTime();
    5757  void sendResults();
    5858  void reopen();
  • trunk/BNC/src/ephemeris.cpp

    r6537 r6556  
    4747    return failure;
    4848  }
    49 
     49  const QVector<int> updateInt = QVector<int>()  << 1 << 2 << 5 << 10 << 15 << 30
     50                                                 << 60 << 120 << 240 << 300 << 600
     51                                                 << 900 << 1800 << 3600 << 7200
     52                                                 << 10800;
    5053  xc.ReSize(4);
    5154  vv.ReSize(3);
     
    5558  if (useCorr) {
    5659    if (_orbCorr && _clkCorr) {
    57 
    5860      double dtO = tt - _orbCorr->_time;
     61      if (_orbCorr->_updateInt) {
     62        dtO -= (0.5 * updateInt[_orbCorr->_updateInt]);
     63      }
    5964      ColumnVector dx(3);
    6065      dx[0] = _orbCorr->_xr[0] + _orbCorr->_dotXr[0] * dtO;
     
    7176
    7277      double dtC = tt - _clkCorr->_time;
     78      if (_clkCorr->_updateInt) {
     79        dtC -= (0.5 * updateInt[_clkCorr->_updateInt]);
     80      }
    7381      xc[3] += _clkCorr->_dClk + _clkCorr->_dotDClk * dtC + _clkCorr->_dotDotDClk * dtC * dtC;
    7482    }
  • trunk/BNC/src/rinex/corrfile.cpp

    r6516 r6556  
    7777    }
    7878
    79     int    numEntries;
    80     string staID;
    81     t_corrSSR::e_type corrType = t_corrSSR::readEpoLine(_lastLine, _lastEpoTime, numEntries, staID);
     79    int          numEntries;
     80    unsigned int updateInt;
     81    string       staID;
     82    t_corrSSR::e_type corrType = t_corrSSR::readEpoLine(_lastLine, _lastEpoTime, updateInt, numEntries, staID);
    8283    if      (corrType == t_corrSSR::unknown) {
    8384      throw "t_corrFile: unknown line " + _lastLine;
  • trunk/BNC/src/satObs.cpp

    r6515 r6556  
    3030    if (!epoTime.valid()) {
    3131      epoTime = corr._time;
    32       *out << "> CLOCK " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << "    "
     32      *out << "> CLOCK " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
     33          <<  corr._updateInt <<  " "
    3334           << corrList.size() << ' ' << corr._staID << endl;
    3435    }
     
    4445////////////////////////////////////////////////////////////////////////////
    4546void t_clkCorr::readEpoch(const string& epoLine, istream& inStream, QList<t_clkCorr>& corrList) {
    46   bncTime epoTime;
    47   int     numCorr;
    48   string  staID;
    49   if (t_corrSSR::readEpoLine(epoLine, epoTime, numCorr, staID) != t_corrSSR::clkCorr) {
     47  bncTime      epoTime;
     48  unsigned int updateInt;
     49  int          numCorr;
     50  string       staID;
     51  if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numCorr, staID) != t_corrSSR::clkCorr) {
    5052    return;
    5153  }
    5254  for (int ii = 0; ii < numCorr; ii++) {
    5355    t_clkCorr corr;
    54     corr._time  = epoTime;
    55     corr._staID = staID;
     56    corr._time      = epoTime;
     57    corr._updateInt = updateInt;
     58    corr._staID     = staID;
    5659
    5760    string line;
     
    9194    if (!epoTime.valid()) {
    9295      epoTime = corr._time;
    93       *out << "> ORBIT " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << "    "
     96      *out << "> ORBIT " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
     97           << corr._updateInt <<  " "
    9498           << corrList.size() << ' ' << corr._staID << endl;
    9599    }
     
    108112////////////////////////////////////////////////////////////////////////////
    109113void t_orbCorr::readEpoch(const string& epoLine, istream& inStream, QList<t_orbCorr>& corrList) {
    110   bncTime epoTime;
    111   int     numCorr;
    112   string  staID;
    113   if (t_corrSSR::readEpoLine(epoLine, epoTime, numCorr, staID) != t_corrSSR::orbCorr) {
     114  bncTime      epoTime;
     115  unsigned int updateInt;
     116  int          numCorr;
     117  string       staID;
     118  if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numCorr, staID) != t_corrSSR::orbCorr) {
    114119    return;
    115120  }
    116121  for (int ii = 0; ii < numCorr; ii++) {
    117122    t_orbCorr corr;
    118     corr._time  = epoTime;
    119     corr._staID = staID;
     123    corr._time      = epoTime;
     124    corr._updateInt = updateInt;
     125    corr._staID     = staID;
    120126
    121127    string line;
     
    144150    if (!epoTime.valid()) {
    145151      epoTime = satCodeBias._time;
    146       *out << "> CODE_BIAS " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << "    "
     152      *out << "> CODE_BIAS " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
     153           << satCodeBias._updateInt <<  " "
    147154           << biasList.size() << ' ' << satCodeBias._staID << endl;
    148155    }
     
    161168////////////////////////////////////////////////////////////////////////////
    162169void t_satCodeBias::readEpoch(const string& epoLine, istream& inStream, QList<t_satCodeBias>& biasList) {
    163   bncTime epoTime;
    164   int     numSat;
    165   string  staID;
    166   if (t_corrSSR::readEpoLine(epoLine, epoTime, numSat, staID) != t_corrSSR::codeBias) {
     170  bncTime      epoTime;
     171  unsigned int updateInt;
     172  int          numSat;
     173  string       staID;
     174  if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numSat, staID) != t_corrSSR::codeBias) {
    167175    return;
    168176  }
    169177  for (int ii = 0; ii < numSat; ii++) {
    170178    t_satCodeBias satCodeBias;
    171     satCodeBias._time  = epoTime;
    172     satCodeBias._staID = staID;
     179    satCodeBias._time      = epoTime;
     180    satCodeBias._updateInt = updateInt;
     181    satCodeBias._staID     = staID;
    173182
    174183    string line;
     
    203212    if (!epoTime.valid()) {
    204213      epoTime = satPhaseBias._time;
    205       *out << "> PHASE_BIAS " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << "    "
     214      *out << "> PHASE_BIAS " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
     215           << satPhaseBias._updateInt <<  " "
    206216           << biasList.size() << ' ' << satPhaseBias._staID << endl;
    207217    }
     
    225235////////////////////////////////////////////////////////////////////////////
    226236void t_satPhaseBias::readEpoch(const string& epoLine, istream& inStream, QList<t_satPhaseBias>& biasList) {
    227   bncTime epoTime;
    228   int     numSat;
    229   string  staID;
    230   if (t_corrSSR::readEpoLine(epoLine, epoTime, numSat, staID) != t_corrSSR::phaseBias) {
     237  bncTime      epoTime;
     238  unsigned int updateInt;
     239  int          numSat;
     240  string       staID;
     241  if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numSat, staID) != t_corrSSR::phaseBias) {
    231242    return;
    232243  }
    233244  for (int ii = 0; ii < numSat; ii++) {
    234245    t_satPhaseBias satPhaseBias;
    235     satPhaseBias._time  = epoTime;
    236     satPhaseBias._staID = staID;
     246    satPhaseBias._time      = epoTime;
     247    satPhaseBias._updateInt = updateInt;
     248    satPhaseBias._staID     = staID;
    237249
    238250    string line;
     
    264276  out->setf(ios::fixed);
    265277  bncTime epoTime = vTec._time;
    266   *out << "> VTEC " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << "    "
     278  *out << "> VTEC " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
     279       << vTec._updateInt <<  " "
    267280       << vTec._layers.size() << ' ' << vTec._staID << endl;
    268281  for (unsigned ii = 0; ii < vTec._layers.size(); ii++) {
     
    281294////////////////////////////////////////////////////////////////////////////
    282295void t_vTec::read(const string& epoLine, istream& inStream, t_vTec& vTec) {
    283   bncTime epoTime;
    284   int     numLayers;
    285   string  staID;
    286   if (t_corrSSR::readEpoLine(epoLine, epoTime, numLayers, staID) != t_corrSSR::vTec) {
     296  bncTime      epoTime;
     297  unsigned int updateInt;
     298  int          numLayers;
     299  string       staID;
     300  if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numLayers, staID) != t_corrSSR::vTec) {
    287301    return;
    288302  }
     
    290304    return;
    291305  }
    292   vTec._time  = epoTime;
    293   vTec._staID = staID;
     306  vTec._time      = epoTime;
     307  vTec._updateInt = updateInt;
     308  vTec._staID     = staID;
    294309  for (int ii = 0; ii < numLayers; ii++) {
    295310    t_vTecLayer layer;
     
    323338////////////////////////////////////////////////////////////////////////////
    324339t_corrSSR::e_type t_corrSSR::readEpoLine(const string& line, bncTime& epoTime,
    325                                          int& numEntries, string& staID) {
     340                                         unsigned int& updateInt, int& numEntries,
     341                                         string& staID) {
    326342
    327343  istringstream inLine(line.c_str());
     
    333349
    334350  inLine >> epoChar >> typeString
    335          >> year >> month >> day >> hour >> min >> sec >> numEntries >> staID;
     351         >> year >> month >> day >> hour >> min >> sec >> updateInt >> numEntries >> staID;
    336352
    337353  if (epoChar == '>') {
  • trunk/BNC/src/satObs.h

    r6501 r6556  
    6868  unsigned short _iod;
    6969  bncTime        _time;
     70  unsigned int   _updateInt;
    7071  char           _system;
    7172  ColumnVector   _xr;
     
    8283  unsigned short _iod;
    8384  bncTime        _time;
     85  unsigned int   _updateInt;
    8486  double         _dClk;
    8587  double         _dotDClk;
     
    103105  t_prn                      _prn;
    104106  bncTime                    _time;
     107  unsigned int               _updateInt;
    105108  std::vector<t_frqCodeBias> _bias;
    106109};
     
    132135  t_prn                       _prn;
    133136  bncTime                     _time;
     137  unsigned int                _updateInt;
    134138  double                      _yawDeg;
    135139  double                      _yawDegRate;
     
    150154  std::string              _staID;
    151155  bncTime                  _time;
     156  unsigned int            _updateInt;
    152157  std::vector<t_vTecLayer> _layers;
    153158};
     
    157162  enum e_type {clkCorr, orbCorr, codeBias, phaseBias, vTec, unknown};
    158163  static e_type readEpoLine(const std::string& line, bncTime& epoTime,
    159                             int& numEntries, std::string& staID);
     164                            unsigned int& updateInt, int& numEntries, std::string& staID);
    160165};
    161166
Note: See TracChangeset for help on using the changeset viewer.