commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r8111 - in grc/branches/grc_reloaded: . src/grc src/gr


From: jblum
Subject: [Commit-gnuradio] r8111 - in grc/branches/grc_reloaded: . src/grc src/grc/gui src/grc_gnuradio src/grc_gnuradio/blocks src/grc_gnuradio/blocks/graphical_sinks src/grc_gnuradio/blocks/synchronizers src/grc_gnuradio/blocks/variables src/grc_gnuradio/data src/grc_gnuradio/wxgui
Date: Mon, 24 Mar 2008 21:04:31 -0600 (MDT)

Author: jblum
Date: 2008-03-24 21:04:30 -0600 (Mon, 24 Mar 2008)
New Revision: 8111

Added:
   grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/
   
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_clock_recovery_mm_xx.xml
   
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_correlate_access_code_bb.xml
   
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_costas_loop_cc.xml
   
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_dd_mpsk_sync_cc.xml
   
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_pll_carriertracking_cc.xml
   
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_pll_freqdet_cf.xml
   
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_pll_refout_cc.xml
   
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_pn_correlator_cc.xml
   
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_simple_correlator.xml
   
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_simple_framer.xml
Removed:
   
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/variables/variable_button.xml
Modified:
   grc/branches/grc_reloaded/setup.py
   grc/branches/grc_reloaded/src/grc/Constants.py
   grc/branches/grc_reloaded/src/grc/gui/SignalBlockSelectionWindow.py
   grc/branches/grc_reloaded/src/grc_gnuradio/Block.py
   
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/graphical_sinks/wxgui_fftsink2.xml
   
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/graphical_sinks/wxgui_numbersink2.xml
   
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/graphical_sinks/wxgui_scopesink2.xml
   
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/graphical_sinks/wxgui_waterfallsink2.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/data/wx_gui.tmpl
   grc/branches/grc_reloaded/src/grc_gnuradio/wxgui/Controls.py
   grc/branches/grc_reloaded/src/grc_gnuradio/wxgui/__init__.py
Log:
graphical variables improved, gui tweaks, sync blocks

Modified: grc/branches/grc_reloaded/setup.py
===================================================================
--- grc/branches/grc_reloaded/setup.py  2008-03-25 03:04:10 UTC (rev 8110)
+++ grc/branches/grc_reloaded/setup.py  2008-03-25 03:04:30 UTC (rev 8111)
@@ -51,6 +51,7 @@
        'blocks/conversions/*.xml',
        'blocks/filters/*.xml',
        'blocks/level_controls/*.xml',
+       'blocks/synchronizers/*.xml',
        'blocks/variables/*.xml',
        'blocks/misc/*.xml',
        'blocks/usrp/*.xml',

Modified: grc/branches/grc_reloaded/src/grc/Constants.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/Constants.py      2008-03-25 03:04:10 UTC 
(rev 8110)
+++ grc/branches/grc_reloaded/src/grc/Constants.py      2008-03-25 03:04:30 UTC 
(rev 8111)
@@ -98,8 +98,7 @@
 ##misc window constraints      @{
 REPORTS_WINDOW_HEIGHT = 100
 
-BLOCK_SELECTION_WINDOW_WIDTH = 250
-BLOCK_SELECTION_WINDOW_HEIGHT = 250
+BLOCK_SELECTION_WINDOW_WIDTH = 200
 
 address@hidden
 

Modified: grc/branches/grc_reloaded/src/grc/gui/SignalBlockSelectionWindow.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/gui/SignalBlockSelectionWindow.py 
2008-03-25 03:04:10 UTC (rev 8110)
+++ grc/branches/grc_reloaded/src/grc/gui/SignalBlockSelectionWindow.py 
2008-03-25 03:04:30 UTC (rev 8111)
@@ -57,10 +57,7 @@
                scrolled_window = gtk.ScrolledWindow()
                scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, 
gtk.POLICY_AUTOMATIC)
                scrolled_window.add_with_viewport(self.treeview)
-               scrolled_window.set_size_request(
-                       BLOCK_SELECTION_WINDOW_WIDTH,
-                       BLOCK_SELECTION_WINDOW_HEIGHT,
-               )
+               scrolled_window.set_size_request(BLOCK_SELECTION_WINDOW_WIDTH, 
-1)
                self.pack_start(scrolled_window)
                #add button
                self.add_button = gtk.Button(None, 'gtk-add')           
