From 6b1d8817a7fc6dd99a770cb11fac7ca48a3c81b0 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 6 Sep 2009 01:58:25 -0700 Subject: Fixed the usrp and usrp2 probe scripts to work with the new gui param api. 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. --- grc/scripts/usrp2_probe | 13 ++++++++----- grc/scripts/usrp_probe | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) (limited to 'grc/scripts') diff --git a/grc/scripts/usrp2_probe b/grc/scripts/usrp2_probe index 00d4366dd..689d41ecb 100755 --- a/grc/scripts/usrp2_probe +++ b/grc/scripts/usrp2_probe @@ -32,9 +32,6 @@ from gnuradio.grc.gui.Dialogs import TextDisplay 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') @@ -42,6 +39,12 @@ 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. @@ -69,8 +72,8 @@ class USRP2ProbeWindow(gtk.Window): #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) diff --git a/grc/scripts/usrp_probe b/grc/scripts/usrp_probe index 6565612c1..985d481ce 100755 --- a/grc/scripts/usrp_probe +++ b/grc/scripts/usrp_probe @@ -30,9 +30,6 @@ from gnuradio.grc.gui.Dialogs import TextDisplay 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') @@ -40,6 +37,12 @@ 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. @@ -66,8 +69,8 @@ class USRPProbeWindow(gtk.Window): #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) -- cgit From b8f69ad7ba49aa85239f6de611ddfd040344f66b Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 8 Sep 2009 23:04:38 -0700 Subject: use show signal to perform initial gui update --- grc/scripts/usrp2_probe | 1 - grc/scripts/usrp_probe | 1 - 2 files changed, 2 deletions(-) (limited to 'grc/scripts') diff --git a/grc/scripts/usrp2_probe b/grc/scripts/usrp2_probe index 689d41ecb..38c8f655c 100755 --- a/grc/scripts/usrp2_probe +++ b/grc/scripts/usrp2_probe @@ -42,7 +42,6 @@ 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): diff --git a/grc/scripts/usrp_probe b/grc/scripts/usrp_probe index 985d481ce..d2e92e753 100755 --- a/grc/scripts/usrp_probe +++ b/grc/scripts/usrp_probe @@ -40,7 +40,6 @@ 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): -- cgit