commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: jblum
Subject: [Commit-gnuradio] r8123 - in grc/branches/grc_reloaded: notes src/grc src/grc/gui src/grc_gnuradio
Date: Thu, 27 Mar 2008 21:51:19 -0600 (MDT)

Author: jblum
Date: 2008-03-27 21:51:18 -0600 (Thu, 27 Mar 2008)
New Revision: 8123

Modified:
   grc/branches/grc_reloaded/notes/todo.txt
   grc/branches/grc_reloaded/src/grc/ActionHandler.py
   grc/branches/grc_reloaded/src/grc/gui/NotebookPage.py
   grc/branches/grc_reloaded/src/grc_gnuradio/Generator.py
Log:
moved generator into page class

Modified: grc/branches/grc_reloaded/notes/todo.txt
===================================================================
--- grc/branches/grc_reloaded/notes/todo.txt    2008-03-28 01:34:15 UTC (rev 
8122)
+++ grc/branches/grc_reloaded/notes/todo.txt    2008-03-28 03:51:18 UTC (rev 
8123)
@@ -1,6 +1,8 @@
 ############ GRC Reloaded: #############
 dtd for saved flow graphs
 html documentation/tutorial
+code dtd paths, and check dtd not encoded in xml file
+default platform for preferences block
 
 ############   Blocks to Add:  ####################
 -usrp hier2 blocks need testing

Modified: grc/branches/grc_reloaded/src/grc/ActionHandler.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/ActionHandler.py  2008-03-28 01:34:15 UTC 
(rev 8122)
+++ grc/branches/grc_reloaded/src/grc/ActionHandler.py  2008-03-28 03:51:18 UTC 
(rev 8123)
@@ -48,7 +48,6 @@
                @param file_paths a list of flow graph file passed from command 
line
                @param platform platform module
                """
-               self.generator = None
                platform = Platform(platform)                   
                if PY_GTK_ICON: 
gtk.window_set_default_icon_from_file(PY_GTK_ICON)
                for action in ACTIONS_LIST: action.connect('activate', 
self._handle_actions)
@@ -309,21 +308,17 @@
                                if not self.get_page().get_saved() or not 
self.get_page().get_file_path(): 
                                        self.handle_states(FLOW_GRAPH_SAVE) 
#only save if file path missing or not saved
                                if self.get_page().get_saved() and 
self.get_page().get_file_path(): 
-                                       self.generator = 
self.get_flow_graph().get_parent().get_generator()(
-                                               self.get_flow_graph(),
-                                               self.get_page().get_file_path(),
-                                       ) #only gen if file path and saved
+                                       generator = 
self.get_page().get_generator()
                                        try: 
-                                               
Messages.send_start_gen(self.generator.get_file_path())
-                                               self.generator.write_file()
-                                       except Exception,e: 
-                                               Messages.send_fail_gen(e)
-                                               self.generator = None   
+                                               
Messages.send_start_gen(generator.get_file_path())
+                                               generator.write()
+                                       except Exception,e: 
Messages.send_fail_gen(e)
                                else: self.generator = None                     
                elif state == FLOW_GRAPH_EXEC:
                        if not self.get_page().get_pid_file():
                                self.handle_states(FLOW_GRAPH_GEN)
-                               if self.generator: ExecFlowGraphThread(self)
+                               if self.get_page().get_saved() and 
self.get_page().get_file_path():
+                                       ExecFlowGraphThread(self)
                elif state == FLOW_GRAPH_KILL:
                        if self.get_page().get_pid_file(): 
                                try: os.kill(self.get_page().get_pid_file(), 9)
@@ -364,10 +359,10 @@
                self.flow_graph = action_handler.get_flow_graph()
                #store page and dont use main window calls in run
                self.page = action_handler.get_page()
-               
Messages.send_start_exec(action_handler.generator.get_file_path())
+               
Messages.send_start_exec(self.page.get_generator().get_file_path())
                #get the popen
                try: 
-                       self.p = action_handler.generator.get_popen()
+                       self.p = self.page.get_generator().get_popen()
                        self.page.set_pid_file(self.p.pid)
                        #update
                        self.update_exec_stop()

Modified: grc/branches/grc_reloaded/src/grc/gui/NotebookPage.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/gui/NotebookPage.py       2008-03-28 
01:34:15 UTC (rev 8122)
+++ grc/branches/grc_reloaded/src/grc/gui/NotebookPage.py       2008-03-28 
03:51:18 UTC (rev 8123)
@@ -75,6 +75,16 @@
                self.tab.pack_start(button, False)              
                self.tab.show_all()
                
+       def get_generator(self):
+               """!
+               Get the generator object for this flow graph.
+               @return generator
+               """
+               return self.get_flow_graph().get_parent().get_generator()(
+                       self.get_flow_graph(),
+                       self.get_file_path(),
+               )
+               
        def _handle_button(self, button):
                """
                The button was clicked.

Modified: grc/branches/grc_reloaded/src/grc_gnuradio/Generator.py
===================================================================
--- grc/branches/grc_reloaded/src/grc_gnuradio/Generator.py     2008-03-28 
01:34:15 UTC (rev 8122)
+++ grc/branches/grc_reloaded/src/grc_gnuradio/Generator.py     2008-03-28 
03:51:18 UTC (rev 8123)
@@ -45,7 +45,7 @@
                
        def get_file_path(self): return self._file_path
                
-       def write_file(self):
+       def write(self):
                #generate
                open(self.get_file_path(), 'w').write(str(self))
                





reply via email to

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