commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r10780 - in gnuradio/branches/developers/jblum/grc/grc


From: jblum
Subject: [Commit-gnuradio] r10780 - in gnuradio/branches/developers/jblum/grc/grc: scripts src/platforms/base src/platforms/gui src/platforms/python
Date: Mon, 6 Apr 2009 02:23:47 -0600 (MDT)

Author: jblum
Date: 2009-04-06 02:23:46 -0600 (Mon, 06 Apr 2009)
New Revision: 10780

Modified:
   gnuradio/branches/developers/jblum/grc/grc/scripts/grc
   gnuradio/branches/developers/jblum/grc/grc/src/platforms/base/Param.py
   gnuradio/branches/developers/jblum/grc/grc/src/platforms/gui/Param.py
   gnuradio/branches/developers/jblum/grc/grc/src/platforms/python/Generator.py
Log:
Check for gnuradio module in grc script w/ error dialog (PYTHONPATH).
Throttle warning for top block modes only.
Simplified enum/combobox input param.



Modified: gnuradio/branches/developers/jblum/grc/grc/scripts/grc
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/scripts/grc      2009-04-06 
06:13:09 UTC (rev 10779)
+++ gnuradio/branches/developers/jblum/grc/grc/scripts/grc      2009-04-06 
08:23:46 UTC (rev 10780)
@@ -22,6 +22,14 @@
 pygtk.require('2.0')
 import gtk
 
+try: import gnuradio
+except ImportError, e:
+       d = gtk.MessageDialog(type=gtk.MESSAGE_ERROR, 
buttons=gtk.BUTTONS_CLOSE, message_format="""
+Cannot find module gnuradio. Is your PYTHONPATH set correctly?""")
+       d.set_title(e.message)
+       d.run()
+       exit(-1)
+
 from gnuradio.grc.platforms.base.Constants import VERSION
 from optparse import OptionParser
 

Modified: gnuradio/branches/developers/jblum/grc/grc/src/platforms/base/Param.py
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/src/platforms/base/Param.py      
2009-04-06 06:13:09 UTC (rev 10779)
+++ gnuradio/branches/developers/jblum/grc/grc/src/platforms/base/Param.py      
2009-04-06 08:23:46 UTC (rev 10780)
@@ -59,15 +59,12 @@
 
        def __init__(self, *args, **kwargs):
                InputParam.__init__(self, *args, **kwargs)
-               input = gtk.ComboBox(gtk.ListStore(gobject.TYPE_STRING))
-               cell = gtk.CellRendererText()
-               input.pack_start(cell, True)
-               input.add_attribute(cell, 'text', 0)
-               for option in self.param.get_options(): 
input.append_text(option.get_name())
-               
input.set_active(int(self.param.get_option_keys().index(self.param.get_value())))
-               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
+               self._input = gtk.combo_box_new_text()
+               for option in self.param.get_options(): 
self._input.append_text(option.get_name())
+               
self._input.set_active(int(self.param.get_option_keys().index(self.param.get_value())))
+               self._input.connect('changed', self._handle_changed)
+               self.pack_start(self._input, False)
+       def get_text(self): return 
self.param.get_option_keys()[self._input.get_active()]
 
 class Option(Element):
 

Modified: gnuradio/branches/developers/jblum/grc/grc/src/platforms/gui/Param.py
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/src/platforms/gui/Param.py       
2009-04-06 06:13:09 UTC (rev 10779)
+++ gnuradio/branches/developers/jblum/grc/grc/src/platforms/gui/Param.py       
2009-04-06 08:23:46 UTC (rev 10780)
@@ -52,9 +52,7 @@
                When the input changes, write the inputs to the data type.
                Finish by calling the exteral callback.
                """
-               value = self._input.get_text()
-               if self.is_enum(): value = self.get_option_keys()[int(value)]
-               self.set_value(value)
+               self.set_value(self._input.get_text())
                #set the markup on the label, red for errors in corresponding 
data type.
                name = '<span font_desc="%s">%s</span>'%(
                        PARAM_LABEL_FONT,

Modified: 
gnuradio/branches/developers/jblum/grc/grc/src/platforms/python/Generator.py
===================================================================
--- 
gnuradio/branches/developers/jblum/grc/grc/src/platforms/python/Generator.py    
    2009-04-06 06:13:09 UTC (rev 10779)
+++ 
gnuradio/branches/developers/jblum/grc/grc/src/platforms/python/Generator.py    
    2009-04-06 08:23:46 UTC (rev 10780)
@@ -53,7 +53,7 @@
        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):
+               if ('usrp' not in all_keys) and ('audio' not in all_keys) and 
('throttle' not in all_keys) and self._generate_options != 'hb':
                        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.''')





reply via email to

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