Changeset 6498 in ntrip for trunk/BNC


Ignore:
Timestamp:
Dec 29, 2014, 2:30:31 PM (10 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
4 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 }
  • trunk/BNC/src/rinex/corrfile.h

    r6483 r6498  
    4949
    5050 private:
    51   bool stopRead(const bncTime& tt);
    5251  std::fstream       _stream;
     52  std::string        _lastLine;
     53  bncTime            _lastEpoTime;
    5354  QMap<QString, int> _corrIODs;
    5455};
  • trunk/BNC/src/satObs.cpp

    r6496 r6498  
    4343//
    4444////////////////////////////////////////////////////////////////////////////
    45 void t_clkCorr::readEpoch(const QStringList& lines, QList<t_clkCorr>& corrList) {
     45void t_clkCorr::readEpoch(const string epoLine, std::istream& in, QList<t_clkCorr>& corrList) {
    4646}
    4747
     
    8484//
    8585////////////////////////////////////////////////////////////////////////////
    86 void t_orbCorr::readEpoch(const QStringList& lines, QList<t_orbCorr>& corrList) {
     86void t_orbCorr::readEpoch(const string epoLine, std::istream& in, QList<t_orbCorr>& corrList) {
    8787}
    8888
     
    116116//
    117117////////////////////////////////////////////////////////////////////////////
    118 void t_satCodeBias::readEpoch(const QStringList& lines, QList<t_satCodeBias>& biasList) {
     118void t_satCodeBias::readEpoch(const string epoLine, std::istream& in, QList<t_satCodeBias>& biasList) {
    119119}
    120120
     
    153153//
    154154////////////////////////////////////////////////////////////////////////////
    155 void t_satPhaseBias::readEpoch(const QStringList& lines, QList<t_satPhaseBias>& biasList) {
     155void t_satPhaseBias::readEpoch(const string epoLine, std::istream& in, QList<t_satPhaseBias>& biasList) {
    156156}
    157157
     
    180180//
    181181////////////////////////////////////////////////////////////////////////////
    182 void t_vTec::read(const QStringList& lines, t_vTec& vTec) {
     182void t_vTec::read(const string epoLine, std::istream& in, t_vTec& vTec) {
    183183}
     184
     185//
     186////////////////////////////////////////////////////////////////////////////
     187t_corrSSR::e_type t_corrSSR::readEpoLine(const string line, bncTime& epoTime) {
     188
     189}
  • trunk/BNC/src/satObs.h

    r6482 r6498  
    6363  t_orbCorr();
    6464  static void writeEpoch(std::ostream* out, const QList<t_orbCorr>& corrList);
    65   static void readEpoch(const QStringList& lines, QList<t_orbCorr>& corrList);
     65  static void readEpoch(const std::string epoLine, std::istream& in, QList<t_orbCorr>& corrList);
    6666  std::string    _staID;
    6767  t_prn          _prn;
     
    7777  t_clkCorr();
    7878  static void writeEpoch(std::ostream* out, const QList<t_clkCorr>& corrList);
    79   static void readEpoch(const QStringList& lines, QList<t_clkCorr>& corrList);
     79  static void readEpoch(const std::string epoLine, std::istream& in, QList<t_clkCorr>& corrList);
    8080  std::string    _staID;
    8181  t_prn          _prn;
     
    9999 public:
    100100  static void writeEpoch(std::ostream* out, const QList<t_satCodeBias>& biasList);
    101   static void readEpoch(const QStringList& lines, QList<t_satCodeBias>& biasList);
     101  static void readEpoch(const std::string epoLine, std::istream& in, QList<t_satCodeBias>& biasList);
    102102  std::string                _staID;
    103103  t_prn                      _prn;
     
    128128  }
    129129  static void writeEpoch(std::ostream* out, const QList<t_satPhaseBias>& biasList);
    130   static void readEpoch(const QStringList& lines, QList<t_satPhaseBias>& biasList);
     130  static void readEpoch(const std::string epoLine, std::istream& in, QList<t_satPhaseBias>& biasList);
    131131  std::string                 _staID;
    132132  t_prn                       _prn;
     
    147147 public:
    148148  static void write(std::ostream* out, const t_vTec& vTec);
    149   static void read(const QStringList& lines, t_vTec& vTec);
     149  static void read(const std::string epoLine, std::istream& in, t_vTec& vTec);
    150150  std::string              _staID;
    151151  bncTime                  _time;
     
    153153};
    154154
     155class t_corrSSR {
     156 public:
     157  enum e_type {clkCorr, orbCorr, codeBias, phaseBias, vTec, unknown};
     158  static e_type readEpoLine(const std::string line, bncTime& epoTime);
     159};
     160
    155161#endif
Note: See TracChangeset for help on using the changeset viewer.