commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r5825 - in grc/branches/jblum_work: notes src src/Elem


From: jblum
Subject: [Commit-gnuradio] r5825 - in grc/branches/jblum_work: notes src src/Elements src/Graphics src/SignalBlockDefs
Date: Sat, 23 Jun 2007 21:22:02 -0600 (MDT)

Author: jblum
Date: 2007-06-23 21:22:02 -0600 (Sat, 23 Jun 2007)
New Revision: 5825

Modified:
   grc/branches/jblum_work/notes/notes.txt
   grc/branches/jblum_work/src/ActionHandler.py
   grc/branches/jblum_work/src/Actions.py
   grc/branches/jblum_work/src/Elements/GraphicalParam.py
   grc/branches/jblum_work/src/ExecFlowGraphGUI.py
   grc/branches/jblum_work/src/Graphics/Dialogs.py
   grc/branches/jblum_work/src/Graphics/FlowGraph.py
   grc/branches/jblum_work/src/Graphics/MainWindow.py
   grc/branches/jblum_work/src/Graphics/SignalBlockParamsDialog.py
   grc/branches/jblum_work/src/Graphics/SignalBlockSelectionWindow.py
   grc/branches/jblum_work/src/Graphics/USRPDiagnostics.py
   grc/branches/jblum_work/src/Graphics/VariableModificationWindow.py
   grc/branches/jblum_work/src/Messages.py
   grc/branches/jblum_work/src/SignalBlockDefs/Custom.py
   grc/branches/jblum_work/src/SignalBlockDefs/GraphicalSinks.py
   grc/branches/jblum_work/src/SignalBlockDefs/Misc.py
   grc/branches/jblum_work/src/SignalBlockDefs/Packet.py
   grc/branches/jblum_work/src/SignalBlockDefs/Sinks.py
Log:
replaced gtk show with show_all, handle variable row reordering, misc block def 
fixes

Modified: grc/branches/jblum_work/notes/notes.txt
===================================================================
--- grc/branches/jblum_work/notes/notes.txt     2007-06-24 00:45:35 UTC (rev 
5824)
+++ grc/branches/jblum_work/notes/notes.txt     2007-06-24 03:22:02 UTC (rev 
5825)
@@ -4,22 +4,24 @@
 -usrp dual and quad souce 
 -blks blocks, add filesave for logging
 -combine add/mult with add/mult vector
+-tun/tap block (with input and output)
 
 ############   Known Problems: ####################
 -in vars window, stop_editing doesnt work
 -fg.stop() doesnt kill running threads
+-abort core dump with throw std exception
 -file save, ask for overwrite even when appending file extension
 -blocks need to fix themselves when they go out of bounds, like in a resize
 -socket controllers should be intelligent on shrinkage
 -the nested data variables should indicate that they are nested data -> 
variable_data
--rearanging variables in the gui doesnt have a handler
 
 ############   Features to Add:        ####################
+-startup tips
+-math expr from file
 -save settings after close (working directory)
 -create sub-flow graphs to be used in larger flow graphs
 -include dtd in saved flow graphs
 -immediate display of tool tips in entry boxes
--function to import taps from a file
 -fm demod example with expansion of wfm_recv block
 
 ############   wxPython Features:      ####################
@@ -43,7 +45,7 @@
 -press enter to close params
 
 ############   Get GTK Stock IDs:      ####################
-       gtk.stock_list_ids()
+gtk.stock_list_ids()
 
 ############   connect packet mod to demod:    ####################    
 gr.packed_to_unpacked_bb(self.bits_per_symbol(), gr.GR_MSB_FIRST)

Modified: grc/branches/jblum_work/src/ActionHandler.py
===================================================================
--- grc/branches/jblum_work/src/ActionHandler.py        2007-06-24 00:45:35 UTC 
(rev 5824)
+++ grc/branches/jblum_work/src/ActionHandler.py        2007-06-24 03:22:02 UTC 
(rev 5825)
@@ -57,8 +57,6 @@
                self.flow_graph = self.main_window.flow_graph
                self.main_window.connect('delete_event', self._quit)
                self.main_window.connect('key_press_event', 
self._handle_key_press)
-               Preferences.load(self.main_window)
-               self.main_window.show()#show after resize in preferences
                #       determine the initial flow graph file, preference to 
command line input #
                if input_arg_file_path: self.flow_graph_file_path = 
os.path.abspath(input_arg_file_path)        
                else: self.flow_graph_file_path = 
