commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r8070 - in grc/branches/grc_reloaded: notes src/grc sr


From: jblum
Subject: [Commit-gnuradio] r8070 - in grc/branches/grc_reloaded: notes src/grc src/grc/gui src/grc/gui/elements src/grc_gnuradio src/grc_gnuradio/blocks/misc src/grc_gnuradio/blocks/operators src/grc_gnuradio/data
Date: Fri, 21 Mar 2008 19:17:16 -0600 (MDT)

Author: jblum
Date: 2008-03-21 19:17:15 -0600 (Fri, 21 Mar 2008)
New Revision: 8070

Added:
   grc/branches/grc_reloaded/src/grc_gnuradio/blocks/misc/gr_mute_xx.xml
   grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_argmax_xx.xml
   grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_max_xx.xml
Modified:
   grc/branches/grc_reloaded/notes/todo.txt
   grc/branches/grc_reloaded/src/grc/ActionHandler.py
   grc/branches/grc_reloaded/src/grc/ParseXML.py
   grc/branches/grc_reloaded/src/grc/gui/Dialogs.py
   grc/branches/grc_reloaded/src/grc/gui/FileDialogs.py
   grc/branches/grc_reloaded/src/grc/gui/MainWindow.py
   grc/branches/grc_reloaded/src/grc/gui/SignalBlockParamsDialog.py
   grc/branches/grc_reloaded/src/grc/gui/elements/Block.py
   grc/branches/grc_reloaded/src/grc_gnuradio/Block.py
   grc/branches/grc_reloaded/src/grc_gnuradio/data/block_tree.xml
   grc/branches/grc_reloaded/src/grc_gnuradio/data/default_flow_graph.grc.xml
Log:
multiple open for files, added max and argmax, changed position param to gui 
coordinate and rotation

Modified: grc/branches/grc_reloaded/notes/todo.txt
===================================================================
--- grc/branches/grc_reloaded/notes/todo.txt    2008-03-22 00:42:36 UTC (rev 
8069)
+++ grc/branches/grc_reloaded/notes/todo.txt    2008-03-22 01:17:15 UTC (rev 
8070)
@@ -26,7 +26,6 @@
 -const sink constructor needs marker option
 -clean up const sink display
 -clean up scope sink display
--grc open multiple file at once
 
 ############   wxPython Features:      ####################
 -dump wx running graph to png?

