commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r8301 - in grc/trunk/src: grc grc/gui grc_gnuradio/blo


From: jblum
Subject: [Commit-gnuradio] r8301 - in grc/trunk/src: grc grc/gui grc_gnuradio/blocks grc_gnuradio/blocks/graphical_sinks grc_gnuradio/blocks/operators grc_gnuradio/blocks/variables grc_gnuradio/data
Date: Wed, 30 Apr 2008 22:43:28 -0600 (MDT)

Author: jblum
Date: 2008-04-30 22:43:27 -0600 (Wed, 30 Apr 2008)
New Revision: 8301

Added:
   grc/trunk/src/grc/converter.py
Modified:
   grc/trunk/src/grc/ParseXML.py
   grc/trunk/src/grc/gui/NotebookPage.py
   
grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_constellationsink2.xml
   grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_fftsink2.xml
   grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_numbersink2.xml
   grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_scopesink2.xml
   grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_waterfallsink2.xml
   grc/trunk/src/grc_gnuradio/blocks/operators/gr_add_const_vxx.xml
   grc/trunk/src/grc_gnuradio/blocks/operators/gr_add_vxx.xml
   grc/trunk/src/grc_gnuradio/blocks/operators/gr_and_xx.xml
   grc/trunk/src/grc_gnuradio/blocks/operators/gr_argmax_xx.xml
   grc/trunk/src/grc_gnuradio/blocks/operators/gr_divide_xx.xml
   grc/trunk/src/grc_gnuradio/blocks/operators/gr_max_xx.xml
   grc/trunk/src/grc_gnuradio/blocks/operators/gr_multiply_const_vxx.xml
   grc/trunk/src/grc_gnuradio/blocks/operators/gr_multiply_vxx.xml
   grc/trunk/src/grc_gnuradio/blocks/operators/gr_not_xx.xml
   grc/trunk/src/grc_gnuradio/blocks/operators/gr_or_xx.xml
   grc/trunk/src/grc_gnuradio/blocks/operators/gr_sub_xx.xml
   grc/trunk/src/grc_gnuradio/blocks/operators/gr_xor_xx.xml
   grc/trunk/src/grc_gnuradio/blocks/options.xml
   grc/trunk/src/grc_gnuradio/blocks/variables/variable_chooser.xml
   grc/trunk/src/grc_gnuradio/blocks/variables/variable_slider.xml
   grc/trunk/src/grc_gnuradio/data/default_flow_graph.grc.xml
   grc/trunk/src/grc_gnuradio/data/no_gui.tmpl
   grc/trunk/src/grc_gnuradio/data/wx_gui.tmpl
Log:
converter script, rearranged block to ease conversion

Modified: grc/trunk/src/grc/ParseXML.py
===================================================================
--- grc/trunk/src/grc/ParseXML.py       2008-04-30 05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc/ParseXML.py       2008-05-01 04:43:27 UTC (rev 8301)
@@ -123,7 +123,7 @@
                                child.appendChild(_to_xml(odict({key: elem}), 
doc, level + 1))
                                child.appendChild(doc.createTextNode("\n"))
                child.appendChild(doc.createTextNode("\t"*(level-1)))
-       elif value: child.appendChild(doc.createTextNode(value))
+       elif value: child.appendChild(doc.createTextNode(str(value)))
        return child
 
 def to_file(doc, file_path):

