Changeset 5736 in ntrip


Ignore:
Timestamp:
Aug 1, 2014, 7:49:40 AM (10 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src/PPP
Files:
6 edited

Legend:

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

    r5712 r5736  
    5050}
    5151
     52// Destructor
     53//////////////////////////////////////////////////////////////////////////////
     54t_options::~t_options() {
     55  cout << "~t_options" << endl;
     56}
     57
  • trunk/BNC/src/PPP/options.h

    r5735 r5736  
    1212 public:
    1313  t_options();
    14   ~t_options() {};
     14  ~t_options();
    1515  bool         _realTime;
    1616  std::string  _roverName;     
  • trunk/BNC/src/PPP/pppMain.cpp

    r5730 r5736  
    6868  readOptions();
    6969
    70   QListIterator<QSharedPointer<t_options> > it(_options);
    71   while (it.hasNext()) {
    72     QSharedPointer<t_options> opt = it.next();
    73     t_pppThread* pppThread = new t_pppThread(opt.data());
     70  QListIterator<t_options*> iOpt(_options);
     71  while (iOpt.hasNext()) {
     72    const t_options* opt = iOpt.next();
     73    t_pppThread* pppThread = new t_pppThread(opt);
    7474    pppThread->start();
    7575    _pppThreads << pppThread;
     
    9393  _pppThreads.clear();
    9494
     95  QListIterator<t_options*> iOpt(_options);
     96  while (iOpt.hasNext()) {
     97    delete iOpt.next();
     98  }
     99  _options.clear();
     100
    95101  _running = false;
    96102}
     
    100106void t_pppMain::readOptions() {
    101107
     108  QListIterator<t_options*> iOpt(_options);
     109  while (iOpt.hasNext()) {
     110    delete iOpt.next();
     111  }
    102112  _options.clear();
    103113
     
    119129  }
    120130
    121   QListIterator<QString> it(settings.value("PPP/staTable").toStringList());
    122   while (it.hasNext()) {
    123     QStringList hlp = it.next().split(",");
     131  QListIterator<QString> iSta(settings.value("PPP/staTable").toStringList());
     132  while (iSta.hasNext()) {
     133    QStringList hlp = iSta.next().split(",");
    124134
    125135    if (hlp.size() < 9) {
     
    127137    }
    128138
    129     QSharedPointer<t_options> opt(new t_options());
     139    t_options* opt = new t_options();
    130140
    131141    opt->_realTime    = realTime;
  • trunk/BNC/src/PPP/pppMain.h

    r5719 r5736  
    1818  void readOptions();
    1919
    20   QList<QSharedPointer<t_options> > _options;
    21   QList<t_pppThread*>               _pppThreads;
    22   QString                           _logFile;
    23   QString                           _nmeaFile;
    24   int                               _nmeaPort;
    25   bool                              _running;
     20  QList<t_options*>  _options;
     21  QList<t_pppThread*> _pppThreads;
     22  QString             _logFile;
     23  QString             _nmeaFile;
     24  int                 _nmeaPort;
     25  bool                _running;
    2626};
    2727
  • trunk/BNC/src/PPP/pppThread.cpp

    r5732 r5736  
    5454////////////////////////////////////////////////////////////////////////////
    5555t_pppThread::t_pppThread(const t_options* opt) : QThread(0) {
    56   _opt = *opt;
     56  _opt = opt;
    5757}
    5858
     
    6868void t_pppThread::run() {
    6969
    70   cout << _opt._roverName << " run" << endl;
     70  cout << _opt->_roverName << " run" << endl;
    7171
    7272  _pppRun = new t_pppRun(_opt);
    7373  QThread::exec();
    7474
    75   cout << _opt._roverName << " exit" << endl;
     75  cout << _opt->_roverName << " exit" << endl;
    7676}
    7777
    7878// Constructor
    7979////////////////////////////////////////////////////////////////////////////
    80 t_pppRun::t_pppRun(const t_options& opt) {
     80t_pppRun::t_pppRun(const t_options* opt) {
    8181  _opt = opt;
    8282
     
    109109void t_pppRun::slotNewEphGPS(gpsephemeris gpseph) {
    110110  QMutexLocker locker(&_mutex);
    111   cout << _opt._roverName << " slotNewEphGPS" << endl;
     111  cout << _opt->_roverName << " slotNewEphGPS" << endl;
    112112}
    113113
     
    116116void t_pppRun::slotNewEphGlonass(glonassephemeris gloeph) {
    117117  QMutexLocker locker(&_mutex);
    118   cout << _opt._roverName << " slotNewEphGlonass" << endl;
     118  cout << _opt->_roverName << " slotNewEphGlonass" << endl;
    119119}
    120120 
     
    123123void t_pppRun::slotNewEphGalileo(galileoephemeris /* galeph */) {
    124124  QMutexLocker locker(&_mutex);
    125   cout << _opt._roverName << " slotNewEphGalileo" << endl;
     125  cout << _opt->_roverName << " slotNewEphGalileo" << endl;
    126126}
    127127
     
    130130void t_pppRun::slotNewCorrections(QStringList corrList) {
    131131  QMutexLocker locker(&_mutex);
    132   cout << _opt._roverName << " slotNewCorrections" << endl;
     132  cout << _opt->_roverName << " slotNewCorrections" << endl;
    133133}
    134134//
     
    136136void t_pppRun::slotNewObs(QByteArray staID, QList<t_obs> obsList) {
    137137  QMutexLocker locker(&_mutex);
    138   cout << _opt._roverName << " slotNewObs" << endl;
     138  cout << _opt->_roverName << " slotNewObs" << endl;
    139139}
    140140   
  • trunk/BNC/src/PPP/pppThread.h

    r5732 r5736  
    1313 Q_OBJECT
    1414 public:
    15   t_pppRun(const t_options& opt);
     15  t_pppRun(const t_options* opt);
    1616  ~t_pppRun();
    1717
     
    2424
    2525 private:
    26   QMutex    _mutex;
    27   t_options _opt;
     26  QMutex           _mutex;
     27  const t_options* _opt;
    2828};
    2929
     
    3535
    3636 private:
    37   t_options _opt;
    38   t_pppRun* _pppRun;
     37  const t_options* _opt;
     38  t_pppRun*        _pppRun;
    3939};
    4040
Note: See TracChangeset for help on using the changeset viewer.