Modified: grc/branches/grc_reloaded/src/grc/ActionHandler.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/ActionHandler.py  2008-03-22 00:42:36 UTC 
(rev 8069)
+++ grc/branches/grc_reloaded/src/grc/ActionHandler.py  2008-03-22 01:17:15 UTC 
(rev 8070)
@@ -81,20 +81,23 @@
                """
                keyname = gtk.gdk.keyval_name(event.keyval)
                #print 'Key "%s" (%d) was pressed' % (keyname, event.keyval)
-               #if event.state & gtk.gdk.CONTROL_MASK: print "Control was 
being held down"
-               #if event.state & gtk.gdk.MOD1_MASK: print "Alt was being held 
down"
-               #if event.state & gtk.gdk.SHIFT_MASK: print "Shift was being 
held down"         
-               ####################    save/open/new/undo/redo 
############################### 
-               if event.state & gtk.gdk.CONTROL_MASK and keyname == 's':
+               ctrl = event.state & gtk.gdk.CONTROL_MASK
+               alt = event.state & gtk.gdk.MOD1_MASK
+               shift = event.state & gtk.gdk.SHIFT_MASK
+               ####################    save/open/new/close     
############################### 
+               if ctrl and keyname == 's':
                        self.handle_states(FLOW_GRAPH_SAVE)
-               elif event.state & gtk.gdk.CONTROL_MASK and keyname == 'z':
+               elif ctrl and keyname == 'o':
+                       self.handle_states(FLOW_GRAPH_OPEN)
+               elif ctrl and keyname == 'n':
+                       self.handle_states(FLOW_GRAPH_NEW)
+               elif ctrl and keyname == 'q':
+                       self.handle_states(FLOW_GRAPH_CLOSE)
+               ####################    Undo/Redo       
###############################
+               elif ctrl and keyname == 'z':
                        self.handle_states(FLOW_GRAPH_UNDO)
-               elif event.state & gtk.gdk.CONTROL_MASK and (keyname in ('y', 
'Z')):
+               elif ctrl and keyname == 'y':
                        self.handle_states(FLOW_GRAPH_REDO)
-               elif event.state & gtk.gdk.CONTROL_MASK and keyname == 'o':
-                       self.handle_states(FLOW_GRAPH_OPEN)
-               elif event.state & gtk.gdk.CONTROL_MASK and keyname == 'n':
-                       self.handle_states(FLOW_GRAPH_NEW)
                ####################    Delete  ###############################
                elif self.get_focus_flag() and keyname == 'Delete':     #mouse 
focus
                        self.handle_states(ELEMENT_REMOVE)
@@ -267,8 +270,10 @@
                elif state == FLOW_GRAPH_NEW:
                        self.main_window.new_page()
                elif state == FLOW_GRAPH_OPEN:
-                       file_path = 
gui.OpenFlowGraphFileDialog(self.get_flow_graph() and 
self.get_page().get_file_path() or '').run()
-                       if file_path: self.main_window.new_page(file_path, 
manual_open=True)
+                       file_paths = 
gui.OpenFlowGraphFileDialog(self.get_flow_graph() and 
self.get_page().get_file_path() or '').run()
+                       if file_paths: #open a new page for each file, show 
only the first
+                               for i,file_path in enumerate(file_paths):
+                                       self.main_window.new_page(file_path, 
show=(i==0))
                elif state == FLOW_GRAPH_CLOSE:
                        self.main_window.close_page()           
                elif state == FLOW_GRAPH_SAVE:

Modified: grc/branches/grc_reloaded/src/grc/ParseXML.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/ParseXML.py       2008-03-22 00:42:36 UTC 
(rev 8069)
+++ grc/branches/grc_reloaded/src/grc/ParseXML.py       2008-03-22 01:17:15 UTC 
(rev 8070)
@@ -50,37 +50,9 @@
        def fatal(self, msg):
                raise ValidationError('Fatal', msg, self.location())
                
-_SPECIAL_CHARS = (
-       ('&', '&'),
-       ('<', '&lt;'),
-       ('>', '&gt;'),          
-       ('"', '&quot;'),
-       ("'", '&apos;'),
-)
-
 def getChildrenByTagName(doc, tag_name):
-       return filter(lambda cn: str(cn.localName) == str(tag_name), 
doc.childNodes)
+       return filter(lambda c: str(c.localName) == str(tag_name), 
doc.childNodes)
        
-def xml_encode(string):
-       """!
-       Encode a string into an xml safe string by replacing special characters.
-       @param string the input string
-       @return output string with safe characters
-       """
-       string = str(string)
-       for char, safe in _SPECIAL_CHARS: string = string.replace(char, safe)
-       return string
-       
-def xml_decode(string):
-       """!
-       Decode an xml string into its original form by replacing special 
characters.
-       @param string the input xml string
-       @return output string without safe characters
-       """
-       string = str(string)
-       for char, safe in reversed(_SPECIAL_CHARS): string = 
string.replace(safe, char)
-       return string
-
 def validate_dtd(file_path):
        """!
        Validate an xml file against its dtd.
@@ -108,7 +80,7 @@
        if not doc.hasChildNodes(): 
                return odict({tag_name: ''})
        elif len(doc.childNodes) == 1 and doc.firstChild.nodeValue:
-               return odict({tag_name: xml_decode(doc.firstChild.nodeValue)})  
+               return odict({tag_name: doc.firstChild.nodeValue})
        nested_data = odict()
        for elem in filter(lambda elem: elem.localName, doc.childNodes):
                key, value = _from_xml(elem).items()[0]
