Changeset 5435 in ntrip


Ignore:
Timestamp:
Sep 12, 2013, 6:43:22 PM (8 years ago)
Author:
mervart
Message:
 
Location:
trunk/GnssCenter/map_stations
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GnssCenter/map_stations/map_stations.cpp

    r5433 r5435  
    132132    }
    133133  }
    134   _plot->slotNewPoint("AAAA", 50.0, 15.0);
     134  ///  _plot->slotNewPoint("AAAA", 50.0, 15.0);
    135135  // end test
    136136  if (_thriftClient) {
  • trunk/GnssCenter/map_stations/worldplot.cpp

    r5423 r5435  
    6161//
    6262/////////////////////////////////////////////////////////////////////////////
    63 void t_worldPlot::slotNewPoint(const QString& name, double latDeg, double lonDeg) {
     63void t_worldPlot::slotNewPoints(const QList<t_point*>& points) {
    6464
    65   if (lonDeg > 180.0) lonDeg -= 360.0;
     65  // Remove old markers
     66  // ------------------
     67  QListIterator<QwtPlotMarker*> im(_markers);
     68  while (im.hasNext()) {
     69    QwtPlotMarker* marker = im.next();
     70    marker->detach();
     71    delete marker;
     72  }
     73  _markers.clear();
    6674
    6775  QColor red(220,20,60);
    68   QwtSymbol* symbol = new QwtSymbol(QwtSymbol::Rect, QBrush(red),
    69                                     QPen(red), QSize(2,2));
    70   QwtPlotMarker* marker = new QwtPlotMarker();
    71   marker->setValue(lonDeg, latDeg);
    72   if (lonDeg > 170.0) {
    73     marker->setLabelAlignment(Qt::AlignLeft);
     76
     77  QListIterator<t_point*> ip(points);
     78  while (ip.hasNext()) {
     79    t_point* point = ip.next();
     80
     81    if (point->_lonDeg > 180.0) point->_lonDeg -= 360.0;
     82 
     83    QwtSymbol* symbol = new QwtSymbol(QwtSymbol::Rect, QBrush(red),
     84                                      QPen(red), QSize(2,2));
     85    QwtPlotMarker* marker = new QwtPlotMarker();
     86    marker->setValue(point->_lonDeg, point->_latDeg);
     87    if (point->_lonDeg > 170.0) {
     88      marker->setLabelAlignment(Qt::AlignLeft);
     89    }
     90    else {
     91      marker->setLabelAlignment(Qt::AlignRight);
     92    }
     93    QwtText text(point->_name.left(4));
     94    QFont   font = text.font();
     95    font.setPointSize(font.pointSize()*0.8);
     96    text.setFont(font);
     97    marker->setLabel(text);
     98    marker->setSymbol(symbol);
     99    marker->attach(this);
     100    _markers.append(marker);
    74101  }
    75   else {
    76     marker->setLabelAlignment(Qt::AlignRight);
    77   }
    78   QwtText text(name.left(4));
    79   QFont   font = text.font();
    80   font.setPointSize(font.pointSize()*0.8);
    81   text.setFont(font);
    82   marker->setLabel(text);
    83   marker->setSymbol(symbol);
    84   marker->attach(this);
    85102
    86103  replot();
  • trunk/GnssCenter/map_stations/worldplot.h

    r5421 r5435  
    55
    66class QwtPlotZoomer;
     7class QwtPlotMarker;
    78
    89namespace GnssCenter {
     
    1314  t_worldPlot();
    1415  ~t_worldPlot();
     16 
     17  class t_point {
     18   public:
     19    t_point(const QString& name, double latDeg, double lonDeg) {
     20      _name   = name;
     21      _latDeg = latDeg;
     22      _lonDeg = lonDeg;
     23    }
     24    ~t_point() {}
     25    QString _name;
     26    double  _latDeg;
     27    double  _lonDeg;
     28  };
    1529
    1630 public slots:
    17   void slotNewPoint(const QString& name, double latDeg, double lonDeg);
     31  void slotNewPoints(const QList<t_point*>& points);
    1832  void slotPrint();
    1933
    2034 private:
    21   QwtPlotZoomer* _zoomer;
     35  QwtPlotZoomer*        _zoomer;
     36  QList<QwtPlotMarker*> _markers;
     37 
    2238};
    2339
Note: See TracChangeset for help on using the changeset viewer.