Changeset 3635 in ntrip for trunk/BNC


Ignore:
Timestamp:
Jan 23, 2012, 2:54:50 PM (12 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncpppclient.cpp

    r3521 r3635  
    4848#include "bncconst.h"
    4949#include "bncmodel.h"
    50 #include "bncsettings.h"
     50#include "pppopt.h"
    5151
    5252using namespace std;
     
    5454// Constructor
    5555////////////////////////////////////////////////////////////////////////////
    56 bncPPPclient::bncPPPclient(QByteArray staID) {
    57 
    58   bncSettings settings;
    59 
    60   if ( Qt::CheckState(settings.value("pppGLONASS").toInt()) == Qt::Checked) {
    61     _useGlonass = true;
     56bncPPPclient::bncPPPclient(QByteArray staID, t_pppOpt* opt) {
     57
     58  if (opt) {
     59    _opt      = opt;
     60    _optOwner = false;
    6261  }
    6362  else {
    64     _useGlonass = false;
    65   }
    66 
    67   if ( Qt::CheckState(settings.value("pppGalileo").toInt()) == Qt::Checked) {
    68     _useGalileo = true;
    69   }
    70   else {
    71     _useGalileo = false;
    72   }
    73 
    74   if (settings.value("pppSPP").toString() == "PPP") {
    75     _pppMode = true;
    76   }
    77   else {
    78     _pppMode = false;
    79   }
     63    _opt      = new t_pppOpt();
     64    _optOwner = true;
     65  }
     66
     67  _staID = staID;
     68  _model = new bncModel(staID);
    8069
    8170  connect(this, SIGNAL(newMessage(QByteArray,bool)),
     
    8574          this, SLOT(slotNewCorrections(QList<QString>)));
    8675
    87   _staID   = staID;
    88   _model   = new bncModel(staID);
    8976  connect(_model, SIGNAL(newNMEAstr(QByteArray)),
    9077          this,   SIGNAL(newNMEAstr(QByteArray)));
    91 
    92   _pppCorrMount = settings.value("pppCorrMount").toString();
    9378}
    9479
     
    11196    delete ib.value();
    11297  }
     98  if (_optOwner) {
     99    delete _opt;
     100  }
    113101}
    114102
     
    119107
    120108  if      (obs.satSys == 'R') {
    121     if (!_useGlonass) return;
     109    if (!_opt->useGlonass) return;
    122110  }
    123111  else if (obs.satSys == 'E') {
    124     if (!_useGalileo) return;
     112    if (!_opt->useGalileo) return;
    125113  }
    126114  else if (obs.satSys != 'G') {
     
    265253  // Check the Mountpoint (source of corrections)
    266254  // --------------------------------------------
    267   if (!_pppCorrMount.isEmpty()) {
     255  if (!_opt->pppCorrMount.isEmpty()) {
    268256    QMutableListIterator<QString> itm(corrList);
    269257    while (itm.hasNext()) {
     
    271259      if (hlp.size() > 0) {
    272260        QString mountpoint = hlp[hlp.size()-1];
    273         if (mountpoint != _pppCorrMount) {
     261        if (mountpoint != _opt->pppCorrMount) {
    274262          itm.remove();     
    275263        }
     
    368356  if (_eph.contains(prn)) {
    369357
    370     if (_pppMode) {
     358    if (_opt->pppMode) {
    371359      if (_corr.contains(prn)) {
    372360        t_corr* cc = _corr.value(prn);
     
    483471void bncPPPclient::processEpochs() {
    484472
    485   // Synchronization threshold (not used in SPP mode)
    486   // ------------------------------------------------
    487   bncSettings settings;
    488   double maxDt = settings.value("pppSync").toDouble();
    489   if (!_pppMode) {
    490     maxDt = 0.0;
    491   }
    492 
    493473  // Make sure the buffer does not grow beyond any limit
    494474  // ---------------------------------------------------
     
    507487    // No corrections yet, skip the epoch
    508488    // ----------------------------------
    509     if (maxDt != 0.0 && !_corr_tt.valid()) {
     489    if (_opt->corrSync != 0.0 && !_corr_tt.valid()) {
    510490      return;
    511491    }
     
    513493    // Process the front epoch
    514494    // -----------------------
    515     if (maxDt == 0 || frontEpoData->tt - _corr_tt < maxDt) {
     495    if (_opt->corrSync == 0 || frontEpoData->tt - _corr_tt < _opt->corrSync) {
    516496      processFrontEpoch();
    517497      delete _epoData.front();
  • trunk/BNC/bncpppclient.h

    r3535 r3635  
    3131
    3232class bncModel;
     33class t_pppOpt;
    3334
    3435class t_satData {
     
    121122
    122123 public:
    123   bncPPPclient(QByteArray staID);
     124  bncPPPclient(QByteArray staID, t_pppOpt* opt = 0);
    124125  ~bncPPPclient();
    125126  void putNewObs(const t_obs& pp);
     
    156157  t_irc cmpToT(t_satData* satData);
    157158
     159  t_pppOpt*               _opt;
     160  bool                    _optOwner;
    158161  QByteArray              _staID;
    159162  QMap<QString, t_corr*>  _corr;
     
    162165  std::queue<t_epoData*>  _epoData;
    163166  bncModel*               _model;
    164   bool                    _useGlonass;
    165   bool                    _useGalileo;
    166   bool                    _pppMode;
    167167  QMap<QString, slipInfo> _slips;
    168   QString                 _pppCorrMount;
    169168};
    170169
  • trunk/BNC/pppopt.cpp

    r3633 r3635  
    6363  antEccNEU[2] = settingsToDouble("pppRefdU");
    6464  maxSolGap    = settingsToDouble("pppMaxSolGap");
    65   quickStart   = settingsToDouble("pppQuickStart"); if (!refCrdSet()) quickStart = 0.0;
    66   corrSync     = settingsToDouble("pppSync");       if (!pppMode) corrSync = 0.0;
     65  quickStart   = settingsToDouble("pppQuickStart");
     66  corrSync     = settingsToDouble("pppSync");       
    6767
    6868  pppCorrMount = settings.value("pppCorrMount").toString();
     
    7777  useGlonass   = settingsChecked("pppGLONASS");
    7878  useGalileo   = settingsChecked("pppGalileo");
     79
     80  if (!refCrdSet()) quickStart = 0.0;
     81  if (!pppMode)     corrSync   = 0.0;
    7982}
    8083
Note: See TracChangeset for help on using the changeset viewer.