Added: grc/trunk/src/grc/converter.py
===================================================================
--- grc/trunk/src/grc/converter.py                              (rev 0)
+++ grc/trunk/src/grc/converter.py      2008-05-01 04:43:27 UTC (rev 8301)
@@ -0,0 +1,236 @@
+"""
+Copyright 2008 Free Software Foundation, Inc.
+This file is part of GNU Radio
+
+GNU Radio Companion is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+GNU Radio Companion is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+"""
address@hidden grc.converter
+#convert old flow graph file format to new format
address@hidden Josh Blum
+
+from grc.Constants import DATA_DIR
+from grc import ParseXML, Utils
+from grc.Utils import odict
+import difflib
+import os
+
+def _make_param(key, value):
+       """!
+       Make a paramater dict from the key/value pair.
+       @param key the key
+       @param value the value
+       @return a dictionary object
+       """
+       param = odict()
+       param['key'] = key
+       param['value'] = value
+       return param
+
+def _get_blocks(blocks, tag):
+       """!
+       Get a list of blocks with the tag.
+       @param blocks the old block list
+       @param tag the tag name
+       @retun a list of matching blocks
+       """
+       return filter(lambda b: b['tag'] == tag, blocks) 
+       
+def _get_params(block):
+       """!
+       Get a list of params.
+       @param block the old block
+       @retun a list of params
+       """
+       params = Utils.exists_or_else(block, 'params', {}) or {}
+       params = Utils.listify(params, 'param')
+       return params 
+       
+def _convert_id(id):
+       """!
+       Convert an old id to a new safe id.
+       Replace spaces with underscores.
+       Lower case the odl id.
+       @return the reformatted id
+       """
+       return id.lower().replace(' ', '_')
+
+def convert(file_path, platform):
+       """!
+       Convert the flow graph to the new format.
+       Make a backup of the old file.
+       Save a reformated flow graph to the file path.
+       If this is a new format flow graph, do nothing.
+       @param file_path the path to the saved flow graph
+       @param platform the grc gnuradio platform
+       """
+       try: #return if file passes validation
+               ParseXML.validate_dtd(file_path, DATA_DIR + '/flow_graph.dtd')
+               return
+       except: pass #convert
+       ############################################################
+       #       extract window size, variables, blocks, and connections
+       ############################################################
+       old_n = ParseXML.from_xml(ParseXML.from_file(file_path))['flow_graph']
+       window_size = '%s, %s'%(
+               Utils.exists_or_else(old_n, 'window_width', '2048'), 
+               Utils.exists_or_else(old_n, 'window_height', '2048'),
+       )
+       variables = Utils.exists_or_else(old_n, 'vars', {}) or {}
+       variables = Utils.listify(variables, 'var')
+       blocks = Utils.exists_or_else(old_n, 'signal_blocks', {}) or {}
+       blocks = Utils.listify(blocks, 'signal_block')
+       connections = Utils.exists_or_else(old_n, 'connections', {}) or {}
+       connections = Utils.listify(connections, 'connection')
+       #initialize new nested data
+       new_n = odict()
+       new_n['block'] = list()
+       new_n['connection'] = list()
+       ############################################################
+       #       conversion - options block
+       ############################################################
+       #get name
+       about_blocks = _get_blocks(blocks, 'About')
+       if about_blocks: title = _get_params(about_blocks[0])[0]
+       else: title = 'Untitled'
+       #get author
+       if about_blocks: author = _get_params(about_blocks[0])[1]
+       else: author = ''
+       #get desc
+       note_blocks = _get_blocks(blocks, 'Note')
+       if note_blocks: desc = _get_params(note_blocks[0])[0]
+       else: desc = ''
+       #create options block
+       options_block = odict()
+       options_block['key'] = 'options'
+       options_block['param'] = [
+               _make_param('id', 'options'),
+               _make_param('title', title),
+               _make_param('author', author),
+               _make_param('description', desc),
+               _make_param('window_size', window_size),                
+       ]
+       #append options block
+       new_n['block'].append(options_block)
+       ############################################################
+       #       conversion - variables
+       ############################################################
+       wxgui_row, wxgui_col = 0, 0
+       #arrange sliders in a row
+       for variable in variables: 
+               key = variable['key']
+               value = variable['value']
+               min = Utils.exists_or_else(variable, 'min', '')
+               max = Utils.exists_or_else(variable, 'max', '')
+               step = Utils.exists_or_else(variable, 'step', '')
+               var_block = odict()     
+               if min and max: #slider varible
+                       #determine num steps
+                       try: num_steps = str(int((float(max) - 
float(min))/float(step)))
+                       except: num_steps = '100'
+                       var_block['key'] = 'variable_slider'
+                       var_block['param'] = [
+                               _make_param('id', key),
+                               _make_param('value', value),
+                               _make_param('min', min),
+                               _make_param('max', max),
+                               _make_param('num_steps', num_steps),
+                               _make_param('grid_pos', '%d, %d, 1, 
2'%(wxgui_row, wxgui_col)), 
+                       ]
+                       wxgui_col = (wxgui_col + 2)%4
+                       if wxgui_col == 0: wxgui_row = wxgui_row + 1
+               else: #regular variable         
+                       var_block['key'] = 'variable'
+                       var_block['param'] = [
+                               _make_param('id', key),
+                               _make_param('value', value),    
+                       ]
+               #append variable block
+               new_n['block'].append(var_block)
+       ############################################################
+       #       conversion - blocks
+       ############################################################
+       wxgui_row = wxgui_row + 1
+       wxgui_col = 0
+       #create name to key map for all blocks in platform
+       name_to_key = dict((b.get_name(), b.get_key()) for b in 
platform.get_blocks())
+       for block in blocks:
+               #extract info
+               tag = block['tag']
+               #ignore list
+               if tag in ('Note', 'About'): continue
+               id = _convert_id(block['id'])
+               coor = '(%s, %s)'%(
+                       Utils.exists_or_else(block, 'x_coordinate', '0'), 
+                       Utils.exists_or_else(block, 'y_coordinate', '0'),
+               )
+               rot = Utils.exists_or_else(block, 'rotation', '0')              
+               params = _get_params(block)
+               #new block
+               new_block = odict()
+               matches = difflib.get_close_matches(tag, name_to_key.keys(), 1)
+               if not matches: continue
+               #match found
+               key = name_to_key[matches[0]]
+               new_block['key'] = key
+               new_block['param'] = [
+                       _make_param('id', id),
+                       _make_param('gui_coordinate', coor),
+                       _make_param('gui_rotation', rot),       
+               ]
+               #handle specific blocks
+               if key == 'wxgui_fftsink2':
+                       params = params[0:3] + ['0'] + params[3:4] + ['8'] + 
params[4:]
+               #handle wxgui blocks
+               if key.startswith('wxgui'):
+                       new_block['param'].append(_make_param('grid_pos', '%d, 
%d, 2, 4'%(wxgui_row, wxgui_col)))
+                       wxgui_row = wxgui_row + 2
+               #append params
+               for i, param in enumerate(params):
+                       platform_block = platform.get_block(key)
+                       try: platform_param = platform_block.get_params()[i+1]
+                       except IndexError: break 
+                       if platform_param.is_enum():
+                               try: param_value = 
platform_param.get_option_keys()[int(param)]
+                               except: param_value = 
platform_param.get_option_keys()[0]
+                       else: param_value = param.replace('$', '')
+                       
new_block['param'].append(_make_param(platform_param.get_key(), param_value))   
        
+               #append block
+               new_n['block'].append(new_block)
+       ############################################################
+       #       conversion - connections
+       ############################################################    
+       for connection in connections:
+               #extract info
+               input_signal_block_id = connection['input_signal_block_id']
+               input_socket_index = connection['input_socket_index']
+               output_signal_block_id = connection['output_signal_block_id']
+               output_socket_index = connection['output_socket_index']
+               #new connection
+               new_conn = odict()
+               new_conn['source_block_id'] = 
_convert_id(output_signal_block_id)
+               new_conn['sink_block_id'] = _convert_id(input_signal_block_id)
+               new_conn['source_key'] = output_socket_index
+               new_conn['sink_key'] = input_socket_index
+               #append connection
+               new_n['connection'].append(new_conn)
+       ############################################################
+       #       backup and replace
+       ############################################################
+       #return #below not ready yet
+       #backup after successful conversion
+       os.rename(file_path, file_path+'.bak')
+       #save new flow graph to file path
+       ParseXML.to_file(ParseXML.to_xml({'flow_graph': new_n}), file_path)
+       

Modified: grc/trunk/src/grc/gui/NotebookPage.py
===================================================================
--- grc/trunk/src/grc/gui/NotebookPage.py       2008-04-30 05:55:34 UTC (rev 
8300)
+++ grc/trunk/src/grc/gui/NotebookPage.py       2008-05-01 04:43:27 UTC (rev 
8301)
@@ -48,6 +48,10 @@
                self.main_window = main_window
                self.set_file_path(file_path)
                file_path = file_path or 
flow_graph.get_parent().get_default_flow_graph()
+               ############################################################
+               from grc import converter
+               converter.convert(file_path, flow_graph.get_parent())
+               ############################################################
                ParseXML.validate_dtd(file_path, DATA_DIR + '/flow_graph.dtd')
                initial_state = ParseXML.from_xml(ParseXML.from_file(file_path))
                self.state_cache = StateCache(initial_state)                    
        

Modified: 
grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_constellationsink2.xml
===================================================================
--- 
grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_constellationsink2.xml  
    2008-04-30 05:55:34 UTC (rev 8300)
+++ 
grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_constellationsink2.xml  
    2008-05-01 04:43:27 UTC (rev 8301)
@@ -56,7 +56,7 @@
        <param>
                <name>Grid Position</name>
                <key>grid_pos</key>
-               <value>0, 0, 1, 1</value>
+               <value>0, 0, 2, 4</value>
                <type>grid_pos</type>
        </param>
        <sink>

Modified: grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_fftsink2.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_fftsink2.xml        
2008-04-30 05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_fftsink2.xml        
2008-05-01 04:43:27 UTC (rev 8301)
@@ -126,21 +126,14 @@
                </option>
        </param>
        <param>
-               <name>Num Inputs</name> 
-               <key>num_inputs</key>
-               <value>1</value>
-               <type>int</type>
-       </param>        
-       <param>
                <name>Grid Position</name>
                <key>grid_pos</key>
-               <value>0, 0, 1, 1</value>
+               <value>0, 0, 2, 4</value>
                <type>grid_pos</type>
        </param>
        <sink>
                <name>in</name>
                <type>$type</type>
-               <nports>$num_inputs</nports>
        </sink>
        <doc>
 Set Average Alpha to 0 for automatic setting.  

Modified: 
grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_numbersink2.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_numbersink2.xml     
2008-04-30 05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_numbersink2.xml     
2008-05-01 04:43:27 UTC (rev 8301)
@@ -154,13 +154,12 @@
        <param>
                <name>Grid Position</name>
                <key>grid_pos</key>
-               <value>0, 0, 1, 1</value>
+               <value>0, 0, 2, 4</value>
                <type>grid_pos</type>
        </param>
        <sink>
                <name>in</name>
                <type>$type</type>
-               <nports>$num_inputs</nports>
        </sink>
        <doc>
 Set Average Alpha to 0 for automatic setting.

Modified: grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_scopesink2.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_scopesink2.xml      
2008-04-30 05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_scopesink2.xml      
2008-05-01 04:43:27 UTC (rev 8301)
@@ -125,7 +125,7 @@
        <param>
                <name>Grid Position</name>
                <key>grid_pos</key>
-               <value>0, 0, 1, 1</value>
+               <value>0, 0, 2, 4</value>
                <type>grid_pos</type>
        </param>
        <sink>

Modified: 
grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_waterfallsink2.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_waterfallsink2.xml  
2008-04-30 05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_waterfallsink2.xml  
2008-05-01 04:43:27 UTC (rev 8301)
@@ -106,21 +106,14 @@
                </option>
        </param>
        <param>
-               <name>Num Inputs</name> 
-               <key>num_inputs</key>
-               <value>1</value>
-               <type>int</type>
-       </param>        
-       <param>
                <name>Grid Position</name>
                <key>grid_pos</key>
-               <value>0, 0, 1, 1</value>
+               <value>0, 0, 2, 4</value>
                <type>grid_pos</type>
        </param>
        <sink>
                <name>in</name>
                <type>$type</type>
-               <nports>$num_inputs</nports>
        </sink>
        <doc>
 Set Average Alpha to 0 for automatic setting.  

Modified: grc/trunk/src/grc_gnuradio/blocks/operators/gr_add_const_vxx.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/operators/gr_add_const_vxx.xml    
2008-04-30 05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/operators/gr_add_const_vxx.xml    
2008-05-01 04:43:27 UTC (rev 8301)
@@ -13,12 +13,6 @@
        <make>gr.add_const_v$(type.fcn)($const)</make>
        <callback>set_k($const)</callback>
        <param>
-               <name>Constant</name>
-               <key>const</key>
-               <value>0</value>
-               <type>$type.const_type</type>
-       </param>
-       <param>
                <name>IO Type</name>
                <key>type</key>
                <type>enum</type>
@@ -48,6 +42,12 @@
                </option>
        </param>        
        <param>
+               <name>Constant</name>
+               <key>const</key>
+               <value>0</value>
+               <type>$type.const_type</type>
+       </param>
+       <param>
                <name>Vec Length</name>
                <key>vlen</key>
                <value>1</value>

Modified: grc/trunk/src/grc_gnuradio/blocks/operators/gr_add_vxx.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/operators/gr_add_vxx.xml  2008-04-30 
05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/operators/gr_add_vxx.xml  2008-05-01 
04:43:27 UTC (rev 8301)
@@ -12,12 +12,6 @@
        <import>from gnuradio import gr</import>
        <make>gr.add_v$(type.fcn)($vlen)</make>
        <param>
-               <name>Num Inputs</name>
-               <key>num_inputs</key>
-               <value>2</value>
-               <type>int</type>                
-       </param>
-       <param>
                <name>IO Type</name>
                <key>type</key>
                <type>enum</type>
@@ -43,6 +37,12 @@
                </option>
        </param>
        <param>
+               <name>Num Inputs</name>
+               <key>num_inputs</key>
+               <value>2</value>
+               <type>int</type>                
+       </param>
+       <param>
                <name>Vec Length</name>
                <key>vlen</key>
                <value>1</value>

Modified: grc/trunk/src/grc_gnuradio/blocks/operators/gr_and_xx.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/operators/gr_and_xx.xml   2008-04-30 
05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/operators/gr_and_xx.xml   2008-05-01 
04:43:27 UTC (rev 8301)
@@ -11,12 +11,6 @@
        <import>from gnuradio import gr</import>
        <make>gr.and_$(type.fcn)()</make>
        <param>
-               <name>Num Inputs</name>
-               <key>num_inputs</key>
-               <value>2</value>
-               <type>int</type>                
-       </param>
-       <param>
                <name>IO Type</name>
                <key>type</key>
                <type>enum</type>               
@@ -36,6 +30,12 @@
                        <opt>fcn:bb</opt>                                       
        
                </option>
        </param>
+       <param>
+               <name>Num Inputs</name>
+               <key>num_inputs</key>
+               <value>2</value>
+               <type>int</type>                
+       </param>
        <check>$num_inputs &gt;= 2</check>
        <sink>
                <name>in</name>

Modified: grc/trunk/src/grc_gnuradio/blocks/operators/gr_argmax_xx.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/operators/gr_argmax_xx.xml        
2008-04-30 05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/operators/gr_argmax_xx.xml        
2008-05-01 04:43:27 UTC (rev 8301)
@@ -12,12 +12,6 @@
        <import>from gnuradio import gr</import>
        <make>gr.argmax_$(type.fcn)($vlen)</make>
        <param>
-               <name>Num Inputs</name>
-               <key>num_inputs</key>
-               <value>2</value>
-               <type>int</type>                
-       </param>
-       <param>
                <name>IO Type</name>
                <key>type</key>
                <type>enum</type>
@@ -38,6 +32,12 @@
                </option>
        </param>
        <param>
+               <name>Num Inputs</name>
+               <key>num_inputs</key>
+               <value>2</value>
+               <type>int</type>                
+       </param>
+       <param>
                <name>Vec Length</name>
                <key>vlen</key>
                <value>1</value>

Modified: grc/trunk/src/grc_gnuradio/blocks/operators/gr_divide_xx.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/operators/gr_divide_xx.xml        
2008-04-30 05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/operators/gr_divide_xx.xml        
2008-05-01 04:43:27 UTC (rev 8301)
@@ -12,12 +12,6 @@
        <import>from gnuradio import gr</import>
        <make>gr.divide_$(type.fcn)()</make>
        <param>
-               <name>Num Inputs</name>
-               <key>num_inputs</key>
-               <value>2</value>
-               <type>int</type>                
-       </param>
-       <param>
                <name>IO Type</name>
                <key>type</key>
                <type>enum</type>
@@ -42,6 +36,12 @@
                        <opt>fcn:ss</opt>                                       
        
                </option>
        </param>
+       <param>
+               <name>Num Inputs</name>
+               <key>num_inputs</key>
+               <value>2</value>
+               <type>int</type>                
+       </param>
        <check>$num_inputs &gt;= 2</check>
        <sink>
                <name>in</name>

Modified: grc/trunk/src/grc_gnuradio/blocks/operators/gr_max_xx.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/operators/gr_max_xx.xml   2008-04-30 
05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/operators/gr_max_xx.xml   2008-05-01 
04:43:27 UTC (rev 8301)
@@ -12,12 +12,6 @@
        <import>from gnuradio import gr</import>
        <make>gr.max_$(type.fcn)($vlen)</make>
        <param>
-               <name>Num Inputs</name>
-               <key>num_inputs</key>
-               <value>2</value>
-               <type>int</type>                
-       </param>
-       <param>
                <name>IO Type</name>
                <key>type</key>
                <type>enum</type>
@@ -38,6 +32,12 @@
                </option>
        </param>
        <param>
+               <name>Num Inputs</name>
+               <key>num_inputs</key>
+               <value>2</value>
+               <type>int</type>                
+       </param>
+       <param>
                <name>Vec Length</name>
                <key>vlen</key>
                <value>1</value>

Modified: grc/trunk/src/grc_gnuradio/blocks/operators/gr_multiply_const_vxx.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/operators/gr_multiply_const_vxx.xml       
2008-04-30 05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/operators/gr_multiply_const_vxx.xml       
2008-05-01 04:43:27 UTC (rev 8301)
@@ -13,12 +13,6 @@
        <make>gr.multiply_const_v$(type.fcn)($const)</make>
        <callback>set_k($const)</callback>
        <param>
-               <name>Constant</name>
-               <key>const</key>
-               <value>0</value>
-               <type>$type.const_type</type>
-       </param>
-       <param>
                <name>IO Type</name>
                <key>type</key>
                <type>enum</type>
@@ -48,6 +42,12 @@
                </option>
        </param>        
        <param>
+               <name>Constant</name>
+               <key>const</key>
+               <value>0</value>
+               <type>$type.const_type</type>
+       </param>
+       <param>
                <name>Vec Length</name>
                <key>vlen</key>
                <value>1</value>

Modified: grc/trunk/src/grc_gnuradio/blocks/operators/gr_multiply_vxx.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/operators/gr_multiply_vxx.xml     
2008-04-30 05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/operators/gr_multiply_vxx.xml     
2008-05-01 04:43:27 UTC (rev 8301)
@@ -12,12 +12,6 @@
        <import>from gnuradio import gr</import>
        <make>gr.multiply_v$(type.fcn)($vlen)</make>
        <param>
-               <name>Num Inputs</name>
-               <key>num_inputs</key>
-               <value>2</value>
-               <type>int</type>                
-       </param>
-       <param>
                <name>IO Type</name>
                <key>type</key>
                <type>enum</type>
@@ -43,6 +37,12 @@
                </option>
        </param>
        <param>
+               <name>Num Inputs</name>
+               <key>num_inputs</key>
+               <value>2</value>
+               <type>int</type>                
+       </param>
+       <param>
                <name>Vec Length</name>
                <key>vlen</key>
                <value>1</value>

Modified: grc/trunk/src/grc_gnuradio/blocks/operators/gr_not_xx.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/operators/gr_not_xx.xml   2008-04-30 
05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/operators/gr_not_xx.xml   2008-05-01 
04:43:27 UTC (rev 8301)
@@ -11,12 +11,6 @@
        <import>from gnuradio import gr</import>
        <make>gr.not_$(type.fcn)()</make>       
        <param>
-               <name>Num Inputs</name>
-               <key>num_inputs</key>
-               <value>2</value>
-               <type>int</type>                
-       </param>
-       <param>
                <name>IO Type</name>
                <key>type</key>
                <type>enum</type>               
@@ -35,6 +29,12 @@
                        <key>byte</key>
                        <opt>fcn:bb</opt>                                       
        
                </option>
+       </param>        
+       <param>
+               <name>Num Inputs</name>
+               <key>num_inputs</key>
+               <value>2</value>
+               <type>int</type>                
        </param>
        <check>$num_inputs &gt;= 2</check>
        <sink>

Modified: grc/trunk/src/grc_gnuradio/blocks/operators/gr_or_xx.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/operators/gr_or_xx.xml    2008-04-30 
05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/operators/gr_or_xx.xml    2008-05-01 
04:43:27 UTC (rev 8301)
@@ -11,12 +11,6 @@
        <import>from gnuradio import gr</import>
        <make>gr.or_$(type.fcn)()</make>
        <param>
-               <name>Num Inputs</name>
-               <key>num_inputs</key>
-               <value>2</value>
-               <type>int</type>                
-       </param>
-       <param>
                <name>IO Type</name>
                <key>type</key>
                <type>enum</type>               
@@ -36,6 +30,12 @@
                        <opt>fcn:bb</opt>                                       
        
                </option>
        </param>
+       <param>
+               <name>Num Inputs</name>
+               <key>num_inputs</key>
+               <value>2</value>
+               <type>int</type>                
+       </param>
        <check>$num_inputs &gt;= 2</check>
        <sink>
                <name>in</name>

Modified: grc/trunk/src/grc_gnuradio/blocks/operators/gr_sub_xx.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/operators/gr_sub_xx.xml   2008-04-30 
05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/operators/gr_sub_xx.xml   2008-05-01 
04:43:27 UTC (rev 8301)
@@ -12,12 +12,6 @@
        <import>from gnuradio import gr</import>
        <make>gr.sub_$(type.fcn)()</make>
        <param>
-               <name>Num Inputs</name>
-               <key>num_inputs</key>
-               <value>2</value>
-               <type>int</type>                
-       </param>
-       <param>
                <name>IO Type</name>
                <key>type</key>
                <type>enum</type>
@@ -42,6 +36,12 @@
                        <opt>fcn:ss</opt>                                       
        
                </option>
        </param>
+       <param>
+               <name>Num Inputs</name>
+               <key>num_inputs</key>
+               <value>2</value>
+               <type>int</type>                
+       </param>
        <check>$num_inputs &gt;= 2</check>
        <sink>
                <name>in</name>

Modified: grc/trunk/src/grc_gnuradio/blocks/operators/gr_xor_xx.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/operators/gr_xor_xx.xml   2008-04-30 
05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/operators/gr_xor_xx.xml   2008-05-01 
04:43:27 UTC (rev 8301)
@@ -11,12 +11,6 @@
        <import>from gnuradio impxort gr</import>
        <make>gr.xor_$(type.fcn)()</make>
        <param>
-               <name>Num Inputs</name>
-               <key>num_inputs</key>
-               <value>2</value>
-               <type>int</type>                
-       </param>
-       <param>
                <name>IO Type</name>
                <key>type</key>
                <type>enum</type>               
@@ -36,6 +30,12 @@
                        <opt>fcn:bb</opt>                                       
        
                </option>
        </param>
+       <param>
+               <name>Num Inputs</name>
+               <key>num_inputs</key>
+               <value>2</value>
+               <type>int</type>                
+       </param>
        <check>$num_inputs &gt;= 2</check>
        <sink>
                <name>in</name>

Modified: grc/trunk/src/grc_gnuradio/blocks/options.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/options.xml       2008-04-30 05:55:34 UTC 
(rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/options.xml       2008-05-01 04:43:27 UTC 
(rev 8301)
@@ -13,15 +13,21 @@
        <import>from gnuradio import gr</import>
        <make></make>
        <param>
-               <name>Name</name>
-               <key>name</key>
+               <name>Title</name>
+               <key>title</key>
                <value>untitled</value>
                <type>string</type>             
        </param>
        <param>
+               <name>Author</name>
+               <key>author</key>
+               <value>unknown</value>
+               <type>string</type>             
+       </param>
+       <param>
                <name>Description</name>
                <key>description</key>
-               <value>untitled flow graph</value>
+               <value>gnuradio flow graph</value>
                <type>string</type>                     
        </param>
        <param>

Modified: grc/trunk/src/grc_gnuradio/blocks/variables/variable_chooser.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/variables/variable_chooser.xml    
2008-04-30 05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/variables/variable_chooser.xml    
2008-05-01 04:43:27 UTC (rev 8301)
@@ -59,7 +59,7 @@
        <param>
                <name>Grid Position</name>
                <key>grid_pos</key>
-               <value>0, 0, 1, 1</value>
+               <value>0, 0, 1, 2</value>
                <type>grid_pos</type>
        </param>
        <check>$value_index in range(len($choices))</check>

Modified: grc/trunk/src/grc_gnuradio/blocks/variables/variable_slider.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/variables/variable_slider.xml     
2008-04-30 05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/blocks/variables/variable_slider.xml     
2008-05-01 04:43:27 UTC (rev 8301)
@@ -42,7 +42,7 @@
        <param>
                <name>Grid Position</name>
                <key>grid_pos</key>
-               <value>0, 0, 1, 1</value>
+               <value>0, 0, 1, 2</value>
                <type>grid_pos</type>
        </param>
        <check>$min &lt;= $value &lt;= $max</check>

Modified: grc/trunk/src/grc_gnuradio/data/default_flow_graph.grc.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/data/default_flow_graph.grc.xml  2008-04-30 
05:55:34 UTC (rev 8300)
+++ grc/trunk/src/grc_gnuradio/data/default_flow_graph.grc.xml  2008-05-01 
04:43:27 UTC (rev 8301)
@@ -14,7 +14,7 @@
                </param>        
                <param>
                        <key>gui_coordinate</key>
-                       <value>(20, 20)</value>
+                       <value>(10, 10)</value>
                </param>
                <param>
                        <key>gui_rotation</key>
@@ -33,7 +33,7 @@
                </param>        
                <param>
                        <key>gui_coordinate</key>
-                       <value>(20, 150)</value>
+                       <value>(10, 150)</value>
                </param>
                <param>
                        <key>gui_rotation</key>

Modified: grc/trunk/src/grc_gnuradio/data/no_gui.tmpl
===================================================================
--- grc/trunk/src/grc_gnuradio/data/no_gui.tmpl 2008-04-30 05:55:34 UTC (rev 
8300)
+++ grc/trunk/src/grc_gnuradio/data/no_gui.tmpl 2008-05-01 04:43:27 UTC (rev 
8301)
@@ -11,13 +11,11 @@
 #import time
 $('#'*40)
 # Gnuradio Python Flow Graph (no gui)
-$('# Name: %s'%$flow_graph.get_option('name'))
+$('# Title: %s'%$flow_graph.get_option('title'))
+$('# Author: %s'%$flow_graph.get_option('author'))
+$('# Description: %s'%$flow_graph.get_option('description'))
 $('# Generated: %s'%time.ctime())
 $('#'*40)
-$('"""')
-Description:
-$flow_graph.get_option('description')
-$('"""')
 
 #for $imp in $imports
 $imp

Modified: grc/trunk/src/grc_gnuradio/data/wx_gui.tmpl
===================================================================
--- grc/trunk/src/grc_gnuradio/data/wx_gui.tmpl 2008-04-30 05:55:34 UTC (rev 
8300)
+++ grc/trunk/src/grc_gnuradio/data/wx_gui.tmpl 2008-05-01 04:43:27 UTC (rev 
8301)
@@ -24,13 +24,11 @@
 #end if
 $('#'*40)
 # Gnuradio Python Flow Graph (wx gui)
-$('# Name: %s'%$flow_graph.get_option('name'))
+$('# Title: %s'%$flow_graph.get_option('title'))
+$('# Author: %s'%$flow_graph.get_option('author'))
+$('# Description: %s'%$flow_graph.get_option('description'))
 $('# Generated: %s'%time.ctime())
 $('#'*40)
-$('"""')
-Description:
-$flow_graph.get_option('description')
-$('"""')
 
 ########################################################
 ##     Create a callback function
@@ -55,7 +53,7 @@
 #end for
 
 tb = grc_wxgui.top_block_gui(
-       title="$MAIN_WINDOW_PREFIX - Executing: $flow_graph.get_option('name')",
+       title="$MAIN_WINDOW_PREFIX - Executing: 
$flow_graph.get_option('title')",
        icon=$WX_APP_ICON,
 )
 





reply via email to

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