Preferences.get_default_flow_graph()
@@ -271,6 +269,9 @@
                        
self.state_cache.save_new_state(self.flow_graph.to_nested_data())       
                        self._set_saved_state(False)    
                        self.flow_graph.update()
+               elif state == VARIABLE_REORDER:
+                       
self.state_cache.save_new_state(self.flow_graph.to_nested_data())       
+                       self._set_saved_state(False)    
                
##############################################################################################
                #       Undo/Redo
                
##############################################################################################

Modified: grc/branches/jblum_work/src/Actions.py
===================================================================
--- grc/branches/jblum_work/src/Actions.py      2007-06-24 00:45:35 UTC (rev 
5824)
+++ grc/branches/jblum_work/src/Actions.py      2007-06-24 03:22:02 UTC (rev 
5825)
@@ -54,6 +54,7 @@
 ELEMENT_DELETE = 'element delete'
 
 VARIABLE_MODIFY = 'variable modify'
+VARIABLE_REORDER = 'variable reorder'
 
 FLOW_GRAPH_OPEN = 'flow graph open'
 FLOW_GRAPH_UNDO = 'flow graph undo'
@@ -106,10 +107,11 @@
        Retrieve the action from the action list.
        Search the list and find an action with said name.
        @param action_name the action name(string)
+       @throw KeyError bad action name
        @return a gtk action object
        """     
        for action in ACTIONS_LIST: 
                if action.get_name() == action_name: return action
-       return None
+       raise KeyError('Action Name: "%s" does not exist'%action_name)
        
        
\ No newline at end of file

Modified: grc/branches/jblum_work/src/Elements/GraphicalParam.py
===================================================================
--- grc/branches/jblum_work/src/Elements/GraphicalParam.py      2007-06-24 
00:45:35 UTC (rev 5824)
+++ grc/branches/jblum_work/src/Elements/GraphicalParam.py      2007-06-24 
03:22:02 UTC (rev 5825)
@@ -38,12 +38,10 @@
        """ The base class for an input parameter inside the input parameters 
