Changeset 6498 in ntrip for trunk/BNC/src/rinex/corrfile.cpp


Ignore:
Timestamp:
Dec 29, 2014, 2:30:31 PM (9 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/rinex/corrfile.cpp

    r6483 r6498  
    6262void t_corrFile::syncRead(const bncTime& tt) {
    6363
    64   QList<t_clkCorr>      clkCorrList;
    65   QList<t_orbCorr>      orbCorrList;
    66   QList<t_satCodeBias>  satCodeBiasList;
    67   QList<t_satPhaseBias> satPhaseBiasList;
    68   t_vTec                vTec;
     64  while (_stream.good() && (!_lastEpoTime.valid() || _lastEpoTime <= tt)) {
    6965
    70   while (!stopRead(tt) && _stream.good()) {
    71     if (stopRead(tt)) {
     66    if (_lastLine.empty()) {
     67      getline(_stream, _lastLine); stripWhiteSpace(_lastLine);
     68      if      (!_stream.good()) {
     69        throw "t_corrFile: end of file";
     70      }
     71      else if (_lastLine.empty() || _lastLine[0] == '!') {
     72        continue;
     73      }
     74      else if (_lastLine[0] != '>') {
     75        throw "t_corrFile: error";
     76      }
     77    }
     78
     79    t_corrSSR::e_type corrType = t_corrSSR::readEpoLine(_lastLine, _lastEpoTime);
     80    if      (corrType == t_corrSSR::unknown) {
     81      throw "t_corrFile: unknown line " + _lastLine;
     82    }
     83    else if (_lastEpoTime > tt) {
    7284      break;
    7385    }
    74   }
    75 
    76   if (orbCorrList.size() > 0) {
    77     emit newOrbCorrections(orbCorrList);
    78   }
    79   if (clkCorrList.size() > 0) {
    80     emit newClkCorrections(clkCorrList);
    81   }
    82   if (satCodeBiasList.size() > 0) {
    83     emit newCodeBiases(satCodeBiasList);
    84   }
    85   if (satPhaseBiasList.size() > 0) {
    86     emit newPhaseBiases(satPhaseBiasList);
    87   }
    88   if (vTec._layers.size() > 0) {
    89     emit newTec(vTec);
     86    else if (corrType == t_corrSSR::clkCorr) {
     87      QList<t_clkCorr> clkCorrList;
     88      t_clkCorr::readEpoch(_lastLine, _stream, clkCorrList);
     89      emit newClkCorrections(clkCorrList);
     90    }
     91    else if (corrType == t_corrSSR::orbCorr) {
     92      QList<t_orbCorr> orbCorrList;
     93      t_orbCorr::readEpoch(_lastLine, _stream, orbCorrList);
     94      emit newOrbCorrections(orbCorrList);
     95    }
     96    else if (corrType == t_corrSSR::codeBias) {
     97      QList<t_satCodeBias> satCodeBiasList;
     98      t_satCodeBias::readEpoch(_lastLine, _stream, satCodeBiasList);
     99      emit newCodeBiases(satCodeBiasList);
     100    }
     101    else if (corrType == t_corrSSR::phaseBias) {
     102      QList<t_satPhaseBias> satPhaseBiasList;
     103      t_satPhaseBias::readEpoch(_lastLine, _stream, satPhaseBiasList);
     104      emit newPhaseBiases(satPhaseBiasList);
     105    }
     106    else if (corrType == t_corrSSR::vTec) {
     107      t_vTec vTec;
     108      t_vTec::read(_lastLine, _stream, vTec);
     109      emit newTec(vTec);
     110    }
    90111  }
    91112}
    92 
    93 // Read till a given time
    94 ////////////////////////////////////////////////////////////////////////////
    95 bool t_corrFile::stopRead(const bncTime& tt) {
    96   return true;
    97 }
Note: See TracChangeset for help on using the changeset viewer.