commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r10407 - in gnuradio/branches/releases/3.2: config grc


From: jcorgan
Subject: [Commit-gnuradio] r10407 - in gnuradio/branches/releases/3.2: config grc/data/platforms/python grc/data/platforms/python/blocks grc/scripts grc/src/grc_gnuradio/usrp grc/src/gui grc/src/platforms/base grc/src/platforms/gui grc/src/platforms/python grc/src/utils usrp/host/lib/legacy
Date: Sun, 8 Feb 2009 13:51:55 -0700 (MST)

Author: jcorgan
Date: 2009-02-08 13:51:55 -0700 (Sun, 08 Feb 2009)
New Revision: 10407

Modified:
   gnuradio/branches/releases/3.2/config/gr_python.m4
   gnuradio/branches/releases/3.2/config/grc_grc.m4
   
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/gr_threshold_ff.xml
   gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/options.xml
   
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_dual_sink_x.xml
   
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_dual_source_x.xml
   
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_probe.xml
   
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_simple_sink_x.xml
   
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_simple_source_x.xml
   gnuradio/branches/releases/3.2/grc/data/platforms/python/flow_graph.tmpl
   gnuradio/branches/releases/3.2/grc/scripts/usrp_probe
   gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/common.py
   gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/dual_usrp.py
   gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/simple_usrp.py
   gnuradio/branches/releases/3.2/grc/src/gui/Messages.py
   gnuradio/branches/releases/3.2/grc/src/platforms/base/Block.py
   gnuradio/branches/releases/3.2/grc/src/platforms/base/Connection.py
   gnuradio/branches/releases/3.2/grc/src/platforms/base/Element.py
   gnuradio/branches/releases/3.2/grc/src/platforms/base/Param.py
   gnuradio/branches/releases/3.2/grc/src/platforms/base/Port.py
   gnuradio/branches/releases/3.2/grc/src/platforms/gui/Param.py
   gnuradio/branches/releases/3.2/grc/src/platforms/python/Block.py
   gnuradio/branches/releases/3.2/grc/src/platforms/python/Param.py
   gnuradio/branches/releases/3.2/grc/src/platforms/python/Port.py
   gnuradio/branches/releases/3.2/grc/src/utils/__init__.py
   gnuradio/branches/releases/3.2/usrp/host/lib/legacy/db_xcvr2450.cc
Log:
Merged r10367:10369, r10376, r10389, r10391, r10399, r10400:10404 from trunk 
into release-3.2 branch

Modified: gnuradio/branches/releases/3.2/config/gr_python.m4
===================================================================
--- gnuradio/branches/releases/3.2/config/gr_python.m4  2009-02-08 20:35:06 UTC 
(rev 10406)
+++ gnuradio/branches/releases/3.2/config/gr_python.m4  2009-02-08 20:51:55 UTC 
(rev 10407)
@@ -135,20 +135,32 @@
 # $2 - module description
 # $3 - action if found
 # $4 - action if not found
+# $5 - test command
 
 AC_DEFUN([PYTHON_CHECK_MODULE],[
-    AC_MSG_CHECKING([for $2]) 
-    python_cmd='import sys
+    AC_MSG_CHECKING([for $2])
+    dnl ########################################
+    dnl # import and test checking
+    dnl ########################################
+    if test "$5"; then
+        python_cmd='
 try:
     import $1
-except:
-    sys.exit(1)'
-
-    if ! $PYTHON -c "$python_cmd" ; then
-       AC_MSG_RESULT([no])
-       $4
+    assert $5
+except: exit(1)'
+    dnl ########################################
+    dnl # import checking only
+    dnl ########################################
     else
-       AC_MSG_RESULT([yes])
-       $3
+        python_cmd='
+try: import $1
+except: exit(1)'
     fi
+    if ! $PYTHON -c "$python_cmd" 2> /dev/null; then
+        AC_MSG_RESULT([no])
+        $4
+    else
+        AC_MSG_RESULT([yes])
+        $3
+    fi
 ])

Modified: gnuradio/branches/releases/3.2/config/grc_grc.m4
===================================================================
--- gnuradio/branches/releases/3.2/config/grc_grc.m4    2009-02-08 20:35:06 UTC 
(rev 10406)
+++ gnuradio/branches/releases/3.2/config/grc_grc.m4    2009-02-08 20:51:55 UTC 
(rev 10407)
@@ -26,41 +26,16 @@
     AM_CONDITIONAL(XDG_UTILS, $XDG_UTILS)
 
     dnl ########################################
-    dnl # test python version
+    dnl # test python modules and versions
     dnl ########################################
-    AC_MSG_CHECKING([for Python version >= 2.5])
-    result=`${PYTHON} -c "import sys; print sys.version.split()[[0]] >= '2.5'"`
-    if test "$result" = "True"; then
-        AC_MSG_RESULT([yes])
-    else
-        AC_MSG_RESULT([no])
-        passed=no
-    fi
-
-    dnl ########################################
-    dnl # test python dependencies
-    dnl ########################################
     if test $passed = yes; then
-        PYTHON_CHECK_MODULE([Cheetah],[Python Cheetah 
templates],[],[passed=no])
-        PYTHON_CHECK_MODULE([lxml],[Python XML wrappers],[],[passed=no])
-        PYTHON_CHECK_MODULE([pygtk],[Python GTK wrappers],[],[passed=no])
+        PYTHON_CHECK_MODULE([sys],[Python >= 
2.5],[],[passed=no],[sys.version.split()[[0]] >= "2.5"])
+        PYTHON_CHECK_MODULE([Cheetah],[Python Cheetah templates >= 
2.0.0],[],[passed=no],[Cheetah.Version >= "2.0.0"])
+        PYTHON_CHECK_MODULE([lxml.etree],[Python lxml wrappers >= 
2.0.0],[],[passed=no],[lxml.etree.LXML_VERSION >= (2, 0, 0, 0)])
+        PYTHON_CHECK_MODULE([gtk],[Python gtk wrappers >= 
2.10.0],[],[passed=no],[gtk.pygtk_version >= (2, 10, 0)])
     fi
 
     dnl ########################################
