diff options
Diffstat (limited to 'grc')
16 files changed, 326 insertions, 30 deletions
diff --git a/grc/data/platforms/python/block_tree.xml b/grc/data/platforms/python/block_tree.xml index 1c8d7b7e1..cdeef8ba1 100644 --- a/grc/data/platforms/python/block_tree.xml +++ b/grc/data/platforms/python/block_tree.xml @@ -249,6 +249,8 @@ <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> </cat> <cat> <name>Variables</name> diff --git a/grc/data/platforms/python/blocks/Makefile.am b/grc/data/platforms/python/blocks/Makefile.am index 7f5d0c139..7938e7684 100644 --- a/grc/data/platforms/python/blocks/Makefile.am +++ b/grc/data/platforms/python/blocks/Makefile.am @@ -197,6 +197,8 @@ dist_ourdata_DATA = \ usrp_dual_source_x.xml \ usrp_simple_sink_x.xml \ usrp_simple_source_x.xml \ + usrp2_sink_xxxx.xml \ + usrp2_source_xxxx.xml \ variable.xml \ variable_chooser.xml \ variable_sink.xml \ diff --git a/grc/data/platforms/python/blocks/blks2_error_rate.xml b/grc/data/platforms/python/blocks/blks2_error_rate.xml index 852e7db01..91a303206 100644 --- a/grc/data/platforms/python/blocks/blks2_error_rate.xml +++ b/grc/data/platforms/python/blocks/blks2_error_rate.xml @@ -20,12 +20,12 @@ <type>enum</type> <option> <name>Bit Error Rate</name> - <key>"BER"</key> + <key>'BER'</key> <opt>hide_bps:</opt> </option> <option> <name>Symbol Error Rate</name> - <key>"SER"</key> + <key>'SER'</key> <opt>hide_bps:all</opt> </option> </param> diff --git a/grc/data/platforms/python/blocks/gr_probe_mpsk_snr_c.xml b/grc/data/platforms/python/blocks/gr_probe_mpsk_snr_c.xml index 8b427076a..7f562d2f3 100644 --- a/grc/data/platforms/python/blocks/gr_probe_mpsk_snr_c.xml +++ b/grc/data/platforms/python/blocks/gr_probe_mpsk_snr_c.xml @@ -9,7 +9,7 @@ <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", + type='$type', alpha=$alpha, probe_rate=$probe_rate, )</make> diff --git a/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml b/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml new file mode 100644 index 000000000..93405873b --- /dev/null +++ b/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml @@ -0,0 +1,127 @@ +<?xml version="1.0"?> +<!-- +################################################### +##USRP2 Sink +################################################### + --> +<block> + <name>USRP2 Sink</name> + <key>usrp2_sink_xxxx</key> + <import>from gnuradio import usrp2</import> + <make>usrp2.sink_$(type.fcn)($interface, $mac_addr) +self.$(id).set_interp_rate($interpolation) +self.$(id).set_frequency($frequency) +self.$(id).set_gain($gain) +#if $auto_tr.eval +self.$(id).set_auto_tr($auto_tr) +#end if +#if $tx_enb.eval +self.$(id).set_enable($tx_enb) +#end if +</make> + <callback>set_interp_rate($interpolation)</callback> + <callback>set_frequency($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> + </option> + <option> + <name>Short</name> + <key>short</key> + <opt>fcn:16sc</opt> + </option> + </param> + <param> + <name>Interface</name> + <key>interface</key> + <value>eth0</value> + <type>string</type> + </param> + <param> + <name>MAC Addr</name> + <key>mac_addr</key> + <value>00:50:C2:85:3x:xx</value> + <type>string</type> + </param> + <param> + <name>Frequency</name> + <key>frequency</key> + <type>real</type> + </param> + <param> + <name>Interpolation</name> + <key>interpolation</key> + <type>int</type> + </param> + <param> + <name>Gain</name> + <key>gain</key> + <type>real</type> + </param> + <param> + <name>Auto T/R</name> + <key>auto_tr</key> + <value></value> + <type>enum</type> + <hide>$auto_tr.hide</hide> + <option> + <name>Ignore</name> + <key></key> + <opt>hide:part</opt> + </option> + <option> + <name>Enable</name> + <key>True</key> + <opt>hide:none</opt> + </option> + <option> + <name>Disable</name> + <key>False</key> + <opt>hide:none</opt> + </option> + </param> + <param> + <name>TX Enable</name> + <key>tx_enb</key> + <value></value> + <type>enum</type> + <hide>$tx_enb.hide</hide> + <option> + <name>Ignore</name> + <key></key> + <opt>hide:part</opt> + </option> + <option> + <name>Enable</name> + <key>True</key> + <opt>hide:none</opt> + </option> + <option> + <name>Disable</name> + <key>False</key> + <opt>hide:none</opt> + </option> + </param> + <sink> + <name>in</name> + <type>$type</type> + </sink> + <doc> +The USRP2 sink inputs 100 Megasamples per second / interpolation. + +--- Flex RF specific --- +The "Auto TR" and "TX Enable" settings are flex rf specific and should be left at "Ignore" unless this is a flex rf board. + +If enabled, "Auto Transmit/Receive Switching" handles the preference for transmit packets vs receive packets. \ +By default, "Auto TR" is disabled. + +The "Transmit Enable" configures the transmitter to be on or off. \ +Do not leave this unconfigured. + </doc> +</block> diff --git a/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml b/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml new file mode 100644 index 000000000..285ed17cb --- /dev/null +++ b/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml @@ -0,0 +1,127 @@ +<?xml version="1.0"?> +<!-- +################################################### +##USRP2 Source +################################################### + --> +<block> + <name>USRP2 Source</name> + <key>usrp2_source_xxxx</key> + <import>from gnuradio import usrp2</import> + <make>usrp2.source_$(type.fcn)($interface, $mac_addr) +self.$(id).set_decim_rate($decimation) +self.$(id).set_frequency($frequency) +self.$(id).set_gain($gain) +#if $auto_tr.eval +self.$(id).set_auto_tr($auto_tr) +#end if +#if $rx_ant.eval +self.$(id).select_rx_antenna($rx_ant) +#end if +</make> + <callback>set_decim_rate($decimation)</callback> + <callback>set_frequency($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> + </option> + <option> + <name>Short</name> + <key>short</key> + <opt>fcn:16sc</opt> + </option> + </param> + <param> + <name>Interface</name> + <key>interface</key> + <value>eth0</value> + <type>string</type> + </param> + <param> + <name>MAC Addr</name> + <key>mac_addr</key> + <value>00:50:C2:85:3x:xx</value> + <type>string</type> + </param> + <param> + <name>Frequency</name> + <key>frequency</key> + <type>real</type> + </param> + <param> + <name>Decimation</name> + <key>decimation</key> + <type>int</type> + </param> + <param> + <name>Gain</name> + <key>gain</key> + <type>real</type> + </param> + <param> + <name>Auto T/R</name> + <key>auto_tr</key> + <value></value> + <type>enum</type> + <hide>$auto_tr.hide</hide> + <option> + <name>Ignore</name> + <key></key> + <opt>hide:part</opt> + </option> + <option> + <name>Enable</name> + <key>True</key> + <opt>hide:none</opt> + </option> + <option> + <name>Disable</name> + <key>False</key> + <opt>hide:none</opt> + </option> + </param> + <param> + <name>RX Antenna</name> + <key>rx_ant</key> + <value></value> + <type>enum</type> + <hide>$rx_ant.hide</hide> + <option> + <name>Ignore</name> + <key></key> + <opt>hide:part</opt> + </option> + <option> + <name>TX/RX</name> + <key>'TX/RX'</key> + <opt>hide:none</opt> + </option> + <option> + <name>RX2</name> + <key>'RX2'</key> + <opt>hide:none</opt> + </option> + </param> + <source> + <name>out</name> + <type>$type</type> + </source> + <doc> +The USRP2 source outputs 100 Megasamples per second / decimation. + +--- Flex RF specific --- +The "Auto TR" and "RX Antenna" settings are flex rf specific and should be left at "Ignore" unless this is a flex rf board. + +If enabled, "Auto Transmit/Receive Switching" handles the preference for transmit packets vs receive packets. \ +By default, "Auto TR" is disabled. + +The "Receive Antenna Setting" selects one of the SMA connectors as the data source. \ +By default, 'TX/RX' is selected. + </doc> +</block> diff --git a/grc/data/platforms/python/blocks/usrp_dual_sink_x.xml b/grc/data/platforms/python/blocks/usrp_dual_sink_x.xml index acc14b1f6..68213080c 100644 --- a/grc/data/platforms/python/blocks/usrp_dual_sink_x.xml +++ b/grc/data/platforms/python/blocks/usrp_dual_sink_x.xml @@ -74,25 +74,30 @@ <param> <name>Mux</name> <key>mux</key> - <value>0xba98</value> + <value>0x0</value> <type>hex</type> + <hide>part</hide> </param> <param> <name>Auto T/R</name> <key>auto_tr</key> <value>None</value> <type>enum</type> + <hide>$auto_tr.hide</hide> <option> <name>Ignore</name> <key>None</key> + <opt>hide:part</opt> </option> <option> <name>Enable</name> <key>True</key> + <opt>hide:none</opt> </option> <option> <name>Disable</name> <key>False</key> + <opt>hide:none</opt> </option> </param> <param> @@ -100,17 +105,21 @@ <key>tx_enb_a</key> <value>None</value> <type>enum</type> + <hide>$tx_enb_a.hide</hide> <option> <name>Ignore</name> <key>None</key> + <opt>hide:part</opt> </option> <option> <name>Enable</name> <key>True</key> + <opt>hide:none</opt> </option> <option> <name>Disable</name> <key>False</key> + <opt>hide:none</opt> </option> </param> <param> @@ -118,17 +127,21 @@ <key>tx_enb_b</key> <value>None</value> <type>enum</type> + <hide>$tx_enb_b.hide</hide> <option> <name>Ignore</name> <key>None</key> + <opt>hide:part</opt> </option> <option> <name>Enable</name> <key>True</key> + <opt>hide:none</opt> </option> <option> <name>Disable</name> <key>False</key> + <opt>hide:none</opt> </option> </param> <sink> diff --git a/grc/data/platforms/python/blocks/usrp_dual_source_x.xml b/grc/data/platforms/python/blocks/usrp_dual_source_x.xml index bd84c73c9..33ff12cb7 100644 --- a/grc/data/platforms/python/blocks/usrp_dual_source_x.xml +++ b/grc/data/platforms/python/blocks/usrp_dual_source_x.xml @@ -74,25 +74,30 @@ <param> <name>Mux</name> <key>mux</key> - <value>0x3210</value> + <value>0x0</value> <type>hex</type> + <hide>part</hide> </param> <param> <name>Auto T/R</name> <key>auto_tr</key> <value>None</value> <type>enum</type> + <hide>$auto_tr.hide</hide> <option> <name>Ignore</name> <key>None</key> + <opt>hide:part</opt> </option> <option> <name>Enable</name> <key>True</key> + <opt>hide:none</opt> </option> <option> <name>Disable</name> <key>False</key> + <opt>hide:none</opt> </option> </param> <param> @@ -100,17 +105,21 @@ <key>rx_ant_a</key> <value>None</value> <type>enum</type> + <hide>$rx_ant_a.hide</hide> <option> <name>Ignore</name> <key>None</key> + <opt>hide:part</opt> </option> <option> <name>TX/RX</name> - <key>"TX/RX"</key> + <key>'TX/RX'</key> + <opt>hide:none</opt> </option> <option> <name>RX2</name> - <key>"RX2"</key> + <key>'RX2'</key> + <opt>hide:none</opt> </option> </param> <param> @@ -118,17 +127,21 @@ <key>rx_ant_b</key> <value>None</value> <type>enum</type> + <hide>$rx_ant_b.hide</hide> <option> <name>Ignore</name> <key>None</key> + <opt>hide:part</opt> </option> <option> <name>TX/RX</name> - <key>"TX/RX"</key> + <key>'TX/RX'</key> + <opt>hide:none</opt> </option> <option> <name>RX2</name> - <key>"RX2"</key> + <key>'RX2'</key> + <opt>hide:none</opt> </option> </param> <source> diff --git a/grc/data/platforms/python/blocks/usrp_simple_sink_x.xml b/grc/data/platforms/python/blocks/usrp_simple_sink_x.xml index b525d031f..31d01c9bf 100644 --- a/grc/data/platforms/python/blocks/usrp_simple_sink_x.xml +++ b/grc/data/platforms/python/blocks/usrp_simple_sink_x.xml @@ -14,11 +14,7 @@ frequency=$frequency, interpolation=$interpolation, gain=$gain, -#if $mux.eval == hex(0) - mux=None, -#else mux=$mux, -#end if auto_tr=$auto_tr, tx_enb=$tx_enb, )</make> @@ -84,23 +80,28 @@ <key>mux</key> <value>0x0</value> <type>hex</type> + <hide>part</hide> </param> <param> <name>Auto T/R</name> <key>auto_tr</key> <value>None</value> <type>enum</type> + <hide>$auto_tr.hide</hide> <option> <name>Ignore</name> <key>None</key> + <opt>hide:part</opt> </option> <option> <name>Enable</name> <key>True</key> + <opt>hide:none</opt> </option> <option> <name>Disable</name> <key>False</key> + <opt>hide:none</opt> </option> </param> <param> @@ -108,17 +109,21 @@ <key>tx_enb</key> <value>None</value> <type>enum</type> + <hide>$tx_enb.hide</hide> <option> <name>Ignore</name> <key>None</key> + <opt>hide:part</opt> </option> <option> <name>Enable</name> <key>True</key> + <opt>hide:none</opt> </option> <option> <name>Disable</name> <key>False</key> + <opt>hide:none</opt> </option> </param> <sink> diff --git a/grc/data/platforms/python/blocks/usrp_simple_source_x.xml b/grc/data/platforms/python/blocks/usrp_simple_source_x.xml index a1598583f..e537f700f 100644 --- a/grc/data/platforms/python/blocks/usrp_simple_source_x.xml +++ b/grc/data/platforms/python/blocks/usrp_simple_source_x.xml @@ -14,11 +14,7 @@ frequency=$frequency, decimation=$decimation, gain=$gain, -#if $mux.eval == hex(0) - mux=None, -#else mux=$mux, -#end if auto_tr=$auto_tr, rx_ant=$rx_ant, )</make> @@ -92,23 +88,28 @@ <key>mux</key> <value>0x0</value> <type>hex</type> + <hide>part</hide> </param> <param> <name>Auto T/R</name> <key>auto_tr</key> <value>None</value> <type>enum</type> + <hide>$auto_tr.hide</hide> <option> <name>Ignore</name> <key>None</key> + <opt>hide:part</opt> </option> <option> <name>Enable</name> <key>True</key> + <opt>hide:none</opt> </option> <option> <name>Disable</name> <key>False</key> + <opt>hide:none</opt> </option> </param> <param> @@ -116,17 +117,21 @@ <key>rx_ant</key> <value>None</value> <type>enum</type> + <hide>$rx_ant.hide</hide> <option> <name>Ignore</name> <key>None</key> + <opt>hide:part</opt> </option> <option> <name>TX/RX</name> - <key>"TX/RX"</key> + <key>'TX/RX'</key> + <opt>hide:none</opt> </option> <option> <name>RX2</name> - <key>"RX2"</key> + <key>'RX2'</key> + <opt>hide:none</opt> </option> </param> <source> diff --git a/grc/data/platforms/python/blocks/variable_chooser.xml b/grc/data/platforms/python/blocks/variable_chooser.xml index 4eba84d4c..2a00a1cf2 100644 --- a/grc/data/platforms/python/blocks/variable_chooser.xml +++ b/grc/data/platforms/python/blocks/variable_chooser.xml @@ -14,7 +14,7 @@ _$(id)_control = grc_wxgui.$(chooser_type)_control( #if $label.eval label=$label, #else - label="$id", + label='$id', #end if index=$value_index, choices=$choices, diff --git a/grc/data/platforms/python/blocks/variable_slider.xml b/grc/data/platforms/python/blocks/variable_slider.xml index 27ac7ea5e..635f3ed4c 100644 --- a/grc/data/platforms/python/blocks/variable_slider.xml +++ b/grc/data/platforms/python/blocks/variable_slider.xml @@ -14,7 +14,7 @@ _$(id)_control = grc_wxgui.slider_$(slider_type)_control( #if $label.eval label=$label, #else - label="$id", + label='$id', #end if value=$id, min=$min, diff --git a/grc/data/platforms/python/blocks/variable_text_box.xml b/grc/data/platforms/python/blocks/variable_text_box.xml index 0dad3d826..97c6aa0d9 100644 --- a/grc/data/platforms/python/blocks/variable_text_box.xml +++ b/grc/data/platforms/python/blocks/variable_text_box.xml @@ -14,7 +14,7 @@ _$(id)_control = grc_wxgui.text_box_control( #if $label.eval label=$label, #else - label="$id", + label='$id', #end if value=$id, ) diff --git a/grc/data/platforms/python/blocks/xmlrpc_client.xml b/grc/data/platforms/python/blocks/xmlrpc_client.xml index 82ae8ceed..f132a7865 100644 --- a/grc/data/platforms/python/blocks/xmlrpc_client.xml +++ b/grc/data/platforms/python/blocks/xmlrpc_client.xml @@ -8,7 +8,7 @@ <name>XMLRPC Client</name> <key>xmlrpc_client</key> <import>import xmlrpclib</import> - <make>xmlrpclib.Server("http://$(addr.eval):$(port)")</make> + <make>xmlrpclib.Server('http://$(addr.eval):$(port)')</make> <callback>$(callback.eval)($variable)</callback> <param> <name>Address</name> diff --git a/grc/data/platforms/python/blocks/xmlrpc_server.xml b/grc/data/platforms/python/blocks/xmlrpc_server.xml index 40e547efc..6c31bd1a9 100644 --- a/grc/data/platforms/python/blocks/xmlrpc_server.xml +++ b/grc/data/platforms/python/blocks/xmlrpc_server.xml @@ -33,7 +33,7 @@ Ex: If the variable is called freq, the function provided by the server will be Example client in python: import xmlrpclib -s = xmlrpclib.Server("http://localhost:8080") +s = xmlrpclib.Server('http://localhost:8080') s.set_freq(5000) </doc> </block> diff --git a/grc/src/grc_gnuradio/usrp/simple_usrp.py b/grc/src/grc_gnuradio/usrp/simple_usrp.py index c1019d334..d829cf9e6 100644 --- a/grc/src/grc_gnuradio/usrp/simple_usrp.py +++ b/grc/src/grc_gnuradio/usrp/simple_usrp.py @@ -146,7 +146,7 @@ class _simple_usrp(object): class _simple_source(gr.hier_block2, _simple_usrp): """A single usrp source of IO type short or complex.""" - def __init__(self, number, subdev_spec, frequency, decimation, gain, mux=None, auto_tr=None, rx_ant=None): + def __init__(self, number, subdev_spec, frequency, decimation, gain, mux=0x0, auto_tr=None, rx_ant=None): """ USRP simple source contructor. @param number the unit number @@ -168,7 +168,7 @@ class _simple_source(gr.hier_block2, _simple_usrp): u = self.constructor[0](number, nchan=1) if subdev_spec is None: subdev_spec = usrp.pick_rx_subdevice(u) u.set_decim_rate(decimation) - if mux is None: mux = usrp.determine_rx_mux_value(u, subdev_spec) + if not mux: mux = usrp.determine_rx_mux_value(u, subdev_spec) u.set_mux(mux) subdev = _setup_rx_subdev(u, subdev_spec, 0, gain, frequency, auto_tr, rx_ant) _simple_usrp.__init__(self, u, subdev, 0) @@ -186,7 +186,7 @@ class simple_source_s(_simple_source): constructor = (usrp.source_s, ) class _simple_sink(gr.hier_block2, _simple_usrp): """A single usrp sink of IO type short or complex.""" - def __init__(self, number, subdev_spec, frequency, interpolation, gain, mux=None, auto_tr=None, tx_enb=None): + def __init__(self, number, subdev_spec, frequency, interpolation, gain, mux=0x0, auto_tr=None, tx_enb=None): """ USRP simple sink contructor. @param number the unit number @@ -208,7 +208,7 @@ class _simple_sink(gr.hier_block2, _simple_usrp): u = self.constructor[0](number, nchan=1) if subdev_spec is None: subdev_spec = usrp.pick_tx_subdevice(u) u.set_interp_rate(interpolation) - if mux is None: mux = usrp.determine_tx_mux_value(u, subdev_spec) + if not mux: mux = usrp.determine_tx_mux_value(u, subdev_spec) u.set_mux(mux) subdev = _setup_tx_subdev(u, subdev_spec, gain, frequency, auto_tr, tx_enb) _simple_usrp.__init__(self, u, subdev, subdev.which()) @@ -299,7 +299,7 @@ class _dual_usrp(object): class _dual_source(gr.hier_block2, _dual_usrp): """A dual usrp source of IO type short or complex.""" - def __init__(self, number, frequency_a, frequency_b, decimation, gain_a, gain_b, mux=0x3210, auto_tr=None, rx_ant_a=None, rx_ant_b=None): + def __init__(self, number, frequency_a, frequency_b, decimation, gain_a, gain_b, mux=0x0, auto_tr=None, rx_ant_a=None, rx_ant_b=None): """ USRP dual source contructor. @param number the unit number @@ -322,6 +322,7 @@ class _dual_source(gr.hier_block2, _dual_usrp): #create usrp object u = self.constructor[0](number, nchan=2) u.set_decim_rate(decimation) + if not mux: mux = 0x3210 u.set_mux(mux) subdev_a = _setup_rx_subdev(u, (0, 0), 0, gain_a, frequency_a, auto_tr, rx_ant_a) subdev_b = _setup_rx_subdev(u, (1, 0), 1, gain_b, frequency_b, auto_tr, rx_ant_b) @@ -342,7 +343,7 @@ class dual_source_s(_dual_source): constructor = usrp.source_s class _dual_sink(gr.hier_block2, _dual_usrp): """A dual usrp sink of IO type short or complex.""" - def __init__(self, number, frequency_a, frequency_b, interpolation, gain_a, gain_b, mux=0xba98, auto_tr=None, tx_enb_a=None, tx_enb_b=None): + def __init__(self, number, frequency_a, frequency_b, interpolation, gain_a, gain_b, mux=0x0, auto_tr=None, tx_enb_a=None, tx_enb_b=None): """ USRP dual sink contructor. @param number the unit number @@ -363,6 +364,7 @@ class _dual_sink(gr.hier_block2, _dual_usrp): #create usrp object u = self.constructor[0](number, nchan=2) u.set_interp_rate(interpolation) + if not mux: mux = 0xba98 u.set_mux(mux) subdev_a = _setup_tx_subdev(u, (0, 0), gain_a, frequency_a, auto_tr, tx_enb_a) subdev_b = _setup_tx_subdev(u, (1, 0), gain_b, frequency_b, auto_tr, tx_enb_b) |