Changeset 4356 in ntrip for trunk/BNC/src
- Timestamp:
- Jun 24, 2012, 6:52:38 PM (12 years ago)
- Location:
- trunk/BNC/src/rinex
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/graphwin.cpp
r4349 r4356 47 47 // Constructor 48 48 //////////////////////////////////////////////////////////////////////////// 49 t_graphWin::t_graphWin(QWidget* parent, const QVector<QWidget*>& plots ) :50 QDialog(parent) {49 t_graphWin::t_graphWin(QWidget* parent, const QVector<QWidget*>& plots, 50 const QwtInterval scaleInterval) : QDialog(parent) { 51 51 52 52 this->setAttribute(Qt::WA_DeleteOnClose); … … 79 79 _colorScale->setTitle( title ); 80 80 81 QwtInterval interval(0.0, 1.0); 82 _colorScale->setColorMap(interval, new t_colorMap()); 81 _colorScale->setColorMap(scaleInterval, new t_colorMap()); 83 82 84 83 QwtLinearScaleEngine scaleEngine; 85 84 _colorScale->setScaleDiv(scaleEngine.transformation(), 86 scaleEngine.divideScale(interval.minValue(), interval.maxValue(), 8, 5)); 85 scaleEngine.divideScale(scaleInterval.minValue(), 86 scaleInterval.maxValue(), 87 8, 5)); 87 88 88 89 // Layout -
trunk/BNC/src/rinex/graphwin.h
r4349 r4356 38 38 t_colorMap() : QwtLinearColorMap(Qt::darkBlue, Qt::yellow) { 39 39 addColorStop(0.05, Qt::blue); 40 addColorStop(0.30, Qt::cyan);41 addColorStop(0.60, Qt::green);42 addColorStop( 0.98, Qt::red);40 // addColorStop(0.30, Qt::cyan); 41 // addColorStop(0.60, Qt::green); 42 addColorStop(9.98, Qt::red); 43 43 } 44 44 }; … … 51 51 52 52 public: 53 t_graphWin(QWidget* parent, const QVector<QWidget*>& plots); 53 t_graphWin(QWidget* parent, const QVector<QWidget*>& plots, 54 const QwtInterval scaleInterval); 54 55 ~t_graphWin(); 55 56 -
trunk/BNC/src/rinex/polarplot.cpp
r4345 r4356 33 33 QwtSymbol ss(symbol); 34 34 const QwtPointPolar& point = sample(ii); 35 const QColor color = colorMap.color( QwtInterval(0.0, 1.0), point._value);35 const QColor color = colorMap.color(_scaleInterval, point._value); 36 36 ss.setBrush(QBrush(color)); 37 37 ss.setPen(QPen(color)); … … 42 42 // Constructor 43 43 //////////////////////////////////////////////////////////////////////////// 44 t_polarPlot::t_polarPlot(const QwtText& title, QWidget* parent) : 44 t_polarPlot::t_polarPlot(const QwtText& title, const QwtInterval& scaleInterval, 45 QWidget* parent) : QwtPolarPlot(title, parent) { 45 46 46 QwtPolarPlot(title, parent) {47 _scaleInterval = scaleInterval; 47 48 48 49 setPlotBackground(Qt::white); … … 81 82 void t_polarPlot::addCurve(QVector<t_polarPoint*>* data) { 82 83 t_polarCurve* curve = new t_polarCurve(); 84 curve->setScaleInterval(_scaleInterval); 83 85 curve->setStyle(QwtPolarCurve::NoCurve); // draw only symbols 84 86 curve->setSymbol(new QwtSymbol(QwtSymbol::Ellipse, -
trunk/BNC/src/rinex/polarplot.h
r4345 r4356 12 12 t_polarCurve() {} 13 13 virtual ~t_polarCurve() {} 14 void setScaleInterval(const QwtInterval& scaleInterval) { 15 _scaleInterval = scaleInterval; 16 } 14 17 protected: 15 virtual void drawSymbols(QPainter* painter, const QwtSymbol& symbol, 16 const QwtScaleMap& azimuthMap, 17 const QwtScaleMap& radialMap, 18 const QPointF& pole, int from, int to) const; 18 virtual void drawSymbols(QPainter* painter, const QwtSymbol& symbol, 19 const QwtScaleMap& azimuthMap, 20 const QwtScaleMap& radialMap, 21 const QPointF& pole, int from, int to) const; 22 private: 23 QwtInterval _scaleInterval; 19 24 }; 20 25 … … 63 68 64 69 public: 65 t_polarPlot(const QwtText& title, QWidget* = 0); 70 t_polarPlot(const QwtText& title, const QwtInterval& scaleInterval, 71 QWidget* = 0); 66 72 void addCurve(QVector<t_polarPoint*>* data); 67 73 68 74 private: 75 QwtInterval _scaleInterval; 69 76 }; 70 77 -
trunk/BNC/src/rinex/reqcanalyze.cpp
r4355 r4356 90 90 if (app->mode() == bncApp::interactive) { 91 91 92 t_polarPlot* plotMP1 = new t_polarPlot(QwtText("MP1"), app->mainWindow()); 92 double maxMP = 0.0; 93 for (int ii = 0; ii < dataMP1->size(); ii++) { 94 double mp = dataMP1->at(ii)->_value; 95 if (maxMP < mp) { 96 maxMP = mp; 97 } 98 } 99 for (int ii = 0; ii < dataMP2->size(); ii++) { 100 double mp = dataMP2->at(ii)->_value; 101 if (maxMP < mp) { 102 maxMP = mp; 103 } 104 } 105 106 qDebug() << maxMP; 107 108 QwtInterval scaleInterval(0.0, maxMP); 109 110 t_polarPlot* plotMP1 = new t_polarPlot(QwtText("MP1"), scaleInterval, 111 app->mainWindow()); 93 112 plotMP1->addCurve(dataMP1); 94 113 95 t_polarPlot* plotMP2 = new t_polarPlot(QwtText("MP2"), app->mainWindow()); 114 t_polarPlot* plotMP2 = new t_polarPlot(QwtText("MP2"), scaleInterval, 115 app->mainWindow()); 96 116 plotMP2->addCurve(dataMP2); 97 117 … … 100 120 plots << plotMP2; 101 121 102 t_graphWin* graphWin = new t_graphWin(0, plots );122 t_graphWin* graphWin = new t_graphWin(0, plots, scaleInterval); 103 123 104 124 graphWin->show();
Note:
See TracChangeset
for help on using the changeset viewer.