summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/grc_gr_qtgui.m412
-rw-r--r--config/grc_gr_uhd.m41
-rw-r--r--config/grc_volk.m418
-rwxr-xr-xgr-qtgui/apps/pyqt_example_f.py3
-rwxr-xr-xgr-qtgui/apps/qt_digital.py1
-rw-r--r--gr-uhd/Makefile.am2
-rw-r--r--gr-uhd/gnuradio-uhd.pc.in11
-rw-r--r--grc/python/FlowGraph.py31
-rw-r--r--grc/python/convert_hier.py14
-rw-r--r--grc/python/flow_graph.tmpl17
10 files changed, 68 insertions, 42 deletions
diff --git a/config/grc_gr_qtgui.m4 b/config/grc_gr_qtgui.m4
index a4592fa41..ddb7c7ca9 100644
--- a/config/grc_gr_qtgui.m4
+++ b/config/grc_gr_qtgui.m4
@@ -47,12 +47,12 @@ AC_DEFUN([GRC_GR_QTGUI],[
if test $passed = yes; then
dnl Check for package qt or qt-mt, set QT_CFLAGS and QT_LIBS
- PKG_CHECK_MODULES(QTCORE, QtCore >= 4.2, [],
- [passed=no; AC_MSG_RESULT([gr-qtgui requires libQtCore >= 4.2.])])
- PKG_CHECK_MODULES(QTGUI, QtGui >= 4.2, [],
- [passed=no; AC_MSG_RESULT([gr-qtgui requires libQtGui >= 4.2.])])
- PKG_CHECK_MODULES(QTOPENGL, QtOpenGL >= 4.2, [],
- [passed=no; AC_MSG_RESULT([gr-qtgui requires libQtOpenGL >- 4.2.])])
+ PKG_CHECK_MODULES(QTCORE, QtCore >= 4.4, [],
+ [passed=no; AC_MSG_RESULT([gr-qtgui requires libQtCore >= 4.4.])])
+ PKG_CHECK_MODULES(QTGUI, QtGui >= 4.4, [],
+ [passed=no; AC_MSG_RESULT([gr-qtgui requires libQtGui >= 4..])])
+ PKG_CHECK_MODULES(QTOPENGL, QtOpenGL >= 4.4, [],
+ [passed=no; AC_MSG_RESULT([gr-qtgui requires libQtOpenGL >- 4.4.])])
dnl Fetch QWT variables
GR_QWT([], [passed=no])
diff --git a/config/grc_gr_uhd.m4 b/config/grc_gr_uhd.m4
index 3cc9691e5..2d571d970 100644
--- a/config/grc_gr_uhd.m4
+++ b/config/grc_gr_uhd.m4
@@ -40,6 +40,7 @@ AC_DEFUN([GRC_GR_UHD],[
AM_CONDITIONAL([GR_DEFINE_HAVE_UHD],[test $passed = yes])
AC_CONFIG_FILES([ \
+ gr-uhd/gnuradio-uhd.pc \
gr-uhd/Makefile \
gr-uhd/grc/Makefile \
gr-uhd/include/Makefile \
diff --git a/config/grc_volk.m4 b/config/grc_volk.m4
index 1b3c54dd7..f349d5e99 100644
--- a/config/grc_volk.m4
+++ b/config/grc_volk.m4
@@ -21,19 +21,23 @@ AC_DEFUN([GRC_VOLK],[
GRC_ENABLE(volk)
GRC_WITH(volk)
- dnl volk uses a subsidiary configure.ac
- AC_CONFIG_SUBDIRS([volk])
-
- dnl If execution gets to here, $passed will be:
- dnl with : if the --with code didn't error out
+ dnl If execution gets to here, test if $passed is:
+ dnl with : if the --with code didn't error out, use these values
+ dnl Test if $enable_volk is:
dnl yes : if the --enable code passed muster and all dependencies are met
- dnl no : otherwise
- if test $passed != with; then
+ dnl no : otherwise, then do not set variables
+ if test $passed != with && test x$enable_volk == xyes; then
dnl how and where to find INCLUDES and LA
volk_INCLUDES="-I\${abs_top_srcdir}/volk/include"
volk_LA="\${abs_top_builddir}/volk/lib/libvolk.la \
\${abs_top_builddir}/volk/lib/libvolk_runtime.la"
fi
+ dnl volk uses a subsidiary configure.ac
+ dnl only run if building Volk
+ if test $passed == yes && test x$enable_volk != xno; then
+ AC_CONFIG_SUBDIRS([volk])
+ fi
+
GRC_BUILD_CONDITIONAL(volk, [])
])
diff --git a/gr-qtgui/apps/pyqt_example_f.py b/gr-qtgui/apps/pyqt_example_f.py
index fb10314ec..2d957c85a 100755
--- a/gr-qtgui/apps/pyqt_example_f.py
+++ b/gr-qtgui/apps/pyqt_example_f.py
@@ -148,6 +148,5 @@ class my_top_block(gr.top_block):
if __name__ == "__main__":
tb = my_top_block();
tb.start()
- sys.exit(tb.qapp.exec_())
+ tb.qapp.exec_()
tb.stop()
-
diff --git a/gr-qtgui/apps/qt_digital.py b/gr-qtgui/apps/qt_digital.py
index c6920a05d..99c799f2a 100755
--- a/gr-qtgui/apps/qt_digital.py
+++ b/gr-qtgui/apps/qt_digital.py
@@ -274,3 +274,4 @@ if __name__ == "__main__":
tb = my_top_block();
tb.start()
tb.qapp.exec_()
+ tb.stop()
diff --git a/gr-uhd/Makefile.am b/gr-uhd/Makefile.am
index 2e2d0fbe9..f9473bea3 100644
--- a/gr-uhd/Makefile.am
+++ b/gr-uhd/Makefile.am
@@ -27,3 +27,5 @@ if PYTHON
SUBDIRS += swig grc
endif
+pkgconfigdir = $(libdir)/pkgconfig
+dist_pkgconfig_DATA = gnuradio-uhd.pc
diff --git a/gr-uhd/gnuradio-uhd.pc.in b/gr-uhd/gnuradio-uhd.pc.in
new file mode 100644
index 000000000..383ad6011
--- /dev/null
+++ b/gr-uhd/gnuradio-uhd.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: gnuradio-qtgui
+Description: GNU Radio blocks for UHD
+Requires: gnuradio-core
+Version: @LIBVER@
+Libs: -L${libdir} -lgnuradio-uhd
+Cflags: -I${includedir}
diff --git a/grc/python/FlowGraph.py b/grc/python/FlowGraph.py
index b2d406bbd..89a169355 100644
--- a/grc/python/FlowGraph.py
+++ b/grc/python/FlowGraph.py
@@ -1,5 +1,5 @@
"""
-Copyright 2008, 2009 Free Software Foundation, Inc.
+Copyright 2008-2011 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
@@ -48,15 +48,16 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph):
#return from cache
return self._eval_cache[my_hash]
- def _get_io_signaturev(self, pad_key):
+ def get_io_signaturev(self, direction):
"""
Get a list of io signatures for this flow graph.
- The pad key determines the directionality of the io signature.
- @param pad_key a string of pad_source or pad_sink
+ @param direction a string of 'in' or 'out'
@return a list of dicts with: type, label, vlen, size
"""
- pads = filter(lambda b: b.get_key() == pad_key, self.get_enabled_blocks())
- sorted_pads = sorted(pads, lambda x, y: cmp(x.get_id(), y.get_id()))
+ sorted_pads = {
+ 'in': self.get_pad_sources(),
+ 'out': self.get_pad_sinks(),
+ }[direction]
#load io signature
return [{
'label': str(pad.get_param('label').get_evaluated()),
@@ -65,19 +66,21 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph):
'size': pad.get_param('type').get_opt('size'),
} for pad in sorted_pads]
- def get_input_signaturev(self):
+ def get_pad_sources(self):
"""
- Get the io signature for the input side of this flow graph.
- @return a list of io signature structures
+ Get a list of pad source blocks sorted by id order.
+ @return a list of pad source blocks in this flow graph
"""
- return self._get_io_signaturev('pad_source')
+ pads = filter(lambda b: b.get_key() == 'pad_source', self.get_enabled_blocks())
+ return sorted(pads, lambda x, y: cmp(x.get_id(), y.get_id()))
- def get_output_signaturev(self):
+ def get_pad_sinks(self):
"""
- Get the io signature for the output side of this flow graph.
- @return a list of io signature structures
+ Get a list of pad sink blocks sorted by id order.
+ @return a list of pad sink blocks in this flow graph
"""
- return self._get_io_signaturev('pad_sink')
+ pads = filter(lambda b: b.get_key() == 'pad_sink', self.get_enabled_blocks())
+ return sorted(pads, lambda x, y: cmp(x.get_id(), y.get_id()))
def get_imports(self):
"""
diff --git a/grc/python/convert_hier.py b/grc/python/convert_hier.py
index befddccea..c6ca5b769 100644
--- a/grc/python/convert_hier.py
+++ b/grc/python/convert_hier.py
@@ -1,5 +1,5 @@
"""
-Copyright 2008 Free Software Foundation, Inc.
+Copyright 2008-2011 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
@@ -23,11 +23,11 @@ from .. base import odict
def convert_hier(flow_graph, python_file):
#extract info from the flow graph
- input_sigs = flow_graph.get_input_signaturev()
- output_sigs = flow_graph.get_output_signaturev()
+ input_sigs = flow_graph.get_io_signaturev('in')
+ output_sigs = flow_graph.get_io_signaturev('out')
parameters = flow_graph.get_parameters()
block_key = flow_graph.get_option('id')
- block_name = flow_graph.get_option('title')
+ block_name = flow_graph.get_option('title') or flow_graph.get_option('id').replace('_', ' ').title()
block_category = flow_graph.get_option('category')
block_desc = flow_graph.get_option('description')
block_author = flow_graph.get_option('author')
@@ -56,19 +56,21 @@ def convert_hier(flow_graph, python_file):
params_n.append(param_n)
block_n['param'] = params_n
#sink data
+ block_n['sink'] = list()
for input_sig in input_sigs:
sink_n = odict()
sink_n['name'] = input_sig['label']
sink_n['type'] = input_sig['type']
sink_n['vlen'] = input_sig['vlen']
- block_n['sink'] = sink_n
+ block_n['sink'].append(sink_n)
#source data
+ block_n['source'] = list()
for output_sig in output_sigs:
source_n = odict()
source_n['name'] = output_sig['label']
source_n['type'] = output_sig['type']
source_n['vlen'] = output_sig['vlen']
- block_n['source'] = source_n
+ block_n['source'].append(source_n)
#doc data
block_n['doc'] = "%s\n%s\n%s"%(block_author, block_desc, python_file)
#write the block_n to file
diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl
index e16e86f5b..d5e53b52b 100644
--- a/grc/python/flow_graph.tmpl
+++ b/grc/python/flow_graph.tmpl
@@ -74,8 +74,8 @@ class $(class_name)(gr.top_block):
def __init__($param_str):
gr.top_block.__init__(self, "$title")
#elif $generate_options == 'hb'
- #set $in_sigs = $flow_graph.get_input_signaturev()
- #set $out_sigs = $flow_graph.get_output_signaturev()
+ #set $in_sigs = $flow_graph.get_io_signaturev('in')
+ #set $out_sigs = $flow_graph.get_io_signaturev('out')
class $(class_name)(gr.hier_block2):
#def make_io_sig($io_sigs)
#set $size_strs = ['%s*%s'%(io_sig['size'], io_sig['vlen']) for io_sig in $io_sigs]
@@ -153,11 +153,13 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))])
## The port name should be the id of the parent block.
## However, port names for IO pads should be self.
########################################################
-#def make_port_name($port)
- #if $port.get_parent().get_key().startswith('pad_')
-self#slurp
+#def make_port_sig($port)
+ #if $port.get_parent().get_key() == 'pad_source'
+(self, $flow_graph.get_pad_sources().index($port.get_parent()))#slurp
+ #elif $port.get_parent().get_key() == 'pad_sink'
+(self, $flow_graph.get_pad_sinks().index($port.get_parent()))#slurp
#else
-self.$port.get_parent().get_id()#slurp
+(self.$port.get_parent().get_id(), $port.get_key())#slurp
#end if
#end def
#if $connections
@@ -175,7 +177,7 @@ self.$port.get_parent().get_id()#slurp
#end if
##do not generate connections with virtual sinks
#if not $sink.get_parent().is_virtual_sink()
- self.connect(($make_port_name($source), $source.get_key()), ($make_port_name($sink), $sink.get_key()))
+ self.connect($make_port_sig($source), $make_port_sig($sink))
#end if
#end for
@@ -242,6 +244,7 @@ if __name__ == '__main__':
#end if
tb.show()
qapp.exec_()
+ tb.stop()
#elif $generate_options == 'no_gui'
tb = $(class_name)($(', '.join($params_eq_list)))
#set $run_options = $flow_graph.get_option('run_options')