-    dnl # test gtk version
-    dnl ########################################
-    if test $passed = yes; then
-        AC_MSG_CHECKING([for Python GTK version >= 2.10.0])
-        result=`${PYTHON} -c "import gtk; print gtk.pygtk_version >= (2, 10, 
0)" 2> /dev/null`
-        if test "$result" = "True"; then
-            AC_MSG_RESULT([yes])
-        else
-            AC_MSG_RESULT([no])
-            passed=no
-        fi
-    fi
-
-    dnl ########################################
     dnl # platform dependency pythonw
     dnl ########################################
     dnl FIXME: move this test to Python config m4

Modified: 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/gr_threshold_ff.xml
===================================================================
--- 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/gr_threshold_ff.xml
 2009-02-08 20:35:06 UTC (rev 10406)
+++ 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/gr_threshold_ff.xml
 2009-02-08 20:51:55 UTC (rev 10407)
@@ -9,6 +9,8 @@
        <key>gr_threshold_ff</key>
        <import>from gnuradio import gr</import>
        <make>gr.threshold_ff($low, $high, $init)</make>
+       <callback>set_hi($high)</callback>
+       <callback>set_lo($low)</callback>
        <param>
                <name>Low</name>
                <key>low</key>

Modified: 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/options.xml
===================================================================
--- gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/options.xml 
2009-02-08 20:35:06 UTC (rev 10406)
+++ gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/options.xml 
2009-02-08 20:51:55 UTC (rev 10407)
@@ -49,17 +49,14 @@
                <option>
                        <name>WX GUI</name>
                        <key>wx_gui</key>
-                       <opt>hide_category:all</opt>
                </option>
                <option>
                        <name>No GUI</name>
                        <key>no_gui</key>
-                       <opt>hide_category:all</opt>
                </option>
                <option>
                        <name>Hier Block</name>
                        <key>hb</key>
-                       <opt>hide_category:</opt>
                </option>
        </param>
        <param>
@@ -67,8 +64,29 @@
                <key>category</key>
                <value>Custom</value>
                <type>string</type>
-               <hide>$generate_options.hide_category</hide>
+               <hide>#if $generate_options.eval == 'hb' then 'none' else 
'all'#</hide>
        </param>
+       <param>
+               <name>Realtime Scheduling</name>
+               <key>realtime_scheduling</key>
+               <value></value>
+               <type>enum</type>
+               <hide>#if $generate_options.eval == 'hb'
+all#slurp
+#elif $realtime_scheduling.eval
+none#slurp
+#else
+part#slurp
+#end if</hide>
+               <option>
+                       <name>Off</name>
+                       <key></key>
+               </option>
+               <option>
+                       <name>On</name>
+                       <key>1</key>
+               </option>
+       </param>
        <check>len($window_size) == 2</check>
        <check>300 &lt;= $(window_size)[0] &lt;= 2048</check>
        <check>300 &lt;= $(window_size)[1] &lt;= 2048</check>

Modified: 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_dual_sink_x.xml
===================================================================
--- 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_dual_sink_x.xml
        2009-02-08 20:35:06 UTC (rev 10406)
+++ 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_dual_sink_x.xml
        2009-02-08 20:51:55 UTC (rev 10407)
@@ -8,7 +8,7 @@
        <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)
+       <make>grc_usrp.dual_sink_$(type.fcn)(which=$which)
 #if $format.eval
 self.$(id).set_format(width=$format.width, shift=$format.shift)
 #end if
@@ -20,20 +20,20 @@
 ##################################################
 ## Flex RF A
 ##################################################
-#if $tx_enb_a.eval
-self.$(id).set_enable_a($tx_enb_a)
+#if $transmit_a.tx_enb
+self.$(id).set_enable_a(True)
 #end if
-#if $auto_tr_a.eval and $tx_enb_a.eval
-self.$(id).set_auto_tr_a($auto_tr_a)
+#if $transmit_a.auto_tr
+self.$(id).set_auto_tr_a(True)
 #end if
 ##################################################
 ## Flex RF B
 ##################################################
-#if $tx_enb_b.eval
-self.$(id).set_enable_b($tx_enb_b)
+#if $transmit_b.tx_enb
+self.$(id).set_enable_b(True)
 #end if
-#if $auto_tr_b.eval and $tx_enb_b.eval
-self.$(id).set_auto_tr_b($auto_tr_b)
+#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)</callback>
@@ -76,7 +76,7 @@
        </param>
        <param>
                <name>Unit Number</name>
-               <key>number</key>
+               <key>which</key>
                <value>0</value>
                <type>int</type>
        </param>
@@ -111,92 +111,60 @@
 ###################################################
  -->
        <param>
-               <name>TX Enable A</name>
-               <key>tx_enb_a</key>
+               <name>Transmit A</name>
+               <key>transmit_a</key>
                <value></value>
                <type>enum</type>
-               <hide>$tx_enb_a.hide</hide>
+               <hide>#if $transmit_a.tx_enb then 'none' else 'part'#</hide>
                <option>
                        <name>Unconfigured</name>
                        <key></key>
-                       <opt>hide:part</opt>
+                       <opt>tx_enb:</opt>
+                       <opt>auto_tr:</opt>
                </option>
                <option>
                        <name>Enable</name>
-                       <key>True</key>
-                       <opt>hide:none</opt>
+                       <key>tx_enb</key>
+                       <opt>tx_enb:1</opt>
+                       <opt>auto_tr:</opt>
                </option>
                <option>
-                       <name>Disable</name>
-                       <key>False</key>
-                       <opt>hide:none</opt>
+                       <name>Auto T/R</name>
+                       <key>auto_tr</key>
+                       <opt>tx_enb:1</opt>
+                       <opt>auto_tr:1</opt>
                </option>
        </param>
-       <param>
-               <name>Auto T/R A</name>
-               <key>auto_tr_a</key>
-               <value></value>
-               <type>enum</type>
-               <hide>#if $tx_enb_a.eval then 'none' else 'all'#</hide>
-               <option>
-                       <name>Auto</name>
-                       <key></key>
-               </option>
-               <option>
-                       <name>Enable</name>
-                       <key>True</key>
-               </option>
-               <option>
-                       <name>Disable</name>
-                       <key>False</key>
-               </option>
-       </param>
 <!--
 ###################################################
 ## Flex RF B
 ###################################################
  -->
        <param>
-               <name>TX Enable B</name>
-               <key>tx_enb_b</key>
+               <name>Transmit B</name>
+               <key>transmit_b</key>
                <value></value>
                <type>enum</type>
