summaryrefslogtreecommitdiff
path: root/gr-qtgui/lib/ConstellationDisplayPlot.cc
diff options
context:
space:
mode:
authorJosh Blum2011-10-17 07:35:56 -0700
committerJosh Blum2011-10-17 07:35:56 -0700
commit41ce01bd6f602009b83422550b0b91bddd830c84 (patch)
tree133899a93985441c97f8ed2f566e71ada32a0681 /gr-qtgui/lib/ConstellationDisplayPlot.cc
parent5179a1ead31e678d575890fb2e413c62bf00c255 (diff)
parenta4dbd973fc6376bacf3c45e63aba61a471c468b3 (diff)
downloadgnuradio-41ce01bd6f602009b83422550b0b91bddd830c84.tar.gz
gnuradio-41ce01bd6f602009b83422550b0b91bddd830c84.tar.bz2
gnuradio-41ce01bd6f602009b83422550b0b91bddd830c84.zip
Merge branch 'next' of http://gnuradio.org/git/gnuradio into next
Diffstat (limited to 'gr-qtgui/lib/ConstellationDisplayPlot.cc')
-rw-r--r--gr-qtgui/lib/ConstellationDisplayPlot.cc39
1 files changed, 38 insertions, 1 deletions
diff --git a/gr-qtgui/lib/ConstellationDisplayPlot.cc b/gr-qtgui/lib/ConstellationDisplayPlot.cc
index dda7cfea2..ca7eede36 100644
--- a/gr-qtgui/lib/ConstellationDisplayPlot.cc
+++ b/gr-qtgui/lib/ConstellationDisplayPlot.cc
@@ -68,11 +68,17 @@ ConstellationDisplayPlot::ConstellationDisplayPlot(QWidget* parent)
_imagDataPoints = new double[_numPoints];
// Disable polygon clipping
+#if QWT_VERSION < 0x060000
QwtPainter::setDeviceClipping(false);
+#else
+ QwtPainter::setPolylineSplitting(false);
+#endif
+#if QWT_VERSION < 0x060000
// We don't need the cache here
canvas()->setPaintAttribute(QwtPlotCanvas::PaintCached, false);
canvas()->setPaintAttribute(QwtPlotCanvas::PaintPacked, false);
+#endif
QPalette palette;
palette.setColor(canvas()->backgroundRole(), QColor("white"));
@@ -91,13 +97,22 @@ ConstellationDisplayPlot::ConstellationDisplayPlot(QWidget* parent)
_plot_curve->attach(this);
_plot_curve->setPen(QPen(Qt::blue, _penSize, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
_plot_curve->setStyle(QwtPlotCurve::Dots);
+
+#if QWT_VERSION < 0x060000
_plot_curve->setRawData(_realDataPoints, _imagDataPoints, _numPoints);
+#else
+ _plot_curve->setRawSamples(_realDataPoints, _imagDataPoints, _numPoints);
+#endif
memset(_realDataPoints, 0x0, _numPoints*sizeof(double));
memset(_imagDataPoints, 0x0, _numPoints*sizeof(double));
_zoomer = new ConstellationDisplayZoomer(canvas());
+
+#if QWT_VERSION < 0x060000
_zoomer->setSelectionFlags(QwtPicker::RectSelection | QwtPicker::DragSelection);
+#endif
+
_zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier);
_zoomer->setMousePattern(QwtEventPattern::MouseSelect3,
@@ -120,8 +135,14 @@ ConstellationDisplayPlot::ConstellationDisplayPlot(QWidget* parent)
// emit the position of clicks on widget
_picker = new QwtDblClickPlotPicker(canvas());
+
+#if QWT_VERSION < 0x060000
connect(_picker, SIGNAL(selected(const QwtDoublePoint &)),
- this, SLOT(OnPickerPointSelected(const QwtDoublePoint &)));
+ this, SLOT(OnPickerPointSelected(const QwtDoublePoint &)));
+#else
+ connect(_picker, SIGNAL(selected(const QPointF &)),
+ this, SLOT(OnPickerPointSelected(const QPointF &)));
+#endif
connect(this, SIGNAL(legendChecked(QwtPlotItem *, bool ) ),
this, SLOT(LegendEntryChecked(QwtPlotItem *, bool ) ));
@@ -193,12 +214,18 @@ void ConstellationDisplayPlot::PlotNewData(const double* realDataPoints,
_realDataPoints = new double[_numPoints];
_imagDataPoints = new double[_numPoints];
+#if QWT_VERSION < 0x060000
_plot_curve->setRawData(_realDataPoints, _imagDataPoints, _numPoints);
+#else
+ _plot_curve->setRawSamples(_realDataPoints, _imagDataPoints, _numPoints);
+#endif
}
memcpy(_realDataPoints, realDataPoints, numDataPoints*sizeof(double));
memcpy(_imagDataPoints, imagDataPoints, numDataPoints*sizeof(double));
+ replot();
+
_lastReplot = gruel::high_res_timer_now();
}
}
@@ -209,6 +236,7 @@ ConstellationDisplayPlot::LegendEntryChecked(QwtPlotItem* plotItem, bool on)
plotItem->setVisible(!on);
}
+#if QWT_VERSION < 0x060000
void
ConstellationDisplayPlot::OnPickerPointSelected(const QwtDoublePoint & p)
{
@@ -216,5 +244,14 @@ ConstellationDisplayPlot::OnPickerPointSelected(const QwtDoublePoint & p)
//fprintf(stderr,"OnPickerPointSelected %f %f\n", point.x(), point.y());
emit plotPointSelected(point);
}
+#else
+void
+ConstellationDisplayPlot::OnPickerPointSelected(const QPointF & p)
+{
+ QPointF point = p;
+ //fprintf(stderr,"OnPickerPointSelected %f %f\n", point.x(), point.y());
+ emit plotPointSelected(point);
+}
+#endif
#endif /* CONSTELLATION_DISPLAY_PLOT_C */