Changeset 8985

Show
Ignore:
Timestamp:
07/23/08 14:33:40
Author:
jblum
Message:

some gui tweaks, todo list, blocks

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • grc/trunk/notes/todo.txt

    r8983 r8985  
    33-optparse block 
    44-ofdm wrappers 
    5 -gr_costas callbacks 
    6 -gr_moving_average_XX 
     5-controlled step block 
    76 
    87############ Features to Add: #################### 
    98-save working directory after close 
    10 -create sub-flow graphs to be used in larger flow graphs 
    119-param editor, expand entry boxes in focus 
    1210-change param dialog to panel within main window 
     
    1715-variable resolution graph structure 
    1816-recursive/nested categories 
     17-icons for certain blocks, + for add 
     18-zoom in/out 
     19-hide io types 
    1920 
    2021############ Problems: #################### 
    2122-catch error on open non-existant files 
    2223-variables dependent on variables that change 
    23 -flow graph, update autoscroll with emit('changed') 
    2424-flow graph, try mouse DRAG_MOTION? 
    2525 
  • grc/trunk/scripts/grc

    r8818 r8985  
    1 #!/usr/bin/python 
     1#!/usr/bin/env python 
    22""" 
    33Copyright 2008 Free Software Foundation, Inc. 
     
    2222#@author Josh Blum 
    2323 
     24import grc 
    2425from grc.Constants import VERSION,FLOW_GRAPH_FILE_EXTENSION 
    2526from optparse import OptionParser 
  • grc/trunk/scripts/usrp_diagnostics

    r8772 r8985  
    1 #!/usr/bin/python 
     1#!/usr/bin/env python 
    22""" 
    33Copyright 2008 Free Software Foundation, Inc. 
  • grc/trunk/src/grc/Constants.py

    r8956 r8985  
    2424 
    2525###################################################################################################### 
    26 ## Global Titles @{ 
     26## Global Titles 
    2727###################################################################################################### 
    2828 
     
    3535##The prefix title on the main window. 
    3636MAIN_WINDOW_PREFIX = "GRC" 
    37 ##@} 
    3837 
    3938###################################################################################################### 
     
    7069###################################################################################################### 
    7170 
    72 ##main window constraints @{ 
     71##main window constraints 
    7372MIN_WINDOW_WIDTH = 600 
    7473MIN_WINDOW_HEIGHT = 400 
    75 ##@} 
    7674 
    77 ##dialog constraints @{ 
     75##dialog constraints 
    7876MIN_DIALOG_WIDTH = 500 
    7977MIN_DIALOG_HEIGHT = 500 
    80 ##@} 
    8178 
    8279##static height of reports window 
     
    8784 
    8885###################################################################################################### 
    89 ## Constraints on displayable labels and ports @{ 
     86## Constraints on displayable labels and ports 
    9087###################################################################################################### 
    9188 
     
    10097MAX_NUM_PORTS = 7 
    10198 
     99PARAM_LABEL_FONT = 'Sans 9.5' 
    102100PARAM_FONT = 'Sans 7.5' 
    103101BLOCK_FONT = 'Sans 8' 
    104102PORT_FONT = 'Sans 7.5' 
    105 ##@} 
    106103 
    107104###################################################################################################### 
    108 ## Dragging, scrolling, and redrawing constants for the flow graph window in pixels @{ 
     105## Dragging, scrolling, and redrawing constants for the flow graph window in pixels 
    109106###################################################################################################### 
    110107 
     
    123120##How close the mouse click can be to a connection and register a connection select. 
    124121CONNECTION_SELECT_SENSITIVITY = 5 
    125 ##@} 
    126122 
    127123###################################################################################################### 
    128 # A state is recorded for each change to the flow graph, the size dictates how many states we can record  
     124# A state is recorded for each change to the flow graph, the size dictates how many states we can record 
    129125###################################################################################################### 
    130126 
     
    133129 
    134130###################################################################################################### 
    135 ## Constansts dealing with File Paths @{ 
     131## Constansts dealing with File Paths 
    136132###################################################################################################### 
    137133 
     
    156152##The default user preferences file. 
    157153PREFERENCES_FILE_PATH = os.path.join(DEFAULT_FILE_PATH, FLOW_GRAPH_FILE_EXTENSION) 
    158 ##@} 
    159154 
  • grc/trunk/src/grc/gui/FileDialogs.py

    r8651 r8985  
    4545ALL_FILE_FILTER = gtk.FileFilter() 
    4646ALL_FILE_FILTER.set_name('All Files') 
    47 ALL_FILE_FILTER.add_pattern('*')        
     47ALL_FILE_FILTER.add_pattern('*') 
    4848 
    4949class FileDialogHelper(gtk.FileChooserDialog): 
    5050        """ 
    51         A wrapper class for the gtk file chooser dialog.  
     51        A wrapper class for the gtk file chooser dialog. 
    5252        Implement a file chooser dialog with only necessary parameters. 
    5353        """ 
    54          
     54 
    5555        def __init__(self, action, title): 
    5656                """! 
     
    6262                """ 
    6363                ok_stock = {gtk.FILE_CHOOSER_ACTION_OPEN : 'gtk-open', gtk.FILE_CHOOSER_ACTION_SAVE : 'gtk-save'}[action] 
    64                 gtk.FileChooserDialog.__init__(self, title, None, action, ('gtk-cancel', gtk.RESPONSE_CANCEL, ok_stock, gtk.RESPONSE_OK))               
     64                gtk.FileChooserDialog.__init__(self, title, None, action, ('gtk-cancel', gtk.RESPONSE_CANCEL, ok_stock, gtk.RESPONSE_OK)) 
    6565                self.set_select_multiple(False) 
    6666                self.set_local_only(True) 
    6767                self.add_filter(ALL_FILE_FILTER) 
    68                 self.connect('key_press_event', self._handle_key_press) 
    69  
    70         def _handle_key_press(self, widget, event): 
    71                 """! 
    72                 Handle key presses from the keyboard. 
    73                 Call the ok response when enter is pressed.      
    74                 @return false to forward the keypress 
    75                 """ 
    76                 keyname = gtk.gdk.keyval_name(event.keyval) 
    77                 if keyname == 'Return': self.response(gtk.RESPONSE_OK)                   
    78                 return False #forward the keypress 
    7968 
    8069class FileDialog(FileDialogHelper): 
    8170        """A dialog box to save or open flow graph files. This is a base class, do not use.""" 
    82                  
     71 
    8372        def __init__(self, current_file_path=''): 
    8473                """! 
    85                 FileDialog constructor.         
     74                FileDialog constructor. 
    8675                @param current_file_path the current directory or path to the open flow graph 
    8776                """ 
     
    9281                        self.set_select_multiple(True) 
    9382                elif self.type == SAVE_FLOW_GRAPH: 
    94                         FileDialogHelper.__init__(self, gtk.FILE_CHOOSER_ACTION_SAVE, 'Save a Flow Graph to a File...')         
     83                        FileDialogHelper.__init__(self, gtk.FILE_CHOOSER_ACTION_SAVE, 'Save a Flow Graph to a File...') 
    9584                        self.add_and_set_filter(FLOW_GRAPH_FILE_FILTER) 
    96                         self.set_current_name(path.basename(current_file_path))        #show the current filename 
     85                        self.set_current_name(path.basename(current_file_path)) #show the current filename 
    9786                elif self.type == SAVE_IMAGE: 
    9887                        FileDialogHelper.__init__(self, gtk.FILE_CHOOSER_ACTION_SAVE, 'Save a Flow Graph Screen Shot...') 
    9988                        self.add_and_set_filter(IMAGE_FILE_FILTER) 
    100                         current_file_path = current_file_path + IMAGE_FILE_EXTENSION    
    101                         self.set_current_name(path.basename(current_file_path))        #show the current filename               
    102                 self.set_current_folder(path.dirname(current_file_path))       #current directory       
    103                  
     89                        current_file_path = current_file_path + IMAGE_FILE_EXTENSION 
     90                        self.set_current_name(path.basename(current_file_path)) #show the current filename 
     91                self.set_current_folder(path.dirname(current_file_path)) #current directory 
     92 
    10493        def add_and_set_filter(self, filter): 
    10594                """! 
     
    112101        def get_rectified_filename(self): 
    113102                """! 
    114                 Run the dialog and get the filename.  
     103                Run the dialog and get the filename. 
    115104                If this is a save dialog and the file name is missing the extension, append the file extension. 
    116105                If the file name with the extension already exists, show a overwrite dialog. 
    117106                If this is an open dialog, return a list of filenames. 
    118                 @return the complete file path  
     107                @return the complete file path 
    119108                """ 
    120                 if gtk.FileChooserDialog.run(self) != gtk.RESPONSE_OK: return None     #response was cancel 
     109                if gtk.FileChooserDialog.run(self) != gtk.RESPONSE_OK: return None #response was cancel 
    121110                ############################################# 
    122111                # Handle Save Dialogs 
    123112                ############################################# 
    124113                if self.type in (SAVE_FLOW_GRAPH, SAVE_IMAGE): 
    125                         filename = self.get_filename()                                  
    126                         for extension,filter in ( 
    127                                 (FLOW_GRAPH_FILE_EXTENSION, FLOW_GRAPH_FILE_FILTER),  
    128                                 (IMAGE_FILE_EXTENSION, IMAGE_FILE_FILTER) 
     114                        filename = self.get_filename() 
     115                        for extension, filter in ( 
     116                                (FLOW_GRAPH_FILE_EXTENSION, FLOW_GRAPH_FILE_FILTER), 
     117                                (IMAGE_FILE_EXTENSION, IMAGE_FILE_FILTER), 
    129118                        ): #append the missing file extension if the filter matches 
    130                                 if      filename[len(filename)-len(extension):] != extension and filter == self.get_filter(): filename = filename + extension                    
    131                         self.set_current_name(path.basename(filename))  #show the filename with extension                                
    132                         if path.exists(filename): #ask the user to confirm overwrite                                             
     119                                if filename[len(filename)-len(extension):] != extension \ 
     120                                        and filter == self.get_filter(): filename += extension 
     121                        self.set_current_name(path.basename(filename)) #show the filename with extension 
     122                        if path.exists(filename): #ask the user to confirm overwrite 
    133123                                if MessageDialogHelper( 
    134124                                        gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, 'Confirm Overwrite!', 
    135125                                        'File <b>"%s"</b> Exists!\nWould you like to overwrite the existing file?'%filename, 
    136                                 ) == gtk.RESPONSE_NO: return self.get_rectified_filename()      
    137                         return filename                 
     126                                ) == gtk.RESPONSE_NO: return self.get_rectified_filename() 
     127                        return filename 
    138128                ############################################# 
    139129                # Handle Open Dialogs 
    140130                ############################################# 
    141131                elif self.type in (OPEN_FLOW_GRAPH,): 
    142                         filenames = self.get_filenames()                
    143                         for filename in filenames:                      
     132                        filenames = self.get_filenames() 
     133                        for filename in filenames: 
    144134                                if not path.exists(filename): #show a warning and re-run 
    145135                                        MessageDialogHelper( 
    146136                                                gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, 'Cannot Open!', 
    147137                                                'File <b>"%s"</b> Does not Exist!'%filename, 
    148                                         )       
     138                                        ) 
    149139                                        return self.get_rectified_filename() 
    150140                        return filenames 
     
    154144                Get the filename and destroy the dialog. 
    155145                @return the filename or None if a close/cancel occured. 
    156                 """             
     146                """ 
    157147                filename = self.get_rectified_filename() 
    158148                self.destroy() 
    159                 return filename  
    160                  
    161 class OpenFlowGraphFileDialog(FileDialog): type = OPEN_FLOW_GRAPH        
    162 class SaveFlowGraphFileDialog(FileDialog): type = SAVE_FLOW_GRAPH        
    163 class SaveImageFileDialog(FileDialog): type = SAVE_IMAGE         
     149                return filename 
    164150 
     151class OpenFlowGraphFileDialog(FileDialog): type = OPEN_FLOW_GRAPH 
     152class SaveFlowGraphFileDialog(FileDialog): type = SAVE_FLOW_GRAPH 
     153class SaveImageFileDialog(FileDialog): type = SAVE_IMAGE 
     154 
  • grc/trunk/src/grc/gui/elements/FlowGraph.py

    r8983 r8985  
    8787                        #make sure that the id is not used by another block 
    8888                        if not filter(lambda e: e.is_block() and e.get_id() == id, self.get_elements()): 
    89                                 vAdj = self.get_scroll_pane().get_vadjustment().get_value() 
    90                                 hAdj = self.get_scroll_pane().get_hadjustment().get_value() 
    91                                 x = random.randint(100,200)+int(hAdj
    92                                 y = random.randint(100,200)+int(vAdj
     89                                v_val = self.get_scroll_pane().get_vadjustment().get_value() 
     90                                h_val = self.get_scroll_pane().get_hadjustment().get_value() 
     91                                x = random.randint(100,200) + int(v_val
     92                                y = random.randint(100,200) + int(h_val
    9393                                #get the new block 
    9494                                block = self.get_new_block(key) 
     
    364364                if time.time() - self.time >= MOTION_DETECT_REDRAWING_SENSITIVITY and \ 
    365365                        self.mouse_pressed and self.get_selected_element(): 
    366                         #The event coordinates must be within BPS pixels away from the bounds of the flow graph. 
    367                         fgW,fgH = self.get_size() 
    368                         x,y = coordinate 
    369                         #get the change in coordinates 
    370                         X,Y = self.get_coordinate() 
    371                         deltaX = int(x - X) 
    372                         deltaY = int(y - Y) 
    373                         vAdj = self.get_scroll_pane().get_vadjustment().get_value() 
    374                         hAdj = self.get_scroll_pane().get_hadjustment().get_value() 
    375                         width = self.get_scroll_pane().get_hadjustment().page_size 
    376                         height = self.get_scroll_pane().get_vadjustment().page_size 
    377                         #scroll horizontal if we moved near the border 
    378                         if x-hAdj > width-SCROLL_PROXIMITY_SENSITIVITY and \ 
    379                                 hAdj+SCROLL_DISTANCE < fgW - width: 
    380                                 self.get_scroll_pane().get_hadjustment().set_value(hAdj+SCROLL_DISTANCE) 
    381                         elif x-hAdj < SCROLL_PROXIMITY_SENSITIVITY: 
    382                                 self.get_scroll_pane().get_hadjustment().set_value(hAdj-SCROLL_DISTANCE) 
    383                         #scroll vertical if we moved near the border 
    384                         if y-vAdj > height-SCROLL_PROXIMITY_SENSITIVITY and \ 
    385                                 vAdj+SCROLL_DISTANCE < fgH - height: 
    386                                 self.get_scroll_pane().get_vadjustment().set_value(vAdj+SCROLL_DISTANCE) 
    387                         elif y-vAdj < SCROLL_PROXIMITY_SENSITIVITY: 
    388                                 self.get_scroll_pane().get_vadjustment().set_value(vAdj-SCROLL_DISTANCE) 
     366                        #perform autoscrolling 
     367                        width, height = self.get_size() 
     368                        x, y = coordinate 
     369                        v_adj = self.get_scroll_pane().get_vadjustment() 
     370                        h_adj = self.get_scroll_pane().get_hadjustment() 
     371                        for pos, length, adj, adj_val, adj_len in ( 
     372                                (x, width, h_adj, h_adj.get_value(), h_adj.page_size), 
     373                                (y, height, v_adj, v_adj.get_value(), v_adj.page_size), 
     374                        ): 
     375                                #scroll if we moved near the border 
     376                                if pos-adj_val > adj_len-SCROLL_PROXIMITY_SENSITIVITY and adj_val+SCROLL_DISTANCE < length-adj_len: 
     377                                        adj.set_value(adj_val+SCROLL_DISTANCE) 
     378                                        adj.emit('changed') 
     379                                elif pos-adj_val < SCROLL_PROXIMITY_SENSITIVITY: 
     380                                        adj.set_value(adj_val-SCROLL_DISTANCE) 
     381                                        adj.emit('changed') 
    389382                        #move the selected element and record the new coordinate 
    390                         self.move_selected((deltaX, deltaY)) 
     383                        X, Y = self.get_coordinate() 
     384                        self.move_selected((int(x - X), int(y - Y))) 
    391385                        self.set_coordinate((x, y)) 
    392386                        #update time 
  • grc/trunk/src/grc/gui/elements/Param.py

    r8442 r8985  
    3737class InputParam(gtk.HBox): 
    3838        """The base class for an input parameter inside the input parameters dialog.""" 
    39          
     39 
    4040        def __init__(self, param, _handle_changed): 
    4141                gtk.HBox.__init__(self) 
     
    4343                self._handle_changed = _handle_changed 
    4444                self.label = gtk.Label('') #no label, markup is added by set_markup 
    45                 self.label.set_size_request(140, -1) 
     45                self.label.set_size_request(150, -1) 
    4646                self.pack_start(self.label, False) 
    47                 self.set_markup = lambda m: self.label.set_markup(m)    
    48                 self.tp = None          
    49                  
     47                self.set_markup = lambda m: self.label.set_markup(m) 
     48                self.tp = None 
     49 
    5050class EntryParam(InputParam): 
    5151        """Provide an entry box for strings and numbers.""" 
    52          
     52 
    5353        def __init__(self, *args, **kwargs): 
    5454                InputParam.__init__(self, *args, **kwargs) 
    55                 self.entry = input = gtk.Entry()                
     55                self.entry = input = gtk.Entry() 
    5656                input.set_text(self.param.get_value()) 
    57                 input.connect("changed", self._handle_changed) 
     57                input.connect('changed', self._handle_changed) 
    5858                self.pack_start(input, True) 
    5959                self.get_text = input.get_text 
     
    6262                self.tp.set_tip(self.entry, '') 
    6363                self.tp.enable() 
    64                  
     64 
    6565class FileParam(EntryParam): 
    6666        """Provide an entry box for filename and a button to browse for a file.""" 
    67          
     67 
    6868        def __init__(self, *args, **kwargs): 
    69                 EntryParam.__init__(self, *args, **kwargs)              
     69                EntryParam.__init__(self, *args, **kwargs) 
    7070                input = gtk.Button('...') 
    7171                input.connect('clicked', self._handle_clicked) 
    7272                self.pack_start(input, False) 
    73          
     73 
    7474        def _handle_clicked(self, widget=None): 
    7575                """ 
     
    7979                file_path = self.param.is_valid() and self.param.evaluate() or '' 
    8080                #bad file paths will be redirected to default 
    81                 if not path.exists(path.dirname(file_path)): file_path = DEFAULT_FILE_PATH      
    82                 if self.param.get_type() == 'file_open':  
     81                if not path.exists(path.dirname(file_path)): file_path = DEFAULT_FILE_PATH 
     82                if self.param.get_type() == 'file_open': 
    8383                        file_dialog = gtk.FileChooserDialog('Open a Data File...', None, 
    8484                                gtk.FILE_CHOOSER_ACTION_OPEN, ('gtk-cancel',gtk.RESPONSE_CANCEL,'gtk-open',gtk.RESPONSE_OK)) 
    85                 elif self.param.get_type() == 'file_save':  
     85                elif self.param.get_type() == 'file_save': 
    8686                        file_dialog = gtk.FileChooserDialog('Save a Data File...', None, 
    8787                                gtk.FILE_CHOOSER_ACTION_SAVE, ('gtk-cancel',gtk.RESPONSE_CANCEL, 'gtk-save',gtk.RESPONSE_OK)) 
    8888                        file_dialog.set_do_overwrite_confirmation(True) 
    89                         file_dialog.set_current_name(path.basename(file_path)) #show the current filename 
    90                 file_dialog.set_current_folder(path.dirname(file_path))        #current directory 
     89                        file_dialog.set_current_name(path.basename(file_path)) #show the current filename 
     90                file_dialog.set_current_folder(path.dirname(file_path)) #current directory 
    9191                file_dialog.set_select_multiple(False) 
    9292                file_dialog.set_local_only(True) 
     
    9595                        self.entry.set_text(file_path) 
    9696                        self._handle_changed() 
    97                 file_dialog.destroy() #destroy the dialog                                               
    98                  
     97                file_dialog.destroy() #destroy the dialog 
     98 
    9999class EnumParam(InputParam): 
    100100        """Provide an entry box for Enum types with a drop down menu.""" 
    101          
     101 
    102102        def __init__(self, *args, **kwargs): 
    103103                InputParam.__init__(self, *args, **kwargs) 
    104                 input = gtk.ComboBox(gtk.ListStore(gobject.TYPE_STRING))                                
     104                input = gtk.ComboBox(gtk.ListStore(gobject.TYPE_STRING)) 
    105105                cell = gtk.CellRendererText() 
    106106                input.pack_start(cell, True) 
     
    117117 
    118118class Param(Element): 
    119         """The graphical parameter."""  
     119        """The graphical parameter.""" 
    120120 
    121121        def update(self): 
    122122                """Called when an external change occurs. 
    123123                Update the graphical input by calling the change handler.""" 
    124                 if hasattr(self, 'input'): self._handle_changed()       
    125                  
     124                if hasattr(self, 'input'): self._handle_changed() 
     125 
    126126        def get_input_object(self, callback=None): 
    127127                """! 
    128                 Get the graphical gtk class to represent this parameter.        
     128                Get the graphical gtk class to represent this parameter. 
    129129                Create the input object with this data type and the handle changed method. 
    130130                @param callback a function of one argument(this param) to be called from the change handler 
     
    138138                self._handle_changed() 
    139139                return self.input 
    140                  
     140 
    141141        def _handle_changed(self, widget=None): 
    142142                """! 
     
    148148                self.set_value(value) 
    149149                #set the markup on the label, red for errors in corresponding data type. 
    150                 name = Utils.xml_encode(self.get_name()) 
     150                name = '<span font_desc="%s">%s</span>'%(PARAM_LABEL_FONT, Utils.xml_encode(self.get_name())) 
    151151                #special markups if param is involved in a callback 
    152152                if hasattr(self.get_parent(), 'get_callbacks') and \ 
    153153                        filter(lambda c: self.get_key() in c, self.get_parent()._callbacks): 
    154                         name = '<span underline="low">%s</span>'%name           
    155                 if not self.is_valid():  
    156                         self.input.set_markup('<span foreground="red"><b>%s</b></span>'%name) 
     154                        name = '<span underline="low">%s</span>'%name 
     155                if not self.is_valid(): 
     156                        self.input.set_markup('<span foreground="red">%s</span>'%name) 
    157157                        tip = '- ' + '\n- '.join(self.get_error_messages()) 
    158                 else:  
     158                else: 
    159159                        self.input.set_markup(name) 
    160                         tip = self.evaluate()   
    161                 #set the tooltip                
     160                        tip = self.evaluate() 
     161                #set the tooltip 
    162162                if self.input.tp: self.input.tp.set_tip(self.input.entry, str(tip)) 
    163                 #execute the external callback  
     163                #execute the external callback 
    164164                if self.callback: self.callback(self) 
    165165 
    166166        def get_markup(self): 
    167167                """! 
    168                 Create a markup to display the Param as a label on the SignalBlock.     
    169                 If the data type is an Enum type, use the cname of the Enum's current choice.   
     168                Create a markup to display the Param as a label on the SignalBlock. 
     169                If the data type is an Enum type, use the cname of the Enum's current choice. 
    170170                Otherwise, use parsed the data type and use its string representation. 
    171171                If the data type is not valid, use a red foreground color. 
     
    176176                ########################################################################### 
    177177                def float_to_str(var): 
    178                         if var-int(var) == 0: return '%d'%int(var)                                      
     178                        if var-int(var) == 0: return '%d'%int(var) 
    179179                        if var*10-int(var*10) == 0: return '%.1f'%var 
    180180                        if var*100-int(var*100) == 0: return '%.2f'%var 
    181181                        if var*1000-int(var*1000) == 0: return '%.3f'%var 
    182                         else: return '%.3g'%var                                 
    183                 def to_str(var):  
     182                        else: return '%.3g'%var 
     183                def to_str(var): 
    184184                        if isinstance(var, str): return var 
    185                         elif isinstance(var, complex):  
     185                        elif isinstance(var, complex): 
    186186                                if var.imag == var.real == 0: return '0'        #value is zero 
    187187                                elif var.imag == 0: return '%s'%float_to_str(var.real)  #value is real 
     
    189189                                elif var.imag < 0: return '%s-%sj'%(float_to_str(var.real), float_to_str(var.imag*-1)) 
    190190                                else: return '%s+%sj'%(float_to_str(var.real), float_to_str(var.imag)) 
    191                         elif isinstance(var, float): return float_to_str(var)                           
     191                        elif isinstance(var, float): return float_to_str(var) 
    192192                        elif isinstance(var, int): return '%d'%var 
    193                         else: return str(var)   
     193                        else: return str(var) 
    194194                ########################################################################### 
    195195                if self.is_valid(): 
     
    201201                                dt_str = ', '.join(map(to_str, data)) 
    202202                        else: dt_str = to_str(data)     #other types 
    203                         #truncate  
     203                        #truncate 
    204204                        max_len = max(42 - len(self.get_name()), 3) 
    205205                        if len(dt_str) > max_len: 
    206                                 dt_str = dt_str[:max_len-3] + '...'                     
     206                                dt_str = dt_str[:max_len-3] + '...' 
    207207                        return '<b>%s:</b> %s'%(Utils.xml_encode(self.get_name()), Utils.xml_encode(dt_str)) 
    208208                else: return '<span foreground="red"><b>%s:</b> error</span>'%Utils.xml_encode(self.get_name()) 
    209                          
     209 
    210210        def get_layout(self): 
    211211                """! 
     
    216216                layout.set_markup(self.get_markup()) 
    217217                desc = pango.FontDescription(PARAM_FONT) 
    218                 layout.set_font_description(desc)  
     218                layout.set_font_description(desc) 
    219219                return layout 
    220220 
  • grc/trunk/src/grc_gnuradio/Param.py

    r8865 r8985  
    181181                        params = filter(lambda p: p is not self, self.get_all_params('grid_pos')) 
    182182                        for param in params: 
     183                                if not hasattr(param, '_hostage_cells'): continue 
    183184                                for cell in param._hostage_cells: 
    184185                                        if cell in self._hostage_cells: 
  • grc/trunk/src/grc_gnuradio/blocks/graphical_sinks/wxgui_fftsink2.xml

    r8939 r8985  
    8888                <name>FFT Size</name> 
    8989                <key>fft_size</key> 
    90                 <value>512</value> 
     90                <value>1024</value> 
    9191                <type>int</type> 
    9292        </param> 
    9393        <param> 
    94                 <name>FFT Rate</name> 
     94                <name>Refresh Rate</name> 
    9595                <key>fft_rate</key> 
    96                 <value>15</value> 
     96                <value>30</value> 
    9797                <type>int</type> 
    9898        </param> 
  • grc/trunk/src/grc_gnuradio/blocks/synchronizers/gr_costas_loop_cc.xml

    r8939 r8985  
    1010        <import>from gnuradio import gr</import> 
    1111        <make>gr.costas_loop_cc($alpha, $beta, $max_freq, $min_freq, $order)</make> 
     12        <callback>set_alpha($alpha)</callback> 
     13        <callback>set_beta($beta)</callback> 
    1214        <param> 
    1315                <name>Alpha</name> 
  • grc/trunk/src/grc_gnuradio/data/block_tree.xml

    r8934 r8985  
    171171                <block>gr_fractional_interpolator_xx</block> 
    172172                <block>gr_keep_one_in_n</block> 
     173                <block>gr_moving_average_xx</block> 
    173174        </cat> 
    174175        <cat>