Changeset 6518 in ntrip


Ignore:
Timestamp:
Dec 30, 2014, 2:36:15 PM (9 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/PPP/pppEphPool.cpp

    r6465 r6518  
    2626/////////////////////////////////////////////////////////////////////////////
    2727void t_pppEphPool::putEphemeris(t_eph* eph) {
    28   if (eph && eph->ok()) {
     28  if (eph && eph->checkState() != t_eph::bad) {
    2929    _satEphPool[eph->prn().toInt()].putEphemeris(_maxQueueSize, eph);
    3030  }
  • trunk/BNC/src/bncephuser.cpp

    r6444 r6518  
    111111  }
    112112
     113  if (check) {
     114    checkEphemeris(eph);
     115  }
     116
    113117  const t_ephGPS*     ephGPS     = dynamic_cast<const t_ephGPS*>(eph);
    114118  const t_ephGlo*     ephGlo     = dynamic_cast<const t_ephGlo*>(eph);
     
    157161}
    158162
     163//
     164////////////////////////////////////////////////////////////////////////////
     165void bncEphUser::checkEphemeris(const t_eph* eph) {
     166
     167}
  • trunk/BNC/src/bncephuser.h

    r6445 r6518  
    7272
    7373 private:
     74  void checkEphemeris(const t_eph* eph);
    7475  QMutex                             _mutex;
    7576  static const unsigned              _maxQueueSize = 5;
  • trunk/BNC/src/ephemeris.cpp

    r6400 r6518  
    2121////////////////////////////////////////////////////////////////////////////
    2222t_eph::t_eph() {
    23   _ok      = false;
    24   _orbCorr = 0;
    25   _clkCorr = 0;
     23  _checkState = unchecked;
     24  _orbCorr    = 0;
     25  _clkCorr    = 0;
    2626}
    2727
     
    4343////////////////////////////////////////////////////////////////////////////
    4444t_irc t_eph::getCrd(const bncTime& tt, ColumnVector& xc, ColumnVector& vv, bool useCorr) const {
     45
     46  if (_checkState == bad) {
     47    return failure;
     48  }
     49
    4550  xc.ReSize(4);
    4651  vv.ReSize(3);
     
    8893  }
    8994  else {
    90     _ok = false;
     95    _checkState = bad;
    9196    return;
    9297  }
     
    134139  _TOT         = 0.9999e9;
    135140  _fitInterval = 0.0;
    136 
    137   _ok       = true;
    138141}
    139142
     
    141144////////////////////////////////////////////////////////////////////////////
    142145t_irc t_ephGPS::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
     146
     147  if (_checkState == bad) {
     148    return failure;
     149  }
    143150
    144151  static const double omegaEarth = 7292115.1467e-11;
     
    261268t_irc t_ephGlo::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
    262269
     270  if (_checkState == bad) {
     271    return failure;
     272  }
     273
    263274  static const double nominalStep = 10.0;
    264275
     
    402413  _xv(5) = _y_velocity * 1.e3;
    403414  _xv(6) = _z_velocity * 1.e3;
    404 
    405   _ok = true;
    406415}
    407416
     
    452461
    453462  _flags    = ee->flags;
    454 
    455   _ok = true;
    456463}
    457464
     
    459466////////////////////////////////////////////////////////////////////////////
    460467t_irc t_ephGal::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
     468
     469  if (_checkState == bad) {
     470    return failure;
     471  }
    461472
    462473  static const double omegaEarth = 7292115.1467e-11;
     
    545556  const int nLines = 8;
    546557
    547   _ok = false;
    548 
    549558  if (lines.size() != nLines) {
     559    _checkState = bad;
    550560    return;
    551561  }
     
    596606           readDbl(line, pos[2], fieldLen, _clock_drift    ) ||
    597607           readDbl(line, pos[3], fieldLen, _clock_driftrate) ) {
     608        _checkState = bad;
    598609        return;
    599610      }
     
    605616           readDbl(line, pos[2], fieldLen, _Delta_n) ||
    606617           readDbl(line, pos[3], fieldLen, _M0     ) ) {
     618        _checkState = bad;
    607619        return;
    608620      }
     
    614626           readDbl(line, pos[2], fieldLen, _Cus   ) ||
    615627           readDbl(line, pos[3], fieldLen, _sqrt_A) ) {
     628        _checkState = bad;
    616629        return;
    617630      }
     
    623636           readDbl(line, pos[2], fieldLen, _OMEGA0)  ||
    624637           readDbl(line, pos[3], fieldLen, _Cis   ) ) {
     638        _checkState = bad;
    625639        return;
    626640      }
     
    632646           readDbl(line, pos[2], fieldLen, _omega   ) ||
    633647           readDbl(line, pos[3], fieldLen, _OMEGADOT) ) {
     648        _checkState = bad;
    634649        return;
    635650      }
     
    641656           readDbl(line, pos[2], fieldLen, _TOEweek  ) ||
    642657           readDbl(line, pos[3], fieldLen, _L2PFlag) ) {
     658        _checkState = bad;
    643659        return;
    644660      }
     
    650666           readDbl(line, pos[2], fieldLen, _TGD   ) ||
    651667           readDbl(line, pos[3], fieldLen, _IODC  ) ) {
     668        _checkState = bad;
    652669        return;
    653670      }
     
    656673    else if ( iLine == 7 ) {
    657674      if ( readDbl(line, pos[0], fieldLen, _TOT) ) {
     675        _checkState = bad;
    658676        return;
    659677      }
     
    661679    }
    662680  }
    663 
    664   _ok = true;
    665681}
    666682
     
    671687  const int nLines = 4;
    672688
    673   _ok = false;
    674 
    675689  if (lines.size() != nLines) {
     690    _checkState = bad;
    676691    return;
    677692  }
     
    722737           readDbl(line, pos[2], fieldLen, _gamma) ||
    723738           readDbl(line, pos[3], fieldLen, _tki  ) ) {
     739        _checkState = bad;
    724740        return;
    725741      }
     
    733749           readDbl(line, pos[2], fieldLen, _x_acceleration) ||
    734750           readDbl(line, pos[3], fieldLen, _health        ) ) {
     751        _checkState = bad;
    735752        return;
    736753      }
     
    742759           readDbl(line, pos[2], fieldLen, _y_acceleration  ) ||
    743760           readDbl(line, pos[3], fieldLen, _frequency_number) ) {
     761        _checkState = bad;
    744762        return;
    745763      }
     
    751769           readDbl(line, pos[2], fieldLen, _z_acceleration)  ||
    752770           readDbl(line, pos[3], fieldLen, _E             ) ) {
     771        _checkState = bad;
    753772        return;
    754773      }
     
    766785  _xv(5) = _y_velocity * 1.e3;
    767786  _xv(6) = _z_velocity * 1.e3;
    768 
    769   _ok = true;
    770787}
    771788
     
    776793  const int nLines = 8;
    777794
    778   _ok = false;
    779 
    780795  if (lines.size() != nLines) {
     796    _checkState = bad;
    781797    return;
    782798  }
     
    824840           readDbl(line, pos[2], fieldLen, _clock_drift    ) ||
    825841           readDbl(line, pos[3], fieldLen, _clock_driftrate) ) {
     842        _checkState = bad;
    826843        return;
    827844      }
     
    833850           readDbl(line, pos[2], fieldLen, _Delta_n) ||
    834851           readDbl(line, pos[3], fieldLen, _M0     ) ) {
     852        _checkState = bad;
    835853        return;
    836854      }
     
    842860           readDbl(line, pos[2], fieldLen, _Cus   ) ||
    843861           readDbl(line, pos[3], fieldLen, _sqrt_A) ) {
     862        _checkState = bad;
    844863        return;
    845864      }
     
    851870           readDbl(line, pos[2], fieldLen, _OMEGA0)  ||
    852871           readDbl(line, pos[3], fieldLen, _Cis   ) ) {
     872        _checkState = bad;
    853873        return;
    854874      }
     
    860880           readDbl(line, pos[2], fieldLen, _omega   ) ||
    861881           readDbl(line, pos[3], fieldLen, _OMEGADOT) ) {
     882        _checkState = bad;
    862883        return;
    863884      }
     
    867888      if ( readDbl(line, pos[0], fieldLen, _IDOT    ) ||
    868889           readDbl(line, pos[2], fieldLen, _TOEweek) ) {
     890        _checkState = bad;
    869891        return;
    870892      }
     
    876898           readDbl(line, pos[2], fieldLen, _BGD_1_5A) ||
    877899           readDbl(line, pos[3], fieldLen, _BGD_1_5B) ) {
     900        _checkState = bad;
    878901        return;
    879902      }
     
    882905    else if ( iLine == 7 ) {
    883906      if ( readDbl(line, pos[0], fieldLen, _TOT) ) {
    884         return;
    885       }
    886     }
    887   }
    888 
    889   _ok = true;
     907        _checkState = bad;
     908        return;
     909      }
     910    }
     911  }
    890912}
    891913
     
    11071129  const int nLines = 4;
    11081130
    1109   _ok = false;
    1110 
    11111131  if (lines.size() != nLines) {
     1132    _checkState = bad;
    11121133    return;
    11131134  }
     
    11551176           readDbl(line, pos[2], fieldLen, _agf1 ) ||
    11561177           readDbl(line, pos[3], fieldLen, _TOW  ) ) {
     1178        _checkState = bad;
    11571179        return;
    11581180      }
     
    11641186           readDbl(line, pos[2], fieldLen, _x_acceleration) ||
    11651187           readDbl(line, pos[3], fieldLen, _health        ) ) {
     1188        _checkState = bad;
    11661189        return;
    11671190      }
     
    11731196           readDbl(line, pos[2], fieldLen, _y_acceleration  ) ||
    11741197           readDbl(line, pos[3], fieldLen, _ura             ) ) {
     1198        _checkState = bad;
    11751199        return;
    11761200      }
     
    11821206           readDbl(line, pos[2], fieldLen, _z_acceleration)  ||
    11831207           readDbl(line, pos[3], fieldLen, _IODN          ) ) {
     1208        _checkState = bad;
    11841209        return;
    11851210      }
     
    11961221  _y_acceleration *= 1.e3;
    11971222  _z_acceleration *= 1.e3;
    1198 
    1199   _ok = true;
    12001223}
    12011224
     
    12271250  _ura            = ee->URA;
    12281251
    1229   _ok     = true;
    12301252  _health = 0;
    12311253}
     
    12341256////////////////////////////////////////////////////////////////////////////
    12351257t_irc t_ephSBAS::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
     1258
     1259  if (_checkState == bad) {
     1260    return failure;
     1261  }
    12361262
    12371263  bncTime tt(GPSweek, GPSweeks);
     
    12931319  const int nLines = 8;
    12941320
    1295   _ok = false;
    1296 
    12971321  if (lines.size() != nLines) {
     1322    _checkState = bad;
    12981323    return;
    12991324  }
     
    13451370           readDbl(line, pos[2], fieldLen, _clock_drift    ) ||
    13461371           readDbl(line, pos[3], fieldLen, _clock_driftrate) ) {
     1372        _checkState = bad;
    13471373        return;
    13481374      }
     
    13551381           readDbl(line, pos[2], fieldLen, _Delta_n) ||
    13561382           readDbl(line, pos[3], fieldLen, _M0     ) ) {
     1383        _checkState = bad;
    13571384        return;
    13581385      }
     
    13651392           readDbl(line, pos[2], fieldLen, _Cus   ) ||
    13661393           readDbl(line, pos[3], fieldLen, _sqrt_A) ) {
     1394        _checkState = bad;
    13671395        return;
    13681396      }
     
    13741402           readDbl(line, pos[2], fieldLen, _OMEGA0)  ||
    13751403           readDbl(line, pos[3], fieldLen, _Cis   ) ) {
     1404        _checkState = bad;
    13761405        return;
    13771406      }
     
    13831412           readDbl(line, pos[2], fieldLen, _omega   ) ||
    13841413           readDbl(line, pos[3], fieldLen, _OMEGADOT) ) {
     1414        _checkState = bad;
    13851415        return;
    13861416      }
     
    13901420      if ( readDbl(line, pos[0], fieldLen, _IDOT    ) ||
    13911421           readDbl(line, pos[2], fieldLen, TOEw)    ) {
     1422        _checkState = bad;
    13921423        return;
    13931424      }
     
    13991430           readDbl(line, pos[2], fieldLen, _TGD1) ||
    14001431           readDbl(line, pos[3], fieldLen, _TGD2) ) {
     1432        _checkState = bad;
    14011433        return;
    14021434      }
     
    14081440      if ( readDbl(line, pos[0], fieldLen, TOTs) ||
    14091441           readDbl(line, pos[1], fieldLen, aodc) ) {
     1442        _checkState = bad;
    14101443        return;
    14111444      }
     
    14281461  //         but it seems to be unreliable in RINEX files
    14291462  _TOT = _TOC;
    1430 
    1431   _ok = true;
    14321463}
    14331464
     
    14351466//////////////////////////////////////////////////////////////////////////////
    14361467t_irc t_ephCompass::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
     1468
     1469  if (_checkState == bad) {
     1470    return failure;
     1471  }
    14371472
    14381473  static const double gmCompass    = 398.6004418e12;
  • trunk/BNC/src/ephemeris.h

    r6400 r6518  
    2020 public:
    2121  enum e_type {unknown, GPS, QZSS, GLONASS, Galileo, SBAS, Compass};
     22  enum e_checkState {unchecked, ok, suspicious, bad};
    2223
    2324  t_eph();
     
    2829  virtual int     IOD() const = 0;
    2930  virtual int     slotNum() const {return 0;}
    30   bool    ok() const {return _ok;}
    3131  bncTime TOC() const {return _TOC;}
    3232  bool    isNewerThan(const t_eph* eph) const {return earlierTime(eph, this);}
     33  e_checkState checkState() const {return _checkState;}
    3334  t_prn   prn() const {return _prn;}
    3435  t_irc   getCrd(const bncTime& tt, ColumnVector& xc, ColumnVector& vv, bool useCorr) const;
     
    4243 protected: 
    4344  virtual t_irc position(int GPSweek, double GPSweeks, double* xc, double* vv) const = 0;
    44   t_prn      _prn;
    45   bncTime    _TOC;
    46   QDateTime  _receptDateTime;
    47   bool       _ok;
    48   t_orbCorr* _orbCorr;
    49   t_clkCorr* _clkCorr;
     45  t_prn        _prn;
     46  bncTime      _TOC;
     47  QDateTime    _receptDateTime;
     48  e_checkState _checkState;
     49  t_orbCorr*   _orbCorr;
     50  t_clkCorr*   _clkCorr;
    5051};
    5152
  • trunk/BNC/src/rinex/rnxnavfile.cpp

    r6401 r6518  
    200200      eph = new t_ephCompass(version(), lines);
    201201    }
    202     if (eph && eph->ok()) {
     202    if (eph && eph->checkState() != t_eph::bad) {
    203203      _ephs.push_back(eph);
    204204    }
Note: See TracChangeset for help on using the changeset viewer.