- Timestamp:
- Nov 24, 2014, 4:38:47 PM (10 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bncoutf.cpp
r5985 r6331 35 35 _numSec = 0; 36 36 37 QFileInfo fileInfo(sklFileName); 38 _path = fileInfo.absolutePath() + QDir::separator(); 39 _sklBaseName = fileInfo.baseName(); 40 _extension = fileInfo.completeSuffix(); 41 42 expandEnvVar(_path); 43 if (!_extension.isEmpty()) { 44 _extension = "." + _extension; 37 if (! sklFileName.isEmpty()) { 38 QFileInfo fileInfo(sklFileName); 39 _path = fileInfo.absolutePath() + QDir::separator(); 40 _sklBaseName = fileInfo.baseName(); 41 _extension = fileInfo.completeSuffix(); 42 43 expandEnvVar(_path); 44 if (!_extension.isEmpty()) { 45 _extension = "." + _extension; 46 } 45 47 } 46 48 -
trunk/BNC/src/bncsp3.cpp
r4991 r6331 17 17 18 18 #include <iomanip> 19 #include <sstream> 19 20 #include <math.h> 20 21 … … 26 27 // Constructor 27 28 //////////////////////////////////////////////////////////////////////////// 29 bncSP3::bncSP3(const QString& fileName) : bncoutf(QString(), QString(), 0) { 30 _inpOut = input; 31 _currEpoch = 0; 32 _prevEpoch = 0; 33 34 _stream.open(fileName.toAscii().data()); 35 if (!_stream.good()) { 36 throw "t_sp3File: cannot open file " + fileName; 37 } 38 39 while (_stream.good()) { 40 getline(_stream, _lastLine); 41 if (_lastLine[0] == '*') { 42 break; 43 } 44 } 45 } 46 47 // Constructor 48 //////////////////////////////////////////////////////////////////////////// 28 49 bncSP3::bncSP3(const QString& sklFileName, const QString& intr, int sampl) 29 50 : bncoutf(sklFileName, intr, sampl) { 51 _inpOut = output; 52 _currEpoch = 0; 53 _prevEpoch = 0; 30 54 } 31 55 … … 33 57 //////////////////////////////////////////////////////////////////////////// 34 58 bncSP3::~bncSP3() { 59 delete _currEpoch; 60 delete _prevEpoch; 35 61 } 36 62 … … 133 159 } 134 160 161 // Read Next Epoch 162 //////////////////////////////////////////////////////////////////////////// 163 const bncSP3::t_sp3Epoch* bncSP3::nextEpoch() { 164 165 delete _prevEpoch; _prevEpoch = _currEpoch; _currEpoch = 0; 166 167 while (true) { 168 169 if (!_currEpoch) { 170 _currEpoch = new t_sp3Epoch(); 171 istringstream in(_lastLine.substr(1).c_str()); 172 int YY, MM, DD, hh, mm; 173 double ss; 174 in >> YY >> MM >> DD >> hh >> mm >> ss; 175 _currEpoch->_tt.set(YY, MM, DD, hh, mm, ss); 176 } 177 178 getline(_stream, _lastLine); 179 if (_stream.eof() || _lastLine.find("EOF") == 0) { 180 throw "t_sp3File: end of file"; 181 break; 182 } 183 if (_lastLine[0] == '*') { 184 break; 185 } 186 187 t_sp3Sat* sp3Sat = new t_sp3Sat(); 188 istringstream in(_lastLine.substr(1).c_str()); 189 in >> sp3Sat->_prn >> sp3Sat->_xyz(1) >> sp3Sat->_xyz(2) >> sp3Sat->_xyz(3) >> sp3Sat->_clk; 190 191 sp3Sat->_xyz *= 1.e3; 192 sp3Sat->_clk *= t_CST::c * 1.e-6; 193 194 _currEpoch->_sp3Sat.push_back(sp3Sat); 195 } 196 197 return _currEpoch; 198 } -
trunk/BNC/src/bncsp3.h
r4991 r6331 8 8 #include "bncoutf.h" 9 9 #include "bnctime.h" 10 #include "t_prn.h" 10 11 11 12 class bncSP3 : public bncoutf { 12 13 public: 13 bncSP3(const QString& sklFileName, const QString& intr, int sampl); 14 15 class t_sp3Sat { 16 public: 17 t_sp3Sat() { 18 _xyz.ReSize(3); 19 _xyz = 0.0; 20 _clk = 0.0; 21 } 22 ~t_sp3Sat() {} 23 t_prn _prn; 24 ColumnVector _xyz; 25 double _clk; 26 }; 27 28 class t_sp3Epoch { 29 public: 30 t_sp3Epoch() {} 31 ~t_sp3Epoch() { 32 for (int ii = 0; ii < _sp3Sat.size(); ii++) { 33 delete _sp3Sat[ii]; 34 } 35 } 36 bncTime _tt; 37 QVector<t_sp3Sat*> _sp3Sat; 38 }; 39 40 bncSP3(const QString& fileName); // input 41 bncSP3(const QString& sklFileName, const QString& intr, int sampl); // output 14 42 virtual ~bncSP3(); 15 43 t_irc write(int GPSweek, double GPSweeks, const QString& prn, … … 17 45 18 46 private: 47 enum e_inpOut {input, output}; 48 19 49 virtual void writeHeader(const QDateTime& datTim); 20 50 virtual void closeFile(); 21 bncTime _lastEpoTime; 51 const t_sp3Epoch* nextEpoch(); 52 const t_sp3Epoch* currEpoch() const {return _currEpoch;} 53 const t_sp3Epoch* prevEpoch() const {return _prevEpoch;} 54 55 e_inpOut _inpOut; 56 bncTime _lastEpoTime; 57 std::ifstream _stream; 58 std::string _lastLine; 59 t_sp3Epoch* _currEpoch; 60 t_sp3Epoch* _prevEpoch; 22 61 }; 23 62
Note:
See TracChangeset
for help on using the changeset viewer.