commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r8121 - in grc/branches/grc_reloaded: notes src/grc_gn


From: jblum
Subject: [Commit-gnuradio] r8121 - in grc/branches/grc_reloaded: notes src/grc_gnuradio src/grc_gnuradio/blocks/operators src/grc_gnuradio/blocks/sinks src/grc_gnuradio/blocks/sources src/grc_gnuradio/blocks/usrp src/grc_gnuradio/blocks/variables src/grc_gnuradio/data src/grc_gnuradio/usrp
Date: Thu, 27 Mar 2008 19:03:33 -0600 (MDT)

Author: jblum
Date: 2008-03-27 19:03:32 -0600 (Thu, 27 Mar 2008)
New Revision: 8121

Added:
   grc/branches/grc_reloaded/src/grc_gnuradio/blocks/usrp/usrp_dual_sink_x.xml
   grc/branches/grc_reloaded/src/grc_gnuradio/blocks/usrp/usrp_dual_source_x.xml
   grc/branches/grc_reloaded/src/grc_gnuradio/blocks/usrp/usrp_simple_sink_x.xml
   
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/usrp/usrp_simple_source_x.xml
   grc/branches/grc_reloaded/src/grc_gnuradio/usrp/simple_usrp.py
Modified:
   grc/branches/grc_reloaded/notes/todo.txt
   grc/branches/grc_reloaded/src/grc_gnuradio/Block.py
   grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_divide_xx.xml
   grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_nlog10_ff.xml
   grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_sub_xx.xml
   grc/branches/grc_reloaded/src/grc_gnuradio/blocks/sinks/audio_sink.xml
   grc/branches/grc_reloaded/src/grc_gnuradio/blocks/sources/audio_source.xml
   grc/branches/grc_reloaded/src/grc_gnuradio/blocks/variables/variable.xml
   
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/variables/variable_chooser.xml
   
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/variables/variable_slider.xml
   grc/branches/grc_reloaded/src/grc_gnuradio/data/block_tree.xml
   grc/branches/grc_reloaded/src/grc_gnuradio/usrp/__init__.py
Log:
some docs, usrp simple blks2, usrp wrappers

Modified: grc/branches/grc_reloaded/notes/todo.txt
===================================================================
--- grc/branches/grc_reloaded/notes/todo.txt    2008-03-27 22:25:30 UTC (rev 
8120)
+++ grc/branches/grc_reloaded/notes/todo.txt    2008-03-28 01:03:32 UTC (rev 
8121)
@@ -1,13 +1,9 @@
 ############ GRC Reloaded: #############
-generate button next to execute
 dtd for saved flow graphs
+html documentation/tutorial
 
 ############   Blocks to Add:  ####################
--ofdm (blks2)
--cpm (blks2)
--filterbank (blks2)
--usrp quad souce, set z == 1 to ignore Q inputs 
--usrp hier2 blocks
+-usrp hier2 blocks need testing
 
 ############   Known Problems: ####################
 -packet threads block on close

Modified: grc/branches/grc_reloaded/src/grc_gnuradio/Block.py
===================================================================
--- grc/branches/grc_reloaded/src/grc_gnuradio/Block.py 2008-03-27 22:25:30 UTC 
(rev 8120)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/Block.py 2008-03-28 01:03:32 UTC 
(rev 8121)
@@ -144,14 +144,9 @@
                                continue
                
        def get_doc(self): 
-               doc = self._doc.strip('\n')
-               #remove single newlines
-               new_doc = ""
-               for i,c in enumerate(doc):
-                       if c == '\n' and i != 0 and doc[i-1] != '\n' and i != 
len(doc)-1 and doc[i+1] != '\n': pass
-                       else: new_doc = new_doc + c                     
+               doc = self._doc.strip('\n').replace('\\\n', '')
                #merge custom doc with doxygen docs 
-               return '\n'.join([new_doc, 
extract_docs(self.get_key())]).strip('\n')
+               return '\n'.join([doc, 
extract_docs(self.get_key())]).strip('\n')
        
        def get_imports(self): return self._imports
        

Modified: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_divide_xx.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_divide_xx.xml    
    2008-03-27 22:25:30 UTC (rev 8120)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_divide_xx.xml    
    2008-03-28 01:03:32 UTC (rev 8121)
@@ -51,10 +51,5 @@
        <source>
                <name>out</name>
                <type>$type</type>
