summaryrefslogtreecommitdiff
path: root/gr-gpio/src/python
diff options
context:
space:
mode:
authoreb2008-06-24 20:48:39 +0000
committereb2008-06-24 20:48:39 +0000
commit4d5e702b2a7d511f22b8e5dcce7da5ce77a2d322 (patch)
tree07818e507e305419d4a098e1a1d6366c098db4bc /gr-gpio/src/python
parentab6cf111c1d00b22d9016524b31cfcc6b09ffdc7 (diff)
downloadgnuradio-4d5e702b2a7d511f22b8e5dcce7da5ce77a2d322.tar.gz
gnuradio-4d5e702b2a7d511f22b8e5dcce7da5ce77a2d322.tar.bz2
gnuradio-4d5e702b2a7d511f22b8e5dcce7da5ce77a2d322.zip
removed is_running method from gr_top_block
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@8689 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-gpio/src/python')
-rwxr-xr-xgr-gpio/src/python/gpio_usrp_siggen.py39
1 files changed, 19 insertions, 20 deletions
diff --git a/gr-gpio/src/python/gpio_usrp_siggen.py b/gr-gpio/src/python/gpio_usrp_siggen.py
index 0a0ea685b..0e483c35d 100755
--- a/gr-gpio/src/python/gpio_usrp_siggen.py
+++ b/gr-gpio/src/python/gpio_usrp_siggen.py
@@ -90,26 +90,25 @@ class my_top_block(gr.top_block):
# self.file_sink = gr.file_sink (gr.sizeof_gr_complex, "siggen.dat")
def _configure_graph (self, type):
- was_running = self.is_running ()
- if was_running:
- self.stop ()
- self.disconnect_all ()
- if type == gr.GR_SIN_WAVE:
- self.connect (self.siggen, self.u)
- # self.connect (self.siggen, self.file_sink)
- self.siggen.set_waveform (type)
- self.src = self.siggen
- elif type == gr.GR_UNIFORM or type == gr.GR_GAUSSIAN:
- self.connect (self.noisegen, self.u)
- self.noisegen.set_type (type)
- self.src = self.noisegen
- elif type == gr.GR_CONST_WAVE:
- self.connect (self.vecgen, self.u)
- self.src = self.vecgen
- else:
- raise ValueError, type
- if was_running:
- self.start ()
+ try:
+ self.lock()
+ self.disconnect_all ()
+ if type == gr.GR_SIN_WAVE:
+ self.connect (self.siggen, self.u)
+ # self.connect (self.siggen, self.file_sink)
+ self.siggen.set_waveform (type)
+ self.src = self.siggen
+ elif type == gr.GR_UNIFORM or type == gr.GR_GAUSSIAN:
+ self.connect (self.noisegen, self.u)
+ self.noisegen.set_type (type)
+ self.src = self.noisegen
+ elif type == gr.GR_CONST_WAVE:
+ self.connect (self.vecgen, self.u)
+ self.src = self.vecgen
+ else:
+ raise ValueError, type
+ finally:
+ self.unlock()
def set_freq(self, target_freq):
"""