Changeset 5435 in ntrip for trunk/GnssCenter
- Timestamp:
- Sep 12, 2013, 6:43:22 PM (11 years ago)
- Location:
- trunk/GnssCenter/map_stations
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GnssCenter/map_stations/map_stations.cpp
r5433 r5435 132 132 } 133 133 } 134 _plot->slotNewPoint("AAAA", 50.0, 15.0);134 /// _plot->slotNewPoint("AAAA", 50.0, 15.0); 135 135 // end test 136 136 if (_thriftClient) { -
trunk/GnssCenter/map_stations/worldplot.cpp
r5423 r5435 61 61 // 62 62 ///////////////////////////////////////////////////////////////////////////// 63 void t_worldPlot::slotNewPoint (const QString& name, double latDeg, double lonDeg) {63 void t_worldPlot::slotNewPoints(const QList<t_point*>& points) { 64 64 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(); 66 74 67 75 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); 74 101 } 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);85 102 86 103 replot(); -
trunk/GnssCenter/map_stations/worldplot.h
r5421 r5435 5 5 6 6 class QwtPlotZoomer; 7 class QwtPlotMarker; 7 8 8 9 namespace GnssCenter { … … 13 14 t_worldPlot(); 14 15 ~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 }; 15 29 16 30 public slots: 17 void slotNewPoint (const QString& name, double latDeg, double lonDeg);31 void slotNewPoints(const QList<t_point*>& points); 18 32 void slotPrint(); 19 33 20 34 private: 21 QwtPlotZoomer* _zoomer; 35 QwtPlotZoomer* _zoomer; 36 QList<QwtPlotMarker*> _markers; 37 22 38 }; 23 39
Note:
See TracChangeset
for help on using the changeset viewer.