-       </source>               
-       <doc>
-output = input_0 / input_1 / input_2 / ...
-
-Divide across all input streams.       
-       </doc>
+       </source>
 </block>

Modified: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_nlog10_ff.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_nlog10_ff.xml    
    2008-03-27 22:25:30 UTC (rev 8120)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_nlog10_ff.xml    
    2008-03-28 01:03:32 UTC (rev 8121)
@@ -39,8 +39,5 @@
                <name>out</name>
                <type>float</type>
                <vlen>$vlen</vlen>
-       </source>       
-       <doc>
-output = n*log10(input) + k    
-       </doc>  
+       </source>
 </block>

Modified: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_sub_xx.xml
===================================================================
--- grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_sub_xx.xml   
2008-03-27 22:25:30 UTC (rev 8120)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_sub_xx.xml   
2008-03-28 01:03:32 UTC (rev 8121)
@@ -51,10 +51,5 @@
        <source>
                <name>out</name>
                <type>$type</type>
-       </source>               
-       <doc>
-output = input_0 - input_1 - input_2 - ...
-
-Subtract across all input streams. 
-       </doc>
+       </source>
 </block>

Modified: grc/branches/grc_reloaded/src/grc_gnuradio/blocks/sinks/audio_sink.xml
===================================================================
--- grc/branches/grc_reloaded/src/grc_gnuradio/blocks/sinks/audio_sink.xml      
2008-03-27 22:25:30 UTC (rev 8120)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/blocks/sinks/audio_sink.xml      
2008-03-28 01:03:32 UTC (rev 8121)
@@ -75,10 +75,10 @@
        <doc>
 Not all sampling rates will be supported by your hardware.
 
-Leave the device name blank to choose deafult audio device.
+Leave the device name blank to choose deafult audio device. \
 Audio device names may look like hw:0,0
 
-The audio sink can have multiple inputs depending upon your hardware. 
+The audio sink can have multiple inputs depending upon your hardware. \
 For example, set the inputs to 2 for stereo audio.     
        </doc>
 </block>

Modified: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/sources/audio_source.xml
===================================================================
--- grc/branches/grc_reloaded/src/grc_gnuradio/blocks/sources/audio_source.xml  
2008-03-27 22:25:30 UTC (rev 8120)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/blocks/sources/audio_source.xml  
2008-03-28 01:03:32 UTC (rev 8121)
@@ -75,10 +75,10 @@
        <doc>
 Not all sampling rates will be supported by your hardware.
 
-Leave the device name blank to choose deafult audio device.
+Leave the device name blank to choose deafult audio device. \
 Audio device names may look like hw:0,0
 
-The audio source can have multiple outputs depending upon your hardware. 
+The audio source can have multiple outputs depending upon your hardware. \
 For example, set the outputs to 2 for stereo audio.    
        </doc>
 </block>

Added: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/usrp/usrp_dual_sink_x.xml
===================================================================
--- grc/branches/grc_reloaded/src/grc_gnuradio/blocks/usrp/usrp_dual_sink_x.xml 
                        (rev 0)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/blocks/usrp/usrp_dual_sink_x.xml 
