Changeset 5228 in ntrip


Ignore:
Timestamp:
Jun 16, 2013, 4:15:05 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

    r5216 r5228  
    6262  _webView->show(); 
    6363
    64   // Test
    65   // ----
    66   _mode = mode_ppp;
    67   _testButton = new QPushButton(tr("Start Test"));
    68   _testButton->setMaximumWidth(10*ww);
    69   connect(_testButton,  SIGNAL(clicked()), this, SLOT(slotTest()));
     64  _statusLabel = new QLabel;
    7065
    7166  // Layout
    7267  // ------
    73   QHBoxLayout* buttonLayout = new QHBoxLayout;
    74   buttonLayout->addWidget(_testButton);
     68
     69  QHBoxLayout* statusLayout = new QHBoxLayout;
     70  statusLayout->addWidget(_statusLabel);
    7571
    7672  QVBoxLayout* mainLayout = new QVBoxLayout(this);
    7773  mainLayout->addWidget(_webView);
    78   mainLayout->addLayout(buttonLayout);
     74  mainLayout->addLayout(statusLayout);
    7975
    8076  setLayout(mainLayout);
     
    121117  _currLon = lon;
    122118  QString location = QString("%1, %2").arg(_currLat,0,'f',8).arg(_currLon,0,'f',8);
     119  _statusLabel->setText(location);
    123120  _webView->page()->mainFrame()->evaluateJavaScript(QString("gotoLocation( %1 )").arg(location));
    124 }
    125 
    126 //
    127 ////////////////////////////////////////////////////////////////////////////
    128 void bncMapWin::slotTest() {
    129 
    130   if (sender() == _testButton) {
    131     if (_mode == mode_ppp) {
    132       _mode = mode_test;
    133       _testButton->setText(tr("Stop Test"));
    134     }
    135     else {
    136       _mode = mode_ppp;
    137       _testButton->setText(tr("Start Test"));
    138       return;
    139     }
    140   }
    141    
    142   if (_mode == mode_test) {
    143     _currLat += 0.00001;
    144     _currLon += 0.00001;
    145     gotoLocation(_currLat, _currLon);
    146     QTimer::singleShot(100, this, SLOT(slotTest()));
    147   }
    148121}
    149122
  • trunk/BNC/src/map/bncmapwin.h

    r5187 r5228  
    4444 private slots:
    4545  void slotInitMap(bool isOk);
    46   void slotTest();
    4746
    4847 private:
    49   enum e_mode {mode_test, mode_ppp};
    5048  void loadHtmlPage();
    5149  void gotoLocation(double lat, double lon);
    52   QWebView*    _webView;
    53   QPushButton* _testButton;
    54   double       _currLat;
    55   double       _currLon;
    56   e_mode       _mode;
     50  QWebView* _webView;
     51  QLabel*   _statusLabel;
     52  double    _currLat;
     53  double    _currLon;
    5754};
    5855
Note: See TracChangeset for help on using the changeset viewer.