dialog.   """
        def __init__(self, data_type, _handle_changed):
                gtk.HBox.__init__(self)
-               self.show()
                self.data_type = data_type
                self._handle_changed = _handle_changed
                self.label = gtk.Label('')      #no label, markup is added by 
set_markup
                self.label.set_size_request(140,-1)
-               self.label.show()
                self.pack_start(self.label, False)
                self.set_markup = lambda m: self.label.set_markup(m)    
                self.tp = None          
@@ -56,7 +54,6 @@
                input.set_size_request(250,-1)          
                input.set_text(self.data_type.get_data())
                input.connect("changed", self._handle_changed)
-               input.show()
                self.pack_start(input, False)
                self.get_text = input.get_text
                # tool tip fun #
@@ -70,7 +67,6 @@
                EntryParam.__init__(self, *args)
                input = gtk.Button('...')
                input.connect('clicked', self.handle_clicked)
-               input.show()
                self.pack_start(input, False)
        
        def handle_clicked(self, widget=None):
@@ -106,7 +102,6 @@
                input.add_attribute(cell, 'text', 0)
                for cname in self.data_type.get_cnames_list(): 
input.append_text(cname)
                input.set_active(int(self.data_type.get_data()))
-               input.show()
                input.connect("changed", self._handle_changed)
                self.pack_start(input, False)
                self.get_text = lambda: str(input.get_active()) #the get text 
parses the selected index to a string

Modified: grc/branches/jblum_work/src/ExecFlowGraphGUI.py
===================================================================
--- grc/branches/jblum_work/src/ExecFlowGraphGUI.py     2007-06-24 00:45:35 UTC 
(rev 5824)
+++ grc/branches/jblum_work/src/ExecFlowGraphGUI.py     2007-06-24 03:22:02 UTC 
(rev 5825)
@@ -192,12 +192,13 @@
                wx.App.__init__(self, 0)        
                        
        def OnInit(self):
-               """ If the creation of the frame fails, return False so the 
program will exit.  """
+               """ If the creation of the frame fails, exit with error.        
"""
                try:
                        
self.SetTopWindow(FlowGraphFrame(self.flow_graph_file_path))#first argument is 
the flow graph
                        return True
-               except Exception, e:
-                       sys.stderr.write(str(e)+'\n')
+               except Exception:
+                       import traceback
+                       traceback.print_exc()
                        sys.exit(1)
                        
 
##############################################################################################

Modified: grc/branches/jblum_work/src/Graphics/Dialogs.py
===================================================================
--- grc/branches/jblum_work/src/Graphics/Dialogs.py     2007-06-24 00:45:35 UTC 
(rev 5824)
+++ grc/branches/jblum_work/src/Graphics/Dialogs.py     2007-06-24 03:22:02 UTC 
(rev 5825)
@@ -43,8 +43,7 @@
                gtk.TextView.__init__(self, text_buffer)
                self.set_editable(False)
                self.set_cursor_visible(False)
-               self.set_wrap_mode(gtk.WRAP_WORD)       
-               self.show()
+               self.set_wrap_mode(gtk.WRAP_WORD)
 
 
######################################################################################################
 class PreferencesDialog(gtk.Dialog):
@@ -55,12 +54,10 @@
                self.set_title("Preferences")   
                self.set_size_request(MIN_DIALOG_WIDTH, MIN_DIALOG_HEIGHT)
                vbox = gtk.VBox()
-               vbox.show()
                for title,notes,params in Preferences.PREFS_LIST:               
        
                        if title:                               
                                label = gtk.Label()
-                               label.set_markup('<b> ----- '+title+' ----- 
</b>')                      
-                               label.show()
+                               label.set_markup('<b> ----- '+title+' ----- 
</b>')      
                                vbox.pack_start(label, False, padding=5)        
        
                                for param in params: 
vbox.pack_start(param.get_input_object(), False)           
                                if notes: vbox.pack_start(TextDisplay(notes), 
False, padding=5)         
@@ -68,8 +65,8 @@
                scrolled_window = gtk.ScrolledWindow()
                scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, 
gtk.POLICY_AUTOMATIC)
                scrolled_window.add_with_viewport(vbox)
-               scrolled_window.show()          
                self.vbox.pack_start(scrolled_window, True)
+               self.show_all()
                self.run()
                self.destroy()
 
@@ -89,13 +86,13 @@
 Minimum window (width/height) in pixels is (%d/%d).
 Maximum window (width/height) in pixels is (%d/%d).
 </i>"""%(MIN_WINDOW_WIDTH, MIN_WINDOW_HEIGHT, MAX_WINDOW_WIDTH, 
MAX_WINDOW_HEIGHT))
-               window_size_label.show()
                self.vbox.pack_end(window_size_label, False)                    
                
                self.original_dimensions = width,height = dimensions    
                self.width = Int(width, min=MIN_WINDOW_WIDTH, 
max=MAX_WINDOW_WIDTH)
                self.height = Int(height, min=MIN_WINDOW_HEIGHT, 
max=MAX_WINDOW_HEIGHT)
                self.vbox.pack_start(GraphicalParam('width (pixels)', 
self.width).get_input_object(), False)
                self.vbox.pack_start(GraphicalParam('height (pixels)', 
self.height).get_input_object(), False)  
+               self.show_all()
                
        def run(self):
                """!
@@ -185,8 +182,8 @@
                                markup = '%s\n<span 
background="%s">%s</span>'%(markup, spec, tag.center(width, ' '))
                label = gtk.Label()
                label.set_markup('<tt>%s</tt>\n'%markup[1:])    #strip 1st 
newline, append newline
-               label.show()
                self.vbox.pack_start(label, False)
+               self.show_all()
                self.run()
                self.destroy()                  
                        
@@ -219,8 +216,8 @@
                ): markup = '%s\n<b>%s:</b>%s'%(markup, action, 
hotkey.rjust(25-len(action),' '))
                label = gtk.Label()
                label.set_markup('<tt>%s</tt>\n'%markup)        #append newline
-               label.show()
                self.vbox.pack_start(label, False)
+               self.show_all()
                self.run()
                self.destroy()          
                
@@ -265,7 +262,6 @@
                self.set_title('Mathematical Expressions')
                label = gtk.Label()
                label.set_markup(self.HELP_MSG)
-               label.show()
                self.vbox.pack_start(label, False)              
                self.set_size_request(800, 600)
                #       create a text box for parser output     #
@@ -279,8 +275,8 @@
                scrolled_window = gtk.ScrolledWindow()
                scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, 
gtk.POLICY_AUTOMATIC)
                scrolled_window.add_with_viewport(self.text_box)
-               scrolled_window.show()          
                self.vbox.pack_start(scrolled_window, True)     
+               self.show_all()
                self.run()
                self.destroy()
                

Modified: grc/branches/jblum_work/src/Graphics/FlowGraph.py
===================================================================
--- grc/branches/jblum_work/src/Graphics/FlowGraph.py   2007-06-24 00:45:35 UTC 
(rev 5824)
+++ grc/branches/jblum_work/src/Graphics/FlowGraph.py   2007-06-24 03:22:02 UTC 
(rev 5825)
@@ -76,7 +76,6 @@
                self.is_selected = lambda: self.selected_element != None
                self.count = 0
                self.pixmap = None
-               self.show()
                
        def _handle_focus_event(self, widget, event, focus_flag):
                """Record the focus state of the flow graph window."""

Modified: grc/branches/jblum_work/src/Graphics/MainWindow.py
===================================================================
--- grc/branches/jblum_work/src/Graphics/MainWindow.py  2007-06-24 00:45:35 UTC 
(rev 5824)
+++ grc/branches/jblum_work/src/Graphics/MainWindow.py  2007-06-24 03:22:02 UTC 
(rev 5825)
@@ -29,6 +29,7 @@
 from SignalBlockSelectionWindow import SignalBlockSelectionWindow
 from VariableModificationWindow import VariableModificationWindow
 from Dialogs import TextDisplay
+import Preferences
 
 class MainWindow(gtk.Window):
        """The topmost window with menus, the tool bar, and other major 
