Changeset 6065 in ntrip


Ignore:
Timestamp:
Sep 7, 2014, 9:58:10 AM (10 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src/PPP_free
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/PPP_free/bncmodel.cpp

    r6064 r6065  
    590590  // ----------------------
    591591  if (update_p(epoData) != success) {
    592     _pppClient->emitNewMessage(_log, false);
     592    LOG << _log.data() << endl;
    593593    return failure;
    594594  }
     
    642642  strB << '\n';
    643643  _log += strB.str().c_str();
    644   _pppClient->emitNewMessage(_log, false);
     644  LOG << _log.data() << endl;
    645645
    646646  // Final Message (both log file and screen)
     
    675675  }
    676676
    677   _pppClient->emitNewMessage(QByteArray(strC.str().c_str()), true);
     677  LOG << strC.str() << endl;
    678678
    679679  delete newPos;
  • trunk/BNC/src/PPP_free/bncpppclient.cpp

    r6055 r6065  
    5555// Constructor
    5656////////////////////////////////////////////////////////////////////////////
    57 bncPPPclient::bncPPPclient(QByteArray staID, t_pppOptions* opt, bool connectSlots) :
    58   bncEphUser(connectSlots) {
    59 
    60   if (opt) {
    61     _opt      = opt;
    62     _optOwner = false;
    63   }
    64   else {
    65     _opt      = new t_pppOptions();
    66     _optOwner = true;
    67   }
    68 
     57bncPPPclient::bncPPPclient(QByteArray staID, t_pppOptions* opt) : bncEphUser(false) {
     58
     59  _opt   = opt;
    6960  _staID = staID;
    70 
    7161  _model = new bncModel(this);
    72 
    73   if (connectSlots) {
    74     connect(this, SIGNAL(newMessage(QByteArray,bool)),
    75             BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
    76 
    77     connect(BNC_CORE, SIGNAL(newCorrections(QList<QString>)),
    78             this, SLOT(slotNewCorrections(QList<QString>)));
    79 
    80     connect(BNC_CORE, SIGNAL(providerIDChanged(QString)),
    81             this, SLOT(slotProviderIDChanged(QString)));
    82   }
    8362}
    8463
     
    8665////////////////////////////////////////////////////////////////////////////
    8766bncPPPclient::~bncPPPclient() {
    88   delete _model;
    8967  while (!_epoData.empty()) {
    9068    delete _epoData.front();
     
    10179    delete ib.value();
    10280  }
    103   if (_optOwner) {
    104     delete _opt;
    105   }
     81  delete _model;
    10682}
    10783
     
    257233//
    258234////////////////////////////////////////////////////////////////////////////
    259 void bncPPPclient::slotNewCorrections(QList<QString> corrList) {
     235void bncPPPclient::putNewCorrections(QList<QString> corrList) {
    260236  QMutexLocker locker(&_mutex);
    261237
     
    472448  }
    473449
    474   emit newMessage(msg.toAscii(), false);
     450  LOG << msg.toAscii() << endl;
    475451#endif // BNC_DEBUG
    476452
     
    493469  // ---------------
    494470  if (_model->update(_epoData.front()) == success) {
    495     emit newPosition(_model->time(), _model->x(), _model->y(), _model->z());
     471    ///    emit newPosition(_model->time(), _model->x(), _model->y(), _model->z());
    496472  }
    497473}
     
    533509  }
    534510}
    535 
    536 //
    537 ////////////////////////////////////////////////////////////////////////////
    538 void bncPPPclient::slotProviderIDChanged(QString mountPoint) {
    539   QMutexLocker locker(&_mutex);
    540 
    541   if (mountPoint != QString(_opt->_corrMount.c_str())) {
    542     return;
    543   }
    544   emit newMessage("bncPPPclient " + _staID + ": Provider Changed: " + mountPoint.toAscii() + "\n", true);
    545 
    546   delete _model;
    547   _model = new bncModel(this);
    548 
    549   while (!_epoData.empty()) {
    550     delete _epoData.front();
    551     _epoData.pop();
    552   }
    553 
    554   QMapIterator<QString, t_corr*> ic(_corr);
    555   while (ic.hasNext()) {
    556     ic.next();
    557     delete ic.value();
    558   }
    559   _corr.clear();
    560  
    561   QMapIterator<QString, t_bias*> ib(_bias);
    562   while (ib.hasNext()) {
    563     ib.next();
    564     delete ib.value();
    565   }
    566   _bias.clear();
    567 }
  • trunk/BNC/src/PPP_free/bncpppclient.h

    r6055 r6065  
    117117
    118118class bncPPPclient : public bncEphUser {
    119  Q_OBJECT
     119 public:
     120  bncPPPclient(QByteArray staID, t_pppOptions* opt);
     121  ~bncPPPclient();
     122  void                putNewObs(const t_obs& pp);
     123  void                putNewCorrections(QList<QString> corrList);
    120124
    121  public:
    122   bncPPPclient(QByteArray staID, t_pppOptions* opt = 0, bool connectSlots = true);
    123   ~bncPPPclient();
    124   void putNewObs(const t_obs& pp);
    125   static t_irc applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc,
    126                          ColumnVector& vv);
    127   QByteArray staID() const {return _staID;}
     125  QByteArray          staID() const {return _staID;}
    128126  const t_pppOptions* opt() const {return _opt;}
    129   void emitNewMessage(QByteArray msg, bool showOnScreen) {
    130     emit newMessage(msg, showOnScreen);
    131   }
    132   void emitNewNMEAstr(QByteArray str) {
    133     emit newNMEAstr(str);
    134   }
    135127
    136  public slots:
    137   void slotNewCorrections(QList<QString> corrList);
    138   void slotProviderIDChanged(QString mountPoint);
     128  static t_irc applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc, ColumnVector& vv);
    139129
    140  signals:
    141   void newMessage(QByteArray msg, bool showOnScreen);
    142   void newPosition(bncTime time, double x, double y, double z);
    143   void newNMEAstr(QByteArray str);
    144130
    145131 private:
     
    163149  t_irc cmpToT(t_satData* satData);
    164150
    165   t_pppOptions*           _opt;
    166   bool                    _optOwner;
     151  const t_pppOptions*     _opt;
    167152  QByteArray              _staID;
    168153  QMap<QString, t_corr*>  _corr;
Note: See TracChangeset for help on using the changeset viewer.