@@ -103,8 +100,8 @@
                """
                selection = self.treeview.get_selection()
                model, iter = selection.get_selected()
-               if iter != None and not model.iter_has_child(iter): 
self.add_button.set_sensitive(True)
-               else: self.add_button.set_sensitive(False)
+               sensitive = bool(iter and not model.iter_has_child(iter))
+               self.add_button.set_sensitive(sensitive)
        
        def _handle_add_button(self, widget):
                """!
@@ -113,7 +110,7 @@
                """
                selection = self.treeview.get_selection()
                treestore, iter = selection.get_selected()
-               if iter != None and not treestore.iter_has_child(iter): 
+               if iter and not treestore.iter_has_child(iter): 
                        name = treestore.get_value(iter, 0)
                        key = self.names[name]
                        self.get_flow_graph().add_new_block(key)                

Modified: grc/branches/grc_reloaded/src/grc_gnuradio/Block.py
===================================================================
--- grc/branches/grc_reloaded/src/grc_gnuradio/Block.py 2008-03-25 03:04:10 UTC 
(rev 8110)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/Block.py 2008-03-25 03:04:30 UTC 
(rev 8111)
@@ -144,7 +144,14 @@
                                continue
                
        def get_doc(self): 
-               return '\n'.join([self._doc.strip('\n'), 
extract_docs(self.get_key())]).strip('\n')
+               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                     
+               #merge custom doc with doxygen docs 
+               return '\n'.join([new_doc, 
extract_docs(self.get_key())]).strip('\n')
        
        def get_imports(self): return self._imports
        

Modified: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/graphical_sinks/wxgui_fftsink2.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/graphical_sinks/wxgui_fftsink2.xml
        2008-03-25 03:04:10 UTC (rev 8110)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/graphical_sinks/wxgui_fftsink2.xml
        2008-03-25 03:04:30 UTC (rev 8111)
@@ -140,7 +140,7 @@
        </sink>
        <doc>
 Set Average Alpha to 0 for automatic setting.  
-       
+
 Use the Grid Position (row, column, row span, column span) to position the 
graphical element in the window.
        </doc>
 </block>

Modified: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/graphical_sinks/wxgui_numbersink2.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/graphical_sinks/wxgui_numbersink2.xml
     2008-03-25 03:04:10 UTC (rev 8110)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/graphical_sinks/wxgui_numbersink2.xml
     2008-03-25 03:04:30 UTC (rev 8111)
@@ -164,7 +164,7 @@
        </sink>
        <doc>
 Set Average Alpha to 0 for automatic setting.
-       
+
 Use the Grid Position (row, column, row span, column span) to position the 
graphical element in the window.
        </doc>
 </block>

Modified: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/graphical_sinks/wxgui_scopesink2.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/graphical_sinks/wxgui_scopesink2.xml
      2008-03-25 03:04:10 UTC (rev 8110)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/graphical_sinks/wxgui_scopesink2.xml
      2008-03-25 03:04:30 UTC (rev 8111)
@@ -135,7 +135,7 @@
        </sink>
        <doc>
 Set the V Scale to 0 for the scope to auto-scale.
-       
+
 Use the Grid Position (row, column, row span, column span) to position the 
graphical element in the window.
        </doc>
 </block>

Modified: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/graphical_sinks/wxgui_waterfallsink2.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/graphical_sinks/wxgui_waterfallsink2.xml
  2008-03-25 03:04:10 UTC (rev 8110)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/graphical_sinks/wxgui_waterfallsink2.xml
  2008-03-25 03:04:30 UTC (rev 8111)
@@ -124,7 +124,7 @@
        </sink>
        <doc>
 Set Average Alpha to 0 for automatic setting.  
-       
+
 Use the Grid Position (row, column, row span, column span) to position the 
graphical element in the window.
        </doc>
 </block>

Added: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_clock_recovery_mm_xx.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_clock_recovery_mm_xx.xml
                         (rev 0)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_clock_recovery_mm_xx.xml
 2008-03-25 03:04:30 UTC (rev 8111)
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!-- 
+###################################################
+##Clock Recovery MM
+###################################################
+ -->
+<block>
+       <name>Clock Recovery MM</name>
+       <key>gr_clock_recovery_mm_xx</key>
+       <import>from gnuradio import gr</import>
+       <make>gr.clock_recovery_mm_$(type.fcn)($omega, $gain_omega, $mu, 
$gain_mu, $omega_relative_limit)</make>
+       <callback>set_omega($omega)</callback>
+       <callback>set_gain_omega($gain_omega)</callback>
+       <callback>set_mu($mu)</callback>
+       <callback>set_gain_mu($gain_mu)</callback>
+       <param>
+               <name>Type</name>
+               <key>type</key>
+               <type>enum</type>
+               <option>
+                       <name>Complex</name>
+                       <key>complex</key>
+                       <opt>fcn:cc</opt>
+               </option>
+               <option>
+                       <name>Float</name>
+                       <key>float</key>
+                       <opt>fcn:ff</opt>
+               </option>
+       </param>        
+       <param>
+               <name>Omega</name>
+               <key>omega</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Gain Omega</name>
+               <key>gain_omega</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Mu</name>
+               <key>mu</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Gain Mu</name>
+               <key>gain_mu</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Omega Relative Limit</name>
+               <key>omega_relative_limit</key>
+               <type>real</type>
+       </param>
+       <sink>
+               <name>in</name>
+               <type>$type</type>
+       </sink>
+       <source>
+               <name>out</name>
+               <type>$type</type>
+       </source>
+</block>

Added: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_correlate_access_code_bb.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_correlate_access_code_bb.xml
                             (rev 0)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_correlate_access_code_bb.xml
     2008-03-25 03:04:30 UTC (rev 8111)
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!-- 
+###################################################
+##Correlate Access Code
+###################################################
+ -->
+<block>
+       <name>Correlate Access Code</name>
+       <key>gr_correlate_access_code_bb</key>
+       <import>from gnuradio import gr</import>
+       <make>gr.correlate_access_code_bb($access_code, $threshold)</make>
+       <param>
+               <name>Access Code</name>
+               <key>access_code</key>
+               <value>101010</value>
+               <type>string</type>
+       </param>
+       <param>
+               <name>Threshold</name>
+               <key>threshold</key>
+               <type>int</type>
+       </param>
+       <sink>
+               <name>in</name>
+               <type>byte</type>
+       </sink>
+       <source>
+               <name>out</name>
+               <type>byte</type>
+       </source>
+</block>

Added: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_costas_loop_cc.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_costas_loop_cc.xml
                               (rev 0)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_costas_loop_cc.xml
       2008-03-25 03:04:30 UTC (rev 8111)
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!-- 
+###################################################
+##Costas Loop
+###################################################
+ -->
+<block>
+       <name>Costas Loop</name>
+       <key>gr_costas_loop_cc</key>
+       <import>from gnuradio import gr</import>
+       <make>gr.costas_loop_cc($alpha, $beta, $max_freq, $min_freq, 
$order)</make>
+       <param>
+               <name>Alpha</name>
+               <key>alpha</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Beta</name>
+               <key>beta</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Max Freq</name>
+               <key>max_freq</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Min Freq</name>
+               <key>min_freq</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Order</name>
+               <key>order</key>
+               <type>int</type>
+       </param>
+       <sink>
+               <name>in</name>
+               <type>complex</type>
+       </sink>
+       <source>
+               <name>out</name>
+               <type>complex</type>
+       </source>
+</block>

Added: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_dd_mpsk_sync_cc.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_dd_mpsk_sync_cc.xml
                              (rev 0)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_dd_mpsk_sync_cc.xml
      2008-03-25 03:04:30 UTC (rev 8111)
@@ -0,0 +1,66 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!-- 
+###################################################
+##DD MPSK Sync
+###################################################
+ -->
+<block>
+       <name>DD MPSK Sync</name>
+       <key>gr_dd_mpsk_sync_cc</key>
+       <import>from gnuradio import gr</import>
+       <make>gr.dd_mpsk_sync_cc($alpha, $beta, $max_freq, $min_freq, 
$ref_phase, $omega, $gain_omega, $mu, $gain_mu)</make>
+       <param>
+               <name>Alpha</name>
+               <key>alpha</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Beta</name>
+               <key>beta</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Max Freq</name>
+               <key>max_freq</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Min Freq</name>
+               <key>min_freq</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Reference Phase</name>
+               <key>ref_phase</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Omega</name>
+               <key>omega</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Gain Omega</name>
+               <key>gain_omega</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Mu</name>
+               <key>mu</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Gain Mu</name>
+               <key>gain_mu</key>
+               <type>real</type>
+       </param>
+       <sink>
+               <name>in</name>
+               <type>complex</type>
+       </sink>
+       <source>
+               <name>out</name>
+               <type>complex</type>
+       </source>
+</block>

Added: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_pll_carriertracking_cc.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_pll_carriertracking_cc.xml
                               (rev 0)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_pll_carriertracking_cc.xml
       2008-03-25 03:04:30 UTC (rev 8111)
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!-- 
+###################################################
+##PLL Carrier Tracking
+###################################################
+ -->
+<block>
+       <name>PLL Carrier Tracking</name>
+       <key>gr_pll_carriertracking_cc</key>
+       <import>from gnuradio import gr</import>
+       <make>gr.pll_carriertracking_cc($alpha, $beta, $max_freq, 
$min_freq)</make>
+       <param>
+               <name>Alpha</name>
+               <key>alpha</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Beta</name>
+               <key>beta</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Max Freq</name>
+               <key>max_freq</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Min Freq</name>
+               <key>min_freq</key>
+               <type>real</type>
+       </param>
+       <sink>
+               <name>in</name>
+               <type>complex</type>
+       </sink>
+       <source>
+               <name>out</name>
+               <type>complex</type>
+       </source>
+</block>

Added: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_pll_freqdet_cf.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_pll_freqdet_cf.xml
                               (rev 0)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_pll_freqdet_cf.xml
       2008-03-25 03:04:30 UTC (rev 8111)
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!-- 
+###################################################
+##PLL Frequency Det
+###################################################
+ -->
+<block>
+       <name>PLL Freq Det</name>
+       <key>gr_pll_freqdet_cf</key>
+       <import>from gnuradio import gr</import>
+       <make>gr.pll_freqdet_cf($alpha, $beta, $max_freq, $min_freq)</make>
+       <param>
+               <name>Alpha</name>
+               <key>alpha</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Beta</name>
+               <key>beta</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Max Freq</name>
+               <key>max_freq</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Min Freq</name>
+               <key>min_freq</key>
+               <type>real</type>
+       </param>
+       <sink>
+               <name>in</name>
+               <type>complex</type>
+       </sink>
+       <source>
+               <name>out</name>
+               <type>float</type>
+       </source>
+</block>

Added: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_pll_refout_cc.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_pll_refout_cc.xml
                                (rev 0)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_pll_refout_cc.xml
        2008-03-25 03:04:30 UTC (rev 8111)
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!-- 
+###################################################
+##PLL Reference Out
+###################################################
+ -->
+<block>
+       <name>PLL Ref Out</name>
+       <key>gr_pll_refout_cc</key>
+       <import>from gnuradio import gr</import>
+       <make>gr.pll_refout_cc($alpha, $beta, $max_freq, $min_freq)</make>
+       <param>
+               <name>Alpha</name>
+               <key>alpha</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Beta</name>
+               <key>beta</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Max Freq</name>
+               <key>max_freq</key>
+               <type>real</type>
+       </param>
+       <param>
+               <name>Min Freq</name>
+               <key>min_freq</key>
+               <type>real</type>
+       </param>
+       <sink>
+               <name>in</name>
+               <type>complex</type>
+       </sink>
+       <source>
+               <name>out</name>
+               <type>complex</type>
+       </source>
+</block>

Added: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_pn_correlator_cc.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_pn_correlator_cc.xml
                             (rev 0)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_pn_correlator_cc.xml
     2008-03-25 03:04:30 UTC (rev 8111)
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!-- 
+###################################################
+##PN Correlator
+###################################################
+ -->
+<block>
+       <name>PN Correlator</name>
+       <key>gr_pn_correlator_cc</key>
+       <import>from gnuradio import gr</import>
+       <make>gr.pn_correlator_cc($degree, $mask, $seed)</make>
+       <param>
+               <name>Degree</name>
+               <key>degree</key>
+               <type>int</type>
+       </param>
+       <param>
+               <name>Mask</name>
+               <key>mask</key>
+               <type>int</type>
+       </param>
+       <param>
+               <name>Seed</name>
+               <key>seed</key>
+               <type>int</type>
+       </param>
+       <sink>
+               <name>in</name>
+               <type>complex</type>
+       </sink>
+       <source>
+               <name>out</name>
+               <type>complex</type>
+       </source>
+</block>

Added: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_simple_correlator.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_simple_correlator.xml
                            (rev 0)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_simple_correlator.xml
    2008-03-25 03:04:30 UTC (rev 8111)
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!-- 
+###################################################
+##Simple Correlator
+###################################################
+ -->
+<block>
+       <name>Simple Correlator</name>
+       <key>gr_simple_correlator</key>
+       <import>from gnuradio import gr</import>
+       <make>gr.simple_correlator($payload_bytesize)</make>
+       <param>
+               <name>Payload Byte Size</name>
+               <key>payload_bytesize</key>
+               <type>int</type>
+       </param>
+       <sink>
+               <name>in</name>
+               <type>byte</type>
+       </sink>
+       <source>
+               <name>out</name>
+               <type>byte</type>
+       </source>
+</block>

Added: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_simple_framer.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_simple_framer.xml
                                (rev 0)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/synchronizers/gr_simple_framer.xml
        2008-03-25 03:04:30 UTC (rev 8111)
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!-- 
+###################################################
+##Simple Framer
+###################################################
+ -->
+<block>
+       <name>Simple Framer</name>
+       <key>gr_simple_framer</key>
+       <import>from gnuradio import gr</import>
+       <make>gr.simple_framer($payload_bytesize)</make>
+       <param>
+               <name>Payload Byte Size</name>
+               <key>payload_bytesize</key>
+               <type>int</type>
+       </param>
+       <sink>
+               <name>in</name>
+               <type>byte</type>
+       </sink>
+       <source>
+               <name>out</name>
+               <type>byte</type>
+       </source>
+</block>

Deleted: 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/variables/variable_button.xml

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-25 03:04:10 UTC (rev 8110)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/variables/variable_chooser.xml
    2008-03-25 03:04:30 UTC (rev 8111)
@@ -10,6 +10,26 @@
        <key>variable_chooser</key>
        <make>$(choices)[$value_index]</make>
        <param>
+               <name>Label</name>
+               <key>label</key>
+               <value></value>
+               <type>string</type>
+       </param>
+       <param>
+               <name>Orientation</name>
+               <key>orientation</key>
+               <value>wx.HORIZONTAL</value>
+               <type>enum</type>
+               <option>
+                       <name>Horizontal</name>
+                       <key>wx.HORIZONTAL</key>
+               </option>
+               <option>
+                       <name>Vertical</name>
+                       <key>wx.VERTICAL</key>
+               </option>
+       </param>
+       <param>
                <name>Value Index</name>
                <key>value_index</key>
                <value>0</value>
@@ -22,6 +42,13 @@
                <type>raw</type>
        </param>
        <param>
+               <name>Labels</name>
+               <key>labels</key>
+               <value>[]</value>
+               <type>raw</type>
+       </param>
+
+       <param>
                <name>Chooser Type</name>
                <key>chooser_type</key>
                <value>drop_down</value>
@@ -31,9 +58,17 @@
                        <key>drop_down</key>
                </option>
                <option>
-                       <name>Radio Buttons</name>
-                       <key>radio_buttons</key>
+                       <name>Radio Buttons Horizontal</name>
+                       <key>radio_buttons_horizontal</key>
                </option>
+               <option>
+                       <name>Radio Buttons Vertical</name>
+                       <key>radio_buttons_vertical</key>
+               </option>
+               <option>
+                       <name>Button</name>
+                       <key>button</key>
+               </option>
        </param>
        <param>
                <name>Grid Position</name>
@@ -42,10 +77,14 @@
                <type>grid_pos</type>
        </param>
        <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 or radio buttons. 
-The value index is the index of a particular choice.
-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.
        </doc>

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-25 03:04:10 UTC (rev 8110)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/variables/variable_slider.xml 
    2008-03-25 03:04:30 UTC (rev 8111)
@@ -10,6 +10,12 @@
        <key>variable_slider</key>
        <make>$value</make>
        <param>
+               <name>Label</name>
+               <key>label</key>
+               <value></value>
+               <type>string</type>
+       </param>
+       <param>
                <name>Default Value</name>
                <key>value</key>
                <value>50</value>
@@ -44,8 +50,9 @@
        <check>0 &lt; $num_steps &lt;= 1000</check>
        <doc>
 This block creates a variable with a slider. 
-The value must be a real number.
-The value must be between the minimum and the maximum.
+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-25 03:04:10 UTC (rev 8110)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/data/block_tree.xml      
2008-03-25 03:04:30 UTC (rev 8111)
@@ -108,7 +108,17 @@
        </cat>
        <cat>
                <name>Synchronizers</name>
+               <block>gr_clock_recover_mm_xx</block>           
+               <block>gr_costas_loop_cc</block>
+               <block>gr_dd_mpsk_sync_cc</block>
+               <block>gr_pll_carriertracking_cc</block>
+               <block>gr_pll_freqdet_cf</block>
+               <block>gr_pll_refout_cc</block>
                
+               <block>gr_correlate_access_code_bb</block>
+               <block>gr_pn_correlator_cc</block>
+               <block>gr_simple_correlator</block>
+               <block>gr_simple_framer</block>
        </cat>
        <cat>
                <name>Level Controls</name>
@@ -147,10 +157,6 @@
                <block>frequency_modulator</block>
                <block>phase_modulator</block>
                <block>quadrature_demodulator</block>
-               <block>costas_loop</block>              
-               <block>clock_recovery</block>
-               <block>vco</block>
-               <block>pll</block>
                
                <block>wfm_receive</block>
                <block>wft_transmit</block>
@@ -196,7 +202,6 @@
                <name>Variables</name>
                <block>variable</block>
                <block>variable_chooser</block>
-               <block>variable_button</block>
                <block>variable_slider</block>
        </cat>
        <cat>

Modified: grc/branches/grc_reloaded/src/grc_gnuradio/data/wx_gui.tmpl
===================================================================
--- grc/branches/grc_reloaded/src/grc_gnuradio/data/wx_gui.tmpl 2008-03-25 
03:04:10 UTC (rev 8110)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/data/wx_gui.tmpl 2008-03-25 
03:04:30 UTC (rev 8111)
@@ -106,8 +106,12 @@
 $make_callback($slider.get_id())
 slider = grc_wxgui.Slider(
        window=_frame, 
-       callback=_callback, 
-       title="$slider.get_id()", 
+       callback=_callback,
+#if $slider.get_param('label').evaluate() 
+       label=$slider.get_param('label').to_code(),
+#else
+       label="$slider.get_id()", 
+#end if
        value=$slider.get_param('value').to_code(),
        min=$slider.get_param('min').to_code(),
        max=$slider.get_param('max').to_code(),
@@ -124,30 +128,20 @@
 chooser = grc_wxgui.Chooser(
        window=_frame, 
        callback=_callback, 
-       title="$chooser.get_id()", 
+#if $chooser.get_param('label').evaluate() 
+       label=$chooser.get_param('label').to_code(),
+#else
+       label="$chooser.get_id()", 
+#end if
+       orientation=$chooser.get_param('orientation').to_code(),
        index=$chooser.get_param('value_index').to_code(),
        choices=$chooser.get_param('choices').to_code(),
-       radio=$(chooser.get_param('chooser_type').to_code() == 'radio_buttons')
+       labels=$chooser.get_param('labels').to_code(),
+       type="$chooser.get_param('chooser_type').to_code()",
 )
 #set $grid_pos = $chooser.get_param('grid_pos').evaluate()
 _grid.Add(chooser, wx.GBPosition($grid_pos[0], $grid_pos[1]), 
wx.GBSpan($grid_pos[2], $grid_pos[3]))
 #end for
-########################################################
-##     Create Buttons
-########################################################
-#for $button in $buttons
-$make_callback($button.get_id())
-button = grc_wxgui.Button(
-       window=_frame, 
-       callback=_callback, 
-       title="$button.get_id()", 
-       on=$(button.get_param('value_index').to_code() == 'on'),
-       on_state=$button.get_param('on_value').to_code(),
-       off_state=$button.get_param('off_value').to_code(),
-)
-#set $grid_pos = $button.get_param('grid_pos').evaluate()
-_grid.Add(button, wx.GBPosition($grid_pos[0], $grid_pos[1]), 
wx.GBSpan($grid_pos[2], $grid_pos[3]))
-#end for       
        
 ########################################################
 ##     Setup GUI
@@ -155,7 +149,7 @@
 #if $WX_APP_ICON
 _frame.SetIcon(wx.Icon("$os.path.abspath($WX_APP_ICON)", wx.BITMAP_TYPE_ANY))
 #end if        
-_frame.SetSizeHints(400, 100)
+_frame.SetSizeHints(300, 100)
 def _quit(event):
        _frame.Destroy()
        tb.stop()

Modified: grc/branches/grc_reloaded/src/grc_gnuradio/wxgui/Controls.py
===================================================================
--- grc/branches/grc_reloaded/src/grc_gnuradio/wxgui/Controls.py        
2008-03-25 03:04:10 UTC (rev 8110)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/wxgui/Controls.py        
2008-03-25 03:04:30 UTC (rev 8111)
@@ -26,12 +26,13 @@
 MAX_STR_LEN = 23
 def trim(s): return str(s)[0:MAX_STR_LEN].title()
 
-class Control(object):
+class Control(wx.BoxSizer):
        """Control base class"""
        
-       def __init__(self, window, callback):
+       def __init__(self, window, callback, orientation=wx.VERTICAL):
                self.window = window
                self.callback = callback
+               wx.BoxSizer.__init__(self, orientation)                 
                
        def get_window(self): return self.window
        
@@ -40,67 +41,12 @@
        def get_value(self): raise NotImplementedError
        
 
##############################################################################################
-#      Button Control
-##############################################################################################
-class Button(Control, wx.BoxSizer):
-       """House a button for variable control."""
-
-       def __init__(self, window, callback, title, on, on_state, off_state):
-               """!
-               Button contructor.
-               Create the slider, text box, and label.
-               @param window the wx parent window
-               @param callback call the callback on changes
-               @param title the label title
-               @param on true if the button starts on
-               @param on_state on state
-               @param off_state off state
-               """
-               #initialize
-               Control.__init__(self, window, callback)
-               self.state = bool(on)
-               self.on_state = on_state
-               self.off_state = off_state
-               wx.BoxSizer.__init__(self, wx.VERTICAL)
-               #create label
-               label = wx.StaticText(self.get_window(), -1, trim(title))
-               self.Add(label, 0, wx.ALIGN_CENTER)
-               #create button
-               self.button = wx.Button(self.get_window(), -1, '')
-               self.button.Bind(wx.EVT_BUTTON, self._handle_changed)
-               self.Add(self.button, 0, wx.ALIGN_CENTER)
-               self._set_button_label()
-  
-       def _handle_changed(self, event=None):
-               """!
-               A change is detected. Call the callback.
-               """
-               self.state = not self.state
-               self._set_button_label()
-               try: self.call()
-               except Exception, e: print >> sys.stderr, 'Error in handle 
change: "%s".'%e             
-
-       def _set_button_label(self):
-               """!
-               Set the button label to the current state.
-               """
-               self.button.SetLabel(trim(self.get_value()))
-
-       def get_value(self):
-               """!
-               Use the state of the button to determine the value.
-               @return one of the possible states
-               """
-               if self.state: return self.on_state
-               else: return self.off_state
-
-##############################################################################################
 #      Chooser Control
 
##############################################################################################
-class Chooser(Control, wx.BoxSizer):
+class Chooser(Control):
        """House a drop down or radio buttons for variable control."""
 
-       def __init__(self, window, callback, title, index, choices, 
radio=False):
+       def __init__(self, window, callback, label='Label', 
orientation=wx.VERTICAL, index=0, choices=[0], labels=[], type='drop_down'):
                """!
                Chooser contructor.
                Create the slider, text box, and label.