2008-03-28 01:03:32 UTC (rev 8121)
@@ -0,0 +1,154 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!-- 
+###################################################
+##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)(
+       number=$number,
+       frequency_a=$frequency_a, 
+       frequency_b=$frequency_b, 
+       interpolation=$interpolation, 
+       gain_a=$gain_a,
+       gain_b=$gain_b,
+       mux=$mux, 
+       auto_tr=$auto_tr, 
+       tx_enb_a=$tx_enb_a,
+       tx_enb_b=$tx_enb_b,
+)</make>
+       <callback>set_frequency_a($frequency_a)</callback>
+       <callback>set_gain_a($gain_a)</callback>
+       <callback>set_frequency_b($frequency_b)</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>number</key>
+               <value>0</value>
+               <type>int</type>                
+       </param>
+       <param>
+               <name>Frequency A</name>
+               <key>frequency_a</key>
+               <type>real</type>               
+       </param>
+       <param>
+               <name>Frequency B</name>
+               <key>frequency_b</key>
+               <type>real</type>               
+       </param>
+       <param>
+               <name>Interpolation</name>
+               <key>interpolation</key>
+               <type>real</type>               
+       </param>
+       <param>
+               <name>Gain A</name>
+               <key>gain_a</key>
+               <type>real</type>               
+       </param>
+       <param>
+               <name>Gain B</name>
+               <key>gain_b</key>
+               <type>real</type>               
+       </param>
+       <param>
+               <name>Mux</name>
+               <key>mux</key>
+               <value>0xba98</value>
+               <type>hex</type>                
+       </param>
+       <param>
+               <name>Auto T/R</name>
+               <key>auto_tr</key>
+               <value>None</value>
+               <type>enum</type>
+               <option>
+                       <name>Ignore</name>
+                       <key>None</key>                         
+               </option>
+               <option>
+                       <name>Enable</name>
+                       <key>True</key>                 
+               </option>
+               <option>
+                       <name>Disable</name>
+                       <key>False</key>                        
+               </option>
+       </param>
+       <param>
+               <name>TX Enable A</name>
+               <key>tx_enb_a</key>
+               <value>None</value>
+               <type>enum</type>
+               <option>
+                       <name>Ignore</name>
+                       <key>None</key>                         
+               </option>
+               <option>
+                       <name>Enable</name>
+                       <key>True</key>                 
+               </option>
+               <option>
+                       <name>Disable</name>
+                       <key>False</key>                        
+               </option>
+       </param>
+       <param>
+               <name>TX Enable B</name>
+               <key>tx_enb_b</key>
+               <value>None</value>
+               <type>enum</type>
+               <option>
+                       <name>Ignore</name>
+                       <key>None</key>                         
+               </option>
+               <option>
+                       <name>Enable</name>
+                       <key>True</key>                 
+               </option>
+               <option>
+                       <name>Disable</name>
+                       <key>False</key>                        
+               </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.
+
+--- 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>

Added: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/usrp/usrp_dual_source_x.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/usrp/usrp_dual_source_x.xml   
                            (rev 0)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/usrp/usrp_dual_source_x.xml   
    2008-03-28 01:03:32 UTC (rev 8121)
@@ -0,0 +1,154 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!-- 
+###################################################
+##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)(
+       number=$number,
+       frequency_a=$frequency_a,       
+       frequency_b=$frequency_b,
+       decimation=$decimation, 
+       gain_a=$gain_a,
+       gain_b=$gain_b,
+       mux=$mux, 
+       auto_tr=$auto_tr, 
+       rx_ant_a=$rx_ant_a,
+       rx_ant_b=$rx_ant_b,
+)</make>
+       <callback>set_frequency_a($frequency_a)</callback>
+       <callback>set_gain_a($gain_a)</callback>
+       <callback>set_frequency_b($frequency_b)</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>Unit Number</name>
+               <key>number</key>
+               <value>0</value>
+               <type>int</type>                
+       </param>
+       <param>
+               <name>Frequency A</name>
+               <key>frequency_a</key>
+               <type>real</type>               
+       </param>
+       <param>
+               <name>Frequency B</name>
+               <key>frequency_b</key>
+               <type>real</type>               
+       </param>
+       <param>
+               <name>Decimation</name>
+               <key>decimation</key>
+               <type>real</type>               
+       </param>
+       <param>
+               <name>Gain A</name>
+               <key>gain_a</key>
+               <type>real</type>               
+       </param>
+       <param>
+               <name>Gain B</name>
+               <key>gain_b</key>
+               <type>real</type>               
+       </param>
+       <param>
+               <name>Mux</name>
+               <key>mux</key>
+               <value>0x3210</value>
+               <type>hex</type>                
+       </param>
+       <param>
+               <name>Auto T/R</name>
+               <key>auto_tr</key>
+               <value>None</value>
+               <type>enum</type>
+               <option>
+                       <name>Ignore</name>
+                       <key>None</key>                         
+               </option>
+               <option>
+                       <name>Enable</name>
+                       <key>True</key>                 
+               </option>
+               <option>
+                       <name>Disable</name>
+                       <key>False</key>                        
+               </option>
+       </param>
+       <param>
+               <name>RX Antenna B</name>
+               <key>rx_ant_a</key>
+               <value>None</value>
+               <type>enum</type>
+               <option>
+                       <name>Ignore</name>
+                       <key>None</key>                         
+               </option>
+               <option>
+                       <name>TX/RX</name>
+                       <key>&quot;TX/RX&quot;</key>                    
+               </option>
+               <option>
+                       <name>RX2</name>
+                       <key>&quot;RX2&quot;</key>                      
+               </option>
+       </param>
+       <param>
+               <name>RX Antenna B</name>
+               <key>rx_ant_b</key>
+               <value>None</value>
+               <type>enum</type>
+               <option>
+                       <name>Ignore</name>
+                       <key>None</key>                         
+               </option>
+               <option>
+                       <name>TX/RX</name>
+                       <key>&quot;TX/RX&quot;</key>                    
+               </option>
+               <option>
+                       <name>RX2</name>
+                       <key>&quot;RX2&quot;</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.
+
+--- 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>

