forked from robotastic/homebrew-hackrf
-
Notifications
You must be signed in to change notification settings - Fork 2
/
gnuradio.rb
308 lines (268 loc) · 11.9 KB
/
gnuradio.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
require 'formula'
class Gnuradio < Formula
homepage 'http://gnuradio.org'
url 'http://gnuradio.org/releases/gnuradio/gnuradio-3.7.7.1.tar.gz'
sha256 '2b27b13fc734ab5882e42c1661d433c0c097fd8b55b682f00626fa96c356584e'
head 'http://gnuradio.org/git/gnuradio.git'
depends_on 'cmake' => :build
depends_on 'Cheetah' => :python
depends_on 'lxml' => :python
depends_on 'numpy' => :python
depends_on 'scipy' => :python
depends_on 'matplotlib' => :python
depends_on 'python'
depends_on 'boost'
depends_on 'cppunit'
depends_on 'gsl'
depends_on 'fftw'
depends_on 'swig'
depends_on 'pygtk'
depends_on 'sdl'
depends_on 'libusb'
depends_on 'orc'
depends_on 'pyqt' if ARGV.include?('--with-qt')
depends_on 'pyqwt' if ARGV.include?('--with-qt')
depends_on 'doxygen' if ARGV.include?('--with-docs')
fails_with :clang do
build 421
cause "Fails to compile .S files."
end
fails_with :llvm
def options
[
['--with-qt', 'Build gr-qtgui.'],
['--with-docs', 'Build docs.']
]
end
#def patches
# DATA
#end
def install
mkdir 'build' do
args = ["-DCMAKE_PREFIX_PATH=#{prefix}", "-DQWT_INCLUDE_DIRS=#{HOMEBREW_PREFIX}/lib/qwt.framework/Headers"] + std_cmake_args
args << '-DENABLE_GR_QTGUI=OFF' unless ARGV.include?('--with-qt')
args << '-DENABLE_DOXYGEN=OFF' unless ARGV.include?('--with-docs')
# From opencv.rb
python_prefix = `python-config --prefix`.strip
# Python is actually a library. The libpythonX.Y.dylib points to this lib, too.
if File.exist? "#{python_prefix}/Python"
# Python was compiled with --framework:
args << "-DPYTHON_LIBRARY='#{python_prefix}/Python'"
if !MacOS::CLT.installed? and python_prefix.start_with? '/System/Library'
# For Xcode-only systems, the headers of system's python are inside of Xcode
args << "-DPYTHON_INCLUDE_DIR='#{MacOS.sdk_path}/System/Library/Frameworks/Python.framework/Versions/2.7/Headers'"
else
args << "-DPYTHON_INCLUDE_DIR='#{python_prefix}/Headers'"
end
else
python_lib = "#{python_prefix}/lib/lib#{which_python}"
if File.exists? "#{python_lib}.a"
args << "-DPYTHON_LIBRARY='#{python_lib}.a'"
else
args << "-DPYTHON_LIBRARY='#{python_lib}.dylib'"
end
args << "-DPYTHON_INCLUDE_DIR='#{python_prefix}/include/#{which_python}'"
end
args << "-DPYTHON_PACKAGES_PATH='#{lib}/#{which_python}/site-packages'"
system 'cmake', '..', *args
system 'make'
system 'make install'
end
end
def python_path
python = Formula.factory('python')
kegs = python.rack.children.reject { |p| p.basename.to_s == '.DS_Store' }
kegs.find { |p| Keg.new(p).linked? } || kegs.last
end
def caveats
<<-EOS.undent
If you want to use custom blocks, create this file:
~/.gnuradio/config.conf
[grc]
local_blocks_path=/usr/local/share/gnuradio/grc/blocks
EOS
end
def which_python
"python" + `python -c 'import sys;print(sys.version[:3])'`.strip
end
end
__END__
diff --git a/grc/CMakeLists.txt b/grc/CMakeLists.txt
index f54aa4f..db0ce3c 100644
--- a/grc/CMakeLists.txt
+++ b/grc/CMakeLists.txt
@@ -25,7 +25,7 @@ include(GrPython)
GR_PYTHON_CHECK_MODULE("python >= 2.5" sys "sys.version.split()[0] >= '2.5'" PYTHON_MIN_VER_FOUND)
GR_PYTHON_CHECK_MODULE("Cheetah >= 2.0.0" Cheetah "Cheetah.Version >= '2.0.0'" CHEETAH_FOUND)
GR_PYTHON_CHECK_MODULE("lxml >= 1.3.6" lxml.etree "lxml.etree.LXML_VERSION >= (1, 3, 6, 0)" LXML_FOUND)
-GR_PYTHON_CHECK_MODULE("pygtk >= 2.10.0" gtk "gtk.pygtk_version >= (2, 10, 0)" PYGTK_FOUND)
+GR_PYTHON_CHECK_MODULE("pygtk >= 2.10.0" pygtk True PYGTK_FOUND)
GR_PYTHON_CHECK_MODULE("numpy" numpy True NUMPY_FOUND)
########################################################################
diff --git a/gr-qtgui/lib/spectrumdisplayform.ui b/gr-qtgui/lib/spectrumdisplayform.ui
index 049d4ff..43e6857 100644
--- a/gr-qtgui/lib/spectrumdisplayform.ui
+++ b/gr-qtgui/lib/spectrumdisplayform.ui
@@ -330,9 +330,6 @@
<property name="focusPolicy">
<enum>Qt::WheelFocus</enum>
</property>
- <property name="valid">
- <bool>true</bool>
- </property>
<property name="totalAngle">
<double>200.000000000000000</double>
</property>
@@ -384,9 +381,6 @@
<height>0</height>
</size>
</property>
- <property name="valid">
- <bool>true</bool>
- </property>
<property name="totalAngle">
<double>200.000000000000000</double>
</property>
@@ -518,7 +512,6 @@
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
- <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<customwidgets>
<customwidget>
<class>QwtWheel</class>
diff --git a/gnuradio-core/src/lib/io/ppio_ppdev.h b/gnuradio-core/src/lib/io/ppio_ppdev.h
index 1f86d7e..9b2c4f1 100644
--- a/gnuradio-core/src/lib/io/ppio_ppdev.h
+++ b/gnuradio-core/src/lib/io/ppio_ppdev.h
@@ -35,7 +35,7 @@ typedef boost::shared_ptr<ppio_ppdev> ppio_ppdev_sptr;
*/
class GR_CORE_API ppio_ppdev : public ppio {
- friend GR_CORE_API ppio_ppdev_sptr make_ppio_ppdev (int which = 0);
+ friend GR_CORE_API ppio_ppdev_sptr make_ppio_ppdev (int which);
ppio_ppdev (int which = 0);
public:
diff --git a/gr-qtgui/include/qtgui_util.h b/gr-qtgui/include/qtgui_util.h
index 2deaddb..7ba9b64 100644
--- a/gr-qtgui/include/qtgui_util.h
+++ b/gr-qtgui/include/qtgui_util.h
@@ -27,6 +27,7 @@
#include <gr_qtgui_api.h>
#include <qwt_plot_picker.h>
#include <qwt_picker_machine.h>
+#include <qwt_plot_canvas.h>
class GR_QTGUI_API QwtDblClickPlotPicker: public QwtPlotPicker
diff --git a/gr-qtgui/lib/ConstellationDisplayPlot.cc b/gr-qtgui/lib/ConstellationDisplayPlot.cc
index 7a595fe..89eb6d1 100644
--- a/gr-qtgui/lib/ConstellationDisplayPlot.cc
+++ b/gr-qtgui/lib/ConstellationDisplayPlot.cc
@@ -107,7 +107,7 @@ ConstellationDisplayPlot::ConstellationDisplayPlot(QWidget* parent)
memset(_realDataPoints, 0x0, _numPoints*sizeof(double));
memset(_imagDataPoints, 0x0, _numPoints*sizeof(double));
- _zoomer = new ConstellationDisplayZoomer(canvas());
+ _zoomer = new ConstellationDisplayZoomer(dynamic_cast<QwtPlotCanvas *>(canvas()));
#if QWT_VERSION < 0x060000
_zoomer->setSelectionFlags(QwtPicker::RectSelection | QwtPicker::DragSelection);
@@ -134,7 +134,7 @@ ConstellationDisplayPlot::ConstellationDisplayPlot(QWidget* parent)
_zoomer->setTrackerPen(c);
// emit the position of clicks on widget
- _picker = new QwtDblClickPlotPicker(canvas());
+ _picker = new QwtDblClickPlotPicker(dynamic_cast<QwtPlotCanvas *>(canvas()));
#if QWT_VERSION < 0x060000
connect(_picker, SIGNAL(selected(const QwtDoublePoint &)),
diff --git a/gr-qtgui/lib/FrequencyDisplayPlot.cc b/gr-qtgui/lib/FrequencyDisplayPlot.cc
index b74d460..d84fcdb 100644
--- a/gr-qtgui/lib/FrequencyDisplayPlot.cc
+++ b/gr-qtgui/lib/FrequencyDisplayPlot.cc
@@ -249,7 +249,7 @@ FrequencyDisplayPlot::FrequencyDisplayPlot(QWidget* parent)
replot();
// emit the position of clicks on widget
- _picker = new QwtDblClickPlotPicker(canvas());
+ _picker = new QwtDblClickPlotPicker(dynamic_cast<QwtPlotCanvas*>(canvas()));
#if QWT_VERSION < 0x060000
connect(_picker, SIGNAL(selected(const QwtDoublePoint &)),
@@ -263,7 +263,7 @@ FrequencyDisplayPlot::FrequencyDisplayPlot(QWidget* parent)
_magnifier = new QwtPlotMagnifier(canvas());
_magnifier->setAxisEnabled(QwtPlot::xBottom, false);
- _zoomer = new FreqDisplayZoomer(canvas(), 0);
+ _zoomer = new FreqDisplayZoomer(dynamic_cast<QwtPlotCanvas*>(canvas()), 0);
#if QWT_VERSION < 0x060000
_zoomer->setSelectionFlags(QwtPicker::RectSelection | QwtPicker::DragSelection);
diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.cc b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
index 84b09af..31073de 100644
--- a/gr-qtgui/lib/TimeDomainDisplayPlot.cc
+++ b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
@@ -102,7 +102,7 @@ TimeDomainDisplayPlot::TimeDomainDisplayPlot(int nplots, QWidget* parent)
_xAxisPoints = new double[_numPoints];
memset(_xAxisPoints, 0x0, _numPoints*sizeof(double));
- _zoomer = new TimeDomainDisplayZoomer(canvas(), 0);
+ _zoomer = new TimeDomainDisplayZoomer(dynamic_cast<QwtPlotCanvas*>(canvas()), 0);
#if QWT_VERSION < 0x060000
_zoomer->setSelectionFlags(QwtPicker::RectSelection | QwtPicker::DragSelection);
@@ -169,7 +169,7 @@ TimeDomainDisplayPlot::TimeDomainDisplayPlot(int nplots, QWidget* parent)
_panner->setMouseButton(Qt::MidButton);
// emit the position of clicks on widget
- _picker = new QwtDblClickPlotPicker(canvas());
+ _picker = new QwtDblClickPlotPicker(dynamic_cast<QwtPlotCanvas*>(canvas()));
#if QWT_VERSION < 0x060000
connect(_picker, SIGNAL(selected(const QwtDoublePoint &)),
@@ -195,7 +195,7 @@ TimeDomainDisplayPlot::TimeDomainDisplayPlot(int nplots, QWidget* parent)
_zoomer->setTrackerPen(c);
QwtLegend* legendDisplay = new QwtLegend(this);
- legendDisplay->setItemMode(QwtLegend::CheckableItem);
+ legendDisplay->setDefaultItemMode(QwtLegendData::Checkable);
insertLegend(legendDisplay);
connect(this, SIGNAL( legendChecked(QwtPlotItem *, bool ) ),
diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.cc b/gr-qtgui/lib/WaterfallDisplayPlot.cc
index 63eb57f..e34b6fa 100644
--- a/gr-qtgui/lib/WaterfallDisplayPlot.cc
+++ b/gr-qtgui/lib/WaterfallDisplayPlot.cc
@@ -329,7 +329,7 @@ WaterfallDisplayPlot::WaterfallDisplayPlot(QWidget* parent)
// MidButton for the panning
// RightButton: zoom out by 1
// Ctrl+RighButton: zoom out to full size
- _zoomer = new WaterfallZoomer(canvas(), 0);
+ _zoomer = new WaterfallZoomer(dynamic_cast<QwtPlotCanvas *>(canvas()), 0);
#if QWT_VERSION < 0x060000
_zoomer->setSelectionFlags(QwtPicker::RectSelection | QwtPicker::DragSelection);
#endif
@@ -343,7 +343,7 @@ WaterfallDisplayPlot::WaterfallDisplayPlot(QWidget* parent)
_panner->setMouseButton(Qt::MidButton);
// emit the position of clicks on widget
- _picker = new QwtDblClickPlotPicker(canvas());
+ _picker = new QwtDblClickPlotPicker(dynamic_cast<QwtPlotCanvas *>(canvas()));
#if QWT_VERSION < 0x060000
connect(_picker, SIGNAL(selected(const QwtDoublePoint &)),
this, SLOT(OnPickerPointSelected(const QwtDoublePoint &)));
diff --git a/gr-qtgui/lib/spectrumdisplayform.cc b/gr-qtgui/lib/spectrumdisplayform.cc
index dd9011d..0da804b 100644
--- a/gr-qtgui/lib/spectrumdisplayform.cc
+++ b/gr-qtgui/lib/spectrumdisplayform.cc
@@ -50,9 +50,9 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent)
MaxHoldCheckBox_toggled( false );
WaterfallMaximumIntensityWheel->setRange(-200, 0);
- WaterfallMaximumIntensityWheel->setTickCnt(50);
+ WaterfallMaximumIntensityWheel->setTickCount(50);
WaterfallMinimumIntensityWheel->setRange(-200, 0);
- WaterfallMinimumIntensityWheel->setTickCnt(50);
+ WaterfallMinimumIntensityWheel->setTickCount(50);
WaterfallMinimumIntensityWheel->setValue(-200);
_peakFrequency = 0;
@@ -597,13 +597,13 @@ void
SpectrumDisplayForm::WaterfallAutoScaleBtnCB()
{
double minimumIntensity = _noiseFloorAmplitude - 5;
- if(minimumIntensity < WaterfallMinimumIntensityWheel->minValue()){
- minimumIntensity = WaterfallMinimumIntensityWheel->minValue();
+ if(minimumIntensity < WaterfallMinimumIntensityWheel->minimum()){
+ minimumIntensity = WaterfallMinimumIntensityWheel->minimum();
}
WaterfallMinimumIntensityWheel->setValue(minimumIntensity);
double maximumIntensity = _peakAmplitude + 10;
- if(maximumIntensity > WaterfallMaximumIntensityWheel->maxValue()){
- maximumIntensity = WaterfallMaximumIntensityWheel->maxValue();
+ if(maximumIntensity > WaterfallMaximumIntensityWheel->maximum()){
+ maximumIntensity = WaterfallMaximumIntensityWheel->maximum();
}
WaterfallMaximumIntensityWheel->setValue(maximumIntensity);
waterfallMaximumIntensityChangedCB(maximumIntensity);