Changeset 4626 in ntrip


Ignore:
Timestamp:
Sep 1, 2012, 2:02:13 PM (12 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncmap.h

    r4624 r4626  
    55#include <QtGui>
    66
    7 class bncMap : public QDialog {
     7class QwtPlot;
     8
     9class t_bncMap : public QDialog {
    810 Q_OBJECT
    911   
    1012 public:
    11   bncMap(QWidget* parent = 0);
    12   ~bncMap();
     13  t_bncMap(QWidget* parent = 0);
     14  ~t_bncMap();
    1315   
    1416 public slots:
     17  void slotNewPoint(QPointF, QString, QPen, double);
    1518   
    1619 private:
     20  QwtPlot* _mapPlot;
    1721};
    1822
  • trunk/BNC/src/bncmap_svg.cpp

    r4622 r4626  
    1616// Constructor
    1717/////////////////////////////////////////////////////////////////////////////
    18 bncMap::bncMap(QWidget* parent) : QDialog(parent) {
     18t_bncMap::t_bncMap(QWidget* parent) : QDialog(parent) {
    1919
    20   QwtPlot* plot = new QwtPlot();
     20  _mapPlot = new QwtPlot();
    2121
    22   (void)new QwtPlotPanner(plot->canvas());
    23   (void)new QwtPlotMagnifier(plot->canvas());
     22  (void)new QwtPlotPanner(_mapPlot->canvas());
     23  (void)new QwtPlotMagnifier(_mapPlot->canvas());
    2424
    25   plot->canvas()->setFocusPolicy(Qt::WheelFocus);
     25  _mapPlot->canvas()->setFocusPolicy(Qt::WheelFocus);
    2626
    27   QRectF rect(-180.0, -90.0, 360.0, 180.0);
    28 
    29   QwtPlotSvgItem* map = new QwtPlotSvgItem();
    30   map->loadFile(rect, ":world.svg");
    31   map->attach(plot);
    32 
    33   //// beg test
    34   for (int ii = -180; ii <= 180; ii += 60) {
    35     for (int jj = -80; jj <= 80;   jj += 40) {
    36       QwtPlotMarker* marker = new QwtPlotMarker();
    37       marker->setValue(ii,jj);
    38       marker->setLabel(QwtText("TXT"));
    39       marker->setItemAttribute(QwtPlotItem::AutoScale, false);
    40       marker->attach(plot);
    41     }
    42   }
    43   //// end test
     27  QwtPlotSvgItem* mapItem = new QwtPlotSvgItem();
     28  mapItem->loadFile(QRectF(-180.0, -90.0, 360.0, 180.0), ":world.svg");
     29  mapItem->attach(_mapPlot);
    4430
    4531  QVBoxLayout* mainLayout = new QVBoxLayout(this);
    46   mainLayout->addWidget(plot);
     32  mainLayout->addWidget(_mapPlot);
    4733
    48   plot->replot();
     34  _mapPlot->replot();
    4935}
    5036
    5137// Destructor
    5238/////////////////////////////////////////////////////////////////////////////
    53 bncMap::~bncMap(){
     39t_bncMap::~t_bncMap() {
     40  delete _mapPlot;
    5441}
     42
     43//
     44/////////////////////////////////////////////////////////////////////////////
     45void t_bncMap::slotNewPoint(QPointF point, QString name, QPen, double) {
     46  QwtPlotMarker* marker = new QwtPlotMarker();
     47  marker->setValue(point.x(), point.y());
     48  marker->setLabel(QwtText(name));
     49  marker->attach(_mapPlot);
     50}
     51
     52
     53
  • trunk/BNC/src/bnctabledlg.cpp

    r4278 r4626  
    324324void bncTableDlg::slotShowMap() {
    325325
    326   bncMap* winMap = new bncMap(this);
    327   winMap->setGeometry( x(), int(y()+height()*1.3), 880, 440 );
     326  t_bncMap* bncMap = new t_bncMap(this);
     327  bncMap->setGeometry( x(), int(y()+height()*1.3), 880, 440 );
    328328
    329329  connect(this, SIGNAL(newPoint(QPointF, QString, QPen, double)),
    330           winMap, SLOT(slotNewPoint(QPointF, QString, QPen, double)));
    331      
    332   connect(this, SIGNAL(fitMap()),
    333           winMap, SLOT(slotFitMap() ));
    334    
    335   connect(this, SIGNAL(fitFont()),
    336           winMap, SLOT(slotFitFont() ));
     330          bncMap, SLOT(slotNewPoint(QPointF, QString, QPen, double)));
    337331     
    338332  _buttonMap->setEnabled(false);
    339333  showSourceTable();
    340   winMap->exec();
     334  bncMap->exec();
    341335  _buttonMap->setEnabled(true);
    342336
    343337  disconnect(this, SIGNAL(newPoint(QPointF, QString, QPen, double)),
    344              winMap, SLOT(slotNewPoint(QPointF, QString, QPen, double)));
     338             bncMap, SLOT(slotNewPoint(QPointF, QString, QPen, double)));
    345339   
    346   disconnect(this, SIGNAL(fitMap()),
    347              winMap, SLOT(slotFitMap() ));
    348    
    349   disconnect(this, SIGNAL(fitFont()),
    350              winMap, SLOT(slotFitFont() ));
    351      
    352   delete winMap;
     340  delete bncMap;
    353341}
    354342
Note: See TracChangeset for help on using the changeset viewer.