summaryrefslogtreecommitdiff
path: root/gnuradio-examples
diff options
context:
space:
mode:
authorjcorgan2007-08-27 18:49:11 +0000
committerjcorgan2007-08-27 18:49:11 +0000
commitc088a546ac7ae55748e5421201f3387f3e1286f9 (patch)
treeb655773370d082062c2842181bff1638354c57c8 /gnuradio-examples
parent06945c04b4af8af035aeee2e28d5e5626888f5ee (diff)
downloadgnuradio-c088a546ac7ae55748e5421201f3387f3e1286f9.tar.gz
gnuradio-c088a546ac7ae55748e5421201f3387f3e1286f9.tar.bz2
gnuradio-c088a546ac7ae55748e5421201f3387f3e1286f9.zip
Merged r6171:6186 from jcorgan/fg into trunk.
Changes hierarchical flow graph API to use gr.top_block instead of gr.runtime. See discuss-gnuradio mailing list for explanation of changes. GRC has not been updated to use the changed API. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6187 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-examples')
-rw-r--r--gnuradio-examples/Makefile.am2
-rw-r--r--gnuradio-examples/c++/Makefile.am3
-rw-r--r--gnuradio-examples/c++/dial_tone/README14
-rw-r--r--gnuradio-examples/c++/dial_tone/dial_tone.cc4
-rw-r--r--gnuradio-examples/c++/dial_tone/dial_tone.h4
-rw-r--r--gnuradio-examples/c++/dial_tone/main.cc5
-rwxr-xr-xgnuradio-examples/python/hier/audio/dial_tone2.py6
-rwxr-xr-xgnuradio-examples/python/hier/dect/usrp_dect.py6
-rwxr-xr-xgnuradio-examples/python/hier/digital/benchmark_loopback.py7
-rwxr-xr-xgnuradio-examples/python/hier/digital/benchmark_rx.py7
-rwxr-xr-xgnuradio-examples/python/hier/digital/benchmark_tx.py7
-rwxr-xr-xgnuradio-examples/python/hier/networking/audio_sink.py5
-rwxr-xr-xgnuradio-examples/python/hier/networking/audio_source.py5
-rwxr-xr-xgnuradio-examples/python/hier/networking/dial_tone_sink.py5
-rwxr-xr-xgnuradio-examples/python/hier/networking/dial_tone_source.py5
-rwxr-xr-xgnuradio-examples/python/hier/networking/vector_sink.py5
-rwxr-xr-xgnuradio-examples/python/hier/networking/vector_source.py5
-rwxr-xr-xgnuradio-examples/python/hier/sounder/usrp_sounder_rx.py3
-rwxr-xr-xgnuradio-examples/python/hier/sounder/usrp_sounder_tx.py6
-rwxr-xr-xgnuradio-examples/python/hier/usrp/usrp_siggen.py4
20 files changed, 35 insertions, 73 deletions
diff --git a/gnuradio-examples/Makefile.am b/gnuradio-examples/Makefile.am
index 25436c1c8..41e9ee4d6 100644
--- a/gnuradio-examples/Makefile.am
+++ b/gnuradio-examples/Makefile.am
@@ -21,4 +21,4 @@
include $(top_srcdir)/Makefile.common
-SUBDIRS = python
+SUBDIRS = python c++
diff --git a/gnuradio-examples/c++/Makefile.am b/gnuradio-examples/c++/Makefile.am
index 444bf11e3..5ac086075 100644
--- a/gnuradio-examples/c++/Makefile.am
+++ b/gnuradio-examples/c++/Makefile.am
@@ -20,7 +20,4 @@
#
include $(top_srcdir)/Makefile.common
-
-# FIXME: do not build automatically; need to detect required pre-requisites
-
# SUBDIRS = dial_tone
diff --git a/gnuradio-examples/c++/dial_tone/README b/gnuradio-examples/c++/dial_tone/README
index cfc545802..6d5ed5059 100644
--- a/gnuradio-examples/c++/dial_tone/README
+++ b/gnuradio-examples/c++/dial_tone/README
@@ -1,2 +1,16 @@
This example requires that gr-audio-alsa be built in the main tree in order
to compile successfully. It is not built automatically.
+
+To build this example, you must make two modifications to the build system:
+
+1) Add the following line inside config/grc_gnuradio_examples.m4:
+
+ gnuradio-examples/c++/dial_tone/Makefile
+
+ ...to the list of Makefiles already in there.
+
+2) In gnuradio-examples/c++/Makefile.am, uncomment the SUBDIRS line
+
+# SUBDIRS = dial_tone
+
+Then, from the top-level directory, re-run ./bootstrap and ./configure. \ No newline at end of file
diff --git a/gnuradio-examples/c++/dial_tone/dial_tone.cc b/gnuradio-examples/c++/dial_tone/dial_tone.cc
index f87b5e60d..296cfcc11 100644
--- a/gnuradio-examples/c++/dial_tone/dial_tone.cc
+++ b/gnuradio-examples/c++/dial_tone/dial_tone.cc
@@ -32,9 +32,7 @@ dial_tone_sptr make_dial_tone()
// Hierarchical block constructor, with no inputs or outputs
dial_tone::dial_tone() :
-gr_hier_block2("dial_tone",
- gr_make_io_signature(0,0,0),
- gr_make_io_signature(0,0,0))
+ gr_top_block("dial_tone")
{
gr_sig_source_f_sptr src0 = gr_make_sig_source_f(48000, GR_SIN_WAVE, 350, 0.1);
gr_sig_source_f_sptr src1 = gr_make_sig_source_f(48000, GR_SIN_WAVE, 440, 0.1);
diff --git a/gnuradio-examples/c++/dial_tone/dial_tone.h b/gnuradio-examples/c++/dial_tone/dial_tone.h
index 793f65b4c..c645439bb 100644
--- a/gnuradio-examples/c++/dial_tone/dial_tone.h
+++ b/gnuradio-examples/c++/dial_tone/dial_tone.h
@@ -19,13 +19,13 @@
* Boston, MA 02110-1301, USA.
*/
-#include <gr_hier_block2.h>
+#include <gr_top_block.h>
class dial_tone;
typedef boost::shared_ptr<dial_tone> dial_tone_sptr;
dial_tone_sptr make_dial_tone();
-class dial_tone : public gr_hier_block2
+class dial_tone : public gr_top_block
{
private:
dial_tone();
diff --git a/gnuradio-examples/c++/dial_tone/main.cc b/gnuradio-examples/c++/dial_tone/main.cc
index 684b8efd3..a09bd8288 100644
--- a/gnuradio-examples/c++/dial_tone/main.cc
+++ b/gnuradio-examples/c++/dial_tone/main.cc
@@ -26,13 +26,10 @@
// Tell the runtime to go...
#include <dial_tone.h>
-#include <gr_runtime.h>
int main()
{
dial_tone_sptr top_block = make_dial_tone();
- gr_runtime_sptr runtime = gr_make_runtime(top_block);
-
- runtime->run();
+ top_block->run();
return 0;
}
diff --git a/gnuradio-examples/python/hier/audio/dial_tone2.py b/gnuradio-examples/python/hier/audio/dial_tone2.py
index a5010faa5..70d1e53d2 100755
--- a/gnuradio-examples/python/hier/audio/dial_tone2.py
+++ b/gnuradio-examples/python/hier/audio/dial_tone2.py
@@ -60,13 +60,9 @@ if __name__ == '__main__':
options.audio_output,
options.amplitude)
- # Create an instance of a runtime, passing it the top block
- # to process
- runtime = gr.runtime(top)
-
try:
# Run forever
- runtime.run()
+ top.run()
except KeyboardInterrupt:
# Ctrl-C exits
pass
diff --git a/gnuradio-examples/python/hier/dect/usrp_dect.py b/gnuradio-examples/python/hier/dect/usrp_dect.py
index bf562e0d9..27259d812 100755
--- a/gnuradio-examples/python/hier/dect/usrp_dect.py
+++ b/gnuradio-examples/python/hier/dect/usrp_dect.py
@@ -51,13 +51,9 @@ def main():
# Create an instance of a hierarchical block
top_block = dect_receiver(options)
- # Create an instance of a runtime, passing it the top block
- # to process
- runtime = gr.runtime(top_block)
-
try:
# Run forever
- runtime.run()
+ top_block.run()
except KeyboardInterrupt:
# Ctrl-C exits
pass
diff --git a/gnuradio-examples/python/hier/digital/benchmark_loopback.py b/gnuradio-examples/python/hier/digital/benchmark_loopback.py
index a98d1cdfb..31dfb991b 100755
--- a/gnuradio-examples/python/hier/digital/benchmark_loopback.py
+++ b/gnuradio-examples/python/hier/digital/benchmark_loopback.py
@@ -155,10 +155,7 @@ def main():
# Create an instance of a hierarchical block
top_block = my_graph(mods[options.modulation], demods[options.modulation], rx_callback, options)
-
- # Create an instance of a runtime, passing it the top block
- runtime = gr.runtime(top_block)
- runtime.start()
+ top_block.start()
# generate and send packets
nbytes = int(1e6 * options.megabytes)
@@ -175,7 +172,7 @@ def main():
send_pkt(eof=True)
- runtime.wait()
+ top_block.wait()
if __name__ == '__main__':
try:
diff --git a/gnuradio-examples/python/hier/digital/benchmark_rx.py b/gnuradio-examples/python/hier/digital/benchmark_rx.py
index 669d5618e..c92d487bd 100755
--- a/gnuradio-examples/python/hier/digital/benchmark_rx.py
+++ b/gnuradio-examples/python/hier/digital/benchmark_rx.py
@@ -95,12 +95,7 @@ def main():
# Create an instance of a hierarchical block
top_block = receive_path(demods[options.modulation], rx_callback, options)
-
- # Create an instance of a runtime, passing it the top block
- runtime = gr.runtime(top_block)
- runtime.start()
-
- runtime.wait() # wait for it to finish
+ top_block.run()
if __name__ == '__main__':
try:
diff --git a/gnuradio-examples/python/hier/digital/benchmark_tx.py b/gnuradio-examples/python/hier/digital/benchmark_tx.py
index 0059a4555..752cdff55 100755
--- a/gnuradio-examples/python/hier/digital/benchmark_tx.py
+++ b/gnuradio-examples/python/hier/digital/benchmark_tx.py
@@ -88,10 +88,7 @@ def main():
# Create an instance of a hierarchical block
top_block = transmit_path(mods[options.modulation], options)
-
- # Create an instance of a runtime, passing it the top block
- runtime = gr.runtime(top_block)
- runtime.start()
+ top_block.start()
# generate and send packets
nbytes = int(1e6 * options.megabytes)
@@ -108,7 +105,7 @@ def main():
pktno += 1
send_pkt(eof=True)
- runtime.wait()
+ top_block.wait()
if __name__ == '__main__':
try:
diff --git a/gnuradio-examples/python/hier/networking/audio_sink.py b/gnuradio-examples/python/hier/networking/audio_sink.py
index 116a84815..e59d50834 100755
--- a/gnuradio-examples/python/hier/networking/audio_sink.py
+++ b/gnuradio-examples/python/hier/networking/audio_sink.py
@@ -50,12 +50,9 @@ if __name__ == '__main__':
top_block = audio_sink(options.src_name, options.src_port,
options.packet_size, options.sample_rate)
- # Create an instance of a runtime, passing it the top block
- runtime = gr.runtime(top_block)
-
try:
# Run forever
- runtime.run()
+ top_block.run()
except KeyboardInterrupt:
# Ctrl-C exits
pass
diff --git a/gnuradio-examples/python/hier/networking/audio_source.py b/gnuradio-examples/python/hier/networking/audio_source.py
index 2c42e29d3..d7f4f6d93 100755
--- a/gnuradio-examples/python/hier/networking/audio_source.py
+++ b/gnuradio-examples/python/hier/networking/audio_source.py
@@ -52,12 +52,9 @@ if __name__ == '__main__':
top_block = audio_source(options.src_name, options.dst_name, options.dst_port,
options.packet_size, options.sample_rate)
- # Create an instance of a runtime, passing it the top block
- runtime = gr.runtime(top_block)
-
try:
# Run forever
- runtime.run()
+ top_block.run()
except KeyboardInterrupt:
# Ctrl-C exits
pass
diff --git a/gnuradio-examples/python/hier/networking/dial_tone_sink.py b/gnuradio-examples/python/hier/networking/dial_tone_sink.py
index 5b979b35b..47d24b9bc 100755
--- a/gnuradio-examples/python/hier/networking/dial_tone_sink.py
+++ b/gnuradio-examples/python/hier/networking/dial_tone_sink.py
@@ -50,12 +50,9 @@ if __name__ == '__main__':
top_block = dial_tone_sink(options.src_name, options.src_port,
options.packet_size, options.sample_rate)
- # Create an instance of a runtime, passing it the top block
- runtime = gr.runtime(top_block)
-
try:
# Run forever
- runtime.run()
+ top_block.run()
except KeyboardInterrupt:
# Ctrl-C exits
pass
diff --git a/gnuradio-examples/python/hier/networking/dial_tone_source.py b/gnuradio-examples/python/hier/networking/dial_tone_source.py
index f092097d9..835f9aafc 100755
--- a/gnuradio-examples/python/hier/networking/dial_tone_source.py
+++ b/gnuradio-examples/python/hier/networking/dial_tone_source.py
@@ -61,12 +61,9 @@ if __name__ == '__main__':
top_block = dial_tone_source(options.src_name, options.dst_name, options.dst_port,
options.packet_size, options.sample_rate)
- # Create an instance of a runtime, passing it the top block
- runtime = gr.runtime(top_block)
-
try:
# Run forever
- runtime.run()
+ top_block.run()
except KeyboardInterrupt:
# Ctrl-C exits
pass
diff --git a/gnuradio-examples/python/hier/networking/vector_sink.py b/gnuradio-examples/python/hier/networking/vector_sink.py
index 05f3b0cbc..981cc598b 100755
--- a/gnuradio-examples/python/hier/networking/vector_sink.py
+++ b/gnuradio-examples/python/hier/networking/vector_sink.py
@@ -48,12 +48,9 @@ if __name__ == "__main__":
# Create an instance of a hierarchical block
top_block = vector_sink(options.src_name, options.src_port, options.packet_size)
- # Create an instance of a runtime, passing it the top block
- runtime = gr.runtime(top_block)
-
try:
# Run forever
- runtime.run()
+ top_block.run()
except KeyboardInterrupt:
# Ctrl-C exits
pass
diff --git a/gnuradio-examples/python/hier/networking/vector_source.py b/gnuradio-examples/python/hier/networking/vector_source.py
index 8ef01d7a9..e7ec2a461 100755
--- a/gnuradio-examples/python/hier/networking/vector_source.py
+++ b/gnuradio-examples/python/hier/networking/vector_source.py
@@ -51,12 +51,9 @@ if __name__ == '__main__':
top_block = vector_source(options.src_name, options.dst_name,
options.dst_port, options.packet_size)
- # Create an instance of a runtime, passing it the top block
- runtime = gr.runtime(top_block)
-
try:
# Run forever
- runtime.run()
+ top_block.run()
except KeyboardInterrupt:
# Ctrl-C exits
pass
diff --git a/gnuradio-examples/python/hier/sounder/usrp_sounder_rx.py b/gnuradio-examples/python/hier/sounder/usrp_sounder_rx.py
index 54c612f62..6b85281ad 100755
--- a/gnuradio-examples/python/hier/sounder/usrp_sounder_rx.py
+++ b/gnuradio-examples/python/hier/sounder/usrp_sounder_rx.py
@@ -85,10 +85,9 @@ def main():
sys.exit(1)
top_block = usrp_sounder_rx(options)
- runtime = gr.runtime(top_block)
try:
- runtime.run()
+ top_block.run()
except KeyboardInterrupt:
pass
diff --git a/gnuradio-examples/python/hier/sounder/usrp_sounder_tx.py b/gnuradio-examples/python/hier/sounder/usrp_sounder_tx.py
index e7fc3f60b..ae531d510 100755
--- a/gnuradio-examples/python/hier/sounder/usrp_sounder_tx.py
+++ b/gnuradio-examples/python/hier/sounder/usrp_sounder_tx.py
@@ -99,13 +99,9 @@ def main():
options.verbose, options.degree, options.chip_rate,
options.amplitude)
- # Create an instance of a runtime, passing it the top block
- # to process
- runtime = gr.runtime(top_block)
-
try:
# Run forever
- runtime.run()
+ top_block.run()
except KeyboardInterrupt:
# Ctrl-C exits
pass
diff --git a/gnuradio-examples/python/hier/usrp/usrp_siggen.py b/gnuradio-examples/python/hier/usrp/usrp_siggen.py
index f1eb2a6bc..91a7a7aff 100755
--- a/gnuradio-examples/python/hier/usrp/usrp_siggen.py
+++ b/gnuradio-examples/python/hier/usrp/usrp_siggen.py
@@ -119,11 +119,9 @@ def main ():
top_block = my_graph(options.type, options.amplitude, options.waveform_freq, options.offset,
options.tx_subdev_spec, options.interp, options.rf_freq)
- runtime = gr.runtime(top_block)
-
try:
# Run forever
- runtime.run()
+ top_block.run()
except KeyboardInterrupt:
# Ctrl-C exits
pass