Also fixed the scripts to work since they were broken by previous changes.
Get input in param class now pases a param instance (self) into the object.
gtk.HBox.__init__(self)
self.param = param
self._callback = callback
- self.label = gtk.Label('') #no label, markup is added by set_markup
+ self.label = gtk.Label() #no label, markup is added by set_markup
self.label.set_size_request(150, -1)
self.pack_start(self.label, False)
self.set_markup = lambda m: self.label.set_markup(m)
self.param.set_value(self.get_text())
#call the callback
if self._callback: self._callback()
- #self.update() #dont update here, parent will update
+ else:
+ #no callback mode (used in supporting gui scripts)
+ #internally re-validate the param and update the gui
+ self.param.validate()
+ self.update()
class EntryParam(InputParam):
"""Provide an entry box for strings and numbers."""
All others get a standard entry parameter.
@return gtk input class
"""
- if self.is_enum(): return EnumParam(*args, **kwargs)
- if self.get_options(): return EnumEntryParam(*args, **kwargs)
- return EntryParam(*args, **kwargs)
+ if self.is_enum(): return EnumParam(self, *args, **kwargs)
+ if self.get_options(): return EnumEntryParam(self, *args, **kwargs)
+ return EntryParam(self, *args, **kwargs)
def get_layout(self):
"""
io_param.destroy()
#repopulate the params box
for param in self._block.get_params():
- io_param = param.get_input(param, callback=self._update)
+ io_param = param.get_input(self._update)
self._input_object_params.append(io_param)
self._params_box.pack_start(io_param, False)
#update the gui inputs
return dt_str
def get_input(self, *args, **kwargs):
- if self.get_type() in ('file_open', 'file_save'): return FileParam(*args, **kwargs)
+ if self.get_type() in ('file_open', 'file_save'): return FileParam(self, *args, **kwargs)
return _GUIParam.get_input(self, *args, **kwargs)
def get_color(self):
from gnuradio.grc.python.Platform import Platform
platform = Platform()
-from gnuradio.grc.gui.Platform import Platform
-platform = Platform(platform)
-
flow_graph = platform.get_new_flow_graph()
block = flow_graph.get_new_block('usrp2_probe')
usrp_interface_param = block.get_param('interface')
usrp_type_param = block.get_param('type')
+def get_input(param):
+ param.validate()
+ input = param.get_input()
+ input.update()
+ return input
+
class USRP2ProbeWindow(gtk.Window):
"""
The main window for USRP Dignostics.
#create vbox for storage
vbox = gtk.VBox()
frame.add(vbox)
- vbox.pack_start(usrp_interface_param.get_input_object(), False)
- vbox.pack_start(usrp_type_param.get_input_object(), False)
+ vbox.pack_start(get_input(usrp_interface_param), False)
+ vbox.pack_start(get_input(usrp_type_param), False)
#make the tree model for holding mac addrs
self.treestore = gtk.TreeStore(gobject.TYPE_STRING)
self.treeview = gtk.TreeView(self.treestore)
from gnuradio.grc.python.Platform import Platform
platform = Platform()
-from gnuradio.grc.gui.Platform import Platform
-platform = Platform(platform)
-
flow_graph = platform.get_new_flow_graph()
block = flow_graph.get_new_block('usrp_probe')
usrp_which_param = block.get_param('which')
usrp_dboard_param = block.get_param('dboard')
+def get_input(param):
+ param.validate()
+ input = param.get_input()
+ input.update()
+ return input
+
class USRPProbeWindow(gtk.Window):
"""
The main window for USRP Dignostics.
#create vbox for storage
vbox = gtk.VBox()
frame.add(vbox)
- vbox.pack_start(usrp_which_param.get_input_object(), False)
- vbox.pack_start(usrp_dboard_param.get_input_object(), False)
+ vbox.pack_start(get_input(usrp_which_param), False)
+ vbox.pack_start(get_input(usrp_dboard_param), False)
self.probe_button = gtk.Button('Probe')
self.probe_button.connect('clicked', self._probe_usrp)
vbox.pack_start(self.probe_button, False)
* threads dont die on exit in probe and variable sink
* align param titles in properties dialog
* weird grid params misbehaving
-* fix param input stuff for usrp probes
##################################################
# Future