Changeset 5181 in ntrip for trunk/BNC/src/map/bncmapwin.cpp


Ignore:
Timestamp:
Jun 8, 2013, 3:57:39 PM (11 years ago)
Author:
mervart
Message:
 
File:
1 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}
Note: See TracChangeset for help on using the changeset viewer.