Changeset 3659 in ntrip


Ignore:
Timestamp:
Feb 3, 2012, 5:34:05 PM (12 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC
Files:
4 edited

Legend:

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

    r3538 r3659  
    9999
    100100  _TGD      = ee->TGD;
     101
     102  _ok       = true;
    101103}
    102104
     
    492494  _xv(5) = _y_velocity * 1.e3;
    493495  _xv(6) = _z_velocity * 1.e3;
     496
     497  _ok = true;
    494498}
    495499
     
    613617  _OMEGADOT = ee->OMEGADOT;
    614618  _IDOT     = ee->IDOT;
     619
     620  _ok = true;
    615621}
    616622
     
    783789  return size;
    784790}
     791
     792// Constructor
     793//////////////////////////////////////////////////////////////////////////////
     794t_ephGPS::t_ephGPS(float rnxVersion, const QStringList& lines) {
     795
     796  _ok = false;
     797}
     798
     799// Constructor
     800//////////////////////////////////////////////////////////////////////////////
     801t_ephGlo::t_ephGlo(float rnxVersion, const QStringList& lines) {
     802
     803  _ok = false;
     804}
     805
     806// Constructor
     807//////////////////////////////////////////////////////////////////////////////
     808t_ephGal::t_ephGal(float rnxVersion, const QStringList& lines) {
     809
     810  _ok = false;
     811}
  • trunk/BNC/RTCM3/ephemeris.h

    r3255 r3659  
    1212class t_eph {
    1313 public:
     14  t_eph() {_ok = false;}
    1415  virtual ~t_eph() {};
    1516
     17  bool     ok() const {return _ok;}
    1618  bool     isNewerThan(const t_eph* eph) const;
    1719  QString  prn() const {return _prn;}
     
    4951  double    _GPSweeks;
    5052  QDateTime _receptDateTime;
     53  bool      _ok;
    5154};
    5255
     
    5558 public:
    5659  t_ephGPS() { }
     60  t_ephGPS(float rnxVersion, const QStringList& lines);
    5761  virtual ~t_ephGPS() {}
    5862  double TOC() const {return _TOC;}
     
    105109 public:
    106110  t_ephGlo() { _xv.ReSize(6); }
     111  t_ephGlo(float rnxVersion, const QStringList& lines);
    107112
    108113  virtual ~t_ephGlo() {}
     
    146151 public:
    147152  t_ephGal() { }
     153  t_ephGal(float rnxVersion, const QStringList& lines);
    148154  virtual ~t_ephGal() {}
    149155  double TOC() const {return _TOC;}
  • trunk/BNC/rnxnavfile.cpp

    r3658 r3659  
    4242#include "rnxnavfile.h"
    4343#include "bncutils.h"
     44#include "RTCM3/ephemeris.h"
    4445
    4546using namespace std;
     
    4950t_rnxNavFile::t_rnxNavHeader::t_rnxNavHeader() {
    5051  _version = 0.0;
     52  _glonass = false;
    5153}
    5254
     
    7274      QTextStream in(value.toAscii(), QIODevice::ReadOnly);
    7375      in >> _version;
     76      if (value.indexOf("GLONASS") != -1) {
     77        _glonass = true;
     78      }
    7479    }
    7580  }
     
    96101}
    97102
     103// Read Next Ephemeris
     104////////////////////////////////////////////////////////////////////////////
     105t_irc t_rnxNavFile::getNextEph(t_eph* eph) {
     106
     107  while (_stream->status() == QTextStream::Ok && !_stream->atEnd()) {
     108    QString line = _stream->readLine();
     109    if (line.isEmpty()) {
     110      continue;
     111    }
     112    QStringList hlp = line.split(QRegExp("\\s+"), QString::SkipEmptyParts);
     113    QString prn;
     114    if (version() >= 3.0) {
     115      prn = hlp.at(0);
     116    }
     117    else {
     118      if (glonass()) {
     119        prn = 'R' + QString("%1").arg(hlp.at(0).toInt(), 2, QChar('0'));
     120      }
     121      else {
     122        prn = 'G' + QString("%1").arg(hlp.at(0).toInt(), 2, QChar('0'));
     123      }
     124    }
     125    QStringList lines; lines << line;
     126    if      (prn[0] == 'G') {
     127      for (int ii = 1; ii < 8; ii++) {
     128        lines << _stream->readLine();
     129      }
     130      eph = new t_ephGPS(version(), lines);
     131    }
     132    else if (prn[0] == 'R') {
     133      for (int ii = 1; ii < 4; ii++) {
     134        lines << _stream->readLine();
     135      }
     136      eph = new t_ephGlo(version(), lines);
     137    }
     138    else if (prn[0] == 'E') {
     139      for (int ii = 1; ii < 8; ii++) {
     140        lines << _stream->readLine();
     141      }
     142      eph = new t_ephGal(version(), lines);
     143    }
     144    else {
     145      return failure;
     146    }
     147    if (!eph->ok()) {
     148      delete eph;
     149      eph = 0;
     150      return failure;
     151    }
     152  }
     153
     154  return success;
     155}
  • trunk/BNC/rnxnavfile.h

    r3658 r3659  
    3131class t_pppOpt;
    3232class bncPPPclient;
     33class t_eph;
    3334
    3435class t_rnxNavFile {
     
    3940    ~t_rnxNavHeader();
    4041    t_irc read(QTextStream* stream);
     42    float version() const {return _version;}
     43    bool  glonass() const {return _glonass;}
    4144   private:
    4245    float   _version;
     46    bool    _glonass;
    4347  };
    4448 
     
    4650  t_rnxNavFile(QString fileName);
    4751  ~t_rnxNavFile();
     52  t_irc getNextEph(t_eph* eph);
     53  float version() const {return _header.version();}
     54  bool  glonass() const {return _header.glonass();}
    4855
    4956 private:
Note: See TracChangeset for help on using the changeset viewer.