@@ -142,7 +114,7 @@
                for key, elems in value.iteritems():
                        if type(elems) != type(list()): elems = [elems]
                        for elem in elems: 
child.appendChild(_to_xml(odict({key: elem}), doc))
-       elif value: child.appendChild(doc.createTextNode(xml_encode(value)))
+       elif value: child.appendChild(doc.createTextNode(value))
        return child
 
 def to_file(doc, file_path):

Modified: grc/branches/grc_reloaded/src/grc/gui/Dialogs.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/gui/Dialogs.py    2008-03-22 00:42:36 UTC 
(rev 8069)
+++ grc/branches/grc_reloaded/src/grc/gui/Dialogs.py    2008-03-22 01:17:15 UTC 
(rev 8070)
@@ -120,9 +120,9 @@
                        ('New Flow Graph', 'Ctrl + n'),
                        ('Open Flow Graph', 'Ctrl + o'),
                        ('Save Flow Graph', 'Ctrl + s'),
+                       ('Close Flow Graph', 'Ctrl + q'),
                        ('Undo Change', 'Ctrl + z'),
                        ('Redo Change', 'Ctrl + y'),
-                       ('Redo Change', 'Ctrl + Z'),
                        ('Delete Block', 'Delete'),
                        ('Modify Parameters', 'Enter'),
                        ('Rotate Block', 'Right'),
@@ -131,7 +131,6 @@
                        ('Modify Data Type', 'Down'),
                        ('Add a Port', '+'),
                        ('Remove a Port', '-'),
-                       ('Close Dialog', 'Esc'),
                        ('Flow Graph Run', 'F5'),
                        ('Flow Graph Stop', 'F7'),
                        ('Screen Shot', 'PrintScreen'),

Modified: grc/branches/grc_reloaded/src/grc/gui/FileDialogs.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/gui/FileDialogs.py        2008-03-22 
00:42:36 UTC (rev 8069)
+++ grc/branches/grc_reloaded/src/grc/gui/FileDialogs.py        2008-03-22 
01:17:15 UTC (rev 8070)
@@ -89,6 +89,7 @@
                if self.type == OPEN_FLOW_GRAPH:
                        FileDialogHelper.__init__(self, 
gtk.FILE_CHOOSER_ACTION_OPEN, 'Open a Flow Graph from a File...')
                        self.add_and_set_filter(FLOW_GRAPH_FILE_FILTER)
+                       self.set_select_multiple(True)
                elif self.type == SAVE_FLOW_GRAPH:
                        FileDialogHelper.__init__(self, 
gtk.FILE_CHOOSER_ACTION_SAVE, 'Save a Flow Graph to a File...') 
                        self.add_and_set_filter(FLOW_GRAPH_FILE_FILTER)
@@ -113,37 +114,40 @@
                Run the dialog and get the filename. 
                If this is a save dialog and the file name is missing the 
extension, append the file extension.
                If the file name with the extension already exists, show a 