@@ -112,26 +58,46 @@
                @param radio true for radio buttons
                """
                #initialize
-               Control.__init__(self, window, callback)
+               Control.__init__(self, window, callback, orientation)
+               label_text = wx.StaticText(self.get_window(), -1, trim(label))
+               self.Add(label_text, 0, wx.ALIGN_CENTER)
                self.choices = choices
-               wx.BoxSizer.__init__(self, wx.VERTICAL)
-               #create label
-               label = wx.StaticText(self.get_window(), -1, trim(title))
-               self.Add(label, 0, wx.ALIGN_CENTER)             
-               if radio: #create radio buttons
+               self.labels = labels = map(trim, labels or choices)
+               ########### Drop Down ###########
+               if type == 'drop_down':
+                       self.drop_down = wx.Choice(self.get_window(), -1, 
choices=labels)
+                       self.Add(self.drop_down, 0, wx.ALIGN_CENTER)
+                       self.drop_down.Bind(wx.EVT_CHOICE, 
self._handle_changed)                
+                       self.drop_down.SetSelection(index)
+               ########### Radio Button ###########
+               elif type in ('radio_buttons_horizontal', 
'radio_buttons_vertical'):
+                       #determine gui parameters
+                       if type == 'radio_buttons_horizontal': 
+                               radio_box_orientation = wx.HORIZONTAL
+                               radio_button_align = wx.ALIGN_CENTER
+                       elif type == 'radio_buttons_vertical': 
+                               radio_box_orientation = wx.VERTICAL
+                               radio_button_align = wx.ALIGN_LEFT
+                       #create box for radio buttons
+                       radio_box = wx.BoxSizer(radio_box_orientation)
+                       self.Add(radio_box, 0, wx.ALIGN_CENTER)
+                       #create radio buttons
                        self.radio_buttons = list()
-                       for choice in choices:
-                               radio_button = 
wx.RadioButton(self.get_window(), -1, trim(choice))
+                       for label in labels:
+                               radio_button = 
wx.RadioButton(self.get_window(), -1, label)
                                radio_button.SetValue(False)
                                self.radio_buttons.append(radio_button)
-                               self.Add(radio_button, 0, wx.ALIGN_CENTER)
+                               radio_box.Add(radio_button, 0, 
radio_button_align)
                                radio_button.Bind(wx.EVT_RADIOBUTTON, 
self._handle_changed)
+                       #set one radio button active
                        self.radio_buttons[index].SetValue(True)
-               else: #create chooser
-                       self.chooser = wx.Choice(self.get_window(), -1, 
choices=map(trim, choices))
-                       self.Add(self.chooser, 0, wx.ALIGN_CENTER)
-                       self.chooser.Bind(wx.EVT_CHOICE, self._handle_changed)  
        
-                       self.chooser.SetSelection(index)
+               ########### Button ###########
+               elif type == 'button':
+                       self.button = wx.Button(self.get_window(), -1, '')
+                       self.button.Bind(wx.EVT_BUTTON, self._handle_changed)
+                       self.Add(self.button, 0, wx.ALIGN_CENTER)
+                       self.button.SetLabel(labels[index])
+               self.index = index              
   
        def _handle_changed(self, event=None):
                """!