-               <hide>$tx_enb_b.hide</hide>
+               <hide>#if $transmit_b.tx_enb then 'none' else 'part'#</hide>
                <option>
                        <name>Unconfigured</name>
                        <key></key>
-                       <opt>hide:part</opt>
+                       <opt>tx_enb:</opt>
+                       <opt>auto_tr:</opt>
                </option>
                <option>
                        <name>Enable</name>
-                       <key>True</key>
-                       <opt>hide:none</opt>
+                       <key>tx_enb</key>
+                       <opt>tx_enb:1</opt>
+                       <opt>auto_tr:</opt>
                </option>
                <option>
-                       <name>Disable</name>
-                       <key>False</key>
-                       <opt>hide:none</opt>
+                       <name>Auto T/R</name>
+                       <key>auto_tr</key>
+                       <opt>tx_enb:1</opt>
+                       <opt>auto_tr:1</opt>
                </option>
        </param>
-       <param>
-               <name>Auto T/R B</name>
-               <key>auto_tr_b</key>
-               <value></value>
-               <type>enum</type>
-               <hide>#if $tx_enb_b.eval then 'none' else 'all'#</hide>
-               <option>
-                       <name>Auto</name>
-                       <key></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>
@@ -208,10 +176,8 @@
        <doc>
 The USRP sink inputs 128 Megasamples per second / interpolation.
 
-Flex RF boards only: The "Transmit Enable" configures the transmitter to be on 
or off. \
-Do not leave this unconfigured.
-
-Flex RF boards only: If enabled, "Auto Transmit/Receive Switching" handles the 
preference for transmit packets vs receive packets. \
-By default, "Auto TR" is disabled.
+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>

Modified: 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_dual_source_x.xml
===================================================================
--- 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_dual_source_x.xml
      2009-02-08 20:35:06 UTC (rev 10406)
+++ 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_dual_source_x.xml
      2009-02-08 20:51:55 UTC (rev 10407)
@@ -8,7 +8,7 @@
        <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, 
side_a='$rx_ant_a.side', rx_ant_a='$rx_ant_a.rx_ant', side_b='$rx_ant_b.side', 
rx_ant_b='$rx_ant_b.rx_ant')
+       <make>grc_usrp.dual_source_$(type.fcn)(which=$which, 
side_a='$rx_ant_a.side', rx_ant_a='$rx_ant_a.rx_ant', side_b='$rx_ant_b.side', 
rx_ant_b='$rx_ant_b.rx_ant')
 #if $format.eval
 self.$(id).set_format(width=$format.width, shift=$format.shift)
 #end if
@@ -16,19 +16,7 @@
 self.$(id).set_frequency_a($frequency_a, verbose=True)
 self.$(id).set_frequency_b($frequency_b, verbose=True)
 self.$(id).set_gain_a($gain_a)
-self.$(id).set_gain_b($gain_b)
-##################################################
-## Flex RF A
-##################################################
-#if $auto_tr_a.eval and $rx_ant_a.flex
-self.$(id).set_auto_tr_a($auto_tr_a)
-#end if
-##################################################
-## Flex RF B
-##################################################
-#if $auto_tr_b.eval and $rx_ant_b.flex
-self.$(id).set_auto_tr_b($auto_tr_b)
-#end if</make>
+self.$(id).set_gain_b($gain_b)</make>
        <callback>set_decim_rate($decimation)</callback>
        <callback>set_frequency_a($frequency_a)</callback>
        <callback>set_frequency_b($frequency_b)</callback>
@@ -70,7 +58,7 @@
        </param>
        <param>
                <name>Unit Number</name>
-               <key>number</key>
+               <key>which</key>
                <value>0</value>
                <type>int</type>
        </param>
@@ -101,7 +89,7 @@
        </param>
 <!--
 ###################################################
-## Flex RF A
+## Antenna A
 ###################################################
  -->
        <param>
@@ -144,28 +132,9 @@
                        <opt>flex:</opt>
                </option>
        </param>
-       <param>
-               <name>Auto T/R A</name>
-               <key>auto_tr_a</key>
-               <value></value>
-               <type>enum</type>
-               <hide>#if $rx_ant_a.flex then 'none' else 'all'#</hide>
-               <option>
-                       <name>Auto</name>
-                       <key></key>
-               </option>
-               <option>
-                       <name>Enable</name>
-                       <key>True</key>
-               </option>
-               <option>
-                       <name>Disable</name>
-                       <key>False</key>
-               </option>
-       </param>
 <!--
 ###################################################
-## Flex RF B
+## Antenna B
 ###################################################
  -->
        <param>
@@ -208,25 +177,6 @@
                        <opt>flex:</opt>
                </option>
        </param>
-       <param>
-               <name>Auto T/R B</name>
-               <key>auto_tr_b</key>
-               <value></value>
-               <type>enum</type>
-               <hide>#if $rx_ant_b.flex then 'none' else 'all'#</hide>
-               <option>
-                       <name>Auto</name>
-                       <key></key>
-               </option>
-               <option>
-                       <name>Enable</name>
-                       <key>True</key>
-               </option>
-               <option>
-                       <name>Disable</name>
-                       <key>False</key>
-               </option>
-       </param>
        <check>'$rx_ant_a' != '$rx_ant_b'</check>
        <source>
                <name>Aout</name>

Modified: 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_probe.xml
===================================================================
--- 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_probe.xml  
    2009-02-08 20:35:06 UTC (rev 10406)
+++ 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_probe.xml  
    2009-02-08 20:51:55 UTC (rev 10407)
@@ -10,8 +10,8 @@
        <key>usrp_probe</key>
        <make></make>
        <param>
-               <name>USRP Number</name>
-               <key>number</key>
+               <name>Unit Number</name>
+               <key>which</key>
                <value>0</value>
                <type>int</type>
        </param>

Modified: 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_simple_sink_x.xml
===================================================================
--- 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_simple_sink_x.xml
      2009-02-08 20:35:06 UTC (rev 10406)
+++ 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_simple_sink_x.xml
      2009-02-08 20:51:55 UTC (rev 10407)
@@ -8,18 +8,18 @@
        <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, side='$side')
