diff options
author | jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> | 2007-04-28 02:20:28 +0000 |
---|---|---|
committer | jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> | 2007-04-28 02:20:28 +0000 |
commit | b26ea69676c09f5366a9e2f33b11ae5a7521ffe5 (patch) | |
tree | 0641c1c25d6e827f70941e07f4611d0a2b6b83cd /gnuradio-examples/python/hier/usrp/usrp_siggen.py | |
parent | 00696b9f754338de9362932c1ecfb1e144a38786 (diff) |
Merged -r 5137:5174 from developer branch jcorgan/hb. Trunk passes distcheck. Converts gr.hier_block2 API to not use 'define_component' methodology anymore.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@5177 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-examples/python/hier/usrp/usrp_siggen.py')
-rwxr-xr-x | gnuradio-examples/python/hier/usrp/usrp_siggen.py | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/gnuradio-examples/python/hier/usrp/usrp_siggen.py b/gnuradio-examples/python/hier/usrp/usrp_siggen.py index 28f80a822a..f1eb2a6bc0 100755 --- a/gnuradio-examples/python/hier/usrp/usrp_siggen.py +++ b/gnuradio-examples/python/hier/usrp/usrp_siggen.py @@ -7,15 +7,9 @@ from gnuradio import eng_notation from optparse import OptionParser import sys - -class my_graph(gr.hier_block2): +class my_graph(gr.top_block): def __init__ (self, type, ampl, wfreq, offset, subdev_spec, interp, rf_freq): - # Call hierarchical block constructor - # Top-level blocks have no inputs or outputs - gr.hier_block2.__init__(self, - "usrp_siggen", # Block type - gr.io_signature(0,0,0), # Input signature - gr.io_signature(0,0,0)) # Output signature + gr.top_block.__init__(self, "usrp_siggen") # controllable values self.interp = interp @@ -40,28 +34,21 @@ class my_graph(gr.hier_block2): sys.stderr.write('Failed to set RF frequency\n') raise SystemExit - self.define_component("usrp", self.u) - if type == gr.GR_SIN_WAVE or type == gr.GR_CONST_WAVE: self.src = gr.sig_source_c (self.usb_freq (), gr.GR_SIN_WAVE, self.waveform_freq, self.waveform_ampl, self.waveform_offset) - self.define_component("src", self.src) elif type == gr.GR_UNIFORM or type == gr.GR_GAUSSIAN: self.src = gr.noise_source_c (gr.GR_UNIFORM, self.waveform_ampl) - self.define_component("src", self.src) - + else: raise ValueError, type - # self.file_sink = gr.file_sink (gr.sizeof_gr_complex, "siggen.dat") - # self.define_component("file_sink", self.file_sink) - - self.connect ("src", 0, "usrp", 0) + self.connect (self.src, self.u) def usb_freq (self): |