summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2012-11-12 21:56:06 -0500
committerTom Rondeau <trondeau@vt.edu>2012-11-12 21:56:06 -0500
commit0613db37aa3d87eb3cce2841fa210abc6b7f9c22 (patch)
tree305ea14c939e945017bf9bc9510a44246b301076
parentbbbbf8b042c3443415ae766bf7b6a26134c0119d (diff)
qtgui: Fixed some build issues and made sure all qtgui examples work.
analog: also fixed having a default arg for noise_source seed in Python.
-rw-r--r--gr-analog/include/analog/noise_source_X.h.t2
-rw-r--r--gr-channels/CMakeLists.txt1
-rwxr-xr-xgr-qtgui/examples/pyqt_const_c.py8
-rwxr-xr-xgr-qtgui/examples/pyqt_example_c.py8
-rwxr-xr-xgr-qtgui/examples/pyqt_example_f.py6
-rwxr-xr-xgr-qtgui/examples/pyqt_freq_c.py10
-rwxr-xr-xgr-qtgui/examples/pyqt_freq_f.py2
-rwxr-xr-xgr-qtgui/examples/pyqt_time_c.py10
-rwxr-xr-xgr-qtgui/examples/pyqt_waterfall_c.py8
-rwxr-xr-xgr-qtgui/examples/pyqt_waterfall_f.py2
-rw-r--r--gr-qtgui/lib/DisplayPlot.cc4
-rw-r--r--gr-qtgui/lib/DisplayPlot.h3
-rw-r--r--gr-qtgui/lib/FrequencyDisplayPlot.cc2
13 files changed, 48 insertions, 18 deletions
diff --git a/gr-analog/include/analog/noise_source_X.h.t b/gr-analog/include/analog/noise_source_X.h.t
index 9d1be6fedf..27d20cd072 100644
--- a/gr-analog/include/analog/noise_source_X.h.t
+++ b/gr-analog/include/analog/noise_source_X.h.t
@@ -53,7 +53,7 @@ namespace gr {
* \param seed seed for random generators. Note that for uniform and
* Gaussian distributions, this should be a negative number.
*/
- static sptr make(noise_type_t type, float ampl, long seed);
+ static sptr make(noise_type_t type, float ampl, long seed=0);
virtual void set_type(noise_type_t type) = 0;
virtual void set_amplitude(float ampl) = 0;
diff --git a/gr-channels/CMakeLists.txt b/gr-channels/CMakeLists.txt
index 54eb23fb0f..6a5d20edef 100644
--- a/gr-channels/CMakeLists.txt
+++ b/gr-channels/CMakeLists.txt
@@ -32,6 +32,7 @@ GR_REGISTER_COMPONENT("gr-channels" ENABLE_GR_CHANNELS
ENABLE_VOLK
Boost_FOUND
ENABLE_GR_CORE
+ ENABLE_GR_BLOCKS
ENABLE_GR_FFT
ENABLE_GR_FILTER
ENABLE_GR_ANALOG
diff --git a/gr-qtgui/examples/pyqt_const_c.py b/gr-qtgui/examples/pyqt_const_c.py
index cf81aa120f..382fbdabee 100755
--- a/gr-qtgui/examples/pyqt_const_c.py
+++ b/gr-qtgui/examples/pyqt_const_c.py
@@ -37,6 +37,12 @@ except ImportError:
sys.stderr.write("Error: Program requires gr-analog.\n")
sys.exit(1)
+try:
+ from gnuradio import channels
+except ImportError:
+ sys.stderr.write("Error: Program requires gr-channels.\n")
+ sys.exit(1)
+
class dialog_box(QtGui.QWidget):
def __init__(self, display, control):
QtGui.QWidget.__init__(self, None)
@@ -148,7 +154,7 @@ class my_top_block(gr.top_block):
src1 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f1, 0.5, 0)
src2 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f2, 0.5, 0)
src = gr.add_cc()
- channel = filter.channel_model(0.001)
+ channel = channels.channel_model(0.001)
thr = gr.throttle(gr.sizeof_gr_complex, 100*npts)
self.snk1 = qtgui.const_sink_c(npts, "Constellation Example", 1)
diff --git a/gr-qtgui/examples/pyqt_example_c.py b/gr-qtgui/examples/pyqt_example_c.py
index 294964479a..3ed64b7003 100755
--- a/gr-qtgui/examples/pyqt_example_c.py
+++ b/gr-qtgui/examples/pyqt_example_c.py
@@ -37,6 +37,12 @@ except ImportError:
sys.stderr.write("Error: Program requires gr-analog.\n")
sys.exit(1)
+try:
+ from gnuradio import channels
+except ImportError:
+ sys.stderr.write("Error: Program requires gr-channels.\n")
+ sys.exit(1)
+
class dialog_box(QtGui.QWidget):
def __init__(self, display, control):
QtGui.QWidget.__init__(self, None)
@@ -152,7 +158,7 @@ class my_top_block(gr.top_block):
src1 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f1, 0.1, 0)
src2 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0)
src = gr.add_cc()
- channel = filter.channel_model(0.001)
+ channel = channels.channel_model(0.001)
thr = gr.throttle(gr.sizeof_gr_complex, 100*fftsize)
self.snk1 = qtgui.sink_c(fftsize, filter.firdes.WIN_BLACKMAN_hARRIS,
0, Rs,
diff --git a/gr-qtgui/examples/pyqt_example_f.py b/gr-qtgui/examples/pyqt_example_f.py
index d2b3d0eb26..4e59d78001 100755
--- a/gr-qtgui/examples/pyqt_example_f.py
+++ b/gr-qtgui/examples/pyqt_example_f.py
@@ -20,7 +20,7 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr
+from gnuradio import gr, filter
import sys
try:
@@ -146,12 +146,12 @@ class my_top_block(gr.top_block):
self.qapp = QtGui.QApplication(sys.argv)
src1 = analog.sig_source_f(Rs, analog.GR_SIN_WAVE, f1, 0.1, 0)
- src2 = analg.sig_source_f(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0)
+ src2 = analog.sig_source_f(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0)
src = gr.add_ff()
thr = gr.throttle(gr.sizeof_float, 100*fftsize)
noise = analog.noise_source_f(analog.GR_GAUSSIAN, 0.001)
add = gr.add_ff()
- self.snk1 = qtgui.sink_f(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
+ self.snk1 = qtgui.sink_f(fftsize, filter.firdes.WIN_BLACKMAN_hARRIS,
0, Rs,
"Float Signal Example",
True, True, True, False)
diff --git a/gr-qtgui/examples/pyqt_freq_c.py b/gr-qtgui/examples/pyqt_freq_c.py
index 5f891f8935..a02ded898d 100755
--- a/gr-qtgui/examples/pyqt_freq_c.py
+++ b/gr-qtgui/examples/pyqt_freq_c.py
@@ -37,6 +37,12 @@ except ImportError:
sys.stderr.write("Error: Program requires gr-analog.\n")
sys.exit(1)
+try:
+ from gnuradio import channels
+except ImportError:
+ sys.stderr.write("Error: Program requires gr-channels.\n")
+ sys.exit(1)
+
class dialog_box(QtGui.QWidget):
def __init__(self, display, control):
QtGui.QWidget.__init__(self, None)
@@ -152,9 +158,9 @@ class my_top_block(gr.top_block):
src1 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f1, 0.1, 0)
src2 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0)
src = gr.add_cc()
- channel = filter.channel_model(0.01)
+ channel = channels.channel_model(0.01)
thr = gr.throttle(gr.sizeof_gr_complex, 100*npts)
- self.snk1 = qtgui.freq_sink_c(npts, analog.firdes.WIN_BLACKMAN_hARRIS,
+ self.snk1 = qtgui.freq_sink_c(npts, filter.firdes.WIN_BLACKMAN_hARRIS,
0, Rs,
"Complex Freq Example", 3)
diff --git a/gr-qtgui/examples/pyqt_freq_f.py b/gr-qtgui/examples/pyqt_freq_f.py
index d276d11106..79c1399a73 100755
--- a/gr-qtgui/examples/pyqt_freq_f.py
+++ b/gr-qtgui/examples/pyqt_freq_f.py
@@ -20,7 +20,7 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr
+from gnuradio import gr, filter
import sys
try:
diff --git a/gr-qtgui/examples/pyqt_time_c.py b/gr-qtgui/examples/pyqt_time_c.py
index ba5980a050..6eb97fa9eb 100755
--- a/gr-qtgui/examples/pyqt_time_c.py
+++ b/gr-qtgui/examples/pyqt_time_c.py
@@ -20,7 +20,7 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, filter
+from gnuradio import gr
import sys
try:
@@ -37,6 +37,12 @@ except ImportError:
sys.stderr.write("Error: Program requires gr-analog.\n")
sys.exit(1)
+try:
+ from gnuradio import channels
+except ImportError:
+ sys.stderr.write("Error: Program requires gr-channels.\n")
+ sys.exit(1)
+
class dialog_box(QtGui.QWidget):
def __init__(self, display, control):
QtGui.QWidget.__init__(self, None)
@@ -152,7 +158,7 @@ class my_top_block(gr.top_block):
src1 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f1, 0.1, 0)
src2 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0)
src = gr.add_cc()
- channel = filter.channel_model(0.01)
+ channel = channels.channel_model(0.01)
thr = gr.throttle(gr.sizeof_gr_complex, 100*npts)
self.snk1 = qtgui.time_sink_c(npts, Rs,
"Complex Time Example", 1)
diff --git a/gr-qtgui/examples/pyqt_waterfall_c.py b/gr-qtgui/examples/pyqt_waterfall_c.py
index eb7e731dfd..30931227b3 100755
--- a/gr-qtgui/examples/pyqt_waterfall_c.py
+++ b/gr-qtgui/examples/pyqt_waterfall_c.py
@@ -37,6 +37,12 @@ except ImportError:
sys.stderr.write("Error: Program requires gr-analog.\n")
sys.exit(1)
+try:
+ from gnuradio import channels
+except ImportError:
+ sys.stderr.write("Error: Program requires gr-channels.\n")
+ sys.exit(1)
+
class dialog_box(QtGui.QWidget):
def __init__(self, display, control):
QtGui.QWidget.__init__(self, None)
@@ -152,7 +158,7 @@ class my_top_block(gr.top_block):
src1 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f1, 0.1, 0)
src2 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0)
src = gr.add_cc()
- channel = filter.channel_model(0.01)
+ channel = channels.channel_model(0.01)
thr = gr.throttle(gr.sizeof_gr_complex, 100*npts)
self.snk1 = qtgui.waterfall_sink_c(npts, filter.firdes.WIN_BLACKMAN_hARRIS,
0, Rs,
diff --git a/gr-qtgui/examples/pyqt_waterfall_f.py b/gr-qtgui/examples/pyqt_waterfall_f.py
index ff79924843..725117d06b 100755
--- a/gr-qtgui/examples/pyqt_waterfall_f.py
+++ b/gr-qtgui/examples/pyqt_waterfall_f.py
@@ -20,7 +20,7 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr
+from gnuradio import gr, filter
import sys
try:
diff --git a/gr-qtgui/lib/DisplayPlot.cc b/gr-qtgui/lib/DisplayPlot.cc
index 0b422ee1ca..a91ac721f1 100644
--- a/gr-qtgui/lib/DisplayPlot.cc
+++ b/gr-qtgui/lib/DisplayPlot.cc
@@ -119,7 +119,7 @@ DisplayPlot::lineLabel(int which)
}
void
-DisplayPlot::setLineColor(int which, QString color)
+DisplayPlot::setLineColor(int which, QColor color)
{
if (which < _nplots) {
// Set the color of the pen
@@ -153,7 +153,7 @@ DisplayPlot::getLineColor(int which) const {
// Use a preprocessor macro to create a bunch of hooks for Q_PROPERTY and hence the stylesheet.
#define SETUPLINE(i, im1) \
- void DisplayPlot::setLineColor ## i (QColor c) {setColor(im1, c);} \
+ void DisplayPlot::setLineColor ## i (QColor c) {setLineColor(im1, c);} \
const QColor DisplayPlot::getLineColor ## i () const {return getLineColor(im1);} \
void DisplayPlot::setLineWidth ## i (int width) {setLineWidth(im1, width);} \
int DisplayPlot::getLineWidth ## i () const {return getLineWidth(im1);} \
diff --git a/gr-qtgui/lib/DisplayPlot.h b/gr-qtgui/lib/DisplayPlot.h
index 934794680d..6a1e684169 100644
--- a/gr-qtgui/lib/DisplayPlot.h
+++ b/gr-qtgui/lib/DisplayPlot.h
@@ -179,8 +179,7 @@ public slots:
void setYaxis(double min, double max);
void setXaxis(double min, double max);
void setLineLabel(int which, QString label);
- void setLineColor(int which, QString color);
-
+ void setLineColor(int which, QColor color);
QColor getLineColor(int which) const;
void setLineWidth(int which, int width);
int getLineWidth(int which) const;
diff --git a/gr-qtgui/lib/FrequencyDisplayPlot.cc b/gr-qtgui/lib/FrequencyDisplayPlot.cc
index 0fdba579c8..88f5ec91c0 100644
--- a/gr-qtgui/lib/FrequencyDisplayPlot.cc
+++ b/gr-qtgui/lib/FrequencyDisplayPlot.cc
@@ -114,7 +114,7 @@ FrequencyDisplayPlot::FrequencyDisplayPlot(int nplots, QWidget* parent)
#else
_plot_curve[i]->setRawSamples(_xAxisPoints, _dataPoints[i], _numPoints);
#endif
- setColor(i, default_colors[i]);
+ setLineColor(i, default_colors[i]);
}
_min_fft_plot_curve = new QwtPlotCurve("Minimum Power");