#
-# Copyright 2006 Free Software Foundation, Inc.
+# Copyright 2006,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# Boston, MA 02110-1301, USA.
#
-from gnuradio_swig_python import hier_block2_swig, gr_make_runtime, \
- runtime_run_unlocked, runtime_start_unlocked, runtime_stop_unlocked, \
- runtime_wait_unlocked, runtime_restart_unlocked, io_signature
+from gnuradio_swig_python import hier_block2_swig
#
# This hack forces a 'has-a' relationship to look like an 'is-a' one.
self._hb.disconnect(src_block.basic_block(), src_port,
dst_block.basic_block(), dst_port)
-# Convenience class to create a no input, no output block for runtime top block
-class top_block(hier_block2):
- def __init__(self, name):
- hier_block2.__init__(self, name, io_signature(0,0,0), io_signature(0,0,0))
-
-# This allows the 'run_locked' methods, which are defined in gr_runtime.i,
-# to release the Python global interpreter lock before calling the actual
-# method in gr.runtime
-#
-# This probably should be elsewhere but it works here
-class runtime(object):
- def __init__(self, top_block):
- if (isinstance(top_block, hier_block2)):
- self._r = gr_make_runtime(top_block._hb)
- else:
- self._r = gr_make_runtime(top_block)
-
- def run(self):
- runtime_run_unlocked(self._r)
-
- def start(self):
- runtime_start_unlocked(self._r)
-
- def stop(self):
- runtime_stop_unlocked(self._r)
-
- def wait(self):
- runtime_wait_unlocked(self._r)
-
- def restart(self):
- runtime_restart_unlocked(self._r)