Skip to content

Commit

Permalink
comms/gnuradio: Prepare to Qwt 6.2.0
Browse files Browse the repository at this point in the history
- Manual apply patches from gnuradio/gnuradio#5034
  • Loading branch information
lbartoletti committed Feb 22, 2024
1 parent 9de5bbc commit 2f66c58
Show file tree
Hide file tree
Showing 14 changed files with 250 additions and 1 deletion.
2 changes: 1 addition & 1 deletion comms/gnuradio/Makefile
@@ -1,7 +1,7 @@
PORTNAME= gnuradio
DISTVERSIONPREFIX= v
DISTVERSION= 3.8.4.0
PORTREVISION= 15
PORTREVISION= 16
CATEGORIES= comms astro hamradio

MAINTAINER= hamradio@FreeBSD.org
Expand Down
@@ -0,0 +1,14 @@
--- gr-qtgui/include/gnuradio/qtgui/DisplayPlot.h.orig 2024-02-19 05:15:00 UTC
+++ gr-qtgui/include/gnuradio/qtgui/DisplayPlot.h
@@ -41,7 +41,10 @@
#include <vector>

#if QWT_VERSION >= 0x060000
-#include <qwt_compat.h>
+typedef QPointF QwtDoublePoint;
+typedef QRectF QwtDoubleRect;
+
+typedef QwtInterval QwtDoubleInterval;
#endif

typedef QList<QColor> QColorList;
@@ -0,0 +1,13 @@
--- gr-qtgui/include/gnuradio/qtgui/TimeRasterDisplayPlot.h.orig 2024-02-19 05:15:29 UTC
+++ gr-qtgui/include/gnuradio/qtgui/TimeRasterDisplayPlot.h
@@ -35,7 +35,9 @@
#if QWT_VERSION < 0x060000
#include <gnuradio/qtgui/plot_waterfall.h>
#else
-#include <qwt_compat.h>
+#include <qwt_interval.h>
+
+typedef QwtInterval QwtDoubleInterval;
#endif