overwrite dialog.
+               If this is an open dialog, return a list of filenames.
                @return the complete file path 
                """
-               if gtk.FileChooserDialog.run(self) == gtk.RESPONSE_OK: 
-                       filename = self.get_filename()
-                       #############################################
-                       # Handle Save Dialogs
-                       #############################################
-                       if self.type in (SAVE_FLOW_GRAPH, SAVE_IMAGE):          
                        
-                               for extension,filter in (
-                                       (FLOW_GRAPH_FILE_EXTENSION, 
FLOW_GRAPH_FILE_FILTER), 
-                                       (IMAGE_FILE_EXTENSION, 
IMAGE_FILE_FILTER)
-                               ): #append the missing file extension if the 
filter matches
-                                       if      
filename[len(filename)-len(extension):] != extension and filter == 
self.get_filter(): filename = filename + extension                   
-                               self.set_current_name(path.basename(filename))  
#show the filename with extension                               
-                               if path.exists(filename): #ask the user to 
confirm overwrite                                            
-                                       if MessageDialogHelper(
-                                               gtk.MESSAGE_QUESTION, 
gtk.BUTTONS_YES_NO, 'Confirm Overwrite!',
-                                               'File <b>"%s"</b> 
Exists!\nWould you like to overwrite the existing file?'%filename,
-                                       ) == gtk.RESPONSE_NO: filename = 
self.get_rectified_filename()                  
-                       #############################################
-                       # Handle Open Dialogs
-                       #############################################
-                       elif self.type in (OPEN_FLOW_GRAPH,):
+               if gtk.FileChooserDialog.run(self) != gtk.RESPONSE_OK: return 
None      #response was cancel
+               #############################################
+               # Handle Save Dialogs
+               #############################################
+               if self.type in (SAVE_FLOW_GRAPH, SAVE_IMAGE):
+                       filename = self.get_filename()                          
        
+                       for extension,filter in (
+                               (FLOW_GRAPH_FILE_EXTENSION, 
FLOW_GRAPH_FILE_FILTER), 
+                               (IMAGE_FILE_EXTENSION, IMAGE_FILE_FILTER)
+                       ): #append the missing file extension if the filter 
matches
+                               if      filename[len(filename)-len(extension):] 
!= extension and filter == self.get_filter(): filename = filename + extension   
                
+                       self.set_current_name(path.basename(filename))  #show 
the filename with extension                               
+                       if path.exists(filename): #ask the user to confirm 
overwrite                                            
+                               if MessageDialogHelper(
+                                       gtk.MESSAGE_QUESTION, 
gtk.BUTTONS_YES_NO, 'Confirm Overwrite!',
+                                       'File <b>"%s"</b> Exists!\nWould you 
like to overwrite the existing file?'%filename,
+                               ) == gtk.RESPONSE_NO: return 
self.get_rectified_filename()      
+                       return filename         
+               #############################################
+               # Handle Open Dialogs
+               #############################################
+               elif self.type in (OPEN_FLOW_GRAPH,):
+                       filenames = self.get_filenames()                
+                       for filename in filenames:                      
                                if not path.exists(filename): #show a warning 
and re-run
                                        MessageDialogHelper(
                                                gtk.MESSAGE_WARNING, 
gtk.BUTTONS_CLOSE, 'Cannot Open!',
                                                'File <b>"%s"</b> Does not 
Exist!'%filename,
                                        )       
-                                       filename = self.get_rectified_filename()
-                       return filename 
-               return None     #response was cancel
+                                       return self.get_rectified_filename()
+                       return filenames
 
        def run(self):
                """!

Modified: grc/branches/grc_reloaded/src/grc/gui/MainWindow.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/gui/MainWindow.py 2008-03-22 00:42:36 UTC 
(rev 8069)
+++ grc/branches/grc_reloaded/src/grc/gui/MainWindow.py 2008-03-22 01:17:15 UTC 
(rev 8070)
@@ -149,12 +149,12 @@
        ##      Pages: create and close
        ############################################################
        
-       def new_page(self, file_path='', manual_open=False):
+       def new_page(self, file_path='', show=False):
                """!
                Create a new notebook page.
                Set the tab to be selected.
                @param file_path optional file to load into the flow graph
-               @param manual_open true if the user initiated this open from 
dialog
+               @param show true if the page should be shown after loading
                """
                #if the file is already open, show the open page and return
                if file_path and file_path in self._get_files(): #already open
@@ -182,7 +182,7 @@
                except: pass #gtk too old
                self.notebook.set_tab_label_packing(page, False, False, 
gtk.PACK_START)
                #only show if blank or manual 
