Changeset 2753 in ntrip


Ignore:
Timestamp:
Dec 1, 2010, 2:02:27 PM (13 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bnc.pro

    r2579 r2753  
    4141          bncfigurelate.h bncpppclient.h bncversion.h                 \
    4242          bancroft.h bncmodel.h bncfigureppp.h bncrawfile.h           \
    43           bnctides.h                                                  \
     43          bnctides.h bncmap.h                                         \
    4444          RTCM/GPSDecoder.h RTCM/RTCM2.h RTCM/RTCM2Decoder.h          \
    4545          RTCM/RTCM2_2021.h RTCM/rtcm_utils.h                         \
     
    7171          bncfigurelate.cpp bncpppclient.cpp bnctime.cpp              \
    7272          bancroft.cpp bncmodel.cpp bncfigureppp.cpp bncrawfile.cpp   \
    73           bnctides.cpp                                                \
     73          bnctides.cpp bncmap.cpp                                     \
    7474          RTCM/RTCM2.cpp RTCM/RTCM2Decoder.cpp                        \
    7575          RTCM/RTCM2_2021.cpp RTCM/rtcm_utils.cpp                     \
  • trunk/BNC/bnctabledlg.cpp

    r1848 r2753  
    4545#include "bncnetqueryv1.h"
    4646#include "bncsettings.h"
     47#include "bncmap.h"
    4748
    4849using namespace std;
     
    140141  connect(_buttonGet, SIGNAL(clicked()), this, SLOT(slotGetTable()));
    141142 
     143  _buttonMap = new QPushButton(tr("Map"), this);
     144  _buttonMap->setEnabled(false);
     145  connect(_buttonMap, SIGNAL(clicked()), this, SLOT(slotShowMap()));
     146 
    142147  _buttonCancel = new QPushButton(tr("Cancel"), this);
    143148  connect(_buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
     
    149154  buttonLayout->addWidget(_buttonWhatsThis);
    150155  buttonLayout->addStretch(1);
     156  buttonLayout->addWidget(_buttonMap);
    151157  buttonLayout->addWidget(_buttonGet);
    152158  buttonLayout->addWidget(_buttonCancel);
     
    219225
    220226  _buttonGet->setEnabled(false);
     227  _buttonMap->setEnabled(true);
    221228  _buttonCasterTable->setEnabled(false);
    222229
     
    228235    return;
    229236  }
    230 
     237 
    231238  static const QStringList labels = QString("mountpoint,identifier,format,"
    232239    "format-details,carrier,system,network,country,lat,long,"
     
    291298}
    292299
     300// Show world map
     301////////////////////////////////////////////////////////////////////////////
     302void bncTableDlg::slotShowMap() {
     303
     304  bncMap* winMap = new bncMap(this);
     305  winMap->setGeometry( x(), y()+height()*1.2, 860, 400 );
     306
     307  connect(this, SIGNAL(newPoint(QPointF, QString, QPen)),
     308          winMap, SLOT(slotNewPoint(QPointF, QString, QPen)));
     309  connect(this, SIGNAL(resetMap()), winMap, SLOT(slotResetMap()));
     310     
     311  _buttonMap->setEnabled(false);
     312  showSourceTable();
     313  winMap->exec();
     314  _buttonMap->setEnabled(true);
     315
     316  disconnect(this, SIGNAL(newPoint(QPointF, QString, QPen)),
     317             winMap, SLOT(slotNewPoint(QPointF, QString, QPen)));
     318  disconnect(this, SIGNAL(resetMap()), winMap, SLOT(slotResetMap()));
     319   
     320  delete winMap;
     321}
     322
     323// Show world map
     324////////////////////////////////////////////////////////////////////////////
     325void bncTableDlg::showSourceTable() {
     326
     327  for( int i = 0; i < _allLines.size(); i++ ){
     328       
     329    if( _allLines.at(i).startsWith("STR") == true ){
     330             
     331       QStringList tmp = _allLines.at(i).split(';');
     332       if( tmp.size() > 0 ){
     333                 
     334         QPointF point;
     335                 point.setY( tmp.at(9).toDouble() );
     336                 point.setX( tmp.at(10).toDouble() );
     337         QString site = tmp.at(1);
     338                 site.resize(4);
     339
     340         emit newPoint(point, site, QPen(QBrush(QColor(0,0,255,180)), 5) );
     341       }             
     342     }
     343   }
     344}
     345
     346
    293347// Accept slot
    294348////////////////////////////////////////////////////////////////////////////
     
    306360
    307361  QStringList* mountPoints = new QStringList;
    308 
    309362  if (_table) {
     363//  emit resetMap();
    310364    for (int ir = 0; ir < _table->rowCount(); ir++) {
    311365      QTableWidgetItem* item   = _table->item(ir,0);
     366      QString             site = _table->item(ir,0)->text();
    312367      QString           format = _table->item(ir,2)->text();
    313368      QString         latitude = _table->item(ir,8)->text();
     
    320375        mountPoints->push_back(url.toString() + " " + format + " " + latitude
    321376                        + " " + longitude + " " + nmea + " " + ntripVersion);
     377         
     378        emit newPoint(QPointF(longitude.toDouble(),latitude.toDouble()), site,
     379                      QPen(QBrush(QColor(255,0,0,180)), 13) );
     380
    322381      }
    323382    }
     
    564623  QDialog::accept();
    565624}
    566 
  • trunk/BNC/bnctabledlg.h

    r1492 r2753  
    6464  signals:
    6565    void newMountPoints(QStringList* mountPoints);
     66    void newPoint(QPointF, QString, QPen);
     67    void resetMap();
    6668
    6769  private slots:
    6870    virtual void accept();
    6971    void slotGetTable();
     72    void slotShowMap();
    7073    void slotSelectionChanged();
    7174    void slotWhatsThis();
     
    7679  private:
    7780    void addUrl(const QUrl& url);
     81    void showSourceTable();
    7882    QComboBox*   _casterHostComboBox;
    7983    QLineEdit*   _casterPortLineEdit;
     
    8387
    8488    QPushButton* _buttonGet;
     89    QPushButton* _buttonMap;
    8590    QPushButton* _buttonCancel;
    8691    QPushButton* _buttonOK;
Note: See TracChangeset for help on using the changeset viewer.