+       <make>grc_usrp.simple_sink_$(type.fcn)(which=$which, side='$side')
 #if $format.eval
 self.$(id).set_format(width=$format.width, shift=$format.shift)
 #end if
 self.$(id).set_interp_rate($interpolation)
 self.$(id).set_frequency($frequency, verbose=True)
 self.$(id).set_gain($gain)
-#if $tx_enb.eval
-self.$(id).set_enable($tx_enb)
+#if $transmit.tx_enb
+self.$(id).set_enable(True)
 #end if
-#if $auto_tr.eval and $tx_enb.eval
-self.$(id).set_auto_tr($auto_tr)
+#if $transmit.auto_tr
+self.$(id).set_auto_tr(True)
 #end if</make>
        <callback>set_interp_rate($interpolation)</callback>
        <callback>set_frequency($frequency)</callback>
@@ -60,7 +60,7 @@
        </param>
        <param>
                <name>Unit Number</name>
-               <key>number</key>
+               <key>which</key>
                <value>0</value>
                <type>int</type>
        </param>
@@ -94,46 +94,30 @@
                </option>
        </param>
        <param>
-               <name>TX Enable</name>
-               <key>tx_enb</key>
+               <name>Transmit</name>
+               <key>transmit</key>
                <value></value>
                <type>enum</type>
-               <hide>$tx_enb.hide</hide>
+               <hide>#if $transmit.tx_enb then 'none' else 'part'#</hide>
                <option>
                        <name>Unconfigured</name>
                        <key></key>
-                       <opt>hide:part</opt>
+                       <opt>tx_enb:</opt>
+                       <opt>auto_tr:</opt>
                </option>
                <option>
                        <name>Enable</name>
-                       <key>True</key>
-                       <opt>hide:none</opt>
+                       <key>tx_enb</key>
+                       <opt>tx_enb:1</opt>
+                       <opt>auto_tr:</opt>
                </option>
                <option>
-                       <name>Disable</name>
-                       <key>False</key>
-                       <opt>hide:none</opt>
+                       <name>Auto T/R</name>
+                       <key>auto_tr</key>
+                       <opt>tx_enb:1</opt>
+                       <opt>auto_tr:1</opt>
                </option>
        </param>
-       <param>
-               <name>Auto T/R</name>
-               <key>auto_tr</key>
-               <value></value>
-               <type>enum</type>
-               <hide>#if $tx_enb.eval then 'none' else 'all'#</hide>
-               <option>
-                       <name>Auto</name>
-                       <key></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>
@@ -141,10 +125,8 @@
        <doc>
 The USRP sink inputs 128 Megasamples per second / interpolation.
 
-Flex RF boards only: The "Transmit Enable" configures the transmitter to be on 
or off. \
-Do not leave this unconfigured.
-
-Flex RF boards only: If enabled, "Auto Transmit/Receive Switching" handles the 
preference for transmit packets vs receive packets. \
-By default, "Auto TR" is disabled.
+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>

Modified: 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_simple_source_x.xml
===================================================================
--- 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_simple_source_x.xml
    2009-02-08 20:35:06 UTC (rev 10406)
+++ 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_simple_source_x.xml
    2009-02-08 20:51:55 UTC (rev 10407)
@@ -8,16 +8,13 @@
        <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, side='$side', 
rx_ant='$rx_ant')
+       <make>grc_usrp.simple_source_$(type.fcn)(which=$which, side='$side', 
rx_ant='$rx_ant'#if $hb_filters.eval then ', no_hb=True' else ''#)
 #if $format.eval
 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)
-self.$(id).set_gain($gain)
-#if $auto_tr.eval and $rx_ant.flex
-self.$(id).set_auto_tr($auto_tr)
-#end if</make>
+self.$(id).set_gain($gain)</make>
        <callback>set_decim_rate($decimation)</callback>
        <callback>set_frequency($frequency)</callback>
        <callback>set_gain($gain)</callback>
@@ -57,7 +54,7 @@
        </param>
        <param>
                <name>Unit Number</name>
-               <key>number</key>
+               <key>which</key>
                <value>0</value>
                <type>int</type>
        </param>
@@ -117,22 +114,18 @@
                </option>
        </param>
        <param>
-               <name>Auto T/R</name>
-               <key>auto_tr</key>
+               <name>Halfband Filters</name>
+               <key>hb_filters</key>
                <value></value>
                <type>enum</type>
-               <hide>#if $rx_ant.flex then 'none' else 'all'#</hide>
+               <hide>#if $hb_filters.eval then 'none' else 'part'#</hide>
                <option>
-                       <name>Auto</name>
+                       <name>Enable</name>
                        <key></key>
                </option>
                <option>
-                       <name>Enable</name>
-                       <key>True</key>
-               </option>
-               <option>
                        <name>Disable</name>
-                       <key>False</key>
+                       <key>1</key>
                </option>
        </param>
        <source>
@@ -149,5 +142,9 @@
 
 Flex RF boards only: If enabled, "Auto Transmit/Receive Switching" handles the 
preference for transmit packets vs receive packets. \
 By default, "Auto TR" is disabled.
+
+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>

Modified: 
gnuradio/branches/releases/3.2/grc/data/platforms/python/flow_graph.tmpl
===================================================================
--- gnuradio/branches/releases/3.2/grc/data/platforms/python/flow_graph.tmpl    
2009-02-08 20:35:06 UTC (rev 10406)
+++ gnuradio/branches/releases/3.2/grc/data/platforms/python/flow_graph.tmpl    
2009-02-08 20:51:55 UTC (rev 10407)
@@ -191,6 +191,10 @@
                #end for
        (options, args) = parser.parse_args()
        #end if
+       #if $flow_graph.get_option('realtime_scheduling')
+       if gr.enable_realtime_scheduling() != gr.RT_OK:
+               print "Error: failed to enable realtime scheduling."
+       #end if
        tb = $(class_name)($(', '.join($args)))
        #if $generate_options == 'wx_gui'
        tb.Run()

Modified: gnuradio/branches/releases/3.2/grc/scripts/usrp_probe
===================================================================
--- gnuradio/branches/releases/3.2/grc/scripts/usrp_probe       2009-02-08 
20:35:06 UTC (rev 10406)
+++ gnuradio/branches/releases/3.2/grc/scripts/usrp_probe       2009-02-08 
20:51:55 UTC (rev 10407)
@@ -37,7 +37,7 @@
 block = flow_graph.get_new_block('usrp_probe')
 
 ##all params