-               if not file_path or manual_open: self._set_page(page) 
+               if not file_path or show: self._set_page(page) 
                
        def close_pages(self):
                """

Modified: grc/branches/grc_reloaded/src/grc/gui/SignalBlockParamsDialog.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/gui/SignalBlockParamsDialog.py    
2008-03-22 00:42:36 UTC (rev 8069)
+++ grc/branches/grc_reloaded/src/grc/gui/SignalBlockParamsDialog.py    
2008-03-22 01:17:15 UTC (rev 8070)
@@ -67,7 +67,7 @@
                err_box.pack_start(get_title_label('Error Messages'), False)
                err_box.pack_start(self._error_messages_text_display, False)    
        
                #Add all the parameters
-               for param in filter(lambda p: p.get_key() not in ('position',), 
self.block.get_params()): 
+               for param in filter(lambda p: p.get_key() not in 
('gui_coordinate', 'gui_rotation'), self.block.get_params()): 
                        
vbox.pack_start(param.get_input_object(self._handle_changed), False)    
                vbox.pack_start(err_box, False)
                #Done adding parameters                                         
        

Modified: grc/branches/grc_reloaded/src/grc/gui/elements/Block.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/gui/elements/Block.py     2008-03-22 
00:42:36 UTC (rev 8069)
+++ grc/branches/grc_reloaded/src/grc/gui/elements/Block.py     2008-03-22 
01:17:15 UTC (rev 8070)
@@ -38,14 +38,22 @@
                Add graphics related params to the block.
                """     
                #add the position param
