Changeset 5181 in ntrip


Ignore:
Timestamp:
Jun 8, 2013, 3:57:39 PM (11 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src/map
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/map/bncmapwin.cpp

    r5180 r5181  
    6363  // Test
    6464  // ----
    65   QPushButton* testButton = new QPushButton(tr("Test"));
    66   testButton->setMaximumWidth(10*ww);
    67   connect(testButton,  SIGNAL(clicked()), this, SLOT(slotTest()));
     65  _mode = mode_ppp;
     66  _testButton = new QPushButton(tr("Start Test"));
     67  _testButton->setMaximumWidth(10*ww);
     68  connect(_testButton,  SIGNAL(clicked()), this, SLOT(slotTest()));
    6869
    6970  // Layout
    7071  // ------
    7172  QHBoxLayout* buttonLayout = new QHBoxLayout;
    72   buttonLayout->addWidget(testButton);
     73  buttonLayout->addWidget(_testButton);
    7374
    7475  QVBoxLayout* mainLayout = new QVBoxLayout(this);
     
    125126////////////////////////////////////////////////////////////////////////////
    126127void bncMapWin::slotTest() {
    127   _currLat += 0.00001;
    128   _currLon += 0.00001;
    129   slotGotoLocation(_currLat, _currLon);
    130   QTimer::singleShot(100, this, SLOT(slotTest()));
     128
     129  if (sender() == _testButton) {
     130    if (_mode == mode_ppp) {
     131      _mode = mode_test;
     132      _testButton->setText(tr("Stop Test"));
     133    }
     134    else {
     135      _mode = mode_ppp;
     136      _testButton->setText(tr("Start Test"));
     137      return;
     138    }
     139  }
     140   
     141  if (_mode == mode_test) {
     142    _currLat += 0.00001;
     143    _currLon += 0.00001;
     144    slotGotoLocation(_currLat, _currLon);
     145    QTimer::singleShot(100, this, SLOT(slotTest()));
     146  }
    131147}
  • trunk/BNC/src/map/bncmapwin.h

    r5180 r5181  
    4646
    4747 private:
     48  enum e_mode {mode_test, mode_ppp};
    4849  void loadHtmlPage();
    49   QWebView* _webView;
    50   double    _currLat;
    51   double    _currLon;
     50  QWebView*    _webView;
     51  QPushButton* _testButton;
     52  double       _currLat;
     53  double       _currLon;
     54  e_mode       _mode;
    5255};
    5356
Note: See TracChangeset for help on using the changeset viewer.