Added: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/usrp/usrp_simple_sink_x.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/usrp/usrp_simple_sink_x.xml   
                            (rev 0)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/usrp/usrp_simple_sink_x.xml   
    2008-03-28 01:03:32 UTC (rev 8121)
@@ -0,0 +1,148 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!-- 
+###################################################
+##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)(
+       number=$number,
+       subdev_spec=$subdev_spec, 
+       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>
+       <callback>set_frequency($frequency)</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>number</key>
+               <value>0</value>
+               <type>int</type>                
+       </param>
+       <param>
+               <name>Subdev Spec</name>
+               <key>subdev_spec</key>
+               <value>auto</value>
+               <type>enum</type>
+               <option>
+                       <name>Auto</name>
+                       <key>None</key>                         
+               </option>
+               <option>
+                       <name>Side A:0</name>
+                       <key>(0, 0)</key>                       
+               </option>
+               <option>
+                       <name>Side B:0</name>
+                       <key>(1, 0)</key>                       
+               </option>
+               <option>
+                       <name>Side A:1</name>
+                       <key>(0, 1)</key>                       
+               </option>
+               <option>
+                       <name>Side B:1</name>
+                       <key>(1, 1)</key>                       
+               </option>
+       </param>
+       <param>
+               <name>Frequency</name>
+               <key>frequency</key>
+               <type>real</type>               
+       </param>
+       <param>
+               <name>Interpolation</name>
+               <key>interpolation</key>
+               <type>real</type>               
+       </param>
+       <param>
+               <name>Gain</name>
+               <key>gain</key>
+               <type>real</type>               
+       </param>
+       <param>
+               <name>Mux</name>
+               <key>mux</key>
+               <value>0x0</value>
+               <type>hex</type>                
+       </param>
+       <param>
+               <name>Auto T/R</name>
+               <key>auto_tr</key>
+               <value>None</value>
+               <type>enum</type>
+               <option>
+                       <name>Ignore</name>
+                       <key>None</key>                         
+               </option>
+               <option>
+                       <name>Enable</name>
+                       <key>True</key>                 
+               </option>
+               <option>
+                       <name>Disable</name>
+                       <key>False</key>                        
+               </option>
+       </param>
+       <param>
+               <name>TX Enable</name>
+               <key>tx_enb</key>
+               <value>None</value>
+               <type>enum</type>
+               <option>
+                       <name>Ignore</name>
+                       <key>None</key>                         
+               </option>
+               <option>
+                       <name>Enable</name>
+                       <key>True</key>                 
+               </option>
+               <option>
+                       <name>Disable</name>
+                       <key>False</key>                        
+               </option>
+       </param>
+       <sink>
+               <name>in</name>
+               <type>$type</type>
+       </sink>
+       <doc>
+The USRP sink inputs 128 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>

Added: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/usrp/usrp_simple_source_x.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/usrp/usrp_simple_source_x.xml 
                            (rev 0)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/usrp/usrp_simple_source_x.xml 
    2008-03-28 01:03:32 UTC (rev 8121)