-               self._params['position'] = self.get_parent().get_parent().Param(
+               self._params['gui_coordinate'] = 
self.get_parent().get_parent().Param(
                        self, 
                        {
-                               'name': 'Position', 
-                               'key': 'position', 
+                               'name': 'GUI Coordinate', 
+                               'key': 'gui_coordinate', 
                                'type': 'raw',
                        }
                )
+               self._params['gui_rotation'] = 
self.get_parent().get_parent().Param(
+                       self, 
+                       {
+                               'name': 'GUI Rotation', 
+                               'key': 'gui_rotation', 
+                               'type': 'raw',
+                       }
+               )
                Element.__init__(self)
        
        def get_coordinate(self):
@@ -54,8 +62,8 @@
                @return the coordinate tuple (x, y) or (0, 0) if failure
                """             
                try: #should evaluate to dict
-                       position = eval(self.get_param('position').get_value())
-                       x, y = int(position['x']), int(position['y'])
+                       coor = 
eval(self.get_param('gui_coordinate').get_value())
+                       x, y = map(int, coor)
                        fgW,fgH = self.get_parent().get_size()
                        if x <= 0:
                                x = 0
@@ -66,16 +74,16 @@
                        elif y >= fgH - BORDER_PROXIMITY_SENSITIVITY:   
                                y = fgH - BORDER_PROXIMITY_SENSITIVITY  
                        return (x, y)
-               except: return (0, 0)
+               except: 
+                       self.set_coordinate((0, 0))
+                       return (0, 0)
                
        def set_coordinate(self, coor):
                """!
                Set the coordinate into the position param.
                @param coor the coordinate tuple (x, y)
                """
-               x, y = coor
-               position = {'x': x, 'y': y, 'rot': self.get_rotation()}
-               self.get_param('position').set_value(str(position))
+               self.get_param('gui_coordinate').set_value(str(coor))
                
        def get_rotation(self):
                """!
@@ -83,18 +91,18 @@
                @return the rotation in degrees or 0 if failure
                """             
                try: #should evaluate to dict
-                       position = eval(self.get_param('position').get_value())
-                       return int(position['rot'])
-               except: return 0
+                       rotation = 
eval(self.get_param('gui_rotation').get_value())
+                       return int(rotation)
+               except: 
+                       self.set_rotation(0)
+                       return 0
                
        def set_rotation(self, rot):
                """!
                Set the rotation into the position param.
                @param rot the rotation in degrees
                """
-               x, y = self.get_coordinate()
-               position = {'x': x, 'y': y, 'rot': rot}
-               self.get_param('position').set_value(str(position))
+               self.get_param('gui_rotation').set_value(str(rot))
        
        def update(self):
                """Update the block, parameters, and ports when a change 
occurs."""
@@ -118,7 +126,7 @@
                if not self.is_valid(): layout.set_markup('<span 
foreground="red"><b>'+self.get_name()+'</b></span>')                   
                self.label_width,self.label_height = layout.get_pixel_size()    
                #display the params (except for the special params id and 
position)
-               for param in filter(lambda p: p.get_key() not in ('position', 
), self.get_params()):
+               for param in filter(lambda p: p.get_key() not in 
('gui_coordinate', 'gui_rotation'), self.get_params()):
                        layout = param.get_layout()
                        layouts.append(layout)
                        w,h = layout.get_pixel_size()

Modified: grc/branches/grc_reloaded/src/grc_gnuradio/Block.py
===================================================================
--- grc/branches/grc_reloaded/src/grc_gnuradio/Block.py 2008-03-22 00:42:36 UTC 
(rev 8069)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/Block.py 2008-03-22 01:17:15 UTC 
(rev 8070)
@@ -43,12 +43,14 @@
        @param file the xml file name
        @return true if matches
        """
-       _file = file.replace('.xml', '') #remove file ext       
-       _file = _file.replace('class', '') #remove the class
-       _file = _file.replace('__', '_') #doxygen xml files have 2 underscores
-       _key = key.rstrip('x') #strip x to the right to match an xml file
-       return _file.startswith(_key) and len(key) == len(_file)
-       
+       file = file.replace('.xml', '') #remove file ext        
+       file = file.replace('class', '') #remove the class
+       file = file.replace('__', '_') #doxygen xml files have 2 underscores
+       if len(file) != len(key): return False
+       for i,k in enumerate(key):
+               if file[i] != k and k != 'x': return False      
+       return True
+
 def extract_docs(key):
        """!
        Extract the documentation from the doxygen generated xml files.

Added: grc/branches/grc_reloaded/src/grc_gnuradio/blocks/misc/gr_mute_xx.xml
===================================================================
--- grc/branches/grc_reloaded/src/grc_gnuradio/blocks/misc/gr_mute_xx.xml       
                        (rev 0)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/blocks/misc/gr_mute_xx.xml       
2008-03-22 01:17:15 UTC (rev 8070)
@@ -0,0 +1,54 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!-- 
+###################################################
+##Mute Block:
+##     Cast input to bool.
+###################################################
+ -->
+<block>
+       <name>Mute</name>
+       <key>gr_mute_xx</key>
+       <import>from gnuradio import gr</import>
+       <make>gr.mute_$(type.fcn)(bool($mute))</make>
+       <callback>set_mute(bool($mute))</callback>
+       <param>
+               <name>IO 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>
+               <option>
+                       <name>Int</name>
+                       <key>int</key>
+                       <opt>fcn:ii</opt>                                       
        
+               </option>
+               <option>
+                       <name>Short</name>
+                       <key>short</key>
+                       <opt>fcn:ss</opt>                                       
        
+               </option>
+       </param>
+       <param>
+               <name>Mute</name>
+               <key>mute</key>
+               <value>False</value>
+               <type>raw</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/operators/gr_argmax_xx.xml
===================================================================
--- 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_argmax_xx.xml    
                            (rev 0)
+++ 
grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_argmax_xx.xml    
    2008-03-22 01:17:15 UTC (rev 8070)
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!-- 
+###################################################
+##ArgMax:
+##     1 output, 2 to inf inputs
+###################################################
+ -->
+<block>
+       <name>Argmax</name>
+       <key>gr_argmax_xx</key>
+       <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>
+               <option>
+                       <name>Float</name>
+                       <key>float</key>
+                       <opt>fcn:fs</opt>                                       
        
+               </option>
+               <option>
+                       <name>Int</name>
+                       <key>int</key>
+                       <opt>fcn:is</opt>                                       
        
+               </option>
+               <option>
+                       <name>Short</name>
+                       <key>short</key>
+                       <opt>fcn:dd</opt>                                       
        
+               </option>
+       </param>
+       <param>
+               <name>Vec Length</name>
+               <key>vlen</key>
+               <value>1</value>
+               <type>int</type>                
+       </param>
+       <check>$num_inputs &gt;= 2</check>
+       <check>$vlen &gt;= 1</check>
+       <sink>
+               <name>in</name>
+               <type>$type</type>
+               <vlen>$vlen</vlen>
+               <nports>$num_inputs</nports>
+       </sink> 
+       <source>
+               <name>out</name>
+               <type>short</type>
+               <vlen>$vlen</vlen>
+       </source>               
+</block>

Added: grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_max_xx.xml
===================================================================
--- grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_max_xx.xml   
                        (rev 0)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/blocks/operators/gr_max_xx.xml   
2008-03-22 01:17:15 UTC (rev 8070)
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!-- 
+###################################################
+##Max:
+##     1 output, 2 to inf inputs
+###################################################
+ -->
+<block>
+       <name>Max</name>
+       <key>gr_max_xx</key>
+       <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>
+               <option>
+                       <name>Float</name>
+                       <key>float</key>
+                       <opt>fcn:ff</opt>                                       
        
+               </option>
+               <option>
+                       <name>Int</name>
+                       <key>int</key>
+                       <opt>fcn:ii</opt>                                       
        
+               </option>
+               <option>
+                       <name>Short</name>
+                       <key>short</key>
+                       <opt>fcn:dd</opt>                                       
        
+               </option>
+       </param>
+       <param>
+               <name>Vec Length</name>
+               <key>vlen</key>
+               <value>1</value>
+               <type>int</type>                
+       </param>
+       <check>$num_inputs &gt;= 2</check>
+       <check>$vlen &gt;= 1</check>
+       <sink>
+               <name>in</name>
+               <type>$type</type>
+               <vlen>$vlen</vlen>
+               <nports>$num_inputs</nports>
+       </sink> 
+       <source>
+               <name>out</name>
+               <type>$type</type>
+               <vlen>$vlen</vlen>
+       </source>               
+</block>

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-22 00:42:36 UTC (rev 8069)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/data/block_tree.xml      
2008-03-22 01:17:15 UTC (rev 8070)
@@ -53,6 +53,9 @@
                <block>gr_and_xx</block>
                <block>gr_or_xx</block>
                <block>gr_xor_xx</block>
+               
+               <block>gr_max_xx</block>
+               <block>gr_argmax_xx</block>
        </cat>
        <cat>
                <name>Type Conversions</name>
@@ -191,6 +194,7 @@
                <name>Misc</name>
                <block>import</block>
                <block>gr_throttle</block>
+               <block>gr_mute_xx</block>
                <block>valve</block>
                <block>selector</block>
                <block>head</block>

Modified: 
grc/branches/grc_reloaded/src/grc_gnuradio/data/default_flow_graph.grc.xml
===================================================================
--- grc/branches/grc_reloaded/src/grc_gnuradio/data/default_flow_graph.grc.xml  
2008-03-22 00:42:36 UTC (rev 8069)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/data/default_flow_graph.grc.xml  
2008-03-22 01:17:15 UTC (rev 8070)
@@ -13,9 +13,13 @@
                        <value>options</value>
                </param>        
                <param>
-                       <key>position</key>             
-                       <value>{'x': 20, 'y': 20, 'rot': 0}</value>
+                       <key>gui_coordinate</key>
+                       <value>(20, 20)</value>
                </param>
+               <param>
+                       <key>gui_rotation</key>
+                       <value>0</value>
+               </param>
        </block>
        <block>
                <key>variable</key>
@@ -28,8 +32,12 @@
                        <value>32000</value>
                </param>        
                <param>
-                       <key>position</key>             
-                       <value>{'x': 20, 'y': 150, 'rot': 0}</value>
+                       <key>gui_coordinate</key>
+                       <value>(20, 150)</value>
                </param>
+               <param>
+                       <key>gui_rotation</key>
+                       <value>0</value>
+               </param>
        </block>
 </flow_graph>





reply via email to

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