@@ -146,20 +112,25 @@
                Read the selected index and parse the choice.
                @return one of the possible choices
                """
-               if hasattr(self, 'radio_buttons'):
+               if hasattr(self, 'drop_down'):  
+                       index = self.drop_down.GetSelection()
+               elif hasattr(self, 'radio_buttons'):
                        selected_radio_button = filter(lambda rb: 
rb.GetValue(), self.radio_buttons)[0]                         
-                       selection = 
self.radio_buttons.index(selected_radio_button)
-               elif hasattr(self, 'chooser'):  
-                       selection = self.chooser.GetSelection()
-               return self.choices[selection]
+                       index = self.radio_buttons.index(selected_radio_button)
+               elif hasattr(self, 'button'):
+                       index = (self.index + 1)%len(self.choices) #circularly 
increment index
+                       self.button.SetLabel(self.labels[index])
+               #store new index        
+               self.index = index
+               return self.choices[index]
 
 
##############################################################################################
 #      Slider Control
 
##############################################################################################
-class Slider(Control, wx.BoxSizer):
+class Slider(Control):
        """House a Slider and a Text Box for variable control."""
        
-       def __init__(self, window, callback, title, value, min, max, num_steps):
+       def __init__(self, window, callback, label='Label', value=50, min=0, 
max=100, num_steps=100):
                """!
                Slider contructor.
                Create the slider, text box, and label.