-usrp_number_param = block.get_param('number')
+usrp_which_param = block.get_param('which')
 usrp_dboard_param = block.get_param('dboard')
 
 class USRPProbeWindow(gtk.Window):
@@ -66,7 +66,7 @@
                #create vbox for storage
                vbox = gtk.VBox()
                frame.add(vbox)
-               vbox.pack_start(usrp_number_param.get_input_object(), False)
+               vbox.pack_start(usrp_which_param.get_input_object(), False)
                vbox.pack_start(usrp_dboard_param.get_input_object(), False)
                self.probe_button = gtk.Button('Probe')
                self.probe_button.connect('clicked', self._probe_usrp)
@@ -88,7 +88,7 @@
                        make = usrp.sink_c
                        get_mux = usrp.determine_tx_mux_value
                try:
-                       u = make(usrp_number_param.evaluate())
+                       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"

Modified: gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/common.py
===================================================================
--- gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/common.py  
2009-02-08 20:35:06 UTC (rev 10406)
+++ gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/common.py  
2009-02-08 20:51:55 UTC (rev 10407)
@@ -28,14 +28,14 @@
        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, which, subdev, frequency, verbose=False):
+       def _set_frequency(self, chan, subdev, frequency, verbose=False):
                """
                Set the carrier frequency for the given subdevice.
-               @param which specifies the DDC/DUC number
+               @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(which, subdev, frequency)
+               r = self._get_u().tune(chan, subdev, frequency)
                if not verbose: return
                print subdev.side_and_name()
                if r:

Modified: gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/dual_usrp.py
===================================================================
--- gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/dual_usrp.py       
2009-02-08 20:35:06 UTC (rev 10406)
+++ gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/dual_usrp.py       
2009-02-08 20:51:55 UTC (rev 10407)
@@ -27,10 +27,10 @@
 class _dual_source(gr.hier_block2):
        """A dual usrp source of IO type short or complex."""
 
-       def __init__(self, number, side_a='A', rx_ant_a='RXA', side_b='B', 
rx_ant_b='RXA'):
+       def __init__(self, which, side_a='A', rx_ant_a='RXA', side_b='B', 
rx_ant_b='RXA'):
                """
                USRP dual source contructor.
-               @param number the unit number
+               @param which the unit number
                @param side_a A or B
                @param rx_ant_a the antenna choice
                @param side_b A or B
@@ -43,7 +43,7 @@
                        gr.io_signature(2, 2, self._get_io_size()),
                )
                #create usrp object
-               self._make_usrp(number, nchan=2)
+               self._make_usrp(which=which, nchan=2)
                #get the mux for output A
                subdev_spec_a = common.to_spec(side_a, rx_ant_a)
                self._subdev_a = usrp.selected_subdev(self._get_u(), 
subdev_spec_a)
@@ -62,22 +62,20 @@
        def set_decim_rate(self, decim): 
self._get_u().set_decim_rate(int(decim))
        def set_frequency_a(self, frequency, verbose=False):
                self._set_frequency(
-                       which=0, #ddc0
+                       chan=0, #ddc0
                        subdev=self._subdev_a,
                        frequency=frequency,
                        verbose=verbose,
                )
        def set_frequency_b(self, frequency, verbose=False):
                self._set_frequency(
-                       which=1, #ddc1
+                       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)
-       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_source_c(_dual_source, common.usrp_source_c): pass
 class dual_source_s(_dual_source, common.usrp_source_s): pass
@@ -88,10 +86,10 @@
 class _dual_sink(gr.hier_block2):
        """A dual usrp sink of IO type short or complex."""
 
-       def __init__(self, number):
+       def __init__(self, which):
                """
                USRP simple sink contructor.
-               @param number the unit number
+               @param which the unit number
                """
                #initialize hier2 block
                gr.hier_block2.__init__(
@@ -100,7 +98,7 @@
                        gr.io_signature(0, 0, 0),
                )
                #create usrp object
-               self._make_usrp(number, nchan=2)
+               self._make_usrp(which=which, nchan=2)
                #get the mux for side A
                subdev_spec_a = common.to_spec('A')
                self._subdev_a = usrp.selected_subdev(self._get_u(), 
subdev_spec_a)
@@ -119,14 +117,14 @@
        def set_interp_rate(self, interp): 