windows."""
@@ -41,18 +42,11 @@
                gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)          
                vbox = gtk.VBox()
                hbox = gtk.HBox()
-               vbox.show()     
-               hbox.show()
                self.add(vbox)
                self.set_title("")      
-               #create the menu bar            
-               menuBar = Bars.MenuBar()
-               menuBar.show()
-               vbox.pack_start(menuBar, False)         
-               #create the toolbar
-               toolbar = Bars.Toolbar()
-               toolbar.show()
-               vbox.pack_start(toolbar, False)                 
+               #create the menu bar    and toolbar     
+               vbox.pack_start(Bars.MenuBar(), False)  
+               vbox.pack_start(Bars.Toolbar(), False)                  
                # create variable modification window   #
                variable_modification_window = 
VariableModificationWindow(self.handle_states)           
                #       create a flow_graph     #
@@ -62,15 +56,12 @@
                scrolled_window.set_size_request(MIN_WINDOW_WIDTH, 
MIN_WINDOW_HEIGHT)   
                scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, 
gtk.POLICY_AUTOMATIC)
                scrolled_window.add_with_viewport(self.flow_graph)
-               scrolled_window.show()
                fg_and_report_box = gtk.VBox()
-               fg_and_report_box.show()
                fg_and_report_box.pack_start(scrolled_window)
                hbox.pack_start(fg_and_report_box)
                vbox.pack_start(hbox)           
                #create the side windows
                side_box = gtk.VBox()
-               side_box.show()
                hbox.pack_start(side_box, False)
                side_box.pack_start(variable_modification_window, False)        
        #dont allow resize
                
side_box.pack_start(SignalBlockSelectionWindow(self.flow_graph)) #all resize, 
selection window can have more space
@@ -80,11 +71,25 @@
                self.reports_scrolled_window = gtk.ScrolledWindow()
                self.reports_scrolled_window.set_size_request(-1, 
REPORTS_WINDOW_HEIGHT)
                self.reports_scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, 
gtk.POLICY_AUTOMATIC)
-               
self.reports_scrolled_window.add_with_viewport(self.text_display)               
-               self.show_reports_window(False) #hide the window by default
+               
self.reports_scrolled_window.add_with_viewport(self.text_display)       
                fg_and_report_box.pack_end(self.reports_scrolled_window, False) 
#dont allow resize, fg should get all the space
-               #self.show()            
+               # show all but the main window container and the reports window 
+               vbox.show_all()                 
+               self.show_reports_window(False) 
+               # load preferences and show the main window 
+               Preferences.load(self)
+               self.show()#show after resize in preferences
                
+       def _quit(self, window, event):
+               """!
+               Handle the delete event from the main window.
+               Generated by pressing X to close, alt+f4, or right click+close. 
+               This method in turns calls the state handler to quit.
+               @return true            
+               """
+               self.handle_states(APPLICATION_QUIT)
+               return True     
+               
        def add_report_line(self, line):
                """!
                Place line plus a newline at the end of the text buffer, then 
scroll its window all the way down.