@@ -0,0 +1,148 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!-- 
+###################################################
+##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)(
+       number=$number,
+       subdev_spec=$subdev_spec, 
+       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>
+       <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:c</opt>                                        
+               </option>
+               <option>
+                       <name>Short</name>
+                       <key>short</key>
+                       <opt>fcn:s</opt>                                        
+               </option>
+       </param>        
+       <param>
+               <name>Unit Number</name>
+               <key>number</key>
+               <value>0</value>
+               <type>int</type>                
+       </param>
+       <param>
+               <name>Subdev Spec</name>
+               <key>subdev_spec</key>
+               <value>auto</value>
+               <type>enum</type>
+               <option>
+                       <name>Auto</name>
+                       <key>None</key>                         
+               </option>
+               <option>
+                       <name>Side A:0</name>
+                       <key>(0, 0)</key>                       
+               </option>
+               <option>
+                       <name>Side B:0</name>
+                       <key>(1, 0)</key>                       
+               </option>
+               <option>
+                       <name>Side A:1</name>
+                       <key>(0, 1)</key>                       
+               </option>
+               <option>
+                       <name>Side B:1</name>
+                       <key>(1, 1)</key>                       
+               </option>
+       </param>
+       <param>
+               <name>Frequency</name>
+               <key>frequency</key>
+               <type>real</type>               
+       </param>
+       <param>
+               <name>Decimation</name>
+               <key>decimation</key>
+               <type>real</type>               
+       </param>
+       <param>
+               <name>Gain</name>
+               <key>gain</key>
+               <type>real</type>               
+       </param>
+       <param>
+               <name>Mux</name>
+               <key>mux</key>
+               <value>0x0</value>
+               <type>hex</type>                
+       </param>
+       <param>
+               <name>Auto T/R</name>
+               <key>auto_tr</key>
+               <value>None</value>
+               <type>enum</type>
+               <option>
+                       <name>Ignore</name>
+                       <key>None</key>                         
+               </option>
+               <option>
+                       <name>Enable</name>
+                       <key>True</key>                 
+               </option>
+               <option>
+                       <name>Disable</name>
+                       <key>False</key>                        
+               </option>
+       </param>
+       <param>
+               <name>RX Antenna</name>
+               <key>rx_ant</key>
+               <value>None</value>
+               <type>enum</type>
+               <option>
+                       <name>Ignore</name>
+                       <key>None</key>                         
+               </option>
+               <option>
+                       <name>TX/RX</name>
+                       <key>&quot;TX/RX&quot;</key>                    
+               </option>
+               <option>
+                       <name>RX2</name>
+                       <key>&quot;RX2&quot;</key>                      
+               </option>
+       </param>
+       <source>
+               <name>out</name>
+               <type>$type</type>
+       </source>
+       <doc>
+The USRP source outputs 64 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>

Modified: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/variables/variable.xml
===================================================================
--- grc/branches/grc_reloaded/src/grc_gnuradio/blocks/variables/variable.xml    
2008-03-27 22:25:30 UTC (rev 8120)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/blocks/variables/variable.xml    
2008-03-28 01:03:32 UTC (rev 8121)
@@ -16,8 +16,8 @@
                <type>raw</type>
        </param>
        <doc>
-This block maps a value to a unique variable.
-This variable block has no graphical representation.
+This block maps a value to a unique variable. \
+This variable block has no graphical representation. \
 Use the variable slider, enum, or button for graphical options.
        </doc>  
 </block>

Modified: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/variables/variable_chooser.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/variables/variable_chooser.xml
    2008-03-27 22:25:30 UTC (rev 8120)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/variables/variable_chooser.xml
    2008-03-28 01:03:32 UTC (rev 8121)