self._get_u().set_interp_rate(int(interp))
        def set_frequency_a(self, frequency, verbose=False):
                self._set_frequency(
-                       which=self._subdev_a.which(),
+                       chan=self._subdev_a.which(),
                        subdev=self._subdev_a,
                        frequency=frequency,
                        verbose=verbose,
                )
        def set_frequency_b(self, frequency, verbose=False):
                self._set_frequency(
-                       which=self._subdev_b.which(),
+                       chan=self._subdev_b.which(),
                        subdev=self._subdev_b,
                        frequency=frequency,
                        verbose=verbose,

Modified: 
gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/simple_usrp.py
===================================================================
--- gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/simple_usrp.py     
2009-02-08 20:35:06 UTC (rev 10406)
+++ gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/simple_usrp.py     
2009-02-08 20:51:55 UTC (rev 10407)
@@ -27,13 +27,15 @@
 class _simple_source(gr.hier_block2):
        """A single usrp source of IO type short or complex."""
 
-       def __init__(self, number, side='A', rx_ant='RXA'):
+       def __init__(self, which, side='A', rx_ant='RXA', no_hb=False):
                """
                USRP simple source contructor.
-               @param number the unit number
+               @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',
@@ -41,7 +43,8 @@
                        gr.io_signature(1, 1, self._get_io_size()),
                )
                #create usrp object
-               self._make_usrp(number, nchan=1)
+               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(usrp.determine_rx_mux_value(self._get_u(), subdev_spec))
                self._subdev = usrp.selected_subdev(self._get_u(), subdev_spec)
@@ -49,16 +52,18 @@
                #connect
                self.connect(self._get_u(), self)
 
-       def set_decim_rate(self, decim): 
self._get_u().set_decim_rate(int(decim))
+       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):
                self._set_frequency(
-                       which=0, #ddc0
+                       chan=0, #ddc0
                        subdev=self._subdev,
                        frequency=frequency,
                        verbose=verbose,
                )
        def set_gain(self, gain): self._subdev.set_gain(gain)
-       def set_auto_tr(self, auto_tr): self._subdev.set_auto_tr(auto_tr)
 
 class simple_source_c(_simple_source, common.usrp_source_c): pass
 class simple_source_s(_simple_source, common.usrp_source_s): pass
@@ -69,10 +74,10 @@
 class _simple_sink(gr.hier_block2):
        """A single usrp sink of IO type short or complex."""
 
-       def __init__(self, number, side='A'):
+       def __init__(self, which, side='A'):
                """
                USRP simple sink contructor.
-               @param number the unit number
+               @param which the unit number
                @param side the usrp side A or B
                """
                #initialize hier2 block
@@ -82,7 +87,7 @@
                        gr.io_signature(0, 0, 0),
                )
                #create usrp object
-               self._make_usrp(number, nchan=1)
+               self._make_usrp(which=which, nchan=1)
                subdev_spec = common.to_spec(side)
                
self._get_u().set_mux(usrp.determine_tx_mux_value(self._get_u(), subdev_spec))
                self._subdev = usrp.selected_subdev(self._get_u(), subdev_spec)
@@ -92,7 +97,7 @@
        def set_interp_rate(self, interp): 
self._get_u().set_interp_rate(int(interp))
        def set_frequency(self, frequency, verbose=False):
                self._set_frequency(
-                       which=self._subdev.which(),
+                       chan=self._subdev.which(),
                        subdev=self._subdev,
                        frequency=frequency,
                        verbose=verbose,

Modified: gnuradio/branches/releases/3.2/grc/src/gui/Messages.py
===================================================================
--- gnuradio/branches/releases/3.2/grc/src/gui/Messages.py      2009-02-08 
20:35:06 UTC (rev 10406)
+++ gnuradio/branches/releases/3.2/grc/src/gui/Messages.py      2009-02-08 
20:51:55 UTC (rev 10407)
@@ -91,7 +91,7 @@
 
 ################# functions for connections    
########################################
 def send_fail_connection():
-       send('>>> Warning: A connection can only be created between a source 
and an unconnected sink.\n')
+       send('>>> Error: Cannot create connection.\n')
 
 ################# functions for preferences    
########################################
 def send_fail_load_preferences(prefs_file_path):

Modified: gnuradio/branches/releases/3.2/grc/src/platforms/base/Block.py
===================================================================
--- gnuradio/branches/releases/3.2/grc/src/platforms/base/Block.py      
2009-02-08 20:35:06 UTC (rev 10406)
+++ gnuradio/branches/releases/3.2/grc/src/platforms/base/Block.py      
2009-02-08 20:51:55 UTC (rev 10407)
@@ -142,8 +142,7 @@
                All ports and params must be valid.
                All checks must evaluate to true.
                """
-               if not self.get_enabled(): return
-               for c in self.get_params() + self.get_sinks() + 
self.get_sources() + self.get_connections():
+               for c in self.get_params() + self.get_ports() + 
self.get_connections():
                        try: assert(c.is_valid())
                        except AssertionError:
                                for msg in c.get_error_messages():

Modified: gnuradio/branches/releases/3.2/grc/src/platforms/base/Connection.py
===================================================================
--- gnuradio/branches/releases/3.2/grc/src/platforms/base/Connection.py 
2009-02-08 20:35:06 UTC (rev 10406)
+++ gnuradio/branches/releases/3.2/grc/src/platforms/base/Connection.py 
2009-02-08 20:51:55 UTC (rev 10407)
@@ -37,10 +37,10 @@
                for port in (porta, portb):
                        if port.is_source(): source = port
                        if port.is_sink(): sink = port
-               #verify the source and sink
                assert(source and sink)
-               assert(not source.is_full())
-               assert(not sink.is_full())
+               #ensure that this connection (source -> sink) is unique
+               for connection in self.get_parent().get_connections():
+                       assert not (connection.get_source() is source and 
connection.get_sink() is sink)
                self._source = source
                self._sink = sink
 

Modified: gnuradio/branches/releases/3.2/grc/src/platforms/base/Element.py
===================================================================
--- gnuradio/branches/releases/3.2/grc/src/platforms/base/Element.py    
2009-02-08 20:35:06 UTC (rev 10406)
+++ gnuradio/branches/releases/3.2/grc/src/platforms/base/Element.py    
2009-02-08 20:51:55 UTC (rev 10407)
@@ -41,10 +41,13 @@
 
        def is_valid(self):
                self._error_messages = []#reset err msgs
-               try: self.validate()
-               except: pass
+               if self.get_enabled():
+                       try: self.validate()
+                       except: pass
                return not self.get_error_messages()
 
+       def get_enabled(self): return True
+
        def _add_error_message(self, msg):
                self._error_messages.append(msg)
 

Modified: gnuradio/branches/releases/3.2/grc/src/platforms/base/Param.py
===================================================================
--- gnuradio/branches/releases/3.2/grc/src/platforms/base/Param.py      
2009-02-08 20:35:06 UTC (rev 10406)
+++ gnuradio/branches/releases/3.2/grc/src/platforms/base/Param.py      
2009-02-08 20:51:55 UTC (rev 10407)
@@ -228,6 +228,16 @@
        def get_type(self): return 
self.get_parent().resolve_dependencies(self._type)
        def is_enum(self): return bool(self.get_options())
 
+       def __repr__(self):
+               """
+               Get the repr (nice string format) for this param.
+               Just return the value (special case enum).
+               Derived classes can handle complex formatting.
+               @return the string representation
+               """
+               if self.is_enum(): return 
self.get_option(self.get_value()).get_name()
+               return self.get_value()
+
        def get_input_class(self):
                """
                Get the graphical gtk class to represent this parameter.

Modified: gnuradio/branches/releases/3.2/grc/src/platforms/base/Port.py
===================================================================
--- gnuradio/branches/releases/3.2/grc/src/platforms/base/Port.py       
2009-02-08 20:35:06 UTC (rev 10406)
+++ gnuradio/branches/releases/3.2/grc/src/platforms/base/Port.py       
2009-02-08 20:51:55 UTC (rev 10407)
@@ -47,8 +47,6 @@
                Validate the port.
                The port must be non-empty and type must a possible type.
                """
-               try: assert(not self.is_empty())
-               except AssertionError: self._add_error_message('Port is not 
connected.')
                try: assert(self.get_type() in self.TYPES)
                except AssertionError: self._add_error_message('Type "%s" is 
not a possible type.'%self.get_type())
 
@@ -59,17 +57,11 @@
                        return 'Sink - %s(%s)'%(self.get_name(), self.get_key())
 
        def is_port(self): return True
-
        def get_color(self): return '#FFFFFF'
-
        def get_name(self): return self._name
-
        def get_key(self): return self._key
-
        def is_sink(self): return self in self.get_parent().get_sinks()
-
        def is_source(self): return self in self.get_parent().get_sources()
-
        def get_type(self): return 
self.get_parent().resolve_dependencies(self._type)
 
        def get_connections(self):
@@ -81,26 +73,9 @@
                connections = filter(lambda c: c.get_source() is self or 
c.get_sink() is self, connections)
                return connections
 
-       def is_connected(self):
+       def get_enabled_connections(self):
                """
-               Is this port connected?
-               @return true if at least one connection
+               Get all enabled connections that use this port.
+               @return a list of connection objects
                """
-               return bool(self.get_connections())
-
-       def is_full(self):
-               """
-               Is this port full of connections?
-               Generally a sink can handle one connection and a source can 
handle many.
-               @return true if the port is full
-               """
-               if self.is_source(): return False
-               if self.is_sink(): return bool(self.get_connections())
-
-       def is_empty(self):
-               """
-               Is this port empty?
-               An empty port has no connections.
-               @return true if empty
-               """
-               return not self.get_connections()
+               return filter(lambda c: c.get_enabled(), self.get_connections())

Modified: gnuradio/branches/releases/3.2/grc/src/platforms/gui/Param.py
===================================================================
--- gnuradio/branches/releases/3.2/grc/src/platforms/gui/Param.py       
2009-02-08 20:35:06 UTC (rev 10406)
+++ gnuradio/branches/releases/3.2/grc/src/platforms/gui/Param.py       
2009-02-08 20:51:55 UTC (rev 10407)
@@ -85,48 +85,15 @@
 
        def get_markup(self):
                """
-               Create a markup to display the Param as a label on the 
SignalBlock.
-               If the data type is an Enum type, use the cname of the Enum's 
current choice.
-               Otherwise, use parsed the data type and use its string 
representation.
-               If the data type is not valid, use a red foreground color.
+               Create a markup to display the param as a label on the block.
+               If the param is valid, use the param's repr representation.
+               Otherwise, create a markup for error.
                @return pango markup string
                """
-               
###########################################################################
-               # display logic for numbers
-               
###########################################################################
-               def float_to_str(var):
-                       if var-int(var) == 0: return '%d'%int(var)
-                       if var*10-int(var*10) == 0: return '%.1f'%var
-                       if var*100-int(var*100) == 0: return '%.2f'%var
-                       if var*1000-int(var*1000) == 0: return '%.3f'%var
-                       else: return '%.3g'%var
-               def to_str(var):
-                       if isinstance(var, str): return var
-                       elif isinstance(var, complex):
-                               if var == 0: return '0' #value is zero
-                               elif var.imag == 0: return 
'%s'%float_to_str(var.real) #value is real
-                               elif var.real == 0: return 
'%sj'%float_to_str(var.imag) #value is imaginary
-                               elif var.imag < 0: return 
'%s-%sj'%(float_to_str(var.real), float_to_str(abs(var.imag)))
-                               else: return '%s+%sj'%(float_to_str(var.real), 
float_to_str(var.imag))
-                       elif isinstance(var, float): return float_to_str(var)
-                       elif isinstance(var, int): return '%d'%var
-                       else: return str(var)
-               
###########################################################################
                if self.is_valid():
-                       data = self.evaluate()
-                       t = self.get_type()
-                       if self.is_enum():
-                               dt_str = 
self.get_option(self.get_value()).get_name()
-                       elif isinstance(data, (list, tuple, set)): #vector types
-                               if len(data) > 8: dt_str = self.get_value() 
#large vectors use code
-                               else: dt_str = ', '.join(map(to_str, data)) 
#small vectors use eval
-                       else: dt_str = to_str(data)     #other types
-                       #truncate
-                       max_len = max(27 - len(self.get_name()), 3)
-                       if len(dt_str) > max_len:
-                               dt_str = dt_str[:max_len/2 -3] + '...' + 
dt_str[-max_len/2:]
-                       return '<b>%s:</b> 
%s'%(Utils.xml_encode(self.get_name()), Utils.xml_encode(dt_str))
-               else: return '<span foreground="red"><b>%s:</b> 
error</span>'%Utils.xml_encode(self.get_name())
+                       return '<b>%s:</b> 
%s'%(Utils.xml_encode(self.get_name()), Utils.xml_encode(repr(self)))
+               else:
+                       return '<span foreground="red"><b>%s:</b> 
error</span>'%Utils.xml_encode(self.get_name())
 
        def get_layout(self):
                """

Modified: gnuradio/branches/releases/3.2/grc/src/platforms/python/Block.py
===================================================================
--- gnuradio/branches/releases/3.2/grc/src/platforms/python/Block.py    
2009-02-08 20:35:06 UTC (rev 10406)
+++ gnuradio/branches/releases/3.2/grc/src/platforms/python/Block.py    
2009-02-08 20:51:55 UTC (rev 10407)
@@ -69,6 +69,7 @@
                                try: assert check_eval
                                except AssertionError: 
self._add_error_message('Check "%s" failed.'%check)
                        except: self._add_error_message('Check "%s" did not 
evaluate.'%check)
+               #adjust nports
                for ports, Port in (
                        (self._sources, self.get_parent().get_parent().Source),
                        (self._sinks, self.get_parent().get_parent().Sink),

Modified: gnuradio/branches/releases/3.2/grc/src/platforms/python/Param.py
===================================================================
--- gnuradio/branches/releases/3.2/grc/src/platforms/python/Param.py    
2009-02-08 20:35:06 UTC (rev 10406)
+++ gnuradio/branches/releases/3.2/grc/src/platforms/python/Param.py    
2009-02-08 20:51:55 UTC (rev 10407)
@@ -25,6 +25,7 @@
 import pygtk
 pygtk.require('2.0')
 import gtk
+from gnuradio import eng_notation
 
 class FileParam(EntryParam):
        """Provide an entry box for filename and a button to browse for a 
file."""
@@ -88,6 +89,53 @@
                'grid_pos', 'import',
        ]
 
+       def __repr__(self):
+               """
+               Get the repr (nice string format) for this param.
+               @return the string representation
+               """
+               if self.is_enum(): return _Param.__repr__(self)
+               ##################################################
+               # display logic for numbers
+               ##################################################
+               def num_to_str(num):
+                       if isinstance(num, COMPLEX_TYPES):
+                               num = complex(num) #cast to python complex
+                               if num == 0: return '0' #value is zero
+                               elif num.imag == 0: return 
'%s'%eng_notation.num_to_str(num.real) #value is real
+                               elif num.real == 0: return 
'%sj'%eng_notation.num_to_str(num.imag) #value is imaginary
+                               elif num.imag < 0: return 
'%s-%sj'%(eng_notation.num_to_str(num.real), 
eng_notation.num_to_str(abs(num.imag)))
+                               else: return 
'%s+%sj'%(eng_notation.num_to_str(num.real), eng_notation.num_to_str(num.imag))
+                       else: return str(num)
+               ##################################################
+               # split up formatting by type
+               ##################################################
+               truncate = 0 #default center truncate
+               max_len = max(27 - len(self.get_name()), 3)
+               e = self.evaluate()
+               t = self.get_type()
+               if isinstance(e, COMPLEX_TYPES): dt_str = num_to_str(e)
+               elif isinstance(e, VECTOR_TYPES): #vector types
+                       if len(e) > 8:
+                               dt_str = self.get_value() #large vectors use 
code
+                               truncate = 1
+                       else: dt_str = ', '.join(map(num_to_str, e)) #small 
vectors use eval
+               elif t in ('file_open', 'file_save'):
+                       dt_str = self.get_value()
+                       truncate = -1
+               else: dt_str = str(e) #other types
+               ##################################################
+               # truncate
+               ##################################################
+               if len(dt_str) > max_len:
+                       if truncate < 0: #front truncate
+                               dt_str = '...' + dt_str[3-max_len:]
+                       elif truncate == 0: #center truncate
+                               dt_str = dt_str[:max_len/2 -3] + '...' + 
dt_str[-max_len/2:]
+                       elif truncate > 0: #rear truncate
+                               dt_str = dt_str[:max_len-3] + '...'
+               return dt_str
+
        def get_input_class(self):
                if self.get_type() in ('file_open', 'file_save'): return 
FileParam
                return _Param.get_input_class(self)

Modified: gnuradio/branches/releases/3.2/grc/src/platforms/python/Port.py
===================================================================
--- gnuradio/branches/releases/3.2/grc/src/platforms/python/Port.py     
2009-02-08 20:35:06 UTC (rev 10406)
+++ gnuradio/branches/releases/3.2/grc/src/platforms/python/Port.py     
2009-02-08 20:51:55 UTC (rev 10407)
@@ -46,6 +46,13 @@
                self._vlen = vlen
                self._optional = bool(optional)
 
+       def validate(self):
+               _Port.validate(self)
+               try: assert(self.get_enabled_connections() or 
self.get_optional())
+               except AssertionError: self._add_error_message('Port is not 
connected.')
+               try: assert(self.is_source() or 
len(self.get_enabled_connections()) <= 1)
+               except AssertionError: self._add_error_message('Port has too 
many connections.')
+
        def get_vlen(self):
                """
                Get the vector length.
@@ -98,15 +105,6 @@
                        }[self.get_type()]
                except: return _Port.get_color(self)
 
-       def is_empty(self):
-               """
-               Is this port empty?
-               An empty port has no connections.
-               Not empty of optional is set.
-               @return true if empty
-               """
-               return not self.get_optional() and not self.get_connections()
-
 class Source(Port):
 
        def __init__(self, block, n):

Modified: gnuradio/branches/releases/3.2/grc/src/utils/__init__.py
===================================================================
--- gnuradio/branches/releases/3.2/grc/src/utils/__init__.py    2009-02-08 
20:35:06 UTC (rev 10406)
+++ gnuradio/branches/releases/3.2/grc/src/utils/__init__.py    2009-02-08 
20:51:55 UTC (rev 10407)
@@ -46,6 +46,32 @@
                copy_dict._keys = list(self._keys)
                return copy_dict
 
+       def insert_after(self, pos_key, key, val):
+               """
+               Insert the new key, value entry after the entry given by the 
position key.
+               If the positional key is None, insert at the end.
+               @param pos_key the positional key
+               @param key the key for the new entry
+               @param val the value for the new entry
+               """
+               index = (pos_key is None) and len(self._keys) or 
self._keys.index(pos_key)
+               assert key not in self._keys
+               self._keys.insert(index+1, key)
+               self._data[key] = val
+
+       def insert_before(self, pos_key, key, val):
+               """
+               Insert the new key, value entry before the entry given by the 
position key.
+               If the positional key is None, insert at the begining.
+               @param pos_key the positional key
+               @param key the key for the new entry
+               @param val the value for the new entry
+               """
+               index = (pos_key is not None) and self._keys.index(pos_key) or 
0 
+               assert key not in self._keys
+               self._keys.insert(index, key)
+               self._data[key] = val
+
 def exists_or_else(d, key, alt):
        if d.has_key(key): return d[key]
        else: return alt

Modified: gnuradio/branches/releases/3.2/usrp/host/lib/legacy/db_xcvr2450.cc
===================================================================
--- gnuradio/branches/releases/3.2/usrp/host/lib/legacy/db_xcvr2450.cc  
2009-02-08 20:35:06 UTC (rev 10406)
+++ gnuradio/branches/releases/3.2/usrp/host/lib/legacy/db_xcvr2450.cc  
2009-02-08 20:51:55 UTC (rev 10407)
@@ -271,7 +271,7 @@
   std::string s(c, 3);
   
   usrp()->_write_spi(0, d_spi_enable, d_spi_format, s);
-  //printf("xcvr2450: Setting reg %d to %06X\n", (v&15), v);
+  printf("xcvr2450: Setting reg %d to %X\n", (v&15), v);
 }
 
 // --------------------------------------------------------------------





reply via email to

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