From 5b9769b7d7f2734bf4c5e7aff347fa74da41b5d2 Mon Sep 17 00:00:00 2001
From: Tom Rondeau <trondeau@vt.edu>
Date: Tue, 3 Jan 2012 15:36:13 -0500
Subject: scheduler: added argument to wxGUI's stdapp that allows a user to
 specify the max_noutput_items when building a wxGUI application.

---
 gr-wxgui/src/python/stdgui2.py | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

(limited to 'gr-wxgui/src/python/stdgui2.py')

diff --git a/gr-wxgui/src/python/stdgui2.py b/gr-wxgui/src/python/stdgui2.py
index e510f174c9..f397fd01e9 100644
--- a/gr-wxgui/src/python/stdgui2.py
+++ b/gr-wxgui/src/python/stdgui2.py
@@ -27,23 +27,27 @@ from gnuradio import gr
 
 
 class stdapp (wx.App):
-    def __init__ (self, top_block_maker, title="GNU Radio", nstatus=2):
+    def __init__ (self, top_block_maker, title="GNU Radio", nstatus=2,
+                  max_noutput_items=None):
         self.top_block_maker = top_block_maker
         self.title = title
         self._nstatus = nstatus
+        self._max_noutput_items = max_noutput_items
         # All our initialization must come before calling wx.App.__init__.
         # OnInit is called from somewhere in the guts of __init__.
         wx.App.__init__ (self, redirect=False)
 
     def OnInit (self):
-        frame = stdframe (self.top_block_maker, self.title, self._nstatus)
+        frame = stdframe (self.top_block_maker, self.title, self._nstatus,
+                          self._max_noutput_items)
         frame.Show (True)
         self.SetTopWindow (frame)
         return True
 
 
 class stdframe (wx.Frame):
-    def __init__ (self, top_block_maker, title="GNU Radio", nstatus=2):
+    def __init__ (self, top_block_maker, title="GNU Radio", nstatus=2,
+                  max_nouts=None):
         # print "stdframe.__init__"
         wx.Frame.__init__(self, None, -1, title)
 
@@ -57,7 +61,7 @@ class stdframe (wx.Frame):
         self.SetMenuBar (mainmenu)
 
         self.Bind (wx.EVT_CLOSE, self.OnCloseWindow)
-        self.panel = stdpanel (self, self, top_block_maker)
+        self.panel = stdpanel (self, self, top_block_maker, max_nouts)
         vbox = wx.BoxSizer(wx.VERTICAL)
         vbox.Add(self.panel, 1, wx.EXPAND)
         self.SetSizer(vbox)
@@ -72,7 +76,8 @@ class stdframe (wx.Frame):
         return self.panel.top_block
     
 class stdpanel (wx.Panel):
-    def __init__ (self, parent, frame, top_block_maker):
+    def __init__ (self, parent, frame, top_block_maker,
+                  max_nouts=None):
         # print "stdpanel.__init__"
         wx.Panel.__init__ (self, parent, -1)
         self.frame = frame
@@ -83,7 +88,10 @@ class stdpanel (wx.Panel):
         self.SetAutoLayout (True)
         vbox.Fit (self)
 
-        self.top_block.start ()
+        if(max_nouts is not None):
+            self.top_block.start (max_nouts)
+        else:
+            self.top_block.start ()            
 
 class std_top_block (gr.top_block):
     def __init__ (self, parent, panel, vbox, argv):
-- 
cgit v1.2.3