@@ -172,17 +143,16 @@
                @param num_steps the number of steps
                """
                #initialize
-               Control.__init__(self, window, callback)
+               Control.__init__(self, window, callback, wx.VERTICAL)
                self.min = min
                self.max = max
                self.num_steps = num_steps
                #create gui elements
-               wx.BoxSizer.__init__(self, wx.VERTICAL)
                label_text_sizer = wx.BoxSizer(wx.HORIZONTAL) #label and text 
box container 
-               label = wx.StaticText(self.get_window(), -1, trim(title) + ' -> 
')
+               label_text = wx.StaticText(self.get_window(), -1, trim(label) + 
' -> ')
                self.text_box = text_box = wx.TextCtrl(self.get_window(), -1, 
str(value), style=wx.TE_PROCESS_ENTER)
                text_box.Bind(wx.EVT_TEXT_ENTER, self._handle_enter)    #bind 
this special enter hotkey event
-               for obj in (label, text_box):   #fill the container with label 
and text entry box
+               for obj in (label_text, text_box):      #fill the container 
with label and text entry box
                        label_text_sizer.Add(obj, 0, 
wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL)
                self.Add(label_text_sizer, 0, wx.ALIGN_CENTER)
                #make the slider

Modified: grc/branches/grc_reloaded/src/grc_gnuradio/wxgui/__init__.py
===================================================================
--- grc/branches/grc_reloaded/src/grc_gnuradio/wxgui/__init__.py        
2008-03-25 03:04:10 UTC (rev 8110)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/wxgui/__init__.py        
2008-03-25 03:04:30 UTC (rev 8111)
@@ -20,5 +20,5 @@
 #Package for external gnuradio wxgui objects.
 address@hidden Josh Blum
 
-from Controls import Button, Chooser, Slider 
+from Controls import Chooser, Slider 
 





reply via email to

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