Modified: grc/branches/jblum_work/src/Graphics/SignalBlockParamsDialog.py
===================================================================
--- grc/branches/jblum_work/src/Graphics/SignalBlockParamsDialog.py     
2007-06-24 00:45:35 UTC (rev 5824)
+++ grc/branches/jblum_work/src/Graphics/SignalBlockParamsDialog.py     
2007-06-24 03:22:02 UTC (rev 5825)
@@ -38,17 +38,14 @@
                self.set_title('Properties: %s'%signal_block.get_id())
                self.set_size_request(MIN_DIALOG_WIDTH, MIN_DIALOG_HEIGHT)
                vbox = gtk.VBox()
-               vbox.show()             
                #       Create the title label  #
                label = gtk.Label()
                label.set_markup('\n<b>Parameters: 
%s</b>\n'%self.signal_block.get_id())
-               label.show()
                vbox.pack_start(label, False)
                # Create the scrolled window to hold all the parameters #
                scrolled_window = gtk.ScrolledWindow()
                scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, 
gtk.POLICY_AUTOMATIC)
                scrolled_window.add_with_viewport(vbox)
-               scrolled_window.show()
                self.vbox.pack_start(scrolled_window, True)
                self.original_data = list()
                #       Add all the parameters  #
@@ -60,10 +57,10 @@
                        #       Create the title label  #
                        label = gtk.Label()
                        label.set_markup('\n\n<b>Documentation: 
%s</b>\n'%self.signal_block.get_cname())
-                       label.show()
                        vbox.pack_start(label, False)   
                        #       Create the text box to display notes about the 
block    #       
                        
vbox.pack_start(TextDisplay(self.signal_block.get_docs()), False)
+               self.show_all()
                        
        def _handle_changed(self, param):
                """!

Modified: grc/branches/jblum_work/src/Graphics/SignalBlockSelectionWindow.py
===================================================================
--- grc/branches/jblum_work/src/Graphics/SignalBlockSelectionWindow.py  
2007-06-24 00:45:35 UTC (rev 5824)
+++ grc/branches/jblum_work/src/Graphics/SignalBlockSelectionWindow.py  
2007-06-24 03:22:02 UTC (rev 5825)
@@ -42,7 +42,6 @@
                #title label
                label = gtk.Label()
                label.set_markup('<b>Signal Blocks</b>')
-               label.show()            
                self.pack_start(label, False)           
                #       make the tree model for holding blocks  #
                self.model = gtk.TreeStore(gobject.TYPE_STRING)
@@ -56,19 +55,18 @@
                renderer = gtk.CellRendererText()
                column = gtk.TreeViewColumn("Category", renderer, text=0)
                self.treeview.append_column(column)
-               self.treeview.show()
                # make the scrolled window to hold the tree view        #
                scrolled_window = gtk.ScrolledWindow()
                scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, 
gtk.POLICY_AUTOMATIC)
                scrolled_window.add_with_viewport(self.treeview)
-               
scrolled_window.set_size_request(SIGNAL_BLOCK_SELECTION_WINDOW_WIDTH,
-                                                                               
                        SIGNAL_BLOCK_SELECTION_WINDOW_HEIGHT)
-               scrolled_window.show()
+               scrolled_window.set_size_request(
+                       SIGNAL_BLOCK_SELECTION_WINDOW_WIDTH,
+                       SIGNAL_BLOCK_SELECTION_WINDOW_HEIGHT,
+               )
                self.pack_start(scrolled_window)
                #       add button      #
                self.add_button = gtk.Button(None, 'gtk-add')           
                self.add_button.connect('clicked', self._handle_add_button)
-               self.add_button.show()
                self.pack_start(self.add_button, False)
                #       add blocks and categories       #
                for category, tags in SB_TREE:
@@ -78,7 +76,7 @@
                                new_iter = self.model.insert_before(iter, None) 
                                                
                                self.model.set_value(new_iter, 0, tag[0])
                self._handle_selection_change(None)
-               self.show()
+               self.show_all()
                
        def _handle_button_press(self, widget, event):
                """If a left double click is detected, let the handler for the 
add button decide to add a block."""

Modified: grc/branches/jblum_work/src/Graphics/USRPDiagnostics.py
===================================================================
--- grc/branches/jblum_work/src/Graphics/USRPDiagnostics.py     2007-06-24 
00:45:35 UTC (rev 5824)
+++ grc/branches/jblum_work/src/Graphics/USRPDiagnostics.py     2007-06-24 
03:22:02 UTC (rev 5825)
@@ -57,12 +57,12 @@
                self.vbox.pack_start(GraphicalParam('Side:Subdevice', 
self.USRP_subdev).get_input_object(), False)
                self.diagnose_button = gtk.Button('Query')
                self.diagnose_button.connect('clicked', self._diagnose_usrp)
-               self.diagnose_button.show()
                self.vbox.pack_start(self.diagnose_button, False)               
                #       Create a text box for USRP queries      #
                self.query_buffer = TextDisplay()
                self.query_buffer.set_text('Press "Query" to retrieve USRP 
information...')                     
-               self.vbox.pack_start(self.query_buffer)         
+               self.vbox.pack_start(self.query_buffer) 
+               self.show_all() 
                self.run()
                self.destroy()
                

Modified: grc/branches/jblum_work/src/Graphics/VariableModificationWindow.py
===================================================================
--- grc/branches/jblum_work/src/Graphics/VariableModificationWindow.py  
2007-06-24 00:45:35 UTC (rev 5824)
+++ grc/branches/jblum_work/src/Graphics/VariableModificationWindow.py  
2007-06-24 03:22:02 UTC (rev 5825)
@@ -21,7 +21,7 @@
 address@hidden Josh Blum
 
 from Constants import *
-from Actions import VARIABLE_MODIFY, NOTHING_SELECT
+from Actions import VARIABLE_MODIFY,VARIABLE_REORDER,NOTHING_SELECT
 import pygtk
 pygtk.require('2.0')
 import gtk
@@ -40,11 +40,9 @@
                #title label
                label = gtk.Label()
                label.set_markup('<b>Variables</b>')
-               label.show()            
                self.pack_start(label, False)           
                # create a srolled window to hold the vars      #
                scrolled_window = gtk.ScrolledWindow()
-               scrolled_window.show()
                scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, 
gtk.POLICY_AUTOMATIC)
                scrolled_window.set_size_request(
                        VARIABLE_MODIFICATION_WINDOW_WIDTH, 
@@ -57,7 +55,7 @@
                        gobject.TYPE_STRING,    #value
                        gobject.TYPE_STRING,    #min
                        gobject.TYPE_STRING,            #max
-                       gobject.TYPE_STRING             #step
+                       gobject.TYPE_STRING,            #step
                )               
                self.treeview = gtk.TreeView(self.liststore)    
                self.treeview.set_enable_search(False) #disable pop up search 
box
@@ -73,26 +71,34 @@
                self.treeview.set_reorderable(True)     
                selection = self.treeview.get_selection()
                selection.set_mode('single')
-               selection.connect('changed', self._handle_selection_change)     
                                
-               self.treeview.show()            
+               selection.connect('changed', self._handle_selection_change)
                scrolled_window.add_with_viewport(self.treeview)
                #       buttons #
                buttons_hbox = gtk.HBox()
-               buttons_hbox.show()
                self.pack_start(buttons_hbox, False)            
                # add, edit, and remove buttons #
                add_button = gtk.Button(None, 'gtk-add')                
                add_button.connect('clicked', self._handle_add_button)
-               add_button.show()
                buttons_hbox.pack_start(add_button, False)
                self.remove_button = gtk.Button(None, 'gtk-remove')
                self.remove_button.connect('clicked', 
self._handle_remove_button)
-               self.remove_button.show()
                buttons_hbox.pack_start(self.remove_button, False)
-               self.treeview.connect("cursor-changed", 
self._handle_cursor_changed)
+               self.treeview.connect("cursor-changed", 
self._handle_cursor_changed)    
+               self.treeview.connect("drag_begin", self._handle_drag_begin)    
+               self.treeview.connect("drag_end", self._handle_drag_end)
                self._handle_selection_change() 
-               self.show()                             
+               self.show_all()                         
                
+       def _handle_drag_begin(self, drag_context, data):
+               """A drag event has begun, make a backup of the key list."""
+               self.backup_key_list = self.to_key_list()
+               
+       def _handle_drag_end(self, drag_context, data):
+               """A drag event has ended. 
+               If the backup key list does not match the current key list, 
+               handle the variable state change."""
+               if self.backup_key_list != self.to_key_list(): 
self.handle_states(VARIABLE_REORDER)     
+               
        def unselect_all(self):         
                """Stop editing in each renderer and unselect every row in the 
tree view."""
                ##TODO: stop editing doesnt work

Modified: grc/branches/jblum_work/src/Messages.py
===================================================================
--- grc/branches/jblum_work/src/Messages.py     2007-06-24 00:45:35 UTC (rev 
5824)
+++ grc/branches/jblum_work/src/Messages.py     2007-06-24 03:22:02 UTC (rev 
5825)
@@ -21,6 +21,7 @@
 address@hidden Josh Blum
 
 from Constants import VERSION,PREFERENCES_FILE_PATH
+import traceback
 
 ##     A list of methods that can receive a message.   
 MESSENGERS_LIST = list()
@@ -54,6 +55,7 @@
                                                        
 def send_error_load(error):
        send('>>> Error: %s\n'%error)
+       traceback.print_exc()
 
 def send_end_load():
        send(">>> Done\n")
@@ -61,6 +63,7 @@
 def send_fail_load(error):
        send('Parser Error: %s\n'%error)
        send(">>> Failue\n")            
+       traceback.print_exc()
 
 #################      methods for executing flow graphs       
########################################        
 def send_start_exec(file_path):

Modified: grc/branches/jblum_work/src/SignalBlockDefs/Custom.py
===================================================================
--- grc/branches/jblum_work/src/SignalBlockDefs/Custom.py       2007-06-24 
00:45:35 UTC (rev 5824)
+++ grc/branches/jblum_work/src/SignalBlockDefs/Custom.py       2007-06-24 
03:22:02 UTC (rev 5825)
@@ -24,14 +24,23 @@
 from SignalBlockConstants import *
 from gnuradio import gr,blks
 
-##add custom blocks to this list and they will appear in the signal block tree 
under the "Custom" category
-CUSTOM_BLOCKS = [
-#('custom block 1', CustomBlockDef1),
-#('custom block 2', CustomBlockDef2),  
-]
-
 ###########################################################################
 #Read "creating_a_signal_block_def.txt" in the notes directory, 
 #and add your own signal block definitions below:
 ###########################################################################
 
+#def CustomBlockDef1(sb):
+#...
+#...
+
+###########################################################################
+#Add custom blocks to the list below, 
+#and the blocks will appear under the "Custom" category:
+###########################################################################
+
+##custom block list
+CUSTOM_BLOCKS = [
+#('Custom Block 1', CustomBlockDef1),
+#('Custom Block 2', CustomBlockDef2),  
+]
+

Modified: grc/branches/jblum_work/src/SignalBlockDefs/GraphicalSinks.py
===================================================================
--- grc/branches/jblum_work/src/SignalBlockDefs/GraphicalSinks.py       
2007-06-24 00:45:35 UTC (rev 5824)
+++ grc/branches/jblum_work/src/SignalBlockDefs/GraphicalSinks.py       
2007-06-24 03:22:02 UTC (rev 5825)
@@ -32,8 +32,10 @@
 
 def FFTSink(sb):
        from gnuradio.wxgui import fftsink
-       type = Enum([('Complex', (fftsink.fft_sink_c, Complex())),
-                                       ('Float', (fftsink.fft_sink_f, 
Float())),], 1)
+       type = Enum([
+               ('Complex', (fftsink.fft_sink_c, Complex())),
+               ('Float', (fftsink.fft_sink_f, Float())),
+       ], 1)
        sb.add_input_socket('in', Variable(type, index=1))
        sb.add_param('Type', type, False, type=True)
        sb.add_param('Title', String('FFT'))    
@@ -61,8 +63,10 @@
        
 def WaterfallSink(sb):
        from gnuradio.wxgui import waterfallsink
-       type = Enum([('Complex', (waterfallsink.waterfall_sink_c, Complex())),
-                                       ('Float', 
(waterfallsink.waterfall_sink_f, Float())),], 1)
+       type = Enum([
+               ('Complex', (waterfallsink.waterfall_sink_c, Complex())),
+               ('Float', (waterfallsink.waterfall_sink_f, Float())),
+       ], 1)
        sb.add_input_socket('in', Variable(type, index=1))
        sb.add_param('Type', type, False, type=True)
        sb.add_param('Title', String('Waterfall'))
@@ -88,8 +92,10 @@
        
 def ScopeSink(sb):
        from gnuradio.wxgui import scopesink
-       type = Enum([('Complex', (scopesink.scope_sink_c, Complex())),
-                                       ('Float', (scopesink.scope_sink_f, 
Float())),], 1)
+       type = Enum([
+               ('Complex', (scopesink.scope_sink_c, Complex())),
+               ('Float', (scopesink.scope_sink_f, Float())),
+       ], 1)
        sb.add_input_socket('in', Variable(type, index=1))
        sb.add_param('Type', type, False, type=True)
        sb.add_param('Title', String('Scope'))
@@ -113,7 +119,7 @@
        
 def ConstellationSink(sb):
        from gnuradio.wxgui import scopesink
-       fcn = scopesink.scope_sink_c
+       fcn = scopesink.scope_sink_c    #dont tell anyone that its really a 
scope sink
        sb.add_input_socket('in', Complex())
        sb.add_param('Title', String('Constellation'))
        sb.add_param('Sampling Rate', Int(default_samp_rate))   
@@ -130,13 +136,15 @@
                elif marker == 1: block.win.set_format_dot()
                elif marker == 2: block.win.set_format_line()
                fg.add_window(block.win, constellation_display_pritority, 
title.parse())        
-               return ThrottleHelper(fg, type.parse()[1].get_num_bytes(), 
samp_rate.parse(), block, True)
+               return ThrottleHelper(fg, Complex().get_num_bytes(), 
samp_rate.parse(), block, True)
        return sb, make
 
 def NumericalSink(sb):
        from gnuradio.wxgui import numbersink
-       type = Enum([('Complex', (numbersink.number_sink_c, Complex())),
-                                       ('Float', (numbersink.number_sink_f, 
Float())),], 1)
+       type = Enum([
+               ('Complex', (numbersink.number_sink_c, Complex())),
+               ('Float', (numbersink.number_sink_f, Float())),
+       ], 1)
        sb.add_input_socket('in', Variable(type, index=1))
        sb.add_param('Type', type, False, type=True)
        sb.add_param('Title', String('Number'))

Modified: grc/branches/jblum_work/src/SignalBlockDefs/Misc.py
===================================================================
--- grc/branches/jblum_work/src/SignalBlockDefs/Misc.py 2007-06-24 00:45:35 UTC 
(rev 5824)
+++ grc/branches/jblum_work/src/SignalBlockDefs/Misc.py 2007-06-24 03:22:02 UTC 
(rev 5825)
@@ -98,12 +98,14 @@
                """
                self.valve_helper = valve_helper
                threading.Thread.__init__(self)
+               self.setDaemon(1)
+               self.keep_running = True
                self.start()
                print 'Created valve thread.'
                
        def run(self):
                """In an endless while loop: read the msgq_out and write to the 
msgq_in when closed."""
-               while True:
+               while self.keep_running:
                        msg = self.valve_helper.msgq_out.delete_head()  
#blocking read of message queue
                        if self.valve_helper.open: 
self.valve_helper.msgq_in.insert_tail(msg) #forward message                  
                        else: del msg   #delete the message

Modified: grc/branches/jblum_work/src/SignalBlockDefs/Packet.py
===================================================================
--- grc/branches/jblum_work/src/SignalBlockDefs/Packet.py       2007-06-24 
00:45:35 UTC (rev 5824)
+++ grc/branches/jblum_work/src/SignalBlockDefs/Packet.py       2007-06-24 
03:22:02 UTC (rev 5825)
@@ -49,13 +49,15 @@
                self.send_packet = send_packet
                self.packet_length = packet_length
                threading.Thread.__init__(self)
+               self.setDaemon(1)
+               self.keep_running = True
                self.start()
                print 'Created packet modulator thread.'
                
        def run(self):
                """In an endless while loop: read the msgq and call send 
packet."""
                r = '' #residual message
-               while True:
+               while self.keep_running:
                        msg = self.msgq.delete_head()  # blocking read of 
message queue
                        sr = r + msg.to_string()
                        num_packets = len(sr)/int(self.packet_length) #integer 
arithmetic

Modified: grc/branches/jblum_work/src/SignalBlockDefs/Sinks.py
===================================================================
--- grc/branches/jblum_work/src/SignalBlockDefs/Sinks.py        2007-06-24 
00:45:35 UTC (rev 5824)
+++ grc/branches/jblum_work/src/SignalBlockDefs/Sinks.py        2007-06-24 
03:22:02 UTC (rev 5825)
@@ -101,6 +101,8 @@
                self.var_key = var_key
                self.msgq = msgq
                threading.Thread.__init__(self)
+               self.setDaemon(1)
+               self.keep_running = True
                self.start()
                print 'Created variable sink thread for variable "%s".'%var_key
                                
@@ -109,7 +111,7 @@
                In an endless while loop: read the vector sink,
                write to the variable, and parse the callbacks.
                """
-               while True:
+               while self.keep_running:
                        msg = self.msgq.delete_head()  # blocking read of 
message queue
                        itemsize = int(msg.arg1())
                        nitems = int(msg.arg2())                                





reply via email to

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