commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r11357 - in gnuradio/branches/developers/jblum/grc: gr


From: jblum
Subject: [Commit-gnuradio] r11357 - in gnuradio/branches/developers/jblum/grc: gr-wxgui/src/python grc/blocks grc/grc_gnuradio/wxgui grc/python
Date: Sun, 5 Jul 2009 19:50:50 -0600 (MDT)

Author: jblum
Date: 2009-07-05 19:50:50 -0600 (Sun, 05 Jul 2009)
New Revision: 11357

Modified:
   
gnuradio/branches/developers/jblum/grc/gr-wxgui/src/python/waterfallsink_gl.py
   gnuradio/branches/developers/jblum/grc/grc/blocks/options.xml
   
gnuradio/branches/developers/jblum/grc/grc/grc_gnuradio/wxgui/top_block_gui.py
   gnuradio/branches/developers/jblum/grc/grc/python/Block.py
   gnuradio/branches/developers/jblum/grc/grc/python/flow_graph.tmpl
Log:
Renamed the autostart parameter to run.
Uses the callback start/stop the flowgraph,
so the start method added to top block gui was removed.

Removed dummy param from waterfall, added catch-all **kwargs.



Modified: 
gnuradio/branches/developers/jblum/grc/gr-wxgui/src/python/waterfallsink_gl.py
===================================================================
--- 
gnuradio/branches/developers/jblum/grc/gr-wxgui/src/python/waterfallsink_gl.py  
    2009-07-06 00:56:39 UTC (rev 11356)
+++ 
gnuradio/branches/developers/jblum/grc/gr-wxgui/src/python/waterfallsink_gl.py  
    2009-07-06 01:50:50 UTC (rev 11357)
@@ -40,7 +40,6 @@
                self,
                parent,
                baseband_freq=0,
-               y_per_div=None, #ignore (old wrapper)
                ref_level=50,
                sample_rate=1,
                fft_size=512,
@@ -52,6 +51,7 @@
                ref_scale=2.0,
                dynamic_range=80,
                num_lines=256,
+               **kwargs #do not end with a comma
        ):
                #ensure avg alpha
                if avg_alpha is None: avg_alpha = 2.0/fft_rate

Modified: gnuradio/branches/developers/jblum/grc/grc/blocks/options.xml
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/blocks/options.xml       
2009-07-06 00:56:39 UTC (rev 11356)
+++ gnuradio/branches/developers/jblum/grc/grc/blocks/options.xml       
2009-07-06 01:50:50 UTC (rev 11357)
@@ -20,7 +20,8 @@
 #end if
 </import>
        <make></make>
-       <callback>self.start($autostart)</callback>
+       <callback>if $run: self.start()
+else: self.stop(); self.wait()</callback>
        <param>
                <name>Title</name>
                <key>title</key>
@@ -76,12 +77,12 @@
                <hide>#if $generate_options() == 'hb' then 'none' else 
'all'#</hide>
        </param>
        <param>
-               <name>Autostart</name>
-               <key>autostart</key>
+               <name>Run</name>
+               <key>run</key>
                <value>True</value>
                <type>bool</type>
                <hide>#if $generate_options() == 'wx_gui'
-       #if str($autostart) == 'True'
+       #if str($run) == 'True'
 part#slurp
        #else
 none#slurp
@@ -90,11 +91,11 @@
 all#slurp
 #end if</hide>
                <option>
-                       <name>Yes</name>
+                       <name>Autostart</name>
                        <key>True</key>
                </option>
                <option>
-                       <name>No</name>
+                       <name>Off</name>
                        <key>False</key>
                </option>
        </param>
@@ -135,7 +136,7 @@
 Non-graphical flow graphs should avoid using graphical sinks or graphical 
variable controls.
 
 In a graphical application, \
-autostart can be controlled by a variable to start and stop the flowgraph at 
runtime.
+run can be controlled by a variable to start and stop the flowgraph at runtime.
 
 The id of this block determines the name of the generated file and the name of 
the class. \
 For example, an id of my_block will generate the file my_block.py and class 
my_block(gr....

Modified: 
gnuradio/branches/developers/jblum/grc/grc/grc_gnuradio/wxgui/top_block_gui.py
===================================================================
--- 
gnuradio/branches/developers/jblum/grc/grc/grc_gnuradio/wxgui/top_block_gui.py  
    2009-07-06 00:56:39 UTC (rev 11356)
+++ 
gnuradio/branches/developers/jblum/grc/grc/grc_gnuradio/wxgui/top_block_gui.py  
    2009-07-06 01:50:50 UTC (rev 11357)
@@ -49,14 +49,7 @@
 
        def SetIcon(self, *args, **kwargs): self._frame.SetIcon(*args, **kwargs)
 
-       def start(self, start=True):
-               if start:
-                       gr.top_block.start(self)
-               else:
-                       gr.top_block.stop(self)
-                       gr.top_block.wait(self)
-
-       def Run(self, autostart=True):
+       def Run(self, start=True):
                """
                Setup the wx gui elements.
                Start the gr top block.
@@ -66,7 +59,7 @@
                self._frame.SetSizeHints(*self._size)
                #create callback for quit
                def _quit(event):
-                       self.start(False)
+                       self.stop(); self.wait()
                        self._frame.Destroy()
                #setup app
                self._frame.Bind(wx.EVT_CLOSE, _quit)
@@ -77,6 +70,6 @@
                self._frame.Show(True)
                self._app.SetTopWindow(self._frame)
                #start flow graph
-               self.start(autostart)
+               if start: self.start()
                #blocking main loop
                self._app.MainLoop()

Modified: gnuradio/branches/developers/jblum/grc/grc/python/Block.py
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/python/Block.py  2009-07-06 
00:56:39 UTC (rev 11356)
+++ gnuradio/branches/developers/jblum/grc/grc/python/Block.py  2009-07-06 
01:50:50 UTC (rev 11357)
@@ -154,6 +154,6 @@
                """
                def make_callback(callback):
                        callback = self.resolve_dependencies(callback)
-                       if callback.startswith('self.'): return callback
+                       if 'self.' in callback: return callback
                        return 'self.%s.%s'%(self.get_id(), callback)
                return map(make_callback, self._callbacks)

Modified: gnuradio/branches/developers/jblum/grc/grc/python/flow_graph.tmpl
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/python/flow_graph.tmpl   
2009-07-06 00:56:39 UTC (rev 11356)
+++ gnuradio/branches/developers/jblum/grc/grc/python/flow_graph.tmpl   
2009-07-06 01:50:50 UTC (rev 11357)
@@ -200,7 +200,7 @@
        #end if
        tb = $(class_name)($(', '.join($params_eq_list)))
        #if $generate_options == 'wx_gui'
-       tb.Run($flow_graph.get_option('autostart'))
+       tb.Run($flow_graph.get_option('run'))
        #elif $generate_options == 'no_gui'
        tb.start()
        raw_input('Press Enter to quit: ')





reply via email to

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