diff options
Diffstat (limited to 'grc')
60 files changed, 242 insertions, 4224 deletions
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/base/Platform.py b/grc/base/Platform.py index 51a3b2f87..096fdec41 100644 --- a/grc/base/Platform.py +++ b/grc/base/Platform.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 @@ -17,6 +17,16 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA """ +#Perform python integrity checks: +# GRC will not work with interpreters that fail the checks below. +# This can fail on interpreters built with special optimizations. +try: + assert False + raise Exception, 'Failed python integrity check: assert not supported' +except AssertionError: pass +if __doc__ is None: + raise Exception, 'Failed python integrity check: __doc__ not supported' + import os import sys from .. base import ParseXML, odict diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am index 18420a013..6f7802169 100644 --- a/grc/blocks/Makefile.am +++ b/grc/blocks/Makefile.am @@ -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 # @@ -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 \ @@ -60,7 +58,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 +155,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 \ @@ -197,12 +195,10 @@ dist_ourdata_DATA = \ import.xml \ low_pass_filter.xml \ note.xml \ - notebook.xml \ options.xml \ pad_sink.xml \ pad_source.xml \ parameter.xml \ - probe_function.xml \ random_source_x.xml \ root_raised_cosine_filter.xml \ trellis_encoder_xx.xml \ @@ -212,29 +208,10 @@ 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 \ variable_config.xml \ - variable_slider.xml \ - variable_static_text.xml \ - variable_text_box.xml \ + variable_function_probe.xml \ virtual_sink.xml \ virtual_source.xml \ - wxgui_constellationsink2.xml \ - wxgui_fftsink2.xml \ - wxgui_histosink2.xml \ - wxgui_numbersink2.xml \ - wxgui_scopesink2.xml \ - wxgui_termsink.xml \ - wxgui_waterfallsink2.xml \ xmlrpc_client.xml \ xmlrpc_server.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 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Audio Sink -################################################### - --> -<block> - <name>Audio Sink</name> - <key>audio_sink</key> - <import>from gnuradio import audio</import> - <make>audio.sink($samp_rate, $device_name, $ok_to_block)</make> - <param> - <name>Sample Rate</name> - <key>samp_rate</key> - <value>32000</value> - <type>int</type> - <option> - <name>16KHz</name> - <key>16000</key> - </option> - <option> - <name>22.05KHz</name> - <key>22050</key> - </option> - <option> - <name>24KHz</name> - <key>24000</key> - </option> - <option> - <name>32KHz</name> - <key>32000</key> - </option> - <option> - <name>44.1KHz</name> - <key>44100</key> - </option> - <option> - <name>48KHz</name> - <key>48000</key> - </option> - </param> - <param> - <name>Device Name</name> - <key>device_name</key> - <value></value> - <type>string</type> - <hide>#if $device_name() then 'none' else 'part'#</hide> - </param> - <param> - <name>OK to Block</name> - <key>ok_to_block</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - <param> - <name>Num Inputs</name> - <key>num_inputs</key> - <value>1</value> - <type>int</type> - </param> - <check>0 < $num_inputs</check> - <sink> - <name>in</name> - <type>float</type> - <nports>$num_inputs</nports> - </sink> - <doc> -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. - </doc> -</block> 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 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Audio Source -################################################### - --> -<block> - <name>Audio Source</name> - <key>audio_source</key> - <import>from gnuradio import audio</import> - <make>audio.source($samp_rate, $device_name, $ok_to_block)</make> - <param> - <name>Sample Rate</name> - <key>samp_rate</key> - <value>32000</value> - <type>int</type> - <option> - <name>16KHz</name> - <key>16000</key> - </option> - <option> - <name>22.05KHz</name> - <key>22050</key> - </option> - <option> - <name>24KHz</name> - <key>24000</key> - </option> - <option> - <name>32KHz</name> - <key>32000</key> - </option> - <option> - <name>44.1KHz</name> - <key>44100</key> - </option> - <option> - <name>48KHz</name> - <key>48000</key> - </option> - </param> - <param> - <name>Device Name</name> - <key>device_name</key> - <value></value> - <type>string</type> - <hide>#if $device_name() then 'none' else 'part'#</hide> - </param> - <param> - <name>OK to Block</name> - <key>ok_to_block</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - <param> - <name>Num Outputs</name> - <key>num_outputs</key> - <value>1</value> - <type>int</type> - </param> - <check>0 < $num_outputs</check> - <source> - <name>out</name> - <type>float</type> - <nports>$num_outputs</nports> - </source> - <doc> -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. - </doc> -</block> 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 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Sink: Custom blks2 block -################################################### - --> -<block> - <name>Variable Sink</name> - <key>blks2_variable_sink_x</key> - <import>from grc_gnuradio import blks2 as grc_blks2</import> - <make>grc_blks2.variable_sink_$(type.fcn)( - vlen=$vlen, - decim=$decim, - callback=self.set_$(variable()), -)</make> - <callback>set_decim($decim)</callback> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:c</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:f</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>fcn:i</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>fcn:s</opt> - </option> - <option> - <name>Byte</name> - <key>byte</key> - <opt>fcn:b</opt> - </option> - </param> - <param> - <name>Variable</name> - <key>variable</key> - <value></value> - <type>string</type> - </param> - <param> - <name>Decimation</name> - <key>decim</key> - <value>1</value> - <type>int</type> - </param> - <param> - <name>Vec Length</name> - <key>vlen</key> - <value>1</value> - <type>int</type> - </param> - <check>$vlen > 0</check> - <sink> - <name>in</name> - <type>$type</type> - <vlen>$vlen</vlen> - </sink> - <doc> -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. - </doc> -</block> diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index 610a88102..549ffbdbf 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -18,7 +18,6 @@ <block>gr_file_source</block> <block>blks2_tcp_source</block> <block>gr_udp_source</block> - <block>audio_source</block> <block>gr_wavfile_source</block> <block>gr_message_source</block> <block>pad_source</block> @@ -26,29 +25,17 @@ </cat> <cat> <name>Sinks</name> - <block>blks2_variable_sink_x</block> <block>gr_vector_sink_x</block> <block>gr_null_sink</block> <block>gr_file_sink</block> <block>blks2_tcp_sink</block> <block>gr_udp_sink</block> - <block>audio_sink</block> <block>gr_wavfile_sink</block> <block>gr_message_sink</block> <block>pad_sink</block> <block>virtual_sink</block> </cat> <cat> - <name>Graphical Sinks</name> - <block>wxgui_numbersink2</block> - <block>wxgui_scopesink2</block> - <block>wxgui_fftsink2</block> - <block>wxgui_constellationsink2</block> - <block>wxgui_waterfallsink2</block> - <block>wxgui_histosink2</block> - <block>wxgui_termsink</block> - </cat> - <cat> <name>Operators</name> <block>gr_add_xx</block> <block>gr_sub_xx</block> @@ -138,7 +125,7 @@ <block>gr_pll_freqdet_cf</block> <block>gr_pll_refout_cc</block> - <block>gr_fll_band_edge_cc</block> + <block>gr_fll_band_edge_cc</block> <block>gr_correlate_access_code_bb</block> <block>gr_pn_correlator_cc</block> @@ -262,7 +249,7 @@ <block>gr_additive_scrambler_bb</block> </cat> <cat> - <name>Vocoders</name> + <name>Vocoders</name> <block>blks2_cvsd_encode</block> <block>blks2_cvsd_decode</block> </cat> @@ -271,26 +258,13 @@ <block>gr_probe_avg_mag_sqrd_x</block> <block>gr_probe_density_b</block> <block>gr_probe_mpsk_snr_c</block> - <block>probe_function</block> - </cat> - <cat> - <name>USRP</name> - <block>usrp_simple_source_x</block> - <block>usrp_simple_sink_x</block> - <block>usrp_dual_source_x</block> - <block>usrp_dual_sink_x</block> - <block>usrp2_source_xxxx</block> - <block>usrp2_sink_xxxx</block> + <block>gr_probe_signal_f</block> </cat> <cat> <name>Variables</name> <block>variable</block> - <block>variable_slider</block> - <block>variable_chooser</block> - <block>variable_check_box</block> - <block>variable_text_box</block> - <block>variable_static_text</block> <block>variable_config</block> + <block>variable_function_probe</block> <block>parameter</block> </cat> <cat> @@ -315,7 +289,5 @@ <block>xmlrpc_server</block> <block>xmlrpc_client</block> - - <block>notebook</block> </cat> </cat> diff --git a/grc/blocks/gr_probe_avg_mag_sqrd_x.xml b/grc/blocks/gr_probe_avg_mag_sqrd_x.xml index eb855956a..6bf706ae1 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 @@ <block> <name>Probe Avg Mag^2</name> <key>gr_probe_avg_mag_sqrd_x</key> - <import>from grc_gnuradio import blks2 as grc_blks2</import> - <make>grc_blks2.probe_avg_mag_sqrd_$(type)( - threshold=$threshold, - alpha=$alpha, - probe_rate=$probe_rate, -)</make> + <import>from gnuradio import gr</import> + <make>gr.probe_avg_mag_sqrd_$(type)($threshold, $alpha)</make> <callback>set_alpha($alpha)</callback> <callback>set_threshold($threshold)</callback> - <callback>set_probe_rate($probe_rate)</callback> <param> <name>Type</name> <key>type</key> @@ -43,18 +38,13 @@ <value>1</value> <type>real</type> </param> - <param> - <name>Probe Rate</name> - <key>probe_rate</key> - <value>10</value> - <type>real</type> - </param> <sink> <name>in</name> <type>$type.input</type> </sink> - <source> - <name>out</name> - <type>float</type> - </source> + <doc> +Available functions to probe: level() + +Use with the function probe block. + </doc> </block> diff --git a/grc/blocks/gr_probe_density_b.xml b/grc/blocks/gr_probe_density_b.xml index 74d3b0a2b..3a91256aa 100644 --- a/grc/blocks/gr_probe_density_b.xml +++ b/grc/blocks/gr_probe_density_b.xml @@ -7,13 +7,9 @@ <block> <name>Probe Density</name> <key>gr_probe_density_b</key> - <import>from grc_gnuradio import blks2 as grc_blks2</import> - <make>grc_blks2.probe_density_b( - alpha=$alpha, - probe_rate=$probe_rate, -)</make> + <import>from gnuradio import gr</import> + <make>gr.probe_density_b($alpha)</make> <callback>set_alpha($alpha)</callback> - <callback>set_probe_rate($probe_rate)</callback> <param> <name>Alpha</name> <key>alpha</key> @@ -30,8 +26,9 @@ <name>in</name> <type>byte</type> </sink> - <source> - <name>out</name> - <type>float</type> - </source> + <doc> +Available functions to probe: density() + +Use with the function probe block. + </doc> </block> diff --git a/grc/blocks/gr_probe_mpsk_snr_c.xml b/grc/blocks/gr_probe_mpsk_snr_c.xml index 7f562d2f3..5687e867d 100644 --- a/grc/blocks/gr_probe_mpsk_snr_c.xml +++ b/grc/blocks/gr_probe_mpsk_snr_c.xml @@ -7,49 +7,22 @@ <block> <name>Probe MPSK SNR</name> <key>gr_probe_mpsk_snr_c</key> - <import>from grc_gnuradio import blks2 as grc_blks2</import> - <make>grc_blks2.probe_mpsk_snr_c( - type='$type', - alpha=$alpha, - probe_rate=$probe_rate, -)</make> + <import>from gnuradio import gr</import> + <make>gr.probe_mpsk_snr_c($alpha)</make> <callback>set_alpha($alpha)</callback> - <callback>set_probe_rate($probe_rate)</callback> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>SNR</name> - <key>snr</key> - </option> - <option> - <name>Signal Mean</name> - <key>signal_mean</key> - </option> - <option> - <name>Noise Variance</name> - <key>noise_variance</key> - </option> - </param> <param> <name>Alpha</name> <key>alpha</key> <value>1</value> <type>real</type> </param> - <param> - <name>Probe Rate</name> - <key>probe_rate</key> - <value>10</value> - <type>real</type> - </param> <sink> <name>in</name> <type>complex</type> </sink> - <source> - <name>out</name> - <type>float</type> - </source> + <doc> +Available functions to probe: signal_mean(), noise_variance() + +Use with the function probe block. + </doc> </block> diff --git a/grc/blocks/gr_probe_signal_f.xml b/grc/blocks/gr_probe_signal_f.xml new file mode 100644 index 000000000..5c38e816f --- /dev/null +++ b/grc/blocks/gr_probe_signal_f.xml @@ -0,0 +1,21 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Probe Signal +################################################### + --> +<block> + <name>Probe Signal</name> + <key>gr_probe_signal_f</key> + <import>from gnuradio import gr</import> + <make>gr.probe_signal_f()</make> + <sink> + <name>in</name> + <type>float</type> + </sink> + <doc> +Available functions to probe: level() + +Use with the function probe block. + </doc> +</block> 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 @@ -<?xml version="1.0"?> -<!-- -################################################### -##WX GUI Notebook -################################################### - --> -<block> - <name>Notebook</name> - <key>notebook</key> - <import>from grc_gnuradio import wxgui as grc_wxgui</import> - <make>#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</make> - <param> - <name>Tab Orientation</name> - <key>style</key> - <value>wx.NB_TOP</value> - <type>enum</type> - <option> - <name>Top</name> - <key>wx.NB_TOP</key> - </option> - <option> - <name>Right</name> - <key>wx.NB_RIGHT</key> - </option> - <option> - <name>Bottom</name> - <key>wx.NB_BOTTOM</key> - </option> - <option> - <name>Left</name> - <key>wx.NB_LEFT</key> - </option> - </param> - <param> - <name>Labels</name> - <key>labels</key> - <value>['tab1', 'tab2', 'tab3']</value> - <type>raw</type> - </param> - <param> - <name>Grid Position</name> - <key>grid_pos</key> - <value></value> - <type>grid_pos</type> - </param> - <param> - <name>Notebook</name> - <key>notebook</key> - <value></value> - <type>notebook</type> - </param> - <check>isinstance($labels, (list, tuple))</check> - <check>all(map(lambda x: isinstance(x, str), $labels))</check> - <check>len($labels) > 0</check> - <doc> -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. - </doc> -</block> diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml index 4d0dd2899..b27ea900c 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 Qt +import sys +#end if #if $generate_options() != 'hb' from optparse import OptionParser from gnuradio.eng_option import eng_option @@ -56,12 +60,15 @@ else: self.stop(); self.wait()</callback> <key>generate_options</key> <value>wx_gui</value> <type>enum</type> - <hide>#if $generate_options() == 'wx_gui' then 'part' else 'none'#</hide> <option> <name>WX GUI</name> <key>wx_gui</key> </option> <option> + <name>QT GUI</name> + <key>qt_gui</key> + </option> + <option> <name>No GUI</name> <key>no_gui</key> </option> @@ -98,7 +105,7 @@ else: self.stop(); self.wait()</callback> <value>True</value> <type>bool</type> <hide> -#if $generate_options() == 'wx_gui' +#if $generate_options() in ('qt_gui', 'wx_gui') #if $run() part #else 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 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Probe Function -################################################### - --> -<block> - <name>Probe Function</name> - <key>probe_function</key> - <import>from grc_gnuradio import blks2 as grc_blks2</import> - <make>grc_blks2.probe_function( - probe_callback=self.$(block_id()).$(function_name()), - probe_rate=$probe_rate, -)</make> - <callback>set_probe_rate($probe_rate)</callback> - <param> - <name>Block ID</name> - <key>block_id</key> - <value>my_block_0</value> - <type>string</type> - </param> - <param> - <name>Function Name</name> - <key>function_name</key> - <value>get_number</value> - <type>string</type> - </param> - <param> - <name>Probe Rate</name> - <key>probe_rate</key> - <value>10</value> - <type>real</type> - </param> - <source> - <name>out</name> - <type>float</type> - </source> - <doc> -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. - </doc> -</block> 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 @@ -<?xml version="1.0"?> -<!-- -################################################### -##USRP2 Probe: -## This block should not appear in the tree. -################################################### - --> -<block> - <name>USRP2 Probe</name> - <key>usrp2_probe</key> - <make></make> - <param> - <name>Interface</name> - <key>interface</key> - <value></value> - <type>string</type> - </param> - <param> - <name>Type</name> - <key>type</key> - <value>rx</value> - <type>enum</type> - <option> - <name>RX</name> - <key>rx</key> - </option> - <option> - <name>TX</name> - <key>tx</key> - </option> - </param> - <doc>Press "Probe" to retrieve USRP2 information...</doc> -</block> 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 @@ -<?xml version="1.0"?> -<!-- -################################################### -##USRP2 Sink -## Note: the center freq must be set after the lo offset -################################################### - --> -<block> - <name>USRP2 Sink</name> - <key>usrp2_sink_xxxx</key> - <import>from gnuradio import usrp2</import> - <make>#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)</make> - <callback>set_interp($interpolation)</callback> - <callback>#if $lo_offset() != float('inf') -self.$(id).set_lo_offset($lo_offset) -#end if -self.$(id).set_center_freq($frequency)</callback> - <callback>set_gain($gain)</callback> - <param> - <name>Output Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:32fc</opt> - <opt>vlen:1</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>fcn:16sc</opt> - <opt>vlen:2</opt> - </option> - </param> - <param> - <name>Interface</name> - <key>interface</key> - <value></value> - <type>string</type> - </param> - <param> - <name>MAC Addr</name> - <key>mac_addr</key> - <value></value> - <type>string</type> - </param> - <param> - <name>Interpolation</name> - <key>interpolation</key> - <type>int</type> - </param> - <param> - <name>Frequency (Hz)</name> - <key>frequency</key> - <type>real</type> - </param> - <param> - <name>LO Offset (Hz)</name> - <key>lo_offset</key> - <value>float('inf')</value> - <type>real</type> - <hide>#if $lo_offset() == float('inf') then 'part' else 'none'#</hide> - <option> - <name>Default</name> - <key>float('inf')</key> - </option> - </param> - <param> - <name>Gain (dB)</name> - <key>gain</key> - <value>0</value> - <type>real</type> - </param> - <param> - <name>Clock Source</name> - <key>usrp2_clock_src</key> - <value>usrp2.MC_WE_DONT_LOCK</value> - <type>enum</type> - <option> - <name>Internal</name> - <key>usrp2.MC_WE_DONT_LOCK</key> - </option> - <option> - <name>External SMA</name> - <key>usrp2.MC_WE_LOCK_TO_SMA</key> - </option> - <option> - <name>External MIMO</name> - <key>usrp2.MC_WE_LOCK_TO_MIMO</key> - </option> - </param> - <sink> - <name>in</name> - <type>$type</type> - <vlen>$type.vlen</vlen> - </sink> - <doc> -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. - </doc> -</block> 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 @@ -<?xml version="1.0"?> -<!-- -################################################### -##USRP2 Source -## Note: the center freq must be set after the lo offset -################################################### - --> -<block> - <name>USRP2 Source</name> - <key>usrp2_source_xxxx</key> - <import>from gnuradio import usrp2</import> - <make>#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)</make> - <callback>set_decim($decimation)</callback> - <callback>#if $lo_offset() != float('inf') -self.$(id).set_lo_offset($lo_offset) -#end if -self.$(id).set_center_freq($frequency)</callback> - <callback>set_gain($gain)</callback> - <param> - <name>Output Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:32fc</opt> - <opt>vlen:1</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>fcn:16sc</opt> - <opt>vlen:2</opt> - </option> - </param> - <param> - <name>Interface</name> - <key>interface</key> - <value></value> - <type>string</type> - </param> - <param> - <name>MAC Addr</name> - <key>mac_addr</key> - <value></value> - <type>string</type> - </param> - <param> - <name>Decimation</name> - <key>decimation</key> - <type>int</type> - </param> - <param> - <name>Frequency (Hz)</name> - <key>frequency</key> - <type>real</type> - </param> - <param> - <name>LO Offset (Hz)</name> - <key>lo_offset</key> - <value>float('inf')</value> - <type>real</type> - <hide>#if $lo_offset() == float('inf') then 'part' else 'none'#</hide> - <option> - <name>Default</name> - <key>float('inf')</key> - </option> - </param> - <param> - <name>Gain (dB)</name> - <key>gain</key> - <value>0</value> - <type>real</type> - </param> - <param> - <name>Clock Source</name> - <key>usrp2_clock_src</key> - <value>usrp2.MC_WE_DONT_LOCK</value> - <type>enum</type> - <option> - <name>Internal</name> - <key>usrp2.MC_WE_DONT_LOCK</key> - </option> - <option> - <name>External SMA</name> - <key>usrp2.MC_WE_LOCK_TO_SMA</key> - </option> - <option> - <name>External MIMO</name> - <key>usrp2.MC_WE_LOCK_TO_MIMO</key> - </option> - </param> - <source> - <name>out</name> - <type>$type</type> - <vlen>$type.vlen</vlen> - </source> - <doc> -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. - </doc> -</block> 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 @@ -<?xml version="1.0"?> -<!-- -################################################### -##USRP Dual Sink -################################################### - --> -<block> - <name>USRP Dual Sink</name> - <key>usrp_dual_sink_x</key> - <import>from grc_gnuradio import usrp as grc_usrp</import> - <make>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</make> - <callback>set_interp_rate($interpolation)</callback> - <callback>set_frequency_a($frequency_a#slurp -#if $lo_offset_a() != float('inf') -, lo_offset=$lo_offset_a#slurp -#end if -)</callback> - <callback>set_frequency_b($frequency_b#slurp -#if $lo_offset_b() != float('inf') -, lo_offset=$lo_offset_b#slurp -#end if -)</callback> - <callback>set_gain_a($gain_a)</callback> - <callback>set_gain_b($gain_b)</callback> - <param> - <name>Input Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:c</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>fcn:s</opt> - </option> - </param> - <param> - <name>Unit Number</name> - <key>which</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Interpolation</name> - <key>interpolation</key> - <type>int</type> - </param> - <param> - <name>Frequency A (Hz)</name> - <key>frequency_a</key> - <type>real</type> - </param> - <param> - <name>Frequency B (Hz)</name> - <key>frequency_b</key> - <type>real</type> - </param> - <param> - <name>LO Offset A (Hz)</name> - <key>lo_offset_a</key> - <value>float('inf')</value> - <type>real</type> - <hide>#if $lo_offset_a() == float('inf') then 'part' else 'none'#</hide> - <option> - <name>Default</name> - <key>float('inf')</key> - </option> - </param> - <param> - <name>LO Offset B (Hz)</name> - <key>lo_offset_b</key> - <value>float('inf')</value> - <type>real</type> - <hide>#if $lo_offset_b() == float('inf') then 'part' else 'none'#</hide> - <option> - <name>Default</name> - <key>float('inf')</key> - </option> - </param> - <param> - <name>Gain A (dB)</name> - <key>gain_a</key> - <value>0</value> - <type>real</type> - </param> - <param> - <name>Gain B (dB)</name> - <key>gain_b</key> - <value>0</value> - <type>real</type> - </param> -<!-- -################################################### -## Flex RF A -################################################### - --> - <param> - <name>Transmit A</name> - <key>transmit_a</key> - <value></value> - <type>enum</type> - <hide>#if $transmit_a.tx_enb then 'none' else 'part'#</hide> - <option> - <name>Unconfigured</name> - <key></key> - <opt>tx_enb:</opt> - <opt>auto_tr:</opt> - </option> - <option> - <name>Enable</name> - <key>tx_enb</key> - <opt>tx_enb:1</opt> - <opt>auto_tr:</opt> - </option> - <option> - <name>Auto T/R</name> - <key>auto_tr</key> - <opt>tx_enb:1</opt> - <opt>auto_tr:1</opt> - </option> - </param> -<!-- -################################################### -## Flex RF B -################################################### - --> - <param> - <name>Transmit B</name> - <key>transmit_b</key> - <value></value> - <type>enum</type> - <hide>#if $transmit_b.tx_enb then 'none' else 'part'#</hide> - <option> - <name>Unconfigured</name> - <key></key> - <opt>tx_enb:</opt> - <opt>auto_tr:</opt> - </option> - <option> - <name>Enable</name> - <key>tx_enb</key> - <opt>tx_enb:1</opt> - <opt>auto_tr:</opt> - </option> - <option> - <name>Auto T/R</name> - <key>auto_tr</key> - <opt>tx_enb:1</opt> - <opt>auto_tr:1</opt> - </option> - </param> - <sink> - <name>Ain</name> - <type>$type</type> - </sink> - <sink> - <name>Bin</name> - <type>$type</type> - </sink> - <doc> -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. - </doc> -</block> 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 @@ -<?xml version="1.0"?> -<!-- -################################################### -##USRP Dual Source -################################################### - --> -<block> - <name>USRP Dual Source</name> - <key>usrp_dual_source_x</key> - <import>from grc_gnuradio import usrp as grc_usrp</import> - <make>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)</make> - <callback>set_decim_rate($decimation)</callback> - <callback>set_frequency_a($frequency_a#slurp -#if $lo_offset_a() != float('inf') -, lo_offset=$lo_offset_a#slurp -#end if -)</callback> - <callback>set_frequency_b($frequency_b#slurp -#if $lo_offset_b() != float('inf') -, lo_offset=$lo_offset_b#slurp -#end if -)</callback> - <callback>set_gain_a($gain_a)</callback> - <callback>set_gain_b($gain_b)</callback> - <param> - <name>Output Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:c</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>fcn:s</opt> - </option> - </param> - <param> - <name>Format</name> - <key>format</key> - <value></value> - <type>enum</type> - <hide>#if $format() then '' else 'part'#</hide> - <option> - <name>16 Bits (Default)</name> - <key></key> - <opt>width:16</opt> - <opt>shift:0</opt> - </option> - <option> - <name>8 Bits, Shift 8</name> - <key>w8_s8</key> - <opt>width:8</opt> - <opt>shift:8</opt> - </option> - </param> - <param> - <name>Unit Number</name> - <key>which</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Decimation</name> - <key>decimation</key> - <type>int</type> - </param> - <param> - <name>Frequency A (Hz)</name> - <key>frequency_a</key> - <type>real</type> - </param> - <param> - <name>Frequency B (Hz)</name> - <key>frequency_b</key> - <type>real</type> - </param> - <param> - <name>LO Offset A (Hz)</name> - <key>lo_offset_a</key> - <value>float('inf')</value> - <type>real</type> - <hide>#if $lo_offset_a() == float('inf') then 'part' else 'none'#</hide> - <option> - <name>Default</name> - <key>float('inf')</key> - </option> - </param> - <param> - <name>LO Offset B (Hz)</name> - <key>lo_offset_b</key> - <value>float('inf')</value> - <type>real</type> - <hide>#if $lo_offset_b() == float('inf') then 'part' else 'none'#</hide> - <option> - <name>Default</name> - <key>float('inf')</key> - </option> - </param> - <param> - <name>Gain A (dB)</name> - <key>gain_a</key> - <value>0</value> - <type>real</type> - </param> - <param> - <name>Gain B (dB)</name> - <key>gain_b</key> - <value>0</value> - <type>real</type> - </param> -<!-- -################################################### -## Antenna A -################################################### - --> - <param> - <name>RX Antenna A</name> - <key>rx_ant_a</key> - <value>RXA</value> - <type>string</type> - <option> - <name>RXA</name> - <key>RXA</key> - </option> - <option> - <name>RXB</name> - <key>RXB</key> - </option> - <option> - <name>RXAB</name> - <key>RXAB</key> - </option> - <option> - <name>TX/RX</name> - <key>TX/RX</key> - </option> - <option> - <name>RX2</name> - <key>RX2</key> - </option> - </param> -<!-- -################################################### -## Antenna B -################################################### - --> - <param> - <name>RX Antenna B</name> - <key>rx_ant_b</key> - <value>RXA</value> - <type>string</type> - <option> - <name>RXA</name> - <key>RXA</key> - </option> - <option> - <name>RXB</name> - <key>RXB</key> - </option> - <option> - <name>RXAB</name> - <key>RXAB</key> - </option> - <option> - <name>TX/RX</name> - <key>TX/RX</key> - </option> - <option> - <name>RX2</name> - <key>RX2</key> - </option> - </param> - <param> - <name>RX Source A</name> - <key>rx_source_a</key> - <value>A</value> - <type>string</type> - <hide>#if $rx_source_a() == 'A' then 'part' else 'none'#</hide> - <option> - <name>Side A</name> - <key>A</key> - </option> - <option> - <name>Side B</name> - <key>B</key> - </option> - </param> - <param> - <name>RX Source B</name> - <key>rx_source_b</key> - <value>B</value> - <type>string</type> - <hide>#if $rx_source_b() == 'B' then 'part' else 'none'#</hide> - <option> - <name>Side A</name> - <key>A</key> - </option> - <option> - <name>Side B</name> - <key>B</key> - </option> - </param> - <source> - <name>Aout</name> - <type>$type</type> - </source> - <source> - <name>Bout</name> - <type>$type</type> - </source> - <doc> -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. - </doc> -</block> 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 @@ -<?xml version="1.0"?> -<!-- -################################################### -##USRP Probe: -## This block should not appear in the tree. -################################################### - --> -<block> - <name>USRP Probe</name> - <key>usrp_probe</key> - <make></make> - <param> - <name>Unit Number</name> - <key>which</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Daughter Board</name> - <key>dboard</key> - <type>enum</type> - <option> - <name>RX A</name> - <key>rx_a</key> - </option> - <option> - <name>RX B</name> - <key>rx_b</key> - </option> - <option> - <name>TX A</name> - <key>tx_a</key> - </option> - <option> - <name>TX B</name> - <key>tx_b</key> - </option> - </param> - <doc>Press "Probe" to retrieve USRP information...</doc> -</block> 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 @@ -<?xml version="1.0"?> -<!-- -################################################### -##USRP Simple Sink -################################################### - --> -<block> - <name>USRP Sink</name> - <key>usrp_simple_sink_x</key> - <import>from grc_gnuradio import usrp as grc_usrp</import> - <make>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</make> - <callback>set_interp_rate($interpolation)</callback> - <callback>set_frequency($frequency#slurp -#if $lo_offset() != float('inf') -, lo_offset=$lo_offset#slurp -#end if -)</callback> - <callback>set_gain($gain)</callback> - <param> - <name>Input Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:c</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>fcn:s</opt> - </option> - </param> - <param> - <name>Unit Number</name> - <key>which</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Interpolation</name> - <key>interpolation</key> - <type>int</type> - </param> - <param> - <name>Frequency (Hz)</name> - <key>frequency</key> - <type>real</type> - </param> - <param> - <name>LO Offset (Hz)</name> - <key>lo_offset</key> - <value>float('inf')</value> - <type>real</type> - <hide>#if $lo_offset() == float('inf') then 'part' else 'none'#</hide> - <option> - <name>Default</name> - <key>float('inf')</key> - </option> - </param> - <param> - <name>Gain (dB)</name> - <key>gain</key> - <value>0</value> - <type>real</type> - </param> - <param> - <name>Side</name> - <key>side</key> - <value>A</value> - <type>string</type> - <option> - <name>A</name> - <key>A</key> - </option> - <option> - <name>B</name> - <key>B</key> - </option> - </param> - <param> - <name>Transmit</name> - <key>transmit</key> - <value></value> - <type>enum</type> - <hide>#if $transmit.tx_enb then 'none' else 'part'#</hide> - <option> - <name>Unconfigured</name> - <key></key> - <opt>tx_enb:</opt> - <opt>auto_tr:</opt> - </option> - <option> - <name>Enable</name> - <key>tx_enb</key> - <opt>tx_enb:1</opt> - <opt>auto_tr:</opt> - </option> - <option> - <name>Auto T/R</name> - <key>auto_tr</key> - <opt>tx_enb:1</opt> - <opt>auto_tr:1</opt> - </option> - </param> - <sink> - <name>in</name> - <type>$type</type> - </sink> - <doc> -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. - </doc> -</block> 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 @@ -<?xml version="1.0"?> -<!-- -################################################### -##USRP Simple Source -################################################### - --> -<block> - <name>USRP Source</name> - <key>usrp_simple_source_x</key> - <import>from grc_gnuradio import usrp as grc_usrp</import> - <make>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)</make> - <callback>set_decim_rate($decimation)</callback> - <callback>set_frequency($frequency#slurp -#if $lo_offset() != float('inf') -, lo_offset=$lo_offset#slurp -#end if -)</callback> - <callback>set_gain($gain)</callback> - <param> - <name>Output Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:c</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>fcn:s</opt> - </option> - </param> - <param> - <name>Format</name> - <key>format</key> - <value></value> - <type>enum</type> - <hide>#if $format() then '' else 'part'#</hide> - <option> - <name>16 Bits (Default)</name> - <key></key> - <opt>width:16</opt> - <opt>shift:0</opt> - </option> - <option> - <name>8 Bits, Shift 8</name> - <key>w8_s8</key> - <opt>width:8</opt> - <opt>shift:8</opt> - </option> - </param> - <param> - <name>Unit Number</name> - <key>which</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Decimation</name> - <key>decimation</key> - <type>int</type> - </param> - <param> - <name>Frequency (Hz)</name> - <key>frequency</key> - <type>real</type> - </param> - <param> - <name>LO Offset (Hz)</name> - <key>lo_offset</key> - <value>float('inf')</value> - <type>real</type> - <hide>#if $lo_offset() == float('inf') then 'part' else 'none'#</hide> - <option> - <name>Default</name> - <key>float('inf')</key> - </option> - </param> - <param> - <name>Gain (dB)</name> - <key>gain</key> - <value>0</value> - <type>real</type> - </param> - <param> - <name>Side</name> - <key>side</key> - <value>A</value> - <type>string</type> - <option> - <name>A</name> - <key>A</key> - </option> - <option> - <name>B</name> - <key>B</key> - </option> - </param> - <param> - <name>RX Antenna</name> - <key>rx_ant</key> - <value>RXA</value> - <type>string</type> - <option> - <name>RXA</name> - <key>RXA</key> - </option> - <option> - <name>RXB</name> - <key>RXB</key> - </option> - <option> - <name>RXAB</name> - <key>RXAB</key> - </option> - <option> - <name>TX/RX</name> - <key>TX/RX</key> - </option> - <option> - <name>RX2</name> - <key>RX2</key> - </option> - </param> - <param> - <name>Halfband Filters</name> - <key>hb_filters</key> - <value></value> - <type>enum</type> - <hide>#if $hb_filters() then 'none' else 'part'#</hide> - <option> - <name>Enable</name> - <key></key> - </option> - <option> - <name>Disable</name> - <key>1</key> - </option> - </param> - <source> - <name>out</name> - <type>$type</type> - </source> - <doc> -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. - </doc> -</block> diff --git a/grc/blocks/variable_check_box.xml b/grc/blocks/variable_check_box.xml deleted file mode 100644 index a703703c7..000000000 --- a/grc/blocks/variable_check_box.xml +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Check Box: -## a gui check box form -################################################### - --> -<block> - <name>Variable Check Box</name> - <key>variable_check_box</key> - <import>from gnuradio.wxgui import forms</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' -#set $win = 'self._%s_check_box'%$id -$win = forms.check_box( - parent=$(parent).GetWin(), - value=self.$id, - callback=self.set_$(id), - #if $label() - label=$label, - #else - label='$id', - #end if - true=$true, - false=$false, -) -#if not $grid_pos() -$(parent).Add($win) -#else -$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos())))) -#end if</make> - <callback>self.set_$(id)($value)</callback> - <callback>self._$(id)_check_box.set_value($id)</callback> - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - <param> - <name>Default Value</name> - <key>value</key> - <value>True</value> - <type>raw</type> - </param> - <param> - <name>True</name> - <key>true</key> - <value>True</value> - <type>raw</type> - </param> - <param> - <name>False</name> - <key>false</key> - <value>False</value> - <type>raw</type> - </param> - <param> - <name>Grid Position</name> - <key>grid_pos</key> - <value></value> - <type>grid_pos</type> - </param> - <param> - <name>Notebook</name> - <key>notebook</key> - <value></value> - <type>notebook</type> - </param> - <check>$value in ($true, $false)</check> - <doc> -This block creates a variable with a check box form. \ -Leave the label blank to use the variable id as the label. - -A check box form can switch between two states; \ -the default being True and False. \ -Override True and False to use alternative states. - -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. - </doc> -</block> diff --git a/grc/blocks/variable_chooser.xml b/grc/blocks/variable_chooser.xml deleted file mode 100644 index ee41f26db..000000000 --- a/grc/blocks/variable_chooser.xml +++ /dev/null @@ -1,122 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Chooser: -## a gui form with enumerated choices -## radio buttons, drop down, or button -################################################### - --> -<block> - <name>Variable Chooser</name> - <key>variable_chooser</key> - <import>from gnuradio.wxgui import forms</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' -#set $win = 'self._%s_chooser'%$id -$win = forms.$(type)( - parent=$(parent).GetWin(), - value=self.$id, - callback=self.set_$(id), - #if $label() - label=$label, - #else - label='$id', - #end if - choices=$choices, - labels=$labels, -#if $type() == 'radio_buttons' - style=$style, -#end if -) -#if not $grid_pos() -$(parent).Add($win) -#else -$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos())))) -#end if</make> - <callback>self.set_$(id)($value)</callback> - <callback>self._$(id)_chooser.set_value($id)</callback> - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - <param> - <name>Default Value</name> - <key>value</key> - <value>1</value> - <type>raw</type> - </param> - <param> - <name>Choices</name> - <key>choices</key> - <value>[1, 2, 3]</value> - <type>raw</type> - </param> - <param> - <name>Labels</name> - <key>labels</key> - <value>[]</value> - <type>raw</type> - </param> - <param> - <name>Type</name> - <key>type</key> - <value>drop_down</value> - <type>enum</type> - <option> - <name>Drop Down</name> - <key>drop_down</key> - </option> - <option> - <name>Radio Buttons</name> - <key>radio_buttons</key> - </option> - <option> - <name>Button</name> - <key>button</key> - </option> - </param> - <param> - <name>Style</name> - <key>style</key> - <value>wx.RA_HORIZONTAL</value> - <type>enum</type> - <hide>#if $type() == 'radio_buttons' then 'part' else 'all'#</hide> - <option> - <name>Horizontal</name> - <key>wx.RA_HORIZONTAL</key> - </option> - <option> - <name>Vertical</name> - <key>wx.RA_VERTICAL</key> - </option> - </param> - <param> - <name>Grid Position</name> - <key>grid_pos</key> - <value></value> - <type>grid_pos</type> - </param> - <param> - <name>Notebook</name> - <key>notebook</key> - <value></value> - <type>notebook</type> - </param> - <check>$value in $choices</check> - <check>not $labels or len($labels) == len($choices)</check> - <doc> -This block creates a variable with a drop down, radio buttons, or a button. \ -Leave the label blank to use the variable id as the label. \ -The value index is the index of a particular choice, \ -which defines the default choice when the flow graph starts. \ -The choices must be a list of possible values. \ -Leave labels empty to use the choices as the labels. - -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. - </doc> -</block> diff --git a/grc/blocks/variable_function_probe.xml b/grc/blocks/variable_function_probe.xml new file mode 100644 index 000000000..269966c70 --- /dev/null +++ b/grc/blocks/variable_function_probe.xml @@ -0,0 +1,70 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Variable function probe +################################################### + --> +<block> + <name>Function Probe</name> + <key>variable_function_probe</key> + <import>import time</import> + <import>import threading</import> + <var_make>self.$(id) = $(id) = $value</var_make> + <make>#slurp +def _$(id)_probe(): + while True: + 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 +_$(id)_thread.start()</make> + <callback>self.set_$(id)($value)</callback> + <param> + <name>Value</name> + <key>value</key> + <value>0</value> + <type>raw</type> + </param> + <param> + <name>Block ID</name> + <key>block_id</key> + <value>my_block_0</value> + <type>string</type> + </param> + <param> + <name>Function Name</name> + <key>function_name</key> + <value>get_number</value> + <type>string</type> + </param> + <param> + <name>Function Args</name> + <key>function_args</key> + <value></value> + <type>string</type> + <hide>#if $function_args() then 'none' else 'part'#</hide> + </param> + <param> + <name>Poll Rate (Hz)</name> + <key>poll_rate</key> + <value>10</value> + <type>real</type> + </param> + <doc> +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. \ +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) + +To poll a stream for a level, use this with the probe signal block. + </doc> +</block> diff --git a/grc/blocks/variable_slider.xml b/grc/blocks/variable_slider.xml deleted file mode 100644 index c13d20856..000000000 --- a/grc/blocks/variable_slider.xml +++ /dev/null @@ -1,138 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Slider: -## a combined slider and text box form -################################################### - --> -<block> - <name>Variable Slider</name> - <key>variable_slider</key> - <import>from gnuradio.wxgui import forms</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' -#set $win = '_%s_sizer'%$id -$win = wx.BoxSizer(wx.VERTICAL) -self._$(id)_text_box = forms.text_box( - parent=$(parent).GetWin(), - sizer=$win, - value=self.$id, - callback=self.set_$(id), - #if $label() - label=$label, - #else - label='$id', - #end if - converter=forms.$(converver)(), - proportion=0, -) -self._$(id)_slider = forms.slider( - parent=$(parent).GetWin(), - sizer=$win, - value=self.$id, - callback=self.set_$(id), - minimum=$min, - maximum=$max, - num_steps=$num_steps, - style=$style, - cast=$(converver.slider_cast), - proportion=1, -) -#if not $grid_pos() -$(parent).Add($win) -#else -$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos())))) -#end if</make> - <callback>self.set_$(id)($value)</callback> - <callback>self._$(id)_slider.set_value($id)</callback> - <callback>self._$(id)_text_box.set_value($id)</callback> - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - <param> - <name>Default Value</name> - <key>value</key> - <value>50</value> - <type>real</type> - </param> - <param> - <name>Minimum</name> - <key>min</key> - <value>0</value> - <type>real</type> - </param> - <param> - <name>Maximum</name> - <key>max</key> - <value>100</value> - <type>real</type> - </param> - <param> - <name>Num Steps</name> - <key>num_steps</key> - <value>100</value> - <type>int</type> - <hide>part</hide> - </param> - <param> - <name>Style</name> - <key>style</key> - <value>wx.SL_HORIZONTAL</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Horizontal</name> - <key>wx.SL_HORIZONTAL</key> - </option> - <option> - <name>Vertical</name> - <key>wx.SL_VERTICAL</key> - </option> - </param> - <param> - <name>Converter</name> - <key>converver</key> - <value>float_converter</value> - <type>enum</type> - <option> - <name>Float</name> - <key>float_converter</key> - <opt>slider_cast:float</opt> - </option> - <option> - <name>Integer</name> - <key>int_converter</key> - <opt>slider_cast:int</opt> - </option> - </param> - <param> - <name>Grid Position</name> - <key>grid_pos</key> - <value></value> - <type>grid_pos</type> - </param> - <param> - <name>Notebook</name> - <key>notebook</key> - <value></value> - <type>notebook</type> - </param> - <check>$min <= $value <= $max</check> - <check>$min < $max</check> - <check>0 < $num_steps <= 1000</check> - <doc> -This block creates a variable with a slider. \ -Leave the label blank to use the variable id as the label. \ -The value must be a real number. \ -The value must be between the minimum and the maximum. \ -The number of steps must be between 0 and 1000. - -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. - </doc> -</block> diff --git a/grc/blocks/variable_static_text.xml b/grc/blocks/variable_static_text.xml deleted file mode 100644 index c866b998d..000000000 --- a/grc/blocks/variable_static_text.xml +++ /dev/null @@ -1,97 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Static Text: -## a gui static text form -################################################### - --> -<block> - <name>Variable Static Text</name> - <key>variable_static_text</key> - <import>from gnuradio.wxgui import forms</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' -#set $win = 'self._%s_static_text'%$id -$win = forms.static_text( - parent=$(parent).GetWin(), - value=self.$id, - callback=self.set_$(id), - #if $label() - label=$label, - #else - label='$id', - #end if - #if $formatter() - converter=forms.$(converver)(formatter=$formatter), - #else - converter=forms.$(converver)(), - #end if -) -#if not $grid_pos() -$(parent).Add($win) -#else -$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos())))) -#end if</make> - <callback>self.set_$(id)($value)</callback> - <callback>self._$(id)_static_text.set_value($id)</callback> - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - <param> - <name>Default Value</name> - <key>value</key> - <value>0</value> - <type>raw</type> - </param> - <param> - <name>Converter</name> - <key>converver</key> - <value>float_converter</value> - <type>enum</type> - <option> - <name>Float</name> - <key>float_converter</key> - </option> - <option> - <name>Integer</name> - <key>int_converter</key> - </option> - <option> - <name>String</name> - <key>str_converter</key> - </option> - </param> - <param> - <name>Formatter</name> - <key>formatter</key> - <value>None</value> - <type>raw</type> - <hide>part</hide> - </param> - <param> - <name>Grid Position</name> - <key>grid_pos</key> - <value></value> - <type>grid_pos</type> - </param> - <param> - <name>Notebook</name> - <key>notebook</key> - <value></value> - <type>notebook</type> - </param> - <doc> -This block creates a variable with a static text form. \ -Leave the label blank to use the variable id as the label. - -Format should be a function/lambda that converts a value into a string or None for the default formatter. - -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. - </doc> -</block> diff --git a/grc/blocks/variable_text_box.xml b/grc/blocks/variable_text_box.xml deleted file mode 100644 index 1b4b4355e..000000000 --- a/grc/blocks/variable_text_box.xml +++ /dev/null @@ -1,101 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Text Box: -## a gui text box form -################################################### - --> -<block> - <name>Variable Text Box</name> - <key>variable_text_box</key> - <import>from gnuradio.wxgui import forms</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' -#set $win = 'self._%s_text_box'%$id -$win = forms.text_box( - parent=$(parent).GetWin(), - value=self.$id, - callback=self.set_$(id), - #if $label() - label=$label, - #else - label='$id', - #end if - #if $formatter() - converter=forms.$(converver)(formatter=$formatter), - #else - converter=forms.$(converver)(), - #end if -) -#if not $grid_pos() -$(parent).Add($win) -#else -$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos())))) -#end if</make> - <callback>self.set_$(id)($value)</callback> - <callback>self._$(id)_text_box.set_value($id)</callback> - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - <param> - <name>Default Value</name> - <key>value</key> - <value>0</value> - <type>raw</type> - </param> - <param> - <name>Converter</name> - <key>converver</key> - <value>float_converter</value> - <type>enum</type> - <option> - <name>Float</name> - <key>float_converter</key> - </option> - <option> - <name>Integer</name> - <key>int_converter</key> - </option> - <option> - <name>String</name> - <key>str_converter</key> - </option> - <option> - <name>Evaluate</name> - <key>eval_converter</key> - </option> - </param> - <param> - <name>Formatter</name> - <key>formatter</key> - <value>None</value> - <type>raw</type> - <hide>part</hide> - </param> - <param> - <name>Grid Position</name> - <key>grid_pos</key> - <value></value> - <type>grid_pos</type> - </param> - <param> - <name>Notebook</name> - <key>notebook</key> - <value></value> - <type>notebook</type> - </param> - <doc> -This block creates a variable with a text box. \ -Leave the label blank to use the variable id as the label. - -Format should be a function/lambda that converts a value into a string or None for the default formatter. - -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. - </doc> -</block> diff --git a/grc/blocks/wxgui_constellationsink2.xml b/grc/blocks/wxgui_constellationsink2.xml deleted file mode 100644 index 598b55064..000000000 --- a/grc/blocks/wxgui_constellationsink2.xml +++ /dev/null @@ -1,139 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Constellation Sink -################################################### - --> -<block> - <name>Constellation Sink</name> - <key>wxgui_constellationsink2</key> - <import>from gnuradio.wxgui import constsink_gl</import> - <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' -constsink_gl.const_sink_c( - $(parent).GetWin(), - title=$title, - sample_rate=$samp_rate, - frame_rate=$frame_rate, - const_size=$const_size, - M=$M, - theta=$theta, - alpha=$alpha, - fmax=$fmax, - mu=$mu, - gain_mu=$gain_mu, - symbol_rate=$symbol_rate, - omega_limit=$omega_limit, -#if $win_size() - size=$win_size, -#end if -) -#if not $grid_pos() -$(parent).Add(self.$(id).win) -#else -$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) -#end if</make> - <callback>set_sample_rate($samp_rate)</callback> - <param> - <name>Title</name> - <key>title</key> - <value>Constellation Plot</value> - <type>string</type> - </param> - <param> - <name>Sample Rate</name> - <key>samp_rate</key> - <value>samp_rate</value> - <type>real</type> - </param> - <param> - <name>Frame Rate</name> - <key>frame_rate</key> - <value>5</value> - <type>real</type> - </param> - <param> - <name>Constellation Size</name> - <key>const_size</key> - <value>2048</value> - <type>real</type> - </param> - <param> - <name>M</name> - <key>M</key> - <value>4</value> - <type>int</type> - </param> - <param> - <name>Theta</name> - <key>theta</key> - <value>0</value> - <type>real</type> - </param> - <param> - <name>Alpha</name> - <key>alpha</key> - <value>0.005</value> - <type>real</type> - </param> - <param> - <name>Max Freq</name> - <key>fmax</key> - <value>0.06</value> - <type>real</type> - </param> - <param> - <name>Mu</name> - <key>mu</key> - <value>0.5</value> - <type>real</type> - </param> - <param> - <name>Gain Mu</name> - <key>gain_mu</key> - <value>0.005</value> - <type>real</type> - </param> - <param> - <name>Symbol Rate</name> - <key>symbol_rate</key> - <value>samp_rate/4.</value> - <type>real</type> - </param> - <param> - <name>Omega Limit</name> - <key>omega_limit</key> - <value>0.005</value> - <type>real</type> - </param> - <param> - <name>Window Size</name> - <key>win_size</key> - <value></value> - <type>int_vector</type> - <hide>#if $win_size() then 'none' else 'part'#</hide> - </param> - <param> - <name>Grid Position</name> - <key>grid_pos</key> - <value></value> - <type>grid_pos</type> - </param> - <param> - <name>Notebook</name> - <key>notebook</key> - <value></value> - <type>notebook</type> - </param> - <check>not $win_size or len($win_size) == 2</check> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <doc> -Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels. - -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. - </doc> -</block> diff --git a/grc/blocks/wxgui_fftsink2.xml b/grc/blocks/wxgui_fftsink2.xml deleted file mode 100644 index 8df8f90d0..000000000 --- a/grc/blocks/wxgui_fftsink2.xml +++ /dev/null @@ -1,232 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##FFT Sink -################################################### - --> -<block> - <name>FFT Sink</name> - <key>wxgui_fftsink2</key> - <import>from gnuradio import window</import> - <import>from gnuradio.wxgui import fftsink2</import> - <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' -fftsink2.$(type.fcn)( - $(parent).GetWin(), - baseband_freq=$baseband_freq, - y_per_div=$y_per_div, - y_divs=$y_divs, - ref_level=$ref_level, - ref_scale=$ref_scale, - sample_rate=$samp_rate, - fft_size=$fft_size, - fft_rate=$fft_rate, - average=$average, - avg_alpha=#if $avg_alpha() then $avg_alpha else 'None'#, - title=$title, - peak_hold=$peak_hold, -#if $win() - win=$win, -#end if -#if $win_size() - size=$win_size, -#end if -) -#if not $grid_pos() -$(parent).Add(self.$(id).win) -#else -$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) -#end if</make> - <callback>set_baseband_freq($baseband_freq)</callback> - <callback>set_sample_rate($samp_rate)</callback> - <param> - <name>Type</name> - <key>type</key> - <value>complex</value> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:fft_sink_c</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:fft_sink_f</opt> - </option> - </param> - <param> - <name>Title</name> - <key>title</key> - <value>FFT Plot</value> - <type>string</type> - </param> - <param> - <name>Sample Rate</name> - <key>samp_rate</key> - <value>samp_rate</value> - <type>real</type> - </param> - <param> - <name>Baseband Freq</name> - <key>baseband_freq</key> - <value>0</value> - <type>real</type> - </param> - <param> - <name>Y per Div</name> - <key>y_per_div</key> - <value>10</value> - <type>enum</type> - <option> - <name>1 dB</name> - <key>1</key> - </option> - <option> - <name>2 dB</name> - <key>2</key> - </option> - <option> - <name>5 dB</name> - <key>5</key> - </option> - <option> - <name>10 dB</name> - <key>10</key> - </option> - <option> - <name>20 dB</name> - <key>20</key> - </option> - </param> - <param> - <name>Y Divs</name> - <key>y_divs</key> - <value>10</value> - <type>int</type> - </param> - <param> - <name>Ref Level (dB)</name> - <key>ref_level</key> - <value>50</value> - <type>real</type> - </param> - <param> - <name>Ref Scale (p2p)</name> - <key>ref_scale</key> - <value>2.0</value> - <type>real</type> - </param> - <param> - <name>FFT Size</name> - <key>fft_size</key> - <value>1024</value> - <type>int</type> - </param> - <param> - <name>Refresh Rate</name> - <key>fft_rate</key> - <value>30</value> - <type>int</type> - </param> - <param> - <name>Peak Hold</name> - <key>peak_hold</key> - <value>False</value> - <type>enum</type> - <hide>#if $peak_hold() == 'True' then 'none' else 'part'#</hide> - <option> - <name>On</name> - <key>True</key> - </option> - <option> - <name>Off</name> - <key>False</key> - </option> - </param> - <param> - <name>Average</name> - <key>average</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>On</name> - <key>True</key> - </option> - <option> - <name>Off</name> - <key>False</key> - </option> - </param> - <param> - <name>Average Alpha</name> - <key>avg_alpha</key> - <value>0</value> - <type>real</type> - <hide>#if $average() == 'True' then 'none' else 'all'#</hide> - </param> - <param> - <name>Window</name> - <key>win</key> - <value>None</value> - <type>raw</type> - <hide>#if $win() is None then 'part' else 'none'#</hide> - <option> - <name>Automatic</name> - <key>None</key> - </option> - <option> - <name>Blackman-Harris</name> - <key>window.blackmanharris</key> - </option> - <option> - <name>Hamming</name> - <key>window.hamming</key> - </option> - <option> - <name>Hanning</name> - <key>window.hanning</key> - </option> - <option> - <name>Rectangular</name> - <key>window.rectangular</key> - </option> - <option> - <name>Flattop</name> - <key>window.flattop</key> - </option> - </param> - <param> - <name>Window Size</name> - <key>win_size</key> - <value></value> - <type>int_vector</type> - <hide>#if $win_size() then 'none' else 'part'#</hide> - </param> - <param> - <name>Grid Position</name> - <key>grid_pos</key> - <value></value> - <type>grid_pos</type> - </param> - <param> - <name>Notebook</name> - <key>notebook</key> - <value></value> - <type>notebook</type> - </param> - <check>not $win_size or len($win_size) == 2</check> - <sink> - <name>in</name> - <type>$type</type> - </sink> - <doc> -Set Average Alpha to 0 for automatic setting. - -Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels. - -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. - </doc> -</block> diff --git a/grc/blocks/wxgui_histosink2.xml b/grc/blocks/wxgui_histosink2.xml deleted file mode 100644 index 9edf9650d..000000000 --- a/grc/blocks/wxgui_histosink2.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Histogram Sink -################################################### - --> -<block> - <name>Histo Sink</name> - <key>wxgui_histosink2</key> - <import>from gnuradio.wxgui import histosink_gl</import> - <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' -histosink_gl.histo_sink_f( - $(parent).GetWin(), - title=$title, - num_bins=$num_bins, - frame_size=$frame_size, -#if $win_size() - size=$win_size, -#end if -) -#if not $grid_pos() -$(parent).Add(self.$(id).win) -#else -$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) -#end if</make> - <callback>set_num_bins($num_bins)</callback> - <callback>set_frame_size($frame_size)</callback> - <param> - <name>Title</name> - <key>title</key> - <value>Histogram Plot</value> - <type>string</type> - </param> - <param> - <name>Num Bins</name> - <key>num_bins</key> - <value>27</value> - <type>int</type> - </param> - <param> - <name>Frame Size</name> - <key>frame_size</key> - <value>1000</value> - <type>int</type> - </param> - <param> - <name>Window Size</name> - <key>win_size</key> - <value></value> - <type>int_vector</type> - <hide>#if $win_size() then 'none' else 'part'#</hide> - </param> - <param> - <name>Grid Position</name> - <key>grid_pos</key> - <value></value> - <type>grid_pos</type> - </param> - <param> - <name>Notebook</name> - <key>notebook</key> - <value></value> - <type>notebook</type> - </param> - <check>not $win_size or len($win_size) == 2</check> - <sink> - <name>in</name> - <type>float</type> - </sink> - <doc> -Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels. - -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. - </doc> -</block> diff --git a/grc/blocks/wxgui_numbersink2.xml b/grc/blocks/wxgui_numbersink2.xml deleted file mode 100644 index ad93dec08..000000000 --- a/grc/blocks/wxgui_numbersink2.xml +++ /dev/null @@ -1,192 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Number Sink -################################################### - --> -<block> - <name>Number Sink</name> - <key>wxgui_numbersink2</key> - <import>from gnuradio.wxgui import numbersink2</import> - <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' -numbersink2.$(type.fcn)( - $(parent).GetWin(), - unit=$units, - minval=$min_value, - maxval=$max_value, - factor=$factor, - decimal_places=$decimal_places, - ref_level=$ref_level, - sample_rate=$samp_rate, - number_rate=$number_rate, - average=$average, - avg_alpha=#if $avg_alpha() then $avg_alpha else 'None'#, - label=$title, - peak_hold=$peak_hold, - show_gauge=$show_gauge, -#if $win_size() - size=$win_size, -#end if -) -#if not $grid_pos() -$(parent).Add(self.$(id).win) -#else -$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) -#end if</make> - <param> - <name>Type</name> - <key>type</key> - <value>complex</value> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:number_sink_c</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:number_sink_f</opt> - </option> - </param> - <param> - <name>Title</name> - <key>title</key> - <value>Number Plot</value> - <type>string</type> - </param> - <param> - <name>Units</name> - <key>units</key> - <value>Units</value> - <type>string</type> - </param> - <param> - <name>Sample Rate</name> - <key>samp_rate</key> - <value>samp_rate</value> - <type>real</type> - </param> - <param> - <name>Min Value</name> - <key>min_value</key> - <value>-100</value> - <type>real</type> - </param> - <param> - <name>Max Value</name> - <key>max_value</key> - <value>100</value> - <type>real</type> - </param> - <param> - <name>Factor</name> - <key>factor</key> - <value>1.0</value> - <type>real</type> - </param> - <param> - <name>Decimal Places</name> - <key>decimal_places</key> - <value>10</value> - <type>int</type> - </param> - <param> - <name>Reference Level</name> - <key>ref_level</key> - <value>0</value> - <type>real</type> - </param> - <param> - <name>Number Rate</name> - <key>number_rate</key> - <value>15</value> - <type>int</type> - </param> - <param> - <name>Peak Hold</name> - <key>peak_hold</key> - <value>False</value> - <type>enum</type> - <hide>#if $peak_hold() == 'True' then 'none' else 'part'#</hide> - <option> - <name>On</name> - <key>True</key> - </option> - <option> - <name>Off</name> - <key>False</key> - </option> - </param> - <param> - <name>Average</name> - <key>average</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>On</name> - <key>True</key> - </option> - <option> - <name>Off</name> - <key>False</key> - </option> - </param> - <param> - <name>Average Alpha</name> - <key>avg_alpha</key> - <value>0</value> - <type>real</type> - <hide>#if $average() == 'True' then 'none' else 'all'#</hide> - </param> - <param> - <name>Show Gauge</name> - <key>show_gauge</key> - <value>True</value> - <type>enum</type> - <option> - <name>Show</name> - <key>True</key> - </option> - <option> - <name>Hide</name> - <key>False</key> - </option> - </param> - <param> - <name>Window Size</name> - <key>win_size</key> - <value></value> - <type>int_vector</type> - <hide>#if $win_size() then 'none' else 'part'#</hide> - </param> - <param> - <name>Grid Position</name> - <key>grid_pos</key> - <value></value> - <type>grid_pos</type> - </param> - <param> - <name>Notebook</name> - <key>notebook</key> - <value></value> - <type>notebook</type> - </param> - <check>not $win_size or len($win_size) == 2</check> - <sink> - <name>in</name> - <type>$type</type> - </sink> - <doc> -Set Average Alpha to 0 for automatic setting. - -Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels. - -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. - -Incoming numbers are multiplied by the factor, and then added-to by the reference level. - </doc> -</block> diff --git a/grc/blocks/wxgui_scopesink2.xml b/grc/blocks/wxgui_scopesink2.xml deleted file mode 100644 index ef0377373..000000000 --- a/grc/blocks/wxgui_scopesink2.xml +++ /dev/null @@ -1,186 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Scope Sink -################################################### - --> -<block> - <name>Scope Sink</name> - <key>wxgui_scopesink2</key> - <import>from gnuradio.wxgui import scopesink2</import> - <import>from gnuradio import gr</import> - <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' -scopesink2.$(type.fcn)( - $(parent).GetWin(), - title=$title, - sample_rate=$samp_rate, - v_scale=$v_scale, - v_offset=$v_offset, - t_scale=$t_scale, - ac_couple=$ac_couple, - xy_mode=$xy_mode, - num_inputs=$num_inputs, - trig_mode=$trig_mode, - y_axis_label=$y_axis_label, -#if $win_size() - size=$win_size, -#end if -) -#if not $grid_pos() -$(parent).Add(self.$(id).win) -#else -$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) -#end if</make> - <callback>set_sample_rate($samp_rate)</callback> - <param> - <name>Type</name> - <key>type</key> - <value>complex</value> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:scope_sink_c</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:scope_sink_f</opt> - </option> - </param> - <param> - <name>Title</name> - <key>title</key> - <value>Scope Plot</value> - <type>string</type> - </param> - <param> - <name>Sample Rate</name> - <key>samp_rate</key> - <value>samp_rate</value> - <type>real</type> - </param> - <param> - <name>V Scale</name> - <key>v_scale</key> - <value>0</value> - <type>real</type> - <hide>#if $v_scale() then 'none' else 'part'#</hide> - </param> - <param> - <name>V Offset</name> - <key>v_offset</key> - <value>0</value> - <type>real</type> - <hide>#if $v_offset() then 'none' else 'part'#</hide> - </param> - <param> - <name>T Scale</name> - <key>t_scale</key> - <value>0</value> - <type>real</type> - <hide>#if $t_scale() then 'none' else 'part'#</hide> - </param> - <param> - <name>AC Couple</name> - <key>ac_couple</key> - <value>False</value> - <type>bool</type> - <hide>#if $ac_couple() then 'none' else 'part'#</hide> - <option> - <name>Off</name> - <key>False</key> - </option> - <option> - <name>On</name> - <key>True</key> - </option> - </param> - <param> - <name>XY Mode</name> - <key>xy_mode</key> - <value>False</value> - <type>enum</type> - <hide>#if $xy_mode() == 'True' then 'none' else 'part'#</hide> - <option> - <name>Off</name> - <key>False</key> - </option> - <option> - <name>On</name> - <key>True</key> - </option> - </param> - <param> - <name>Num Inputs</name> - <key>num_inputs</key> - <value>1</value> - <type>int</type> - </param> - <param> - <name>Window Size</name> - <key>win_size</key> - <value></value> - <type>int_vector</type> - <hide>#if $win_size() then 'none' else 'part'#</hide> - </param> - <param> - <name>Grid Position</name> - <key>grid_pos</key> - <value></value> - <type>grid_pos</type> - </param> - <param> - <name>Notebook</name> - <key>notebook</key> - <value></value> - <type>notebook</type> - </param> - <param> - <name>Trigger Mode</name> - <key>trig_mode</key> - <type>enum</type> - <option> - <name>Auto</name> - <key>gr.gr_TRIG_MODE_AUTO</key> - </option> - <option> - <name>Normal</name> - <key>gr.gr_TRIG_MODE_NORM</key> - </option> - <option> - <name>Freerun</name> - <key>gr.gr_TRIG_MODE_FREE</key> - </option> - <option> - <name>Stripchart</name> - <key>gr.gr_TRIG_MODE_STRIPCHART</key> - </option> - </param> - <param> - <name>Y Axis Label</name> - <key>y_axis_label</key> - <value>Counts</value> - <type>string</type> - </param> - <check>not $win_size or len($win_size) == 2</check> - <check>not $xy_mode or '$type' == 'complex' or $num_inputs != 1</check> - <sink> - <name>in</name> - <type>$type</type> - <nports>$num_inputs</nports> - </sink> - <doc> -Set the V Scale to 0 for the scope to auto-scale. - -Set the T Scale to 0 for automatic setting. - -XY Mode allows the scope to initialize as an XY plotter. - -Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels. - -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. - </doc> -</block> diff --git a/grc/blocks/wxgui_termsink.xml b/grc/blocks/wxgui_termsink.xml deleted file mode 100644 index 985d89b58..000000000 --- a/grc/blocks/wxgui_termsink.xml +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Terminal window -################################################### - --> -<block> - <name>Terminal Sink</name> - <key>wxgui_termsink</key> - - <import>from gnuradio.wxgui import termsink</import> - - <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' -termsink.termsink( - parent=$(parent).GetWin(), -#if $win_size() - size=$win_size, -#end if - msgq=$(id)_msgq_in, -) -#if not $grid_pos() -$(parent).Add(self.$(id)) -#else -$(parent).GridAdd(self.$(id), $(', '.join(map(str, $grid_pos())))) -#end if</make> - - <param> - <name>Window Size</name> - <key>win_size</key> - <value></value> - <type>int_vector</type> - <hide>#if $win_size() then 'none' else 'part'#</hide> - </param> - <param> - <name>Grid Position</name> - <key>grid_pos</key> - <value></value> - <type>grid_pos</type> - </param> - - <param> - <name>Notebook</name> - <key>notebook</key> - <value></value> - <type>notebook</type> - </param> - - <check>not $win_size or len($win_size) == 2</check> - - <sink> - <name>in</name> - <type>msg</type> - </sink> - -</block> diff --git a/grc/blocks/wxgui_waterfallsink2.xml b/grc/blocks/wxgui_waterfallsink2.xml deleted file mode 100644 index 3de67597f..000000000 --- a/grc/blocks/wxgui_waterfallsink2.xml +++ /dev/null @@ -1,189 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Waterfall Sink -################################################### - --> -<block> - <name>Waterfall Sink</name> - <key>wxgui_waterfallsink2</key> - <import>from gnuradio import window</import> - <import>from gnuradio.wxgui import waterfallsink2</import> - <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' -waterfallsink2.$(type.fcn)( - $(parent).GetWin(), - baseband_freq=$baseband_freq, - dynamic_range=$dynamic_range, - ref_level=$ref_level, - ref_scale=$ref_scale, - sample_rate=$samp_rate, - fft_size=$fft_size, - fft_rate=$fft_rate, - average=$average, - avg_alpha=#if $avg_alpha() then $avg_alpha else 'None'#, - title=$title, -#if $win() - win=$win, -#end if -#if $win_size() - size=$win_size, -#end if -) -#if not $grid_pos() -$(parent).Add(self.$(id).win) -#else -$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) -#end if</make> - <callback>set_baseband_freq($baseband_freq)</callback> - <callback>set_sample_rate($samp_rate)</callback> - <param> - <name>Type</name> - <key>type</key> - <value>complex</value> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:waterfall_sink_c</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:waterfall_sink_f</opt> - </option> - </param> - <param> - <name>Title</name> - <key>title</key> - <value>Waterfall Plot</value> - <type>string</type> - </param> - <param> - <name>Sample Rate</name> - <key>samp_rate</key> - <value>samp_rate</value> - <type>real</type> - </param> - <param> - <name>Baseband Freq</name> - <key>baseband_freq</key> - <value>0</value> - <type>real</type> - </param> - <param> - <name>Dynamic Range</name> - <key>dynamic_range</key> - <value>100</value> - <type>real</type> - </param> - <param> - <name>Reference Level</name> - <key>ref_level</key> - <value>50</value> - <type>real</type> - </param> - <param> - <name>Ref Scale (p2p)</name> - <key>ref_scale</key> - <value>2.0</value> - <type>real</type> - </param> - <param> - <name>FFT Size</name> - <key>fft_size</key> - <value>512</value> - <type>int</type> - </param> - <param> - <name>FFT Rate</name> - <key>fft_rate</key> - <value>15</value> - <type>int</type> - </param> - <param> - <name>Average</name> - <key>average</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>On</name> - <key>True</key> - </option> - <option> - <name>Off</name> - <key>False</key> - </option> - </param> - <param> - <name>Average Alpha</name> - <key>avg_alpha</key> - <value>0</value> - <type>real</type> - <hide>#if $average() == 'True' then 'none' else 'all'#</hide> - </param> - <param> - <name>Window</name> - <key>win</key> - <value>None</value> - <type>raw</type> - <hide>#if $win() is None then 'part' else 'none'#</hide> - <option> - <name>Automatic</name> - <key>None</key> - </option> - <option> - <name>Blackman-Harris</name> - <key>window.blackmanharris</key> - </option> - <option> - <name>Hamming</name> - <key>window.hamming</key> - </option> - <option> - <name>Hanning</name> - <key>window.hanning</key> - </option> - <option> - <name>Rectangular</name> - <key>window.rectangular</key> - </option> - <option> - <name>Flattop</name> - <key>window.flattop</key> - </option> - </param> - <param> - <name>Window Size</name> - <key>win_size</key> - <value></value> - <type>int_vector</type> - <hide>#if $win_size() then 'none' else 'part'#</hide> - </param> - <param> - <name>Grid Position</name> - <key>grid_pos</key> - <value></value> - <type>grid_pos</type> - </param> - <param> - <name>Notebook</name> - <key>notebook</key> - <value></value> - <type>notebook</type> - </param> - <check>not $win_size or len($win_size) == 2</check> - <sink> - <name>in</name> - <type>$type</type> - </sink> - <doc> -Set Average Alpha to 0 for automatic setting. - -Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels. - -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. - </doc> -</block> 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..af1d86be9 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,20 +31,5 @@ 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 - -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 \ - wxgui/panel.py \ - wxgui/top_block_gui.py + blks2/tcp.py 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 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/grc_gnuradio/wxgui/__init__.py b/grc/grc_gnuradio/wxgui/__init__.py deleted file mode 100644 index 81427253b..000000000 --- a/grc/grc_gnuradio/wxgui/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2008, 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 top_block_gui import top_block_gui -from panel import Panel diff --git a/grc/grc_gnuradio/wxgui/panel.py b/grc/grc_gnuradio/wxgui/panel.py deleted file mode 100644 index e62133cac..000000000 --- a/grc/grc_gnuradio/wxgui/panel.py +++ /dev/null @@ -1,49 +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 wx - -class Panel(wx.Panel): - def __init__(self, parent, orient=wx.VERTICAL): - wx.Panel.__init__(self, parent) - self._box = wx.BoxSizer(orient) - self._grid = wx.GridBagSizer(5, 5) - self.Add(self._grid) - self.SetSizer(self._box) - - def GetWin(self): return self - - def Add(self, win): - """ - Add a window to the wx vbox. - @param win the wx window - """ - self._box.Add(win, 0, wx.EXPAND) - - def GridAdd(self, win, row, col, row_span=1, col_span=1): - """ - Add a window to the wx grid at the given position. - @param win the wx window - @param row the row specification (integer >= 0) - @param col the column specification (integer >= 0) - @param row_span the row span specification (integer >= 1) - @param col_span the column span specification (integer >= 1) - """ - self._grid.Add(win, wx.GBPosition(row, col), wx.GBSpan(row_span, col_span), wx.EXPAND) diff --git a/grc/grc_gnuradio/wxgui/top_block_gui.py b/grc/grc_gnuradio/wxgui/top_block_gui.py deleted file mode 100644 index 333ccf1c1..000000000 --- a/grc/grc_gnuradio/wxgui/top_block_gui.py +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 2008, 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 wx -from gnuradio import gr -import panel - -default_gui_size = (200, 100) - -class top_block_gui(gr.top_block): - """gr top block with wx gui app and grid sizer.""" - - def __init__(self, title='', size=default_gui_size): - """ - Initialize the gr top block. - Create the wx gui elements. - @param title the main window title - @param size the main window size tuple in pixels - @param icon the file path to an icon or None - """ - #initialize - gr.top_block.__init__(self) - self._size = size - #create gui elements - self._app = wx.App() - self._frame = wx.Frame(None, title=title) - self._panel = panel.Panel(self._frame) - self.Add = self._panel.Add - self.GridAdd = self._panel.GridAdd - self.GetWin = self._panel.GetWin - - def SetIcon(self, *args, **kwargs): self._frame.SetIcon(*args, **kwargs) - - def Run(self, start=True): - """ - Setup the wx gui elements. - Start the gr top block. - Block with the wx main loop. - """ - #set minimal window size - self._frame.SetSizeHints(*self._size) - #create callback for quit - def _quit(event): - self.stop(); self.wait() - self._frame.Destroy() - #setup app - self._frame.Bind(wx.EVT_CLOSE, _quit) - self._sizer = wx.BoxSizer(wx.VERTICAL) - self._sizer.Add(self._panel, 0, wx.EXPAND) - self._frame.SetSizerAndFit(self._sizer) - self._frame.SetAutoLayout(True) - self._frame.Show(True) - self._app.SetTopWindow(self._frame) - #start flow graph - if start: self.start() - #blocking main loop - self._app.MainLoop() 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): """ diff --git a/grc/python/Generator.py b/grc/python/Generator.py index d53802bef..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,18 +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(), + 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()) @@ -125,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 6dd008d1d..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 @@ -99,7 +99,7 @@ class Param(_Param, _GUIParam): 'hex', 'string', 'bool', 'file_open', 'file_save', 'id', 'stream_id', - 'grid_pos', 'notebook', + 'grid_pos', 'notebook', 'gui_hint', 'import', ) @@ -354,6 +354,29 @@ class Param(_Param, _GUIParam): except: raise Exception, 'Stream ID "%s" is not found.'%v return v ######################### + # GUI Position/Hint + ######################### + elif t == 'gui_hint': + if ':' in v: tab, pos = v.split(':') + elif '@' in v: tab, pos = v, '' + else: tab, pos = '', v + + if '@' in tab: tab, index = tab.split('@') + else: index = '?' + + widget_str = ({ + (True, True): 'self.%(tab)s_grid_layout_%(index)s.addWidget(%(widget)s, %(pos)s)', + (True, False): 'self.%(tab)s_layout_%(index)s.addWidget(%(widget)s)', + (False, True): 'self.top_grid_layout.addWidget(%(widget)s, %(pos)s)', + (False, False): 'self.top_layout.addWidget(%(widget)s)', + }[bool(tab), bool(pos)])%{'tab': tab, 'index': index, 'widget': '%s', 'pos': pos} + + def gui_hint(ws, w): + if 'layout' in w: ws = ws.replace('addWidget', 'addLayout') + return ws%w + + return lambda w: gui_hint(widget_str, w) + ######################### # Grid Position Type ######################### elif t == 'grid_pos': diff --git a/grc/python/Platform.py b/grc/python/Platform.py index 04db0b9b0..ec3f94096 100644 --- a/grc/python/Platform.py +++ b/grc/python/Platform.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +Copyright 2008, 2009, 2010, 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 a1a9308aa..e16e86f5b 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 @@ -59,6 +57,17 @@ class $(class_name)(grc_wxgui.top_block_gui): _icon_path = "$icon.get_filename()" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) #end if +#elif $generate_options == 'qt_gui' +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) #elif $generate_options == 'no_gui' class $(class_name)(gr.top_block): @@ -112,30 +121,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 @@ -157,7 +142,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 @@ -196,6 +185,9 @@ self.$port.get_parent().get_id()#slurp ######################################################## #for $var in $parameters + $variables #set $id = $var.get_id() + def get_$(id)(self): + return self.$id + def set_$(id)(self, $id): self.$id = $id #for $callback in $var_id2cbs[$id] @@ -239,10 +231,19 @@ if __name__ == '__main__': if gr.enable_realtime_scheduling() != gr.RT_OK: print "Error: failed to enable realtime scheduling." #end if - tb = $(class_name)($(', '.join($params_eq_list))) #if $generate_options == 'wx_gui' + tb = $(class_name)($(', '.join($params_eq_list))) tb.Run($flow_graph.get_option('run')) + #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' + tb = $(class_name)($(', '.join($params_eq_list))) #set $run_options = $flow_graph.get_option('run_options') #if $run_options == 'prompt' tb.start() 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() |