@@ -65,11 +65,11 @@
        <check>$value_index in range(len($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. 
+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.

Modified: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/variables/variable_slider.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/variables/variable_slider.xml 
    2008-03-27 22:25:30 UTC (rev 8120)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/variables/variable_slider.xml 
    2008-03-28 01:03:32 UTC (rev 8121)
@@ -49,10 +49,10 @@
        <check>$min &lt; $max</check>
        <check>0 &lt; $num_steps &lt;= 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. 
+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.

Modified: grc/branches/grc_reloaded/src/grc_gnuradio/data/block_tree.xml
===================================================================
--- grc/branches/grc_reloaded/src/grc_gnuradio/data/block_tree.xml      
2008-03-27 22:25:30 UTC (rev 8120)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/data/block_tree.xml      
2008-03-28 01:03:32 UTC (rev 8121)
@@ -16,9 +16,7 @@
                <block>gr_file_source</block>   
                <block>gr_udp_source</block>
                <block>audio_source</block>     
-               <block>gr_wavfile_source</block>        
-               <block>usrp_source</block>
-               <block>usrp_dual_source</block>
+               <block>gr_wavfile_source</block>
        </cat>
        <cat>
                <name>Sinks</name>
@@ -27,8 +25,6 @@
                <block>gr_udp_sink</block>
                <block>audio_sink</block>
                <block>gr_wavfile_sink</block>
-               <block>usrp_sink</block>
-               <block>usrp_dual_sink</block>
        </cat>
        <cat>
                <name>Graphical Sinks</name>
@@ -206,6 +202,13 @@
                <block>deinterleaver</block>             
        </cat> -->
        <cat>
+               <name>USRP</name>
+               <block>usrp_simple_source_x</block>
+               <block>usrp_dual_source_x</block>
+               <block>usrp_simple_sink_x</block>
+               <block>usrp_dual_sink_x</block>
+       </cat>
+       <cat>
                <name>Variables</name>
                <block>variable</block>
                <block>variable_chooser</block>

Modified: grc/branches/grc_reloaded/src/grc_gnuradio/usrp/__init__.py
===================================================================
--- grc/branches/grc_reloaded/src/grc_gnuradio/usrp/__init__.py 2008-03-27 
22:25:30 UTC (rev 8120)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/usrp/__init__.py 2008-03-28 
01:03:32 UTC (rev 8121)
@@ -0,0 +1,27 @@
+"""
+Copyright 2008 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
+"""
address@hidden grc_gnuradio.usrp
+#Package for external gnuradio blocks.
address@hidden Josh Blum
+
+from simple_usrp import simple_source_c, simple_source_s
+from simple_usrp import dual_source_c, dual_source_s
+from simple_usrp import simple_sink_c, simple_sink_s
+from simple_usrp import dual_sink_c, dual_sink_s
+

Added: grc/branches/grc_reloaded/src/grc_gnuradio/usrp/simple_usrp.py
===================================================================
--- grc/branches/grc_reloaded/src/grc_gnuradio/usrp/simple_usrp.py              
                (rev 0)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/usrp/simple_usrp.py      
2008-03-28 01:03:32 UTC (rev 8121)
@@ -0,0 +1,325 @@
+"""
+Copyright 2008 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
+"""
address@hidden grc_gnuradio.usrp.usrp
+#USRP convenience contructors.
address@hidden Josh Blum
+
+from gnuradio import usrp, gr
+
+def _set_frequency(u, which, subdev, frequency, verbose=False):
+       """!
+       Set the carrier frequency for the given subdevice.      
+       @param u the usrp source/sink
+       @param which specifies the DDC/DUC number
+       @param frequency the carrier frequency in Hz
+       @param verbose if true, print usrp tuning information
+       """
+       r = u.tune(which, subdev, frequency)
+       if verbose and r:       
+               print subdev.side_and_name()
+               print "  r.baseband_frequency =", r.baseband_frequency
+               print "  r.dxc_frequency      =", r.dxc_frequency
+               print "  r.residual_frequency =", r.residual_frequency
+               print "  r.inverted      =", r.inverted
+       elif not r: raise ValueError, '"%s" is not a valid frequency for this 
sub-device\n'%frequency
+               
+def _setup_rx_subdev(u, subdev_spec, ddc, gain, frequency, auto_tr=None, 
rx_ant=None):
+       """!
+       Setup a usrp receive subdevice by setting gain and frequency.
+       Add the gain and frequency callbacks to the flow graph.
+       FlexRF: Handle auto transmit/receive and set the receive antenna. 
+       @param u the usrp object
+       @param subdev_spec the sub-device specification
+       @param ddc which ddc to use: 0 or 1
+       @param gain the gain to set
+       @param frequency the frequency to tune
+       @param auto_tr auto transmit/receive True, False, or None
+       @param rx_ant the receive antenna: 'TX/RX', 'RX2', or None
+       @return the subdevice
+       """
+       subdev = usrp.selected_subdev(u, subdev_spec)#get the subdev
+       subdev.set_gain(gain)   
+       _set_frequency(u, ddc, subdev, frequency, verbose=True)
+       if auto_tr is not None: subdev.set_auto_tr(auto_tr)
+       if rx_ant is not None: subdev.select_rx_antenna(rx_ant)
+       return subdev
+
+def _setup_tx_subdev(u, subdev_spec, gain, frequency, auto_tr=None, 
tx_enb=None):
+       """!
+       Setup a usrp receive subdevice by setting gain and frequency.
+       Add the gain and frequency callbacks to the flow graph.
+       FlexRF: Handle auto transmit/receive and enable the transmitter. 
+       @param u the usrp object
+       @param subdev_spec the sub-device specification
+       @param gain the gain to set
+       @param frequency the frequency to tune
+       @param auto_tr auto transmit/receive True, False, or None
+       @param tx_enb the transmit enable: True, False, or None
+       @return the subdevice
+       """
+       subdev = usrp.selected_subdev(u, subdev_spec)#get the subdev
+       subdev.set_gain(gain)   
+       _set_frequency(u, subdev._which, subdev, frequency, verbose=True)
+       if auto_tr is not None: subdev.set_auto_tr(auto_tr)
+       if tx_enb is not None: subdev.set_enable(tx_enb)
+       return subdev
+
+##map the usrp contructors to IO sizes
+constructor_to_size = {
+       usrp.source_c: gr.sizeof_gr_complex,
+       usrp.sink_c: gr.sizeof_gr_complex,
+       usrp.source_s: gr.sizeof_short,
+       usrp.sink_s: gr.sizeof_short,
+}
+
+####################################################################
+#      Single USRP Source
+####################################################################
+class _simple_source(gr.hier_block2):
+       """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):
+               """!
+               USRP simple source contructor.
+               @param number the unit number
+               @param subdev_spec the sub-device specification tuple
+               @param frequency the frequency to tune
+               @param decimation the device decimation
+               @param gain the gain to set
+               @param mux the mux in hex or None
+               @param auto_tr auto transmit/receive True, False, or None
+               @param rx_ant the receive antenna: 'TX/RX', 'RX2', or None
+               """
+               #initialize hier2 block
+               gr.hier_block2.__init__(
+                       self, 'usrp_simple_source', 
+                       gr.io_signature(0, 0, 0), 
+                       gr.io_signature(1, 1, 
constructor_to_size[self.constructor]),
+               )
+               #create usrp object
+               self.u = u = self.constructor(number, nchan=1)
+               if subdev_spec is None: subdev_spec = 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)
+               u.set_mux(mux)                  
+               self.subdev = _setup_rx_subdev(u, subdev_spec, 0, gain, 
frequency, auto_tr, rx_ant)                     
+               #connect
+               self.connect(u, self)
+       
+       def set_frequency(self, frequency):
+               """!
+               Set the frequency of the subdevice.
+               @param frequency the frequency to tune
+               """
+               _set_frequency(self.u, 0, self.subdev, frequency)
+               
+       def set_gain(self, gain):
+               """!
+               Set the gain of the subdevice.
+               @param gain the gain to set
+               """
+               self.subdev.set_gain(gain)
+
+class simple_source_c(_simple_source): constructor = usrp.source_c
+class simple_source_s(_simple_source): constructor = usrp.source_s
+
+####################################################################
+#      Dual USRP Source
+####################################################################
+class _dual_source(gr.hier_block2):
+       """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):
+               """!
+               USRP dual source contructor.
+               @param number the unit number
+               @param frequency_a the frequency to tune side a
+               @param frequency_b the frequency to tune side b
+               @param decimation the device decimation
+               @param gain_a the gain to set side a
+               @param gain_b the gain to set side b
+               @param mux the mux in hex
+               @param auto_tr auto transmit/receive True, False, or None
+               @param rx_ant_a the receive antenna side a: 'TX/RX', 'RX2', or 
None
+               @param rx_ant_b the receive antenna side b: 'TX/RX', 'RX2', or 
None
+               """
+               #initialize hier2 block
+               gr.hier_block2.__init__(
+                       self, 'usrp_dual_source', 
+                       gr.io_signature(0, 0, 0), 
+                       gr.io_signature(2, 2, 
constructor_to_size[self.constructor]),
+               )
+               #create usrp object
+               self.u = u = self.constructor(number, nchan=2)
+               u.set_decim_rate(decimation)
+               u.set_mux(mux)                  
+               self.subdev_a = _setup_rx_subdev(u, (0, 0), 0, gain_a, 
frequency_a, auto_tr, rx_ant_a)          
+               self.subdev_b = _setup_rx_subdev(u, (1, 0), 1, gain_b, 
frequency_b, auto_tr, rx_ant_b)                  
+               #connect
+               deinter = gr.deinterleave(constructor_to_size[self.constructor])
+               self.connect(u, deinter)
+               for i in range(2): self.connect((deinter, i), (self, i))
+       
+       def set_frequency_a(self, frequency):
+               """!
+               Set the frequency of the subdevice.
+               @param frequency the frequency to tune
+               """
+               _set_frequency(self.u, 0, self.subdev_a, frequency)
+               
+       def set_gain_a(self, gain):
+               """!
+               Set the gain of the subdevice.
+               @param gain the gain to set
+               """
+               self.subdev_a.set_gain(gain)
+               
+       def set_frequency_b(self, frequency):
+               """!
+               Set the frequency of the subdevice.
+               @param frequency the frequency to tune
+               """
+               _set_frequency(self.u, 0, self.subdev_b, frequency)
+               
+       def set_gain_b(self, gain):
+               """!
+               Set the gain of the subdevice.
+               @param gain the gain to set
+               """
+               self.subdev_b.set_gain(gain)
+
+class dual_source_c(_dual_source): constructor = usrp.source_c
+class dual_source_s(_dual_source): constructor = usrp.source_s
+
+####################################################################
+#      Single USRP Sink
+####################################################################
+class _simple_sink(gr.hier_block2):
+       """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):
+               """!
+               USRP simple sink contructor.
+               @param number the unit number
+               @param subdev_spec the sub-device specification tuple
+               @param frequency the frequency to tune
+               @param interpolation the device interpolation
+               @param gain the gain to set
+               @param mux the mux in hex or None
+               @param auto_tr auto transmit/receive True, False, or None
+               @param tx_enb the transmit enable: True, False, or None
+               """
+               #initialize hier2 block
+               gr.hier_block2.__init__(
+                       self, 'usrp_simple_sink', 
+                       gr.io_signature(1, 1, 
constructor_to_size[self.constructor]),
+                       gr.io_signature(0, 0, 0), 
+               )
+               #create usrp object
+               self.u = u = self.constructor(number, nchan=1)
+               if subdev_spec is None: subdev_spec = 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)
+               u.set_mux(mux)                  
+               self.subdev = _setup_tx_subdev(u, subdev_spec, gain, frequency, 
auto_tr, tx_enb)                        
+               #connect
+               self.connect(self, u)
+       
+       def set_frequency(self, frequency):
+               """!
+               Set the frequency of the subdevice.
+               @param frequency the frequency to tune
+               """
+               _set_frequency(self.u, 0, self.subdev, frequency)
+               
+       def set_gain(self, gain):
+               """!
+               Set the gain of the subdevice.
+               @param gain the gain to set
+               """
+               self.subdev.set_gain(gain)
+
+class simple_sink_c(_simple_sink): constructor = usrp.sink_c
+class simple_sink_s(_simple_sink): constructor = usrp.sink_s
+
+####################################################################
+#      Dual USRP Sink
+####################################################################
+class _dual_sink(gr.hier_block2):
+       """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):
+               """!
+               USRP dual sink contructor.
+               @param number the unit number
+               @param subdev_spec the sub-device specification tuple
+               @param frequency the frequency to tune
+               @param interpolation the device interpolation
+               @param gain the gain to set
+               @param mux the mux in hex or None
+               @param auto_tr auto transmit/receive True, False, or None
+               @param tx_enb the transmit enable: True, False, or None
+               """
+               #initialize hier2 block
+               gr.hier_block2.__init__(
+                       self, 'usrp_dual_sink', 
+                       gr.io_signature(2, 2, 
constructor_to_size[self.constructor]),
+                       gr.io_signature(0, 0, 0), 
+               )
+               #create usrp object
+               self.u = u = self.constructor(number, nchan=2)
+               u.set_interp_rate(interpolation)
+               u.set_mux(mux)                  
+               self.subdev_a = _setup_tx_subdev(u, (0, 0), gain_a, 
frequency_a, auto_tr, tx_enb_a)
+               self.subdev_b = _setup_tx_subdev(u, (0, 0), gain_b, 
frequency_b, auto_tr, tx_enb_b)                     
+               #connect
+               inter = gr.interleaver(constructor_to_size[self.constructor])
+               self.connect(inter, u)
+               for i in range(2): self.connect((self, i), (inter, i))
+       
+       def set_frequency_a(self, frequency):
+               """!
+               Set the frequency of the subdevice.
+               @param frequency the frequency to tune
+               """
+               _set_frequency(self.u, 0, self.subdev_a, frequency)
+               
+       def set_gain_a(self, gain):
+               """!
+               Set the gain of the subdevice.
+               @param gain the gain to set
+               """
+               self.subdev.set_gain_a(gain)
+               
+       def set_frequency_b(self, frequency):
+               """!
+               Set the frequency of the subdevice.
+               @param frequency the frequency to tune
+               """
+               _set_frequency(self.u, 0, self.subdev_b, frequency)
+               
+       def set_gain_b(self, gain):
+               """!
+               Set the gain of the subdevice.
+               @param gain the gain to set
+               """
+               self.subdev.set_gain_b(gain)
+
+class dual_sink_c(_dual_sink): constructor = usrp.sink_c
+class dual_sink_s(_dual_sink): constructor = usrp.sink_s





reply via email to

[Prev in Thread] Current Thread [Next in Thread]