From 7ed83c72dbd079a50a421661a874c3ac94a34bd6 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 5 Dec 2010 17:21:07 -0500 Subject: grc: added qtgui support to grc (just added sink) --- grc/blocks/Makefile.am | 1 + grc/blocks/block_tree.xml | 1 + grc/blocks/options.xml | 8 +++ grc/blocks/qtgui_sink_x.xml | 123 ++++++++++++++++++++++++++++++++++++++++++++ grc/python/flow_graph.tmpl | 9 ++++ 5 files changed, 142 insertions(+) create mode 100644 grc/blocks/qtgui_sink_x.xml (limited to 'grc') diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am index 18420a013..ea3c94cbe 100644 --- a/grc/blocks/Makefile.am +++ b/grc/blocks/Makefile.am @@ -203,6 +203,7 @@ dist_ourdata_DATA = \ pad_source.xml \ parameter.xml \ probe_function.xml \ + qtgui_sink_x.xml \ random_source_x.xml \ root_raised_cosine_filter.xml \ trellis_encoder_xx.xml \ diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index 610a88102..644841884 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -47,6 +47,7 @@ wxgui_waterfallsink2 wxgui_histosink2 wxgui_termsink + qtgui_sink_x Operators diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml index 4d0dd2899..62ceeba0f 100644 --- a/grc/blocks/options.xml +++ b/grc/blocks/options.xml @@ -15,6 +15,10 @@ from grc_gnuradio import wxgui as grc_wxgui import wx #end if +#if $generate_options() == 'qt_gui' +from PyQt4 import QtGui +import sys +#end if #if $generate_options() != 'hb' from optparse import OptionParser from gnuradio.eng_option import eng_option @@ -61,6 +65,10 @@ else: self.stop(); self.wait() WX GUI wx_gui + - - Graphical Sinks - wxgui_numbersink2 - wxgui_scopesink2 - wxgui_fftsink2 - wxgui_constellationsink2 - wxgui_waterfallsink2 - wxgui_histosink2 - wxgui_termsink - qtgui_sink_x - Operators gr_add_xx @@ -139,7 +128,7 @@ gr_pll_freqdet_cf gr_pll_refout_cc - gr_fll_band_edge_cc + gr_fll_band_edge_cc gr_correlate_access_code_bb gr_pn_correlator_cc @@ -263,7 +252,7 @@ gr_additive_scrambler_bb - Vocoders + Vocoders blks2_cvsd_encode blks2_cvsd_decode @@ -311,7 +300,5 @@ xmlrpc_server xmlrpc_client - - notebook diff --git a/grc/blocks/notebook.xml b/grc/blocks/notebook.xml deleted file mode 100644 index d41db9e2d..000000000 --- a/grc/blocks/notebook.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - Notebook - notebook - from grc_gnuradio import wxgui as grc_wxgui - #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' -self.$(id) = wx.Notebook($(parent).GetWin(), style=$style) -#for $label in $labels() -self.$(id).AddPage(grc_wxgui.Panel(self.$(id)), "$label") -#end for -#if not $grid_pos() -$(parent).Add(self.$(id)) -#else -$(parent).GridAdd(self.$(id), $(', '.join(map(str, $grid_pos())))) -#end if - - Tab Orientation - style - wx.NB_TOP - enum - - - - - - - Labels - labels - ['tab1', 'tab2', 'tab3'] - raw - - - Grid Position - grid_pos - - grid_pos - - - Notebook - notebook - - notebook - - isinstance($labels, (list, tuple)) - all(map(lambda x: isinstance(x, str), $labels)) - len($labels) > 0 - -Use the Grid Position (row, column, row span, column span) to position the graphical element in the window. - -Use the Notebook Param (notebook-id, page-index) to place the graphical element inside of a notebook page. - - diff --git a/grc/python/Generator.py b/grc/python/Generator.py index 7d08b914b..b669fa65a 100644 --- a/grc/python/Generator.py +++ b/grc/python/Generator.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009, 2010 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 @@ -90,22 +90,20 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''') imports = self._flow_graph.get_imports() variables = self._flow_graph.get_variables() parameters = self._flow_graph.get_parameters() - #list of variables with controls - controls = filter(lambda v: v.get_make(), variables) #list of blocks not including variables and imports and parameters and disabled - blocks = sorted(self._flow_graph.get_enabled_blocks(), lambda x, y: cmp(x.get_id(), y.get_id())) - probes = filter(lambda b: b.get_key().startswith('probe_'), blocks) #ensure probes are last in the block list - #get a list of notebooks and sort them according dependencies - notebooks = expr_utils.sort_objects( - filter(lambda b: b.get_key() == 'notebook', blocks), - lambda n: n.get_id(), lambda n: n.get_param('notebook').get_value(), - ) - notebooks += expr_utils.sort_objects( - filter(lambda b: b.get_key() == 'qtgui_tab_widget', blocks), - lambda n: n.get_id(), lambda n: n.get_param('gui_hint').get_value(), + def _get_block_sort_text(block): + code = block.get_make().replace(block.get_id(), ' ') + try: code += block.get_param('notebook').get_value() #older gui markup w/ wxgui + except: pass + try: code += block.get_param('gui_hint').get_value() #newer gui markup w/ qtgui + except: pass + return code + blocks = expr_utils.sort_objects( + self._flow_graph.get_enabled_blocks(), + lambda b: b.get_id(), _get_block_sort_text ) #list of regular blocks (all blocks minus the special ones) - blocks = filter(lambda b: b not in (imports + parameters + variables + probes + notebooks), blocks) + probes + blocks = filter(lambda b: b not in (imports + parameters), blocks) #list of connections where each endpoint is enabled connections = filter(lambda c: not c.is_msg(), self._flow_graph.get_enabled_connections()) messages = filter(lambda c: c.is_msg(), self._flow_graph.get_enabled_connections()) @@ -129,8 +127,6 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''') 'imports': imports, 'flow_graph': self._flow_graph, 'variables': variables, - 'notebooks': notebooks, - 'controls': controls, 'parameters': parameters, 'blocks': blocks, 'connections': connections, diff --git a/grc/python/Param.py b/grc/python/Param.py index 27258faab..303ab3ed8 100644 --- a/grc/python/Param.py +++ b/grc/python/Param.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009, 2010 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 diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index 88049a9ef..8757b5204 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -5,8 +5,6 @@ ##@param imports the import statements ##@param flow_graph the flow_graph ##@param variables the variable blocks -##@param notebooks a list of notebook blocks -##@param controls the variables with gui controls ##@param parameters the paramater blocks ##@param blocks the signal blocks ##@param connections the connections @@ -121,30 +119,6 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))]) $indent($var.get_var_make()) #end for ######################################################## -##Create Notebooks -######################################################## -#if $notebooks - - $DIVIDER - # Notebooks - $DIVIDER -#end if -#for $notebook in $notebooks - $indent($notebook.get_make()) -#end for -######################################################## -##Create Controls -######################################################## -#if $controls - - $DIVIDER - # Controls - $DIVIDER -#end if -#for $ctrl in $controls - $indent($ctrl.get_make()) -#end for -######################################################## ##Create Message Queues ######################################################## #if $messages @@ -166,7 +140,11 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))]) $DIVIDER #end if #for $blk in filter(lambda b: b.get_make(), $blocks) + #if $blk in $variables + $indent($blk.get_make()) + #else self.$blk.get_id() = $indent($blk.get_make()) + #end if #end for ######################################################## ##Create Connections -- cgit From fedf4fbc9d217926ecbb1917d3c995516d88a8a9 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 1 Mar 2011 18:18:53 -0800 Subject: qtgui-grc: enable start/stop control through qt widgets --- grc/blocks/options.xml | 2 +- grc/python/flow_graph.tmpl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'grc') diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml index e6c7e0287..b27ea900c 100644 --- a/grc/blocks/options.xml +++ b/grc/blocks/options.xml @@ -105,7 +105,7 @@ else: self.stop(); self.wait() True bool -#if $generate_options() == 'wx_gui' +#if $generate_options() in ('qt_gui', 'wx_gui') #if $run() part #else diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index 8757b5204..854d83967 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -235,7 +235,9 @@ if __name__ == '__main__': #elif $generate_options == 'qt_gui' qapp = Qt.QApplication(sys.argv) tb = $(class_name)($(', '.join($params_eq_list))) + #if $flow_graph.get_option('run') tb.start() + #end if tb.show() qapp.exec_() #elif $generate_options == 'no_gui' -- cgit From 028f105b345c937f69aa5701e0de7761a2c6fcf3 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 4 Mar 2011 09:08:37 -0800 Subject: qtgui-grc: use a vboxlayout for the top_layout --- grc/python/flow_graph.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'grc') diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index 854d83967..070ad7ed1 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -63,7 +63,7 @@ class $(class_name)(gr.top_block, Qt.QWidget): def __init__($param_str): gr.top_block.__init__(self, "$title") Qt.QWidget.__init__(self) - self.top_layout = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self) + self.top_layout = Qt.QVBoxLayout(self) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) #elif $generate_options == 'no_gui' -- cgit From 7070c10d7ac59adcd597c18ec2c83b1b59ed87e9 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 6 Mar 2011 11:18:27 -0800 Subject: grc: rework the probe blocks and how they fit into grc Removed the source on all probe blocks. Advertise the probe-able function in the docs. Added missing signal probe block. Removed probe function and variable sink blocks. Removed all supporting grc_gnuradio python files. Added variable_function_probe block that can probe arbitrary functions on a block. All the code needed by the function probe is available is the make tag. To display the value of a probe block, use the variable probe block, and a gui widget. To disply the value of a stream, do the same but use the signal probe block. Simple see :-) If more types other than floats need to be read from the stream, the signal probe should be extended. --- grc/blocks/Makefile.am | 4 +- grc/blocks/blks2_variable_sink_x.xml | 77 -------------------- grc/blocks/block_tree.xml | 4 +- grc/blocks/gr_probe_avg_mag_sqrd_x.xml | 22 ++---- grc/blocks/gr_probe_density_b.xml | 15 ++-- grc/blocks/gr_probe_mpsk_snr_c.xml | 39 ++-------- grc/blocks/gr_probe_signal_f.xml | 19 +++++ grc/blocks/probe_function.xml | 44 ------------ grc/blocks/variable_function_probe.xml | 51 +++++++++++++ grc/grc_gnuradio/Makefile.am | 6 +- grc/grc_gnuradio/blks2/__init__.py | 4 +- grc/grc_gnuradio/blks2/probe.py | 123 -------------------------------- grc/grc_gnuradio/blks2/variable_sink.py | 64 ----------------- 13 files changed, 92 insertions(+), 380 deletions(-) delete mode 100644 grc/blocks/blks2_variable_sink_x.xml create mode 100644 grc/blocks/gr_probe_signal_f.xml delete mode 100644 grc/blocks/probe_function.xml create mode 100644 grc/blocks/variable_function_probe.xml delete mode 100644 grc/grc_gnuradio/blks2/probe.py delete mode 100644 grc/grc_gnuradio/blks2/variable_sink.py (limited to 'grc') diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am index d9ec0896e..15c641fbc 100644 --- a/grc/blocks/Makefile.am +++ b/grc/blocks/Makefile.am @@ -60,7 +60,6 @@ dist_ourdata_DATA = \ blks2_tcp_sink.xml \ blks2_tcp_source.xml \ blks2_valve.xml \ - blks2_variable_sink_x.xml \ blks2_wfm_rcv.xml \ blks2_wfm_rcv_pll.xml \ blks2_wfm_tx.xml \ @@ -158,6 +157,7 @@ dist_ourdata_DATA = \ gr_probe_avg_mag_sqrd_x.xml \ gr_probe_density_b.xml \ gr_probe_mpsk_snr_c.xml \ + gr_probe_signal_f.xml \ gr_pwr_squelch_xx.xml \ gr_quadrature_demod_cf.xml \ gr_rational_resampler_base_xxx.xml \ @@ -201,7 +201,6 @@ dist_ourdata_DATA = \ pad_sink.xml \ pad_source.xml \ parameter.xml \ - probe_function.xml \ random_source_x.xml \ root_raised_cosine_filter.xml \ trellis_encoder_xx.xml \ @@ -221,6 +220,7 @@ dist_ourdata_DATA = \ usrp_simple_source_x.xml \ variable.xml \ variable_config.xml \ + variable_function_probe.xml \ virtual_sink.xml \ virtual_source.xml \ xmlrpc_client.xml \ diff --git a/grc/blocks/blks2_variable_sink_x.xml b/grc/blocks/blks2_variable_sink_x.xml deleted file mode 100644 index 5709c9f76..000000000 --- a/grc/blocks/blks2_variable_sink_x.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - Variable Sink - blks2_variable_sink_x - from grc_gnuradio import blks2 as grc_blks2 - grc_blks2.variable_sink_$(type.fcn)( - vlen=$vlen, - decim=$decim, - callback=self.set_$(variable()), -) - set_decim($decim) - - Type - type - enum - - - - - - - - Variable - variable - - string - - - Decimation - decim - 1 - int - - - Vec Length - vlen - 1 - int - - $vlen > 0 - - in - $type - $vlen - - -Read samples from the input stream and \ -write one in every decimation samples to the variable. - -The variable must be the id of an existing variable block. - - diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index 50c463f55..e9a0c1591 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -26,7 +26,6 @@ Sinks - blks2_variable_sink_x gr_vector_sink_x gr_null_sink gr_file_sink @@ -261,7 +260,7 @@ gr_probe_avg_mag_sqrd_x gr_probe_density_b gr_probe_mpsk_snr_c - probe_function + gr_probe_signal_f USRP @@ -276,6 +275,7 @@ Variables variable variable_config + variable_function_probe parameter diff --git a/grc/blocks/gr_probe_avg_mag_sqrd_x.xml b/grc/blocks/gr_probe_avg_mag_sqrd_x.xml index eb855956a..ac409ad67 100644 --- a/grc/blocks/gr_probe_avg_mag_sqrd_x.xml +++ b/grc/blocks/gr_probe_avg_mag_sqrd_x.xml @@ -7,15 +7,10 @@ Probe Avg Mag^2 gr_probe_avg_mag_sqrd_x - from grc_gnuradio import blks2 as grc_blks2 - grc_blks2.probe_avg_mag_sqrd_$(type)( - threshold=$threshold, - alpha=$alpha, - probe_rate=$probe_rate, -) + from gnuradio import gr + gr.probe_avg_mag_sqrd_$(type)($threshold, $alpha) set_alpha($alpha) set_threshold($threshold) - set_probe_rate($probe_rate) Type type @@ -43,18 +38,11 @@ 1 real - - Probe Rate - probe_rate - 10 - real - in $type.input - - out - float - + +Available functions to probe: level + diff --git a/grc/blocks/gr_probe_density_b.xml b/grc/blocks/gr_probe_density_b.xml index 74d3b0a2b..8e0e2c964 100644 --- a/grc/blocks/gr_probe_density_b.xml +++ b/grc/blocks/gr_probe_density_b.xml @@ -7,13 +7,9 @@ Probe Density gr_probe_density_b - from grc_gnuradio import blks2 as grc_blks2 - grc_blks2.probe_density_b( - alpha=$alpha, - probe_rate=$probe_rate, -) + from gnuradio import gr + gr.probe_density_b($alpha) set_alpha($alpha) - set_probe_rate($probe_rate) Alpha alpha @@ -30,8 +26,7 @@ in byte - - out - float - + +Available functions to probe: density + diff --git a/grc/blocks/gr_probe_mpsk_snr_c.xml b/grc/blocks/gr_probe_mpsk_snr_c.xml index 7f562d2f3..38211b55f 100644 --- a/grc/blocks/gr_probe_mpsk_snr_c.xml +++ b/grc/blocks/gr_probe_mpsk_snr_c.xml @@ -7,49 +7,20 @@ Probe MPSK SNR gr_probe_mpsk_snr_c - from grc_gnuradio import blks2 as grc_blks2 - grc_blks2.probe_mpsk_snr_c( - type='$type', - alpha=$alpha, - probe_rate=$probe_rate, -) + from gnuradio import gr + gr.probe_mpsk_snr_c($alpha) set_alpha($alpha) - set_probe_rate($probe_rate) - - Type - type - enum - - - - Alpha alpha 1 real - - Probe Rate - probe_rate - 10 - real - in complex - - out - float - + +Available functions to probe: signal_mean, noise_variance + diff --git a/grc/blocks/gr_probe_signal_f.xml b/grc/blocks/gr_probe_signal_f.xml new file mode 100644 index 000000000..e1847788a --- /dev/null +++ b/grc/blocks/gr_probe_signal_f.xml @@ -0,0 +1,19 @@ + + + + Probe Signal + gr_probe_signal_f + from gnuradio import gr + gr.probe_signal_f() + + in + float + + +Available functions to probe: level + + diff --git a/grc/blocks/probe_function.xml b/grc/blocks/probe_function.xml deleted file mode 100644 index ac0b3dcde..000000000 --- a/grc/blocks/probe_function.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - Probe Function - probe_function - from grc_gnuradio import blks2 as grc_blks2 - grc_blks2.probe_function( - probe_callback=self.$(block_id()).$(function_name()), - probe_rate=$probe_rate, -) - set_probe_rate($probe_rate) - - Block ID - block_id - my_block_0 - string - - - Function Name - function_name - get_number - string - - - Probe Rate - probe_rate - 10 - real - - - out - float - - -Polls a function of an arbitrary block and writes the value to the output port. \ -The block id is the id of another block in the flow graph. \ -The function name is the name of a function in the said block. \ -The function should take no arguments and return a floating point or integer number. - - diff --git a/grc/blocks/variable_function_probe.xml b/grc/blocks/variable_function_probe.xml new file mode 100644 index 000000000..695d2f56c --- /dev/null +++ b/grc/blocks/variable_function_probe.xml @@ -0,0 +1,51 @@ + + + + Function Probe + variable_function_probe + import time + import threading + self.$(id) = $(id) = $value + #slurp +def _$(id)_probe(): + while True: + self.set_$(id)(self.$(block_id()).$(function_name())()) + time.sleep(1.0/($poll_rate)) +_$(id)_thread = threading.Thread(target=_$(id)_probe) +_$(id)_thread.daemon = True +_$(id)_thread.start() + self.set_$(id)($value) + + Value + value + 0 + raw + + + Block ID + block_id + my_block_0 + string + + + Function Name + function_name + get_number + string + + + Poll Rate (Hz) + poll_rate + 10 + real + + +Periodically probe a function and set its value to this variable. + +To poll a stream for a level, use this with the probe signal block. + + diff --git a/grc/grc_gnuradio/Makefile.am b/grc/grc_gnuradio/Makefile.am index c53d07b4e..c70972f59 100644 --- a/grc/grc_gnuradio/Makefile.am +++ b/grc/grc_gnuradio/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -31,10 +31,8 @@ blks2_python_PYTHON = \ blks2/__init__.py \ blks2/error_rate.py \ blks2/packet.py \ - blks2/probe.py \ blks2/selector.py \ - blks2/tcp.py \ - blks2/variable_sink.py + blks2/tcp.py usrp_pythondir = $(grc_gnuradio_prefix)/usrp usrp_python_PYTHON = \ diff --git a/grc/grc_gnuradio/blks2/__init__.py b/grc/grc_gnuradio/blks2/__init__.py index cb1196f25..fde76f256 100644 --- a/grc/grc_gnuradio/blks2/__init__.py +++ b/grc/grc_gnuradio/blks2/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2008, 2009 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -23,6 +23,4 @@ from packet import options, packet_encoder, packet_decoder, \ packet_mod_b, packet_mod_s, packet_mod_i, packet_mod_f, packet_mod_c, \ packet_demod_b, packet_demod_s, packet_demod_i, packet_demod_f, packet_demod_c from error_rate import error_rate -from probe import probe_function, probe_avg_mag_sqrd_c, probe_avg_mag_sqrd_f, probe_density_b, probe_mpsk_snr_c -from variable_sink import variable_sink_b, variable_sink_s, variable_sink_i, variable_sink_f, variable_sink_c from tcp import tcp_source, tcp_sink diff --git a/grc/grc_gnuradio/blks2/probe.py b/grc/grc_gnuradio/blks2/probe.py deleted file mode 100644 index 8db81f057..000000000 --- a/grc/grc_gnuradio/blks2/probe.py +++ /dev/null @@ -1,123 +0,0 @@ -# -# Copyright 2008 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr -import threading -import numpy -import time - -####################################################################################### -## Probe: Function -####################################################################################### -class probe_function(gr.hier_block2, threading.Thread): - """ - The thread polls the function for values and writes to a message source. - """ - - def __init__(self, probe_callback, probe_rate): - #init hier block - gr.hier_block2.__init__( - self, 'probe_function', - gr.io_signature(0, 0, 0), - gr.io_signature(1, 1, gr.sizeof_float), - ) - self._probe_callback = probe_callback - self.set_probe_rate(probe_rate) - #create message source - message_source = gr.message_source(gr.sizeof_float, 1) - self._msgq = message_source.msgq() - #connect - self.connect(message_source, self) - #setup thread - threading.Thread.__init__(self) - self.setDaemon(True) - self.start() - - def run(self): - """ - Infinite polling loop. - """ - while True: - time.sleep(1.0/self._probe_rate) - arr = numpy.array(self._probe_callback(), numpy.float32) - msg = gr.message_from_string(arr.tostring(), 0, gr.sizeof_float, 1) - self._msgq.insert_tail(msg) - - def set_probe_rate(self, probe_rate): - self._probe_rate = probe_rate - -class _probe_base(gr.hier_block2): - def __init__(self, probe_block, probe_callback, probe_rate): - #init hier block - gr.hier_block2.__init__( - self, 'probe', - gr.io_signature(1, 1, probe_block.input_signature().sizeof_stream_items()[0]), - gr.io_signature(1, 1, gr.sizeof_float), - ) - probe_function_block = probe_function(probe_callback, probe_rate) - #forward callbacks - self.set_probe_rate = probe_function_block.set_probe_rate - #connect - self.connect(self, probe_block) - self.connect(probe_function_block, self) - -####################################################################################### -## Probe: Average Magnitude Squared -####################################################################################### -class _probe_avg_mag_sqrd_base(_probe_base): - def __init__(self, threshold, alpha, probe_rate): - #create block - probe_block = self._probe_block_contructor[0](threshold, alpha) - #forward callbacks - self.set_alpha = probe_block.set_alpha - self.set_threshold = probe_block.set_threshold - #init - _probe_base.__init__(self, probe_block, probe_block.level, probe_rate) - -class probe_avg_mag_sqrd_c(_probe_avg_mag_sqrd_base): _probe_block_contructor = (gr.probe_avg_mag_sqrd_c,) -class probe_avg_mag_sqrd_f(_probe_avg_mag_sqrd_base): _probe_block_contructor = (gr.probe_avg_mag_sqrd_f,) - -####################################################################################### -## Probe: Density -####################################################################################### -class probe_density_b(_probe_base): - def __init__(self, alpha, probe_rate): - #create block - probe_block = gr.probe_density_b(alpha) - #forward callbacks - self.set_alpha = probe_block.set_alpha - #init - _probe_base.__init__(self, probe_block, probe_block.density, probe_rate) - -####################################################################################### -## Probe: MPSK SNR -####################################################################################### -class probe_mpsk_snr_c(_probe_base): - def __init__(self, type, alpha, probe_rate): - """ - Type can be "snr", "signal_mean", or "noise_variance" - """ - #create block - probe_block = gr.probe_mpsk_snr_c(alpha) - #forward callbacks - self.set_alpha = probe_block.set_alpha - #init - _probe_base.__init__(self, probe_block, getattr(probe_block, type), probe_rate) diff --git a/grc/grc_gnuradio/blks2/variable_sink.py b/grc/grc_gnuradio/blks2/variable_sink.py deleted file mode 100644 index cad3b8b04..000000000 --- a/grc/grc_gnuradio/blks2/variable_sink.py +++ /dev/null @@ -1,64 +0,0 @@ -# -# Copyright 2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr -import threading -import numpy - -class _variable_sink_base(gr.hier_block2, threading.Thread): - """ - The thread polls the message queue for values and writes to a callback. - """ - - def __init__(self, vlen, decim, callback): - self._vlen = vlen - self._callback = callback - self._item_size = self._size*self._vlen - #init hier block - gr.hier_block2.__init__( - self, 'variable_sink', - gr.io_signature(1, 1, self._item_size), - gr.io_signature(0, 0, 0), - ) - #create blocks - self._decimator = gr.keep_one_in_n(self._item_size, decim) - self._msgq = gr.msg_queue(2) - message_sink = gr.message_sink(self._item_size, self._msgq, False) - #connect - self.connect(self, self._decimator, message_sink) - #setup thread - threading.Thread.__init__(self) - self.setDaemon(True) - self.start() - - def set_decim(self, decim): self._decimator.set_n(decim) - - def run(self): - while True: #truncate to item size, convert to array, callback - msg = self._msgq.delete_head().to_string()[-self._item_size:] - arr = map(self._cast, numpy.fromstring(msg, self._numpy)) - self._callback(self._vlen > 1 and arr or arr[0]) - -class variable_sink_b(_variable_sink_base): _numpy, _size, _cast = numpy.int8, gr.sizeof_char, int -class variable_sink_s(_variable_sink_base): _numpy, _size, _cast = numpy.int16, gr.sizeof_short, int -class variable_sink_i(_variable_sink_base): _numpy, _size, _cast = numpy.int32, gr.sizeof_int, int -class variable_sink_f(_variable_sink_base): _numpy, _size, _cast = numpy.float32, gr.sizeof_float, float -class variable_sink_c(_variable_sink_base): _numpy, _size, _cast = numpy.complex64, gr.sizeof_gr_complex, complex -- cgit From 4e0fb789e55e26bc16990a257c57494f3d3e6100 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 7 Mar 2011 11:43:34 -0800 Subject: grc: added function args to probe block and documentation --- grc/blocks/gr_probe_avg_mag_sqrd_x.xml | 4 +++- grc/blocks/gr_probe_density_b.xml | 4 +++- grc/blocks/gr_probe_mpsk_snr_c.xml | 4 +++- grc/blocks/gr_probe_signal_f.xml | 4 +++- grc/blocks/variable_function_probe.xml | 18 +++++++++++++++++- 5 files changed, 29 insertions(+), 5 deletions(-) (limited to 'grc') diff --git a/grc/blocks/gr_probe_avg_mag_sqrd_x.xml b/grc/blocks/gr_probe_avg_mag_sqrd_x.xml index ac409ad67..6bf706ae1 100644 --- a/grc/blocks/gr_probe_avg_mag_sqrd_x.xml +++ b/grc/blocks/gr_probe_avg_mag_sqrd_x.xml @@ -43,6 +43,8 @@ $type.input -Available functions to probe: level +Available functions to probe: level() + +Use with the function probe block. diff --git a/grc/blocks/gr_probe_density_b.xml b/grc/blocks/gr_probe_density_b.xml index 8e0e2c964..3a91256aa 100644 --- a/grc/blocks/gr_probe_density_b.xml +++ b/grc/blocks/gr_probe_density_b.xml @@ -27,6 +27,8 @@ byte -Available functions to probe: density +Available functions to probe: density() + +Use with the function probe block. diff --git a/grc/blocks/gr_probe_mpsk_snr_c.xml b/grc/blocks/gr_probe_mpsk_snr_c.xml index 38211b55f..5687e867d 100644 --- a/grc/blocks/gr_probe_mpsk_snr_c.xml +++ b/grc/blocks/gr_probe_mpsk_snr_c.xml @@ -21,6 +21,8 @@ complex -Available functions to probe: signal_mean, noise_variance +Available functions to probe: signal_mean(), noise_variance() + +Use with the function probe block. diff --git a/grc/blocks/gr_probe_signal_f.xml b/grc/blocks/gr_probe_signal_f.xml index e1847788a..5c38e816f 100644 --- a/grc/blocks/gr_probe_signal_f.xml +++ b/grc/blocks/gr_probe_signal_f.xml @@ -14,6 +14,8 @@ float -Available functions to probe: level +Available functions to probe: level() + +Use with the function probe block. diff --git a/grc/blocks/variable_function_probe.xml b/grc/blocks/variable_function_probe.xml index 695d2f56c..49f48fc89 100644 --- a/grc/blocks/variable_function_probe.xml +++ b/grc/blocks/variable_function_probe.xml @@ -13,7 +13,7 @@ #slurp def _$(id)_probe(): while True: - self.set_$(id)(self.$(block_id()).$(function_name())()) + self.set_$(id)(self.$(block_id()).$(function_name())($(function_args()))) time.sleep(1.0/($poll_rate)) _$(id)_thread = threading.Thread(target=_$(id)_probe) _$(id)_thread.daemon = True @@ -37,6 +37,13 @@ _$(id)_thread.start() get_number string + + Function Args + function_args + + string + #if $function_args() then 'none' else 'part'# + Poll Rate (Hz) poll_rate @@ -46,6 +53,15 @@ _$(id)_thread.start() Periodically probe a function and set its value to this variable. +Set the values for block ID, function name, and function args appropriately: \ +Block ID should be the ID of another block in this flow graph. \ +Function name should be the name of a class method on that block. \ +Function args are the parameters passed into that function. \ +For a function with no arguments, leave function args blank. + +The values will used literally, and generated into the following form: +self.block_id.function_name(function_args) + To poll a stream for a level, use this with the probe signal block. -- cgit From 9121b75d68a0c90deee814edffe387480b52019b Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 7 Mar 2011 18:40:57 -0800 Subject: qtgui-grc: minor tweaks to the various things --- grc/blocks/variable_function_probe.xml | 7 +++++-- grc/python/flow_graph.tmpl | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'grc') diff --git a/grc/blocks/variable_function_probe.xml b/grc/blocks/variable_function_probe.xml index 49f48fc89..269966c70 100644 --- a/grc/blocks/variable_function_probe.xml +++ b/grc/blocks/variable_function_probe.xml @@ -13,7 +13,9 @@ #slurp def _$(id)_probe(): while True: - self.set_$(id)(self.$(block_id()).$(function_name())($(function_args()))) + val = self.$(block_id()).$(function_name())($(function_args())) + try: self.set_$(id)(val) + except AttributeError, e: pass time.sleep(1.0/($poll_rate)) _$(id)_thread = threading.Thread(target=_$(id)_probe) _$(id)_thread.daemon = True @@ -57,7 +59,8 @@ Set the values for block ID, function name, and function args appropriately: \ Block ID should be the ID of another block in this flow graph. \ Function name should be the name of a class method on that block. \ Function args are the parameters passed into that function. \ -For a function with no arguments, leave function args blank. +For a function with no arguments, leave function args blank. \ +When passing a string for the function arguments, quote the string literal: '"arg"'. The values will used literally, and generated into the following form: self.block_id.function_name(function_args) diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index 070ad7ed1..1aea58838 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -235,6 +235,7 @@ if __name__ == '__main__': #elif $generate_options == 'qt_gui' qapp = Qt.QApplication(sys.argv) tb = $(class_name)($(', '.join($params_eq_list))) + tb.setWindowTitle("$title") #if $flow_graph.get_option('run') tb.start() #end if -- cgit From c86acebd1ab6adf994f49dab1669fcbbb6324637 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 7 Mar 2011 23:52:40 -0800 Subject: qtgui-grc: added suport in main template for theme icon --- grc/python/flow_graph.tmpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'grc') diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index 1aea58838..5aaa99793 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -63,6 +63,8 @@ class $(class_name)(gr.top_block, Qt.QWidget): def __init__($param_str): gr.top_block.__init__(self, "$title") Qt.QWidget.__init__(self) + self.setWindowTitle("$title") + self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) self.top_layout = Qt.QVBoxLayout(self) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) @@ -235,7 +237,6 @@ if __name__ == '__main__': #elif $generate_options == 'qt_gui' qapp = Qt.QApplication(sys.argv) tb = $(class_name)($(', '.join($params_eq_list))) - tb.setWindowTitle("$title") #if $flow_graph.get_option('run') tb.start() #end if -- cgit From 0644b009591f4c63ed05a8095a0c54c1501bac71 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 9 Mar 2011 11:44:35 -0800 Subject: audio: moved the grc audio blocks into gr-audio dir --- grc/blocks/Makefile.am | 2 -- grc/blocks/audio_sink.xml | 85 --------------------------------------------- grc/blocks/audio_source.xml | 85 --------------------------------------------- grc/blocks/block_tree.xml | 2 -- 4 files changed, 174 deletions(-) delete mode 100644 grc/blocks/audio_sink.xml delete mode 100644 grc/blocks/audio_source.xml (limited to 'grc') diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am index 18420a013..c218a59c2 100644 --- a/grc/blocks/Makefile.am +++ b/grc/blocks/Makefile.am @@ -24,8 +24,6 @@ include $(top_srcdir)/Makefile.common ourdatadir = $(grc_blocksdir) dist_ourdata_DATA = \ block_tree.xml \ - audio_sink.xml \ - audio_source.xml \ band_pass_filter.xml \ band_reject_filter.xml \ blks2_am_demod_cf.xml \ diff --git a/grc/blocks/audio_sink.xml b/grc/blocks/audio_sink.xml deleted file mode 100644 index 75d583470..000000000 --- a/grc/blocks/audio_sink.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - Audio Sink - audio_sink - from gnuradio import audio - audio.sink($samp_rate, $device_name, $ok_to_block) - - Sample Rate - samp_rate - 32000 - int - - - - - - - - - Device Name - device_name - - string - #if $device_name() then 'none' else 'part'# - - - OK to Block - ok_to_block - True - enum - part - - - - - Num Inputs - num_inputs - 1 - int - - 0 < $num_inputs - - in - float - $num_inputs - - -Not all sampling rates will be supported by your hardware. - -Leave the device name blank to choose deafult audio device. \ -ALSA users with audio trouble may try setting the device name to plughw:0,0 - -The audio sink can have multiple inputs depending upon your hardware. \ -For example, set the inputs to 2 for stereo audio. - - diff --git a/grc/blocks/audio_source.xml b/grc/blocks/audio_source.xml deleted file mode 100644 index 1f5d1033e..000000000 --- a/grc/blocks/audio_source.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - Audio Source - audio_source - from gnuradio import audio - audio.source($samp_rate, $device_name, $ok_to_block) - - Sample Rate - samp_rate - 32000 - int - - - - - - - - - Device Name - device_name - - string - #if $device_name() then 'none' else 'part'# - - - OK to Block - ok_to_block - True - enum - part - - - - - Num Outputs - num_outputs - 1 - int - - 0 < $num_outputs - - out - float - $num_outputs - - -Not all sampling rates will be supported by your hardware. - -Leave the device name blank to choose deafult audio device. \ -ALSA users with audio trouble may try setting the device name to plughw:0,0 - -The audio source can have multiple outputs depending upon your hardware. \ -For example, set the outputs to 2 for stereo audio. - - diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index 610a88102..82b9e58f3 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -18,7 +18,6 @@ gr_file_source blks2_tcp_source gr_udp_source - audio_source gr_wavfile_source gr_message_source pad_source @@ -32,7 +31,6 @@ gr_file_sink blks2_tcp_sink gr_udp_sink - audio_sink gr_wavfile_sink gr_message_sink pad_sink -- cgit From 21158d425ff8d8b1ba8bbc6a89609b33fb4252b4 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 13 Mar 2011 11:36:03 -0700 Subject: grc: swap store the subprocess object rather than the pid when executing For some reason os.kill(p.pid, SIGKILL) does not work on windows. However, the subprocess p.kill() works just fine for both systems. --- grc/gui/ActionHandler.py | 20 ++++++++++---------- grc/gui/MainWindow.py | 6 +++--- grc/gui/NotebookPage.py | 20 ++++++++++---------- 3 files changed, 23 insertions(+), 23 deletions(-) (limited to 'grc') diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py index 108e23a23..350b297bb 100644 --- a/grc/gui/ActionHandler.py +++ b/grc/gui/ActionHandler.py @@ -1,5 +1,5 @@ """ -Copyright 2007, 2008, 2009 Free Software Foundation, Inc. +Copyright 2007, 2008, 2009, 2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -282,7 +282,7 @@ class ActionHandler: # Gen/Exec/Stop ################################################## elif action == Actions.FLOW_GRAPH_GEN: - if not self.get_page().get_pid(): + if not self.get_page().get_proc(): if not self.get_page().get_saved() or not self.get_page().get_file_path(): Actions.FLOW_GRAPH_SAVE() #only save if file path missing or not saved if self.get_page().get_saved() and self.get_page().get_file_path(): @@ -293,14 +293,14 @@ class ActionHandler: except Exception,e: Messages.send_fail_gen(e) else: self.generator = None elif action == Actions.FLOW_GRAPH_EXEC: - if not self.get_page().get_pid(): + if not self.get_page().get_proc(): Actions.FLOW_GRAPH_GEN() if self.get_page().get_saved() and self.get_page().get_file_path(): ExecFlowGraphThread(self) elif action == Actions.FLOW_GRAPH_KILL: - if self.get_page().get_pid(): - try: os.kill(self.get_page().get_pid(), signal.SIGKILL) - except: print "could not kill pid: %s"%self.get_page().get_pid() + if self.get_page().get_proc(): + try: self.get_page().get_proc().kill() + except: print "could not kill process: %d"%self.get_page().get_proc().pid elif action == Actions.PAGE_CHANGE: #pass and run the global actions pass else: print '!!! Action "%s" not handled !!!'%action @@ -340,10 +340,10 @@ class ActionHandler: Update the exec and stop buttons. Lock and unlock the mutex for race conditions with exec flow graph threads. """ - sensitive = self.get_flow_graph().is_valid() and not self.get_page().get_pid() + sensitive = self.get_flow_graph().is_valid() and not self.get_page().get_proc() Actions.FLOW_GRAPH_GEN.set_sensitive(sensitive) Actions.FLOW_GRAPH_EXEC.set_sensitive(sensitive) - Actions.FLOW_GRAPH_KILL.set_sensitive(self.get_page().get_pid() != None) + Actions.FLOW_GRAPH_KILL.set_sensitive(self.get_page().get_proc() != None) class ExecFlowGraphThread(Thread): """Execute the flow graph as a new process and wait on it to finish.""" @@ -362,7 +362,7 @@ class ExecFlowGraphThread(Thread): #get the popen try: self.p = self.page.get_generator().get_popen() - self.page.set_pid(self.p.pid) + self.page.set_proc(self.p) #update self.update_exec_stop() self.start() @@ -385,5 +385,5 @@ class ExecFlowGraphThread(Thread): def done(self): """Perform end of execution tasks.""" Messages.send_end_exec() - self.page.set_pid(None) + self.page.set_proc(None) self.update_exec_stop() diff --git a/grc/gui/MainWindow.py b/grc/gui/MainWindow.py index 9fcbe2a6c..2f761df1f 100644 --- a/grc/gui/MainWindow.py +++ b/grc/gui/MainWindow.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009 Free Software Foundation, Inc. +Copyright 2008, 2009, 2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -216,7 +216,7 @@ class MainWindow(gtk.Window): """ if not self.page_to_be_closed: self.page_to_be_closed = self.get_page() #show the page if it has an executing flow graph or is unsaved - if self.page_to_be_closed.get_pid() or not self.page_to_be_closed.get_saved(): + if self.page_to_be_closed.get_proc() or not self.page_to_be_closed.get_saved(): self._set_page(self.page_to_be_closed) #unsaved? ask the user if not self.page_to_be_closed.get_saved() and self._save_changes(): @@ -225,7 +225,7 @@ class MainWindow(gtk.Window): self.page_to_be_closed = None #set the page to be closed back to None return #stop the flow graph if executing - if self.page_to_be_closed.get_pid(): Actions.FLOW_GRAPH_KILL() + if self.page_to_be_closed.get_proc(): Actions.FLOW_GRAPH_KILL() #remove the page self.notebook.remove_page(self.notebook.page_num(self.page_to_be_closed)) if ensure and self.notebook.get_n_pages() == 0: self.new_page() #no pages, make a new one diff --git a/grc/gui/NotebookPage.py b/grc/gui/NotebookPage.py index fddfeaf5f..86b6f1513 100644 --- a/grc/gui/NotebookPage.py +++ b/grc/gui/NotebookPage.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009 Free Software Foundation, Inc. +Copyright 2008, 2009, 2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -40,7 +40,7 @@ class NotebookPage(gtk.HBox): @param file_path path to a flow graph file """ self._flow_graph = flow_graph - self.set_pid(None) + self.set_proc(None) #import the file self.main_window = main_window self.set_file_path(file_path) @@ -119,19 +119,19 @@ class NotebookPage(gtk.HBox): """ return self.tab - def get_pid(self): + def get_proc(self): """ - Get the pid for the flow graph. - @return the pid number + Get the subprocess for the flow graph. + @return the subprocess object """ - return self.pid + return self.process - def set_pid(self, pid): + def set_proc(self, process): """ - Set the pid number. - @param pid the new pid number + Set the subprocess object. + @param process the new subprocess """ - self.pid = pid + self.process = process def get_flow_graph(self): """ -- cgit From 07bd878bc30f7ab54afc1e2f0055419388c3c992 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 13 Mar 2011 17:33:33 -0700 Subject: grc: moved all usrp1 and usrp2 stuff out of grc and into gr-usrp*/grc Moved grc xml files, python wrappers (USRP1 only), probe apps + freedesktop files. When the gr-usrp and gr-usrp2 directories are removed, grc will not have to change. Minor change: the freedesktop files are always installed now. This does not mean that they are installed properly with xdg, it just means that the runtime can have access to the icons. --- grc/Makefile.am | 8 +- grc/blocks/Makefile.am | 8 - grc/blocks/block_tree.xml | 9 - grc/blocks/usrp2_probe.xml | 33 ---- grc/blocks/usrp2_sink_xxxx.xml | 120 ------------- grc/blocks/usrp2_source_xxxx.xml | 118 ------------- grc/blocks/usrp_dual_sink_x.xml | 203 ---------------------- grc/blocks/usrp_dual_source_x.xml | 242 --------------------------- grc/blocks/usrp_probe.xml | 40 ----- grc/blocks/usrp_simple_sink_x.xml | 132 --------------- grc/blocks/usrp_simple_source_x.xml | 167 ------------------ grc/freedesktop/Makefile.am | 8 +- grc/freedesktop/gnuradio-usrp2_probe.desktop | 7 - grc/freedesktop/gnuradio-usrp_probe.desktop | 7 - grc/freedesktop/grc_setup_freedesktop.in | 11 +- grc/grc_gnuradio/Makefile.am | 9 +- grc/grc_gnuradio/usrp/__init__.py | 26 --- grc/grc_gnuradio/usrp/common.py | 75 --------- grc/grc_gnuradio/usrp/dual_usrp.py | 132 --------------- grc/grc_gnuradio/usrp/simple_usrp.py | 113 ------------- grc/scripts/Makefile.am | 4 +- grc/scripts/usrp2_probe | 163 ------------------ grc/scripts/usrp_probe | 115 ------------- 23 files changed, 12 insertions(+), 1738 deletions(-) delete mode 100644 grc/blocks/usrp2_probe.xml delete mode 100644 grc/blocks/usrp2_sink_xxxx.xml delete mode 100644 grc/blocks/usrp2_source_xxxx.xml delete mode 100644 grc/blocks/usrp_dual_sink_x.xml delete mode 100644 grc/blocks/usrp_dual_source_x.xml delete mode 100644 grc/blocks/usrp_probe.xml delete mode 100644 grc/blocks/usrp_simple_sink_x.xml delete mode 100644 grc/blocks/usrp_simple_source_x.xml delete mode 100644 grc/freedesktop/gnuradio-usrp2_probe.desktop delete mode 100644 grc/freedesktop/gnuradio-usrp_probe.desktop delete mode 100644 grc/grc_gnuradio/usrp/__init__.py delete mode 100644 grc/grc_gnuradio/usrp/common.py delete mode 100644 grc/grc_gnuradio/usrp/dual_usrp.py delete mode 100644 grc/grc_gnuradio/usrp/simple_usrp.py delete mode 100755 grc/scripts/usrp2_probe delete mode 100755 grc/scripts/usrp_probe (limited to 'grc') diff --git a/grc/Makefile.am b/grc/Makefile.am index 330777bb7..c36786281 100644 --- a/grc/Makefile.am +++ b/grc/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008,2009,2010 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -25,16 +25,12 @@ if PYTHON SUBDIRS = \ base \ blocks \ + freedesktop \ grc_gnuradio \ gui \ python \ scripts -## append freedesktop to the list of subdirs when xdg utils are present -if XDG_UTILS -SUBDIRS += freedesktop -endif - ourpythondir = $(pkgpythondir)/grc ourpython_PYTHON = __init__.py diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am index 18420a013..517792453 100644 --- a/grc/blocks/Makefile.am +++ b/grc/blocks/Makefile.am @@ -212,14 +212,6 @@ dist_ourdata_DATA = \ trellis_siso_f.xml \ trellis_viterbi_combined_xx.xml \ trellis_viterbi_x.xml \ - usrp2_probe.xml \ - usrp2_sink_xxxx.xml \ - usrp2_source_xxxx.xml \ - usrp_dual_sink_x.xml \ - usrp_dual_source_x.xml \ - usrp_probe.xml \ - usrp_simple_sink_x.xml \ - usrp_simple_source_x.xml \ variable.xml \ variable_check_box.xml \ variable_chooser.xml \ diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index 610a88102..e18944bce 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -273,15 +273,6 @@ gr_probe_mpsk_snr_c probe_function - - USRP - usrp_simple_source_x - usrp_simple_sink_x - usrp_dual_source_x - usrp_dual_sink_x - usrp2_source_xxxx - usrp2_sink_xxxx - Variables variable diff --git a/grc/blocks/usrp2_probe.xml b/grc/blocks/usrp2_probe.xml deleted file mode 100644 index cc3f9c2fd..000000000 --- a/grc/blocks/usrp2_probe.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - USRP2 Probe - usrp2_probe - - - Interface - interface - - string - - - Type - type - rx - enum - - - - Press "Probe" to retrieve USRP2 information... - diff --git a/grc/blocks/usrp2_sink_xxxx.xml b/grc/blocks/usrp2_sink_xxxx.xml deleted file mode 100644 index f9fb25361..000000000 --- a/grc/blocks/usrp2_sink_xxxx.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - USRP2 Sink - usrp2_sink_xxxx - from gnuradio import usrp2 - #if not $interface() and not $mac_addr() -usrp2.sink_$(type.fcn)() -#elif not $mac_addr() -usrp2.sink_$(type.fcn)($interface) -#else -usrp2.sink_$(type.fcn)($interface, $mac_addr) -#end if -self.$(id).set_interp($interpolation) -#if $lo_offset() != float('inf') -self.$(id).set_lo_offset($lo_offset) -#end if -self.$(id).set_center_freq($frequency) -self.$(id).set_gain($gain) -self.$(id).config_mimo($usrp2_clock_src) - set_interp($interpolation) - #if $lo_offset() != float('inf') -self.$(id).set_lo_offset($lo_offset) -#end if -self.$(id).set_center_freq($frequency) - set_gain($gain) - - Output Type - type - enum - - - - - Interface - interface - - string - - - MAC Addr - mac_addr - - string - - - Interpolation - interpolation - int - - - Frequency (Hz) - frequency - real - - - LO Offset (Hz) - lo_offset - float('inf') - real - #if $lo_offset() == float('inf') then 'part' else 'none'# - - - - Gain (dB) - gain - 0 - real - - - Clock Source - usrp2_clock_src - usrp2.MC_WE_DONT_LOCK - enum - - - - - - in - $type - $type.vlen - - -The USRP2 sink inputs 100 Megasamples per second / interpolation. - -Input amplitude should be between 0.0 and 1.0. - -To use the default ethernet device, leave interface blank. \ -For systems with only 1 USRP2, you may leave the mac address blank. \ -For multi-USRP2 systems, specify the mac address in the form 00:50:C2:85:3x:xx. - - diff --git a/grc/blocks/usrp2_source_xxxx.xml b/grc/blocks/usrp2_source_xxxx.xml deleted file mode 100644 index 584199798..000000000 --- a/grc/blocks/usrp2_source_xxxx.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - USRP2 Source - usrp2_source_xxxx - from gnuradio import usrp2 - #if not $interface() and not $mac_addr() -usrp2.source_$(type.fcn)() -#elif not $mac_addr() -usrp2.source_$(type.fcn)($interface) -#else -usrp2.source_$(type.fcn)($interface, $mac_addr) -#end if -self.$(id).set_decim($decimation) -#if $lo_offset() != float('inf') -self.$(id).set_lo_offset($lo_offset) -#end if -self.$(id).set_center_freq($frequency) -self.$(id).set_gain($gain) -self.$(id).config_mimo($usrp2_clock_src) - set_decim($decimation) - #if $lo_offset() != float('inf') -self.$(id).set_lo_offset($lo_offset) -#end if -self.$(id).set_center_freq($frequency) - set_gain($gain) - - Output Type - type - enum - - - - - Interface - interface - - string - - - MAC Addr - mac_addr - - string - - - Decimation - decimation - int - - - Frequency (Hz) - frequency - real - - - LO Offset (Hz) - lo_offset - float('inf') - real - #if $lo_offset() == float('inf') then 'part' else 'none'# - - - - Gain (dB) - gain - 0 - real - - - Clock Source - usrp2_clock_src - usrp2.MC_WE_DONT_LOCK - enum - - - - - - out - $type - $type.vlen - - -The USRP2 source outputs 100 Megasamples per second / decimation. - -To use the default ethernet device, leave interface blank. \ -For systems with only 1 USRP2, you may leave the mac address blank. \ -For multi-USRP2 systems, specify the mac address in the form 00:50:C2:85:3x:xx. - - diff --git a/grc/blocks/usrp_dual_sink_x.xml b/grc/blocks/usrp_dual_sink_x.xml deleted file mode 100644 index 4539b62f9..000000000 --- a/grc/blocks/usrp_dual_sink_x.xml +++ /dev/null @@ -1,203 +0,0 @@ - - - - USRP Dual Sink - usrp_dual_sink_x - from grc_gnuradio import usrp as grc_usrp - grc_usrp.dual_sink_$(type.fcn)(which=$which) -self.$(id).set_interp_rate($interpolation) -self.$(id).set_frequency_a($frequency_a, verbose=True#slurp -#if $lo_offset_a() != float('inf') -, lo_offset=$lo_offset_a#slurp -#end if -) -self.$(id).set_frequency_b($frequency_b, verbose=True#slurp -#if $lo_offset_b() != float('inf') -, lo_offset=$lo_offset_b#slurp -#end if -) -self.$(id).set_gain_a($gain_a) -self.$(id).set_gain_b($gain_b) -################################################## -## Flex RF A -################################################## -#if $transmit_a.tx_enb -self.$(id).set_enable_a(True) -#end if -#if $transmit_a.auto_tr -self.$(id).set_auto_tr_a(True) -#end if -################################################## -## Flex RF B -################################################## -#if $transmit_b.tx_enb -self.$(id).set_enable_b(True) -#end if -#if $transmit_b.auto_tr -self.$(id).set_auto_tr_b(True) -#end if - set_interp_rate($interpolation) - set_frequency_a($frequency_a#slurp -#if $lo_offset_a() != float('inf') -, lo_offset=$lo_offset_a#slurp -#end if -) - set_frequency_b($frequency_b#slurp -#if $lo_offset_b() != float('inf') -, lo_offset=$lo_offset_b#slurp -#end if -) - set_gain_a($gain_a) - set_gain_b($gain_b) - - Input Type - type - enum - - - - - Unit Number - which - 0 - int - - - Interpolation - interpolation - int - - - Frequency A (Hz) - frequency_a - real - - - Frequency B (Hz) - frequency_b - real - - - LO Offset A (Hz) - lo_offset_a - float('inf') - real - #if $lo_offset_a() == float('inf') then 'part' else 'none'# - - - - LO Offset B (Hz) - lo_offset_b - float('inf') - real - #if $lo_offset_b() == float('inf') then 'part' else 'none'# - - - - Gain A (dB) - gain_a - 0 - real - - - Gain B (dB) - gain_b - 0 - real - - - - Transmit A - transmit_a - - enum - #if $transmit_a.tx_enb then 'none' else 'part'# - - - - - - - Transmit B - transmit_b - - enum - #if $transmit_b.tx_enb then 'none' else 'part'# - - - - - - Ain - $type - - - Bin - $type - - -The USRP sink inputs 128 Megasamples per second / interpolation. - -Input amplitude should be between 0 and 32767. - -Flex RF boards only: The "Transmit Setting" must be configured. \ -When set to "Enable" the transmitter is always on. \ -When set to "Auto Transmit/Receive", the transmitter is disabled while receiving. - - diff --git a/grc/blocks/usrp_dual_source_x.xml b/grc/blocks/usrp_dual_source_x.xml deleted file mode 100644 index 07d3174bb..000000000 --- a/grc/blocks/usrp_dual_source_x.xml +++ /dev/null @@ -1,242 +0,0 @@ - - - - USRP Dual Source - usrp_dual_source_x - from grc_gnuradio import usrp as grc_usrp - grc_usrp.dual_source_$(type.fcn)( - which=$which, - rx_ant_a=$rx_ant_a, rx_ant_b=$rx_ant_b, - rx_source_a=$rx_source_a, rx_source_b=$rx_source_b, -) -#if $format() -self.$(id).set_format(width=$format.width, shift=$format.shift) -#end if -self.$(id).set_decim_rate($decimation) -self.$(id).set_frequency_a($frequency_a, verbose=True#slurp -#if $lo_offset_a() != float('inf') -, lo_offset=$lo_offset_a#slurp -#end if -) -self.$(id).set_frequency_b($frequency_b, verbose=True#slurp -#if $lo_offset_b() != float('inf') -, lo_offset=$lo_offset_b#slurp -#end if -) -self.$(id).set_gain_a($gain_a) -self.$(id).set_gain_b($gain_b) - set_decim_rate($decimation) - set_frequency_a($frequency_a#slurp -#if $lo_offset_a() != float('inf') -, lo_offset=$lo_offset_a#slurp -#end if -) - set_frequency_b($frequency_b#slurp -#if $lo_offset_b() != float('inf') -, lo_offset=$lo_offset_b#slurp -#end if -) - set_gain_a($gain_a) - set_gain_b($gain_b) - - Output Type - type - enum - - - - - Format - format - - enum - #if $format() then '' else 'part'# - - - - - Unit Number - which - 0 - int - - - Decimation - decimation - int - - - Frequency A (Hz) - frequency_a - real - - - Frequency B (Hz) - frequency_b - real - - - LO Offset A (Hz) - lo_offset_a - float('inf') - real - #if $lo_offset_a() == float('inf') then 'part' else 'none'# - - - - LO Offset B (Hz) - lo_offset_b - float('inf') - real - #if $lo_offset_b() == float('inf') then 'part' else 'none'# - - - - Gain A (dB) - gain_a - 0 - real - - - Gain B (dB) - gain_b - 0 - real - - - - RX Antenna A - rx_ant_a - RXA - string - - - - - - - - - RX Antenna B - rx_ant_b - RXA - string - - - - - - - - RX Source A - rx_source_a - A - string - #if $rx_source_a() == 'A' then 'part' else 'none'# - - - - - RX Source B - rx_source_b - B - string - #if $rx_source_b() == 'B' then 'part' else 'none'# - - - - - Aout - $type - - - Bout - $type - - -The USRP source outputs 64 Megasamples per second / decimation. - -The "Receive Antenna Setting" selects one of the SMA connectors as the data source. \ -Flex RF boards use the "TX/RX" and "RX2" settings. \ -Basic RX and LFRX use the "RXA", "RXB", and "RXAB" settings. \ -All other boards use the "RXA" setting. - - diff --git a/grc/blocks/usrp_probe.xml b/grc/blocks/usrp_probe.xml deleted file mode 100644 index ee207c28d..000000000 --- a/grc/blocks/usrp_probe.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - USRP Probe - usrp_probe - - - Unit Number - which - 0 - int - - - Daughter Board - dboard - enum - - - - - - Press "Probe" to retrieve USRP information... - diff --git a/grc/blocks/usrp_simple_sink_x.xml b/grc/blocks/usrp_simple_sink_x.xml deleted file mode 100644 index b52cd4880..000000000 --- a/grc/blocks/usrp_simple_sink_x.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - - USRP Sink - usrp_simple_sink_x - from grc_gnuradio import usrp as grc_usrp - grc_usrp.simple_sink_$(type.fcn)(which=$which, side=$side) -self.$(id).set_interp_rate($interpolation) -self.$(id).set_frequency($frequency, verbose=True#slurp -#if $lo_offset() != float('inf') -, lo_offset=$lo_offset#slurp -#end if -) -self.$(id).set_gain($gain) -#if $transmit.tx_enb -self.$(id).set_enable(True) -#end if -#if $transmit.auto_tr -self.$(id).set_auto_tr(True) -#end if - set_interp_rate($interpolation) - set_frequency($frequency#slurp -#if $lo_offset() != float('inf') -, lo_offset=$lo_offset#slurp -#end if -) - set_gain($gain) - - Input Type - type - enum - - - - - Unit Number - which - 0 - int - - - Interpolation - interpolation - int - - - Frequency (Hz) - frequency - real - - - LO Offset (Hz) - lo_offset - float('inf') - real - #if $lo_offset() == float('inf') then 'part' else 'none'# - - - - Gain (dB) - gain - 0 - real - - - Side - side - A - string - - - - - Transmit - transmit - - enum - #if $transmit.tx_enb then 'none' else 'part'# - - - - - - in - $type - - -The USRP sink inputs 128 Megasamples per second / interpolation. - -Input amplitude should be between 0 and 32767. - -Flex RF boards only: The "Transmit Setting" must be configured. \ -When set to "Enable" the transmitter is always on. \ -When set to "Auto Transmit/Receive", the transmitter is disabled while receiving. - - diff --git a/grc/blocks/usrp_simple_source_x.xml b/grc/blocks/usrp_simple_source_x.xml deleted file mode 100644 index 7fcc7a22c..000000000 --- a/grc/blocks/usrp_simple_source_x.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - USRP Source - usrp_simple_source_x - from grc_gnuradio import usrp as grc_usrp - grc_usrp.simple_source_$(type.fcn)(which=$which, side=$side, rx_ant=$rx_ant#if $hb_filters() then ', no_hb=True' else ''#) -#if $format() -self.$(id).set_format(width=$format.width, shift=$format.shift) -#end if -self.$(id).set_decim_rate($decimation) -self.$(id).set_frequency($frequency, verbose=True#slurp -#if $lo_offset() != float('inf') -, lo_offset=$lo_offset#slurp -#end if -) -self.$(id).set_gain($gain) - set_decim_rate($decimation) - set_frequency($frequency#slurp -#if $lo_offset() != float('inf') -, lo_offset=$lo_offset#slurp -#end if -) - set_gain($gain) - - Output Type - type - enum - - - - - Format - format - - enum - #if $format() then '' else 'part'# - - - - - Unit Number - which - 0 - int - - - Decimation - decimation - int - - - Frequency (Hz) - frequency - real - - - LO Offset (Hz) - lo_offset - float('inf') - real - #if $lo_offset() == float('inf') then 'part' else 'none'# - - - - Gain (dB) - gain - 0 - real - - - Side - side - A - string - - - - - RX Antenna - rx_ant - RXA - string - - - - - - - - Halfband Filters - hb_filters - - enum - #if $hb_filters() then 'none' else 'part'# - - - - - out - $type - - -The USRP source outputs 64 Megasamples per second / decimation. - -The "Receive Antenna Setting" selects one of the SMA connectors as the data source. \ -Flex RF boards use the "TX/RX" and "RX2" settings. \ -Basic RX and LFRX use the "RXA", "RXB", and "RXAB" settings. \ -All other boards use the "RXA" setting. - -With the format set to 8 bits and the halfband filters disabled, the USRP can acheive a decimation rate of 4. \ -Disabling the halfband filters requires a special USRP firmware without halfband filters or TX paths. \ -For this reason, the USRP cannot transmit with the halfband filters disabled. - - diff --git a/grc/freedesktop/Makefile.am b/grc/freedesktop/Makefile.am index dd7411bbb..f89a344f7 100644 --- a/grc/freedesktop/Makefile.am +++ b/grc/freedesktop/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -29,9 +29,7 @@ dist_ourdata_DATA = \ grc-icon-48.png \ grc-icon-32.png \ gnuradio-grc.xml \ - gnuradio-grc.desktop \ - gnuradio-usrp2_probe.desktop \ - gnuradio-usrp_probe.desktop + gnuradio-grc.desktop pkglibexecdir = $(libexecdir)/$(PACKAGE) dist_pkglibexec_SCRIPTS = grc_setup_freedesktop @@ -42,6 +40,7 @@ grc_setup_freedesktop: $(srcdir)/grc_setup_freedesktop.in Makefile EXTRA_DIST += $(srcdir)/grc_setup_freedesktop.in BUILT_SOURCES += grc_setup_freedesktop +if XDG_UTILS install-data-hook: @printf "\n*** GRC Post-Install Message ***\ \nTo install icons, mime type, and menu items\ @@ -53,3 +52,4 @@ uninstall-hook: \nTo uninstall icons, mime type, and menu items\ \nfor a freedesktop.org system (Gnome/KDE/Xfce):\ \n >>> sudo $(pkglibexecdir)/grc_setup_freedesktop uninstall\n\n" +endif diff --git a/grc/freedesktop/gnuradio-usrp2_probe.desktop b/grc/freedesktop/gnuradio-usrp2_probe.desktop deleted file mode 100644 index c71a092b1..000000000 --- a/grc/freedesktop/gnuradio-usrp2_probe.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -Name=USRP2 Probe -Exec=usrp2_probe -Categories=Development; -Icon=gnuradio-grc diff --git a/grc/freedesktop/gnuradio-usrp_probe.desktop b/grc/freedesktop/gnuradio-usrp_probe.desktop deleted file mode 100644 index 136321994..000000000 --- a/grc/freedesktop/gnuradio-usrp_probe.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -Name=USRP Probe -Exec=usrp_probe -Categories=Development; -Icon=gnuradio-grc diff --git a/grc/freedesktop/grc_setup_freedesktop.in b/grc/freedesktop/grc_setup_freedesktop.in index ab4ce82ef..1e3546197 100644 --- a/grc/freedesktop/grc_setup_freedesktop.in +++ b/grc/freedesktop/grc_setup_freedesktop.in @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -28,7 +28,6 @@ ################################################## ICON_SIZES="32 48 64 128 256" -MENU_ITEMS="grc usrp2_probe usrp_probe" if [ -n "$2" ]; then SRCDIR="$2" else @@ -49,9 +48,7 @@ case "$1" in echo "Install mime type" xdg-mime install ${SRCDIR}/gnuradio-grc.xml echo "Install menu items" - for menu_item in ${MENU_ITEMS}; do \ - xdg-desktop-menu install ${SRCDIR}/gnuradio-${menu_item}.desktop; \ - done + xdg-desktop-menu install ${SRCDIR}/*.desktop echo "Done!" echo "" ;; @@ -68,9 +65,7 @@ case "$1" in echo "Uninstall mime type" xdg-mime uninstall ${SRCDIR}/gnuradio-grc.xml echo "Uninstall menu items" - for menu_item in ${MENU_ITEMS}; do \ - xdg-desktop-menu uninstall gnuradio-${menu_item}.desktop; \ - done + xdg-desktop-menu uninstall `ls ${SRCDIR}/*.desktop | xargs -n1 basename` echo "Done!" echo "" ;; diff --git a/grc/grc_gnuradio/Makefile.am b/grc/grc_gnuradio/Makefile.am index 63bb72822..9187a01e0 100644 --- a/grc/grc_gnuradio/Makefile.am +++ b/grc/grc_gnuradio/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -36,13 +36,6 @@ blks2_python_PYTHON = \ blks2/tcp.py \ blks2/variable_sink.py -usrp_pythondir = $(grc_gnuradio_prefix)/usrp -usrp_python_PYTHON = \ - usrp/__init__.py \ - usrp/common.py \ - usrp/dual_usrp.py \ - usrp/simple_usrp.py - wxgui_pythondir = $(grc_gnuradio_prefix)/wxgui wxgui_python_PYTHON = \ wxgui/__init__.py \ diff --git a/grc/grc_gnuradio/usrp/__init__.py b/grc/grc_gnuradio/usrp/__init__.py deleted file mode 100644 index 1956bbd5b..000000000 --- a/grc/grc_gnuradio/usrp/__init__.py +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2008 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from simple_usrp import \ - simple_source_c, simple_source_s, \ - simple_sink_c, simple_sink_s -from dual_usrp import \ - dual_source_c, dual_source_s, \ - dual_sink_c, dual_sink_s diff --git a/grc/grc_gnuradio/usrp/common.py b/grc/grc_gnuradio/usrp/common.py deleted file mode 100644 index 65c1e7e29..000000000 --- a/grc/grc_gnuradio/usrp/common.py +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright 2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -import sys -from gnuradio import usrp, gr - -################################################## -# USRP base class with common methods -################################################## -class usrp_helper(object): - def _make_usrp(self, *args, **kwargs): self._u = self._usrp_args[0](*args, **kwargs) - def _get_u(self): return self._u - def _get_io_size(self): return self._usrp_args[1] - def _set_frequency(self, chan, subdev, frequency, verbose=False): - """ - Set the carrier frequency for the given subdevice. - @param chan specifies the DDC/DUC number - @param frequency the carrier frequency in Hz - @param verbose if true, print usrp tuning information - """ - r = self._get_u().tune(chan, subdev, frequency) - if not verbose: return - print subdev.side_and_name() - if r: - print "\tr.baseband_frequency =", r.baseband_freq - print "\tr.dxc_frequency =", r.dxc_freq - print "\tr.residual_frequency =", r.residual_freq - print "\tr.inverted =", r.inverted, "\n" - else: print >> sys.stderr, 'Error calling tune on subdevice.' - def set_format(self, width, shift): self._get_u().set_format(self._get_u().make_format(width, shift)) - -################################################## -# Classes to associate usrp constructor w/ io size -################################################## -class usrp_source_c(usrp_helper): _usrp_args = (usrp.source_c, gr.sizeof_gr_complex) -class usrp_source_s(usrp_helper): _usrp_args = (usrp.source_s, gr.sizeof_short) -class usrp_sink_c(usrp_helper): _usrp_args = (usrp.sink_c, gr.sizeof_gr_complex) -class usrp_sink_s(usrp_helper): _usrp_args = (usrp.sink_s, gr.sizeof_short) - -################################################## -# Side spec and antenna spec functions -################################################## -def is_flex(rx_ant): return rx_ant.upper() in ('TX/RX', 'RX2') -def to_spec(side, rx_ant='RXA'): - """ - Convert the side to a spec number. - @param side A or B - @param rx_ant antenna type - @return the spec (0/1, 0/1/2) - """ - #determine the side spec - try: side_spec = {'A': 0, 'B': 1}[side.upper()] - except: raise ValueError, 'Side A or B expected.' - #determine the subdevice spec - if rx_ant.upper() == 'RXB': subdev_spec = 1 - elif rx_ant.upper() == 'RXAB': subdev_spec = 2 - else: subdev_spec = 0 - return (side_spec, subdev_spec) diff --git a/grc/grc_gnuradio/usrp/dual_usrp.py b/grc/grc_gnuradio/usrp/dual_usrp.py deleted file mode 100644 index 66b76b2df..000000000 --- a/grc/grc_gnuradio/usrp/dual_usrp.py +++ /dev/null @@ -1,132 +0,0 @@ -# Copyright 2009, 2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -import common -from gnuradio import gr - -#################################################################### -# Dual USRP Source -#################################################################### -class _dual_source(gr.hier_block2): - """A dual usrp source of IO type short or complex.""" - - def __init__(self, which, rx_ant_a='RXA', rx_ant_b='RXA', rx_source_a='A', rx_source_b='B'): - """ - USRP dual source contructor. - @param which the unit number - @param rx_ant_a the antenna choice - @param rx_ant_b the antenna choice - """ - #initialize hier2 block - gr.hier_block2.__init__( - self, 'usrp_dual_source', - gr.io_signature(0, 0, 0), - gr.io_signature(2, 2, self._get_io_size()), - ) - #create usrp object - self._make_usrp(which=which, nchan=2) - subdev_spec_a = common.to_spec(rx_source_a, rx_ant_a) - subdev_spec_b = common.to_spec(rx_source_b, rx_ant_b) - self._get_u().set_mux(self._get_u().determine_rx_mux_value(subdev_spec_a, subdev_spec_b)) - self._subdev_a = self._get_u().selected_subdev(subdev_spec_a) - self._subdev_b = self._get_u().selected_subdev(subdev_spec_b) - #connect - deinter = gr.deinterleave(self._get_io_size()) - self.connect(self._get_u(), deinter) - for i in range(2): self.connect((deinter, i), (self, i)) - - def set_decim_rate(self, decim): self._get_u().set_decim_rate(int(decim)) - def set_frequency_a(self, frequency, verbose=False, lo_offset=None): - if lo_offset is not None: self._subdev_a.set_lo_offset(lo_offset) - self._set_frequency( - chan=0, #ddc0 - subdev=self._subdev_a, - frequency=frequency, - verbose=verbose, - ) - def set_frequency_b(self, frequency, verbose=False, lo_offset=None): - if lo_offset is not None: self._subdev_b.set_lo_offset(lo_offset) - self._set_frequency( - chan=1, #ddc1 - subdev=self._subdev_b, - frequency=frequency, - verbose=verbose, - ) - def set_gain_a(self, gain): self._subdev_a.set_gain(gain) - def set_gain_b(self, gain): self._subdev_b.set_gain(gain) - -class dual_source_c(_dual_source, common.usrp_source_c): pass -class dual_source_s(_dual_source, common.usrp_source_s): pass - -#################################################################### -# Dual USRP Sink -#################################################################### -class _dual_sink(gr.hier_block2): - """A dual usrp sink of IO type short or complex.""" - - def __init__(self, which): - """ - USRP simple sink contructor. - @param which the unit number - """ - #initialize hier2 block - gr.hier_block2.__init__( - self, 'usrp_dual_sink', - gr.io_signature(2, 2, self._get_io_size()), - gr.io_signature(0, 0, 0), - ) - #create usrp object - self._make_usrp(which=which, nchan=2) - subdev_spec_a = common.to_spec('A') - subdev_spec_b = common.to_spec('B') - self._get_u().set_mux(self._get_u().determine_tx_mux_value(subdev_spec_a, subdev_spec_b)) - self._subdev_a = self._get_u().selected_subdev(subdev_spec_a) - self._subdev_b = self._get_u().selected_subdev(subdev_spec_b) - #connect - inter = gr.interleave(self._get_io_size()) - self.connect(inter, self._get_u()) - for i in range(2): self.connect((self, i), (inter, i)) - - def set_interp_rate(self, interp): self._get_u().set_interp_rate(int(interp)) - def set_frequency_a(self, frequency, verbose=False, lo_offset=None): - if lo_offset is not None: self._subdev_a.set_lo_offset(lo_offset) - self._set_frequency( - chan=self._subdev_a.which(), - subdev=self._subdev_a, - frequency=frequency, - verbose=verbose, - ) - def set_frequency_b(self, frequency, verbose=False, lo_offset=None): - if lo_offset is not None: self._subdev_b.set_lo_offset(lo_offset) - self._set_frequency( - chan=self._subdev_b.which(), - subdev=self._subdev_b, - frequency=frequency, - verbose=verbose, - ) - def set_gain_a(self, gain): self._subdev_a.set_gain(gain) - def set_gain_b(self, gain): self._subdev_b.set_gain(gain) - def set_enable_a(self, enable): self._subdev_a.set_enable(enable) - def set_enable_b(self, enable): self._subdev_b.set_enable(enable) - def set_auto_tr_a(self, auto_tr): self._subdev_a.set_auto_tr(auto_tr) - def set_auto_tr_b(self, auto_tr): self._subdev_b.set_auto_tr(auto_tr) - -class dual_sink_c(_dual_sink, common.usrp_sink_c): pass -class dual_sink_s(_dual_sink, common.usrp_sink_s): pass diff --git a/grc/grc_gnuradio/usrp/simple_usrp.py b/grc/grc_gnuradio/usrp/simple_usrp.py deleted file mode 100644 index fb7a39570..000000000 --- a/grc/grc_gnuradio/usrp/simple_usrp.py +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright 2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -import common -from gnuradio import gr - -#################################################################### -# Simple USRP Source -#################################################################### -class _simple_source(gr.hier_block2): - """A single usrp source of IO type short or complex.""" - - def __init__(self, which, side='A', rx_ant='RXA', no_hb=False): - """ - USRP simple source contructor. - @param which the unit number - @param side the usrp side A or B - @param rx_ant the antenna choice - @param no_hb disable half band filters - """ - self._no_hb = no_hb - #initialize hier2 block - gr.hier_block2.__init__( - self, 'usrp_simple_source', - gr.io_signature(0, 0, 0), - gr.io_signature(1, 1, self._get_io_size()), - ) - #create usrp object - if self._no_hb: self._make_usrp(which=which, nchan=1, fpga_filename="std_4rx_0tx.rbf") - else: self._make_usrp(which=which, nchan=1) - subdev_spec = common.to_spec(side, rx_ant) - self._get_u().set_mux(self._get_u().determine_rx_mux_value(subdev_spec)) - self._subdev = self._get_u().selected_subdev(subdev_spec) - if common.is_flex(rx_ant): self._subdev.select_rx_antenna(rx_ant) - #connect - self.connect(self._get_u(), self) - - def set_decim_rate(self, decim): - self._get_u().set_decim_rate(int(decim)) - if self._no_hb: #set the BW to half the sample rate - self._subdev.set_bw(self._get_u().converter_rate()/decim/2) - def set_frequency(self, frequency, verbose=False, lo_offset=None): - if lo_offset is not None: self._subdev.set_lo_offset(lo_offset) - self._set_frequency( - chan=0, #ddc0 - subdev=self._subdev, - frequency=frequency, - verbose=verbose, - ) - def set_gain(self, gain): self._subdev.set_gain(gain) - -class simple_source_c(_simple_source, common.usrp_source_c): pass -class simple_source_s(_simple_source, common.usrp_source_s): pass - -#################################################################### -# Simple USRP Sink -#################################################################### -class _simple_sink(gr.hier_block2): - """A single usrp sink of IO type short or complex.""" - - def __init__(self, which, side='A'): - """ - USRP simple sink contructor. - @param which the unit number - @param side the usrp side A or B - """ - #initialize hier2 block - gr.hier_block2.__init__( - self, 'usrp_simple_sink', - gr.io_signature(1, 1, self._get_io_size()), - gr.io_signature(0, 0, 0), - ) - #create usrp object - self._make_usrp(which=which, nchan=1) - subdev_spec = common.to_spec(side) - self._get_u().set_mux(self._get_u().determine_tx_mux_value(subdev_spec)) - self._subdev = self._get_u().selected_subdev(subdev_spec) - #connect - self.connect(self, self._get_u()) - - def set_interp_rate(self, interp): self._get_u().set_interp_rate(int(interp)) - def set_frequency(self, frequency, verbose=False, lo_offset=None): - if lo_offset is not None: self._subdev.set_lo_offset(lo_offset) - self._set_frequency( - chan=self._subdev.which(), - subdev=self._subdev, - frequency=frequency, - verbose=verbose, - ) - def set_gain(self, gain): self._subdev.set_gain(gain) - def set_enable(self, enable): self._subdev.set_enable(enable) - def set_auto_tr(self, auto_tr): self._subdev.set_auto_tr(auto_tr) - -class simple_sink_c(_simple_sink, common.usrp_sink_c): pass -class simple_sink_s(_simple_sink, common.usrp_sink_s): pass - diff --git a/grc/scripts/Makefile.am b/grc/scripts/Makefile.am index 9019ec5cc..84e2759dc 100644 --- a/grc/scripts/Makefile.am +++ b/grc/scripts/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,4 +21,4 @@ include $(top_srcdir)/Makefile.common -dist_bin_SCRIPTS = gnuradio-companion usrp2_probe usrp_probe +dist_bin_SCRIPTS = gnuradio-companion diff --git a/grc/scripts/usrp2_probe b/grc/scripts/usrp2_probe deleted file mode 100755 index 38c8f655c..000000000 --- a/grc/scripts/usrp2_probe +++ /dev/null @@ -1,163 +0,0 @@ -#!/usr/bin/env python -""" -Copyright 2009 Free Software Foundation, Inc. -This file is part of GNU Radio - -GNU Radio Companion is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -GNU Radio Companion is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA -""" - -from gnuradio import usrp2 -import subprocess -import os - -import pygtk -pygtk.require('2.0') -import gtk -import gobject - -from gnuradio.grc.gui.Dialogs import TextDisplay - -from gnuradio.grc.python.Platform import Platform -platform = Platform() - -flow_graph = platform.get_new_flow_graph() -block = flow_graph.get_new_block('usrp2_probe') - -##all params -usrp_interface_param = block.get_param('interface') -usrp_type_param = block.get_param('type') - -def get_input(param): - param.validate() - input = param.get_input() - return input - -class USRP2ProbeWindow(gtk.Window): - """ - The main window for USRP Dignostics. - """ - - def delete_event(self, widget, event, data=None): return False - - def destroy(self, widget, data=None): gtk.main_quit() - - def __init__(self): - """ - USRP2ProbeWindow contructor. - Create a new gtk Dialog with a close button, USRP2 input paramaters, and output labels. - """ - self.usrp2_macs = list() - gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL) - #quit signals - self.connect("delete_event", self.delete_event) - self.connect("destroy", self.destroy) - #set the title - self.set_title('USRP2 Probe') - #create decorative frame - frame = gtk.Frame() - self.add(frame) - #create vbox for storage - vbox = gtk.VBox() - frame.add(vbox) - vbox.pack_start(get_input(usrp_interface_param), False) - vbox.pack_start(get_input(usrp_type_param), False) - #make the tree model for holding mac addrs - self.treestore = gtk.TreeStore(gobject.TYPE_STRING) - self.treeview = gtk.TreeView(self.treestore) - self.treeview.set_enable_search(False) #disable pop up search box - self.treeview.add_events(gtk.gdk.BUTTON_PRESS_MASK) - self.treeview.connect('button_press_event', self._handle_selection) - selection = self.treeview.get_selection() - selection.set_mode('single') - selection.connect('changed', self._handle_selection) - renderer = gtk.CellRendererText() - column = gtk.TreeViewColumn('Select a USRP2 MAC Address', renderer, text=0) - self.treeview.append_column(column) - vbox.pack_start(self.treeview, False) - #create probe button - self.probe_button = gtk.Button('Probe') - self.probe_button.connect('clicked', self._probe_usrp2) - vbox.pack_start(self.probe_button, False) - #Create a text box for USRP queries - self.query_buffer = TextDisplay() - self.query_buffer.set_text(block.get_doc()) - vbox.pack_start(self.query_buffer) - self.show_all() - self.treeview.hide() - - def _probe_usrp2(self, widget=None): - """Probe the USRP2 device and copy the results into the query text box.""" - #call find usrps - args = ['find_usrps'] - interface = usrp_interface_param.evaluate() - if interface: args.extend(['-e', interface]) - p = subprocess.Popen(args=args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=False, universal_newlines=True) - msg = p.stdout.read() - #extract mac addrs - self.usrp2_macs = sorted(map(lambda l: l.split()[0], filter(lambda l: l.count(':') >= 5, msg.strip().splitlines()))) - #set the tree store with the mac addrs - self.treestore.clear() - for usrp2_mac in self.usrp2_macs: self.treestore.append(None, (usrp2_mac,)) - #set the text with the error message for 0 found, hide the list - #when only 1 usrp2, auto handle selection, hide the list - #for multiple usrp2, show the list - if not self.usrp2_macs: - self.treeview.hide() - self.query_buffer.set_text(msg) - elif len(self.usrp2_macs) == 1: - self.treeview.hide() - self.query_buffer.set_text('') - self._handle_selection() - else: - self.treeview.show() - self.query_buffer.set_text('') - - def _handle_selection(self, *args, **kwargs): - """A selection change or click occured.""" - #get the mac addr - selection = self.treeview.get_selection() - treestore, iter = selection.get_selected() - mac_addr = iter and treestore.get_value(iter, 0) or '' - if not mac_addr and len(self.usrp2_macs) > 1: - return #no empty mac addrs for when multiple found - #make the usrp2 object - make, rate_attr = { - 'rx': (usrp2.source_32fc, 'adc_rate'), - 'tx': (usrp2.sink_32fc, 'dac_rate'), - }[usrp_type_param.evaluate()] - interface = usrp_interface_param.evaluate() - try: - if not interface and not mac_addr: u = make() - elif not mac_addr: u = make(interface) - else: u = make(interface, mac_addr) - msg = ">>> USRP2 Probe\n" - msg = "%s\nMAC Addr:\n\t%s\n"%(msg, u.mac_addr()) - msg = "%s\nName (ID):\n\t%s\n"%(msg, u.daughterboard_id()) - msg = "%s\nConverter Rate:\n\t%s Hz\n"%(msg, getattr(u, rate_attr)()) - gain_min, gain_max, gain_step = u.gain_range() - msg = "%s\nGain Range (min, max, step size):\n\t%s\n\t%s\n\t%s\n"%(msg, gain_min, gain_max, gain_step) - freq_min, freq_max = u.freq_range() - msg = "%s\nFreq Range (min, max):\n\t%s Hz\n\t%s Hz\n"%(msg, freq_min, freq_max) - self.query_buffer.set_text(msg) - except Exception, e: #display the error message - self.query_buffer.set_text('>>> Error\n%s'%str(e)) - -if __name__ == '__main__': - #setup icon using icon theme - try: gtk.window_set_default_icon(gtk.IconTheme().load_icon('gnuradio-grc', 256, 0)) - except: pass - #enter the mainloop - USRP2ProbeWindow() - gtk.main() diff --git a/grc/scripts/usrp_probe b/grc/scripts/usrp_probe deleted file mode 100755 index d2e92e753..000000000 --- a/grc/scripts/usrp_probe +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env python -""" -Copyright 2009 Free Software Foundation, Inc. -This file is part of GNU Radio - -GNU Radio Companion is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -GNU Radio Companion is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA -""" - -from gnuradio import usrp -import os - -import pygtk -pygtk.require('2.0') -import gtk - -from gnuradio.grc.gui.Dialogs import TextDisplay - -from gnuradio.grc.python.Platform import Platform -platform = Platform() - -flow_graph = platform.get_new_flow_graph() -block = flow_graph.get_new_block('usrp_probe') - -##all params -usrp_which_param = block.get_param('which') -usrp_dboard_param = block.get_param('dboard') - -def get_input(param): - param.validate() - input = param.get_input() - return input - -class USRPProbeWindow(gtk.Window): - """ - The main window for USRP Dignostics. - """ - - def delete_event(self, widget, event, data=None): return False - - def destroy(self, widget, data=None): gtk.main_quit() - - def __init__(self): - """ - USRPProbeWindow contructor. - Create a new gtk Dialog with a close button, USRP input paramaters, and output labels. - """ - gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL) - #quit signals - self.connect("delete_event", self.delete_event) - self.connect("destroy", self.destroy) - #set the title - self.set_title('USRP Probe') - #create decorative frame - frame = gtk.Frame() - self.add(frame) - #create vbox for storage - vbox = gtk.VBox() - frame.add(vbox) - vbox.pack_start(get_input(usrp_which_param), False) - vbox.pack_start(get_input(usrp_dboard_param), False) - self.probe_button = gtk.Button('Probe') - self.probe_button.connect('clicked', self._probe_usrp) - vbox.pack_start(self.probe_button, False) - #Create a text box for USRP queries - self.query_buffer = TextDisplay() - self.query_buffer.set_text(block.get_doc()) - vbox.pack_start(self.query_buffer) - self.show_all() - - def _probe_usrp(self, widget=None): - """Probe the USRP device and copy the results into the query text box.""" - dboard = usrp_dboard_param.evaluate() - side = {'a': 0, 'b': 1}[dboard[-1]] - if dboard.startswith('rx'): make = usrp.source_c - elif dboard.startswith('tx'): make = usrp.sink_c - try: - u = make(which=usrp_which_param.evaluate()) - subdev_spec = (side, 0) - subdev = usrp.selected_subdev(u, subdev_spec) #get the subdev - msg = ">>> USRP Probe\n" - msg = "%s\nName:\n\t%s\n"%(msg, str(subdev.name())) - msg = "%s\nConverter Rate:\n\t%s\n"%(msg, u.converter_rate()) - msg = "%s\nUses Quadrature:\n\t%s\n"%(msg, str(subdev.is_quadrature())) - gain_min, gain_max, gain_step = subdev.gain_range() - msg = "%s\nGain Range (min, max, step size):\n\t%s\n\t%s\n\t%s\n"%(msg, gain_min, gain_max, gain_step) - freq_min, freq_max, freq_step = subdev.freq_range() - msg = "%s\nFreq Range (min, max, step size):\n\t%s\n\t%s\n\t%s\n"%(msg, freq_min, freq_max, freq_step) - self.query_buffer.set_text(msg) - except Exception, e: #display the error message - self.query_buffer.set_text('''\ ->>> Error\n%s - -If the USRP cannot be found, make sure that the USRP is plugged-in and restart this program. \ -If the problem persists, there may be a problem with you gnuradio installation or USB 2.0. -'''%str(e)) - -if __name__ == '__main__': - #setup icon using icon theme - try: gtk.window_set_default_icon(gtk.IconTheme().load_icon('gnuradio-grc', 256, 0)) - except: pass - #enter the mainloop - USRPProbeWindow() - gtk.main() -- cgit