commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r10581 - in gnuradio/trunk/grc/src: gui platforms/pyth


From: jblum
Subject: [Commit-gnuradio] r10581 - in gnuradio/trunk/grc/src: gui platforms/python
Date: Wed, 11 Mar 2009 13:07:32 -0600 (MDT)

Author: jblum
Date: 2009-03-11 13:07:31 -0600 (Wed, 11 Mar 2009)
New Revision: 10581

Modified:
   gnuradio/trunk/grc/src/gui/Messages.py
   gnuradio/trunk/grc/src/platforms/python/Generator.py
Log:
Add a warning about flow control and throttle when the fg is generated.
Because who reads the wiki anyway.



Modified: gnuradio/trunk/grc/src/gui/Messages.py
===================================================================
--- gnuradio/trunk/grc/src/gui/Messages.py      2009-03-10 05:42:32 UTC (rev 
10580)
+++ gnuradio/trunk/grc/src/gui/Messages.py      2009-03-11 19:07:31 UTC (rev 
10581)
@@ -99,3 +99,7 @@
 
 def send_fail_save_preferences(prefs_file_path):
        send('>>> Error: Cannot save preferences file: "%s"\n'%prefs_file_path)
+
+################# functions for warning        
########################################
+def send_warning(warning):
+       send('>>> Warning: %s\n'%warning)

Modified: gnuradio/trunk/grc/src/platforms/python/Generator.py
===================================================================
--- gnuradio/trunk/grc/src/platforms/python/Generator.py        2009-03-10 
05:42:32 UTC (rev 10580)
+++ gnuradio/trunk/grc/src/platforms/python/Generator.py        2009-03-11 
19:07:31 UTC (rev 10581)
@@ -26,6 +26,7 @@
        HIER_BLOCKS_LIB_DIR, PYEXEC, \
        FLOW_GRAPH_TEMPLATE
 from utils import convert_hier
+from ... gui import Messages
 
 class Generator(object):
 
@@ -50,6 +51,12 @@
        def get_file_path(self): return self._file_path
 
        def write(self):
+               #do throttle warning
+               all_keys = ' '.join(map(lambda b: b.get_key(), 
self._flow_graph.get_enabled_blocks()))
+               if ('usrp' not in all_keys) and ('audio' not in all_keys) and 
('throttle' not in all_keys):
+                       Messages.send_warning('''\
+This flow graph may not have flow control: no audio or usrp blocks found. \
+Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''')
                #generate
                open(self.get_file_path(), 'w').write(str(self))
                if self._generate_options == 'hb':





reply via email to

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