/*!
@@ -0,0 +1,13 @@
--- gr-qtgui/include/gnuradio/qtgui/WaterfallDisplayPlot.h.orig 2024-02-19 05:15:53 UTC
+++ gr-qtgui/include/gnuradio/qtgui/WaterfallDisplayPlot.h
@@ -34,7 +34,9 @@
#if QWT_VERSION < 0x060000
#include <gnuradio/qtgui/plot_waterfall.h>
#else
-#include <qwt_compat.h>
+#include <qwt_interval.h>
+
+typedef QwtInterval QwtDoubleInterval;
#endif

/*!
@@ -0,0 +1,15 @@
--- gr-qtgui/include/gnuradio/qtgui/plot_raster.h.orig 2024-02-19 05:17:07 UTC
+++ gr-qtgui/include/gnuradio/qtgui/plot_raster.h
@@ -28,8 +28,10 @@
#include <qwt_plot_rasteritem.h>

#if QWT_VERSION >= 0x060000
-#include <qwt_compat.h>
-#include <qwt_point_3d.h> // doesn't seem necessary, but is...
+#include <qsize.h>
+#include <qwt_interval.h>
+
+typedef QwtInterval QwtDoubleInterval;
#endif

class QwtColorMap;
@@ -0,0 +1,15 @@
--- gr-qtgui/include/gnuradio/qtgui/plot_waterfall.h.orig 2024-02-19 05:17:32 UTC
+++ gr-qtgui/include/gnuradio/qtgui/plot_waterfall.h
@@ -28,8 +28,10 @@
#include <qwt_plot_rasteritem.h>

#if QWT_VERSION >= 0x060000
-#include <qwt_compat.h>
-#include <qwt_point_3d.h> // doesn't seem necessary, but is...
+#include <qsize.h>
+#include <qwt_interval.h>
+
+typedef QwtInterval QwtDoubleInterval;
#endif

class QwtColorMap;
@@ -0,0 +1,10 @@
--- gr-qtgui/include/gnuradio/qtgui/qtgui_types.h.orig 2024-02-19 05:18:00 UTC
+++ gr-qtgui/include/gnuradio/qtgui/qtgui_types.h
@@ -26,6 +26,7 @@
#include <gnuradio/high_res_timer.h>
#include <qwt_color_map.h>
#include <qwt_scale_draw.h>
+#include <qwt_text.h>

namespace gr {
namespace qtgui {
@@ -0,0 +1,35 @@
--- gr-qtgui/include/gnuradio/qtgui/timeRasterGlobalData.h.orig 2024-02-19 05:18:25 UTC
+++ gr-qtgui/include/gnuradio/qtgui/timeRasterGlobalData.h
@@ -27,8 +27,9 @@
#include <qwt_raster_data.h>

#if QWT_VERSION >= 0x060000
-#include <qwt_compat.h>
-#include <qwt_point_3d.h> // doesn't seem necessary, but is...
+#include <qwt_interval.h>
+
+typedef QwtInterval QwtDoubleInterval;
#endif

class TimeRasterData : public QwtRasterData
@@ -47,6 +48,9 @@ class TimeRasterData : public QwtRasterData (public)
#if QWT_VERSION < 0x060000
virtual QwtDoubleInterval range() const;
virtual void setRange(const QwtDoubleInterval&);
+#elif QWT_VERSION >= 0x060200
+ virtual QwtInterval interval(Qt::Axis) const;
+ void setInterval(Qt::Axis, const QwtInterval&);
#endif

virtual double value(double x, double y) const;
@@ -68,6 +72,10 @@ class TimeRasterData : public QwtRasterData (public)
QwtDoubleInterval d_intensityRange;
#else
QwtInterval d_intensityRange;
+#endif
+
+#if QWT_VERSION >= 0x060200
+ QwtInterval d_intervals[3];
#endif

private:
@@ -0,0 +1,35 @@
--- gr-qtgui/include/gnuradio/qtgui/waterfallGlobalData.h.orig 2024-02-19 05:19:43 UTC
+++ gr-qtgui/include/gnuradio/qtgui/waterfallGlobalData.h
@@ -27,8 +27,9 @@
#include <qwt_raster_data.h>

#if QWT_VERSION >= 0x060000
-#include <qwt_compat.h>
-#include <qwt_point_3d.h> // doesn't seem necessary, but is...
+#include <qwt_interval.h>
+
+typedef QwtInterval QwtDoubleInterval;
#endif

class WaterfallData : public QwtRasterData
@@ -48,6 +49,9 @@ class WaterfallData : public QwtRasterData (public)
#if QWT_VERSION < 0x060000
virtual QwtDoubleInterval range() const;
virtual void setRange(const QwtDoubleInterval&);
+#elif QWT_VERSION >= 0x060200
+ virtual QwtInterval interval(Qt::Axis) const;
+ void setInterval(Qt::Axis, const QwtInterval&);
#endif

virtual double value(double x, double y) const;
@@ -72,6 +76,10 @@ class WaterfallData : public QwtRasterData (public)
QwtDoubleInterval _intensityRange;
#else
QwtInterval _intensityRange;
+#endif
+
+#if QWT_VERSION >= 0x060200
+ QwtInterval d_intervals[3];
#endif

private:
@@ -0,0 +1,10 @@
--- gr-qtgui/lib/ConstellationDisplayPlot.cc.orig 2024-02-19 05:20:52 UTC
+++ gr-qtgui/lib/ConstellationDisplayPlot.cc
@@ -29,6 +29,7 @@
#include <qwt_scale_draw.h>
#include <QColor>
#include <iostream>
+#include <cmath>

class ConstellationDisplayZoomer : public QwtPlotZoomer
{
29 changes: 29 additions & 0 deletions comms/gnuradio/files/patch-gr-qtgui_lib_plot__raster.cc
@@ -0,0 +1,29 @@
--- gr-qtgui/lib/plot_raster.cc.orig 2024-02-19 05:21:10 UTC
+++ gr-qtgui/lib/plot_raster.cc
@@ -257,7 +257,11 @@ QImage PlotTimeRaster::renderImage(const QwtScaleMap&
}
d_data->data->incrementResidual();
} else if (d_data->colorMap->format() == QwtColorMap::Indexed) {
+#if QWT_VERSION >= 0x060200
+ image.setColorTable(d_data->colorMap->colorTable(256));
+#else
image.setColorTable(d_data->colorMap->colorTable(intensityRange));
+#endif

for (int y = rect.top(); y <= rect.bottom(); y++) {
const double ty = yyMap.invTransform(y);
@@ -265,9 +269,13 @@ QImage PlotTimeRaster::renderImage(const QwtScaleMap&
unsigned char* line = image.scanLine(y - rect.top());
for (int x = rect.left(); x <= rect.right(); x++) {
const double tx = xxMap.invTransform(x);
-
+#if QWT_VERSION >= 0x060200
+ *line++ = d_data->colorMap->colorIndex(
+ 256, intensityRange, d_data->data->value(tx, ty));
+#else
*line++ = d_data->colorMap->colorIndex(intensityRange,
d_data->data->value(tx, ty));
+#endif
}
}
}
28 changes: 28 additions & 0 deletions comms/gnuradio/files/patch-gr-qtgui_lib_plot__waterfall.cc
@@ -0,0 +1,28 @@
--- gr-qtgui/lib/plot_waterfall.cc.orig 2024-02-19 05:22:53 UTC
+++ gr-qtgui/lib/plot_waterfall.cc
@@ -252,7 +252,11 @@ QImage PlotWaterfall::renderImage(const QwtScaleMap& x
}
}
} else if (d_data->colorMap->format() == QwtColorMap::Indexed) {
+#if QWT_VERSION >= 0x060200
+ image.setColorTable(d_data->colorMap->colorTable(256));
+#else
image.setColorTable(d_data->colorMap->colorTable(intensityRange));
+#endif

for (int y = rect.top(); y <= rect.bottom(); y++) {
const double ty = yyMap.invTransform(y);
@@ -261,8 +265,13 @@ QImage PlotWaterfall::renderImage(const QwtScaleMap& x
for (int x = rect.left(); x <= rect.right(); x++) {
const double tx = xxMap.invTransform(x);

+#if QWT_VERSION >= 0x060200
+ *line++ = d_data->colorMap->colorIndex(
+ 256, intensityRange, d_data->data->value(tx, ty));
+#else
*line++ = d_data->colorMap->colorIndex(intensityRange,
d_data->data->value(tx, ty));
+#endif
}
}
}
16 changes: 16 additions & 0 deletions comms/gnuradio/files/patch-gr-qtgui_lib_timeRasterGlobalData.cc
@@ -0,0 +1,16 @@
--- gr-qtgui/lib/timeRasterGlobalData.cc.orig 2024-02-19 05:24:01 UTC
+++ gr-qtgui/lib/timeRasterGlobalData.cc
@@ -155,7 +155,13 @@ void TimeRasterData::setRange(const QwtDoubleInterval&
{
d_intensityRange = newRange;
}
+#elif QWT_VERSION >= 0x060200
+void TimeRasterData::setInterval(Qt::Axis axis, const QwtInterval& interval)
+{
+ d_intervals[axis] = interval;
+}

+QwtInterval TimeRasterData::interval(Qt::Axis a) const { return d_intervals[a]; }
#endif


16 changes: 16 additions & 0 deletions comms/gnuradio/files/patch-gr-qtgui_lib_waterfallGlobalData.cc
@@ -0,0 +1,16 @@
--- gr-qtgui/lib/waterfallGlobalData.cc.orig 2024-02-19 05:24:33 UTC
+++ gr-qtgui/lib/waterfallGlobalData.cc
@@ -158,7 +158,13 @@ void WaterfallData::setRange(const QwtDoubleInterval&
{
_intensityRange = newRange;
}
+#elif QWT_VERSION >= 0x060200
+void WaterfallData::setInterval(Qt::Axis axis, const QwtInterval& interval)
+{
+ d_intervals[axis] = interval;
+}

+QwtInterval WaterfallData::interval(Qt::Axis a) const { return d_intervals[a]; }
#endif


0 comments on commit 2f66c58

Please sign in to comment.