Changeset 5486 in ntrip for trunk/GnssCenter


Ignore:
Timestamp:
Sep 18, 2013, 2:54:23 PM (11 years ago)
Author:
mervart
Message:
 
Location:
trunk/GnssCenter/monitor
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GnssCenter/monitor/monitor.cpp

    r5482 r5486  
    7676  _thriftClient = 0;
    7777  _results      = 0;
     78  _satellites   = 0;
    7879
    7980  // Read Settings, Set Title, Enable/Disable Actions
     
    9596    delete _results;
    9697  }
     98  if (_satellites) {
     99    while (!_satellites->empty()) {
     100      delete _satellites->back();
     101      _satellites->pop_back();
     102    }
     103    delete _satellites;
     104  }
    97105}
    98106
     
    163171    connect(_thriftClient, SIGNAL(message(QByteArray)), this, SLOT(slotMessage(QByteArray)));
    164172    _thriftClient->start();
    165     slotPlotResults();
     173    slotPlot();
    166174  }
    167175  enableActions();
     
    202210//
    203211/////////////////////////////////////////////////////////////////////////////
    204 void t_monitor::slotPlotResults() {
     212void t_monitor::putThriftSatellites(std::vector<t_thriftSatellite*>* satellites) {
    205213  QMutexLocker locker(&_mutex);
    206 
     214  if (_satellites) {
     215    while (!_satellites->empty()) {
     216      delete _satellites->back();
     217      _satellites->pop_back();
     218    }
     219    delete _satellites;
     220  }
     221  _satellites = satellites;
     222}
     223
     224//
     225/////////////////////////////////////////////////////////////////////////////
     226void t_monitor::slotPlot() {
     227  QMutexLocker locker(&_mutex);
     228  plotResults();
     229  plotSatellites();
     230  if (_thriftClient) {
     231    QTimer::singleShot(1000, this, SLOT(slotPlotResults()));
     232  }
     233}
     234
     235//
     236/////////////////////////////////////////////////////////////////////////////
     237void t_monitor::plotResults() {
    207238  if (_results) {
    208239    QList<t_worldPlot::t_point*> points;
     
    232263    }
    233264  }
    234 
    235   if (_thriftClient) {
    236     QTimer::singleShot(1000, this, SLOT(slotPlotResults()));
    237   }
    238 }
     265}
     266
     267//
     268/////////////////////////////////////////////////////////////////////////////
     269void t_monitor::plotSatellites() {
     270  if (_satellites) {
     271  }
     272}
  • trunk/GnssCenter/monitor/monitor.h

    r5482 r5486  
    1111  class t_thriftClient;
    1212  class t_thriftResult;
     13  class t_thriftSatellite;
    1314}
    1415
     
    2223
    2324  void putThriftResults(std::vector<t_thriftResult*>* results);
     25  void putThriftSatellites(std::vector<t_thriftSatellite*>* satellites);
    2426
    2527 private slots:
     
    2830  void slotStopThrift();
    2931  void slotThriftFinished();
    30   void slotPlotResults();
     32  void slotPlot();
    3133  void slotMessage(QByteArray msg);
    3234
     
    3537  void setTitle();
    3638  void enableActions();
    37   QMutex                        _mutex;
    38   QTabWidget*                   _tabWidget;
    39   QAction*                      _actConfig;
    40   QAction*                      _actStartThrift;
    41   QAction*                      _actStopThrift;
    42   QString                       _host;
    43   QString                       _port;
    44   t_thriftClient*               _thriftClient;
    45   t_worldPlot*                  _plotStations;
    46   t_worldPlot*                  _plotSatellites;
    47   std::vector<t_thriftResult*>* _results;
     39  void plotResults();
     40  void plotSatellites();
     41  QMutex                           _mutex;
     42  QTabWidget*                      _tabWidget;
     43  QAction*                         _actConfig;
     44  QAction*                         _actStartThrift;
     45  QAction*                         _actStopThrift;
     46  QString                          _host;
     47  QString                          _port;
     48  t_thriftClient*                  _thriftClient;
     49  t_worldPlot*                     _plotStations;
     50  t_worldPlot*                     _plotSatellites;
     51  std::vector<t_thriftResult*>*    _results;
     52  std::vector<t_thriftSatellite*>* _satellites;
    4853};
    4954
  • trunk/GnssCenter/monitor/thriftclient.cpp

    r5485 r5486  
    9999    satellite->_y   = sat.xyz.y;
    100100    satellite->_z   = sat.xyz.z;
    101     cout << satellite->_prn << ' ' << satellite->_x << endl;
     101    satellites->push_back(satellite);
    102102  }
     103  _parent->putThriftSatellites(satellites);
    103104}
    104105
Note: See TracChangeset for help on using the changeset viewer.