summaryrefslogtreecommitdiff
path: root/gr-qtgui/src/python
diff options
context:
space:
mode:
Diffstat (limited to 'gr-qtgui/src/python')
-rw-r--r--gr-qtgui/src/python/Makefile.am33
-rw-r--r--gr-qtgui/src/python/__init__.py0
-rwxr-xr-xgr-qtgui/src/python/qttest_c.py27
-rwxr-xr-xgr-qtgui/src/python/qttest_f.py29
4 files changed, 89 insertions, 0 deletions
diff --git a/gr-qtgui/src/python/Makefile.am b/gr-qtgui/src/python/Makefile.am
new file mode 100644
index 000000000..ce862c2b7
--- /dev/null
+++ b/gr-qtgui/src/python/Makefile.am
@@ -0,0 +1,33 @@
+#
+# Copyright 2004 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+include $(top_srcdir)/Makefile.common
+
+noinst_PYTHON = \
+ qttest_f.py \
+ qttest_c.py
+
+qtguipythondir = $(grpythondir)/qtgui
+
+qtguipython_PYTHON = \
+ __init__.py
+
+CLEANFILES = *.pyc *.pyo
diff --git a/gr-qtgui/src/python/__init__.py b/gr-qtgui/src/python/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/gr-qtgui/src/python/__init__.py
diff --git a/gr-qtgui/src/python/qttest_c.py b/gr-qtgui/src/python/qttest_c.py
new file mode 100755
index 000000000..40d1f42b7
--- /dev/null
+++ b/gr-qtgui/src/python/qttest_c.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+
+from gnuradio import gr
+from gnuradio.qtgui import qtgui
+
+class my_top_block(gr.top_block):
+ def __init__(self):
+ gr.top_block.__init__(self)
+
+ fftsize = 2048
+
+ src1 = gr.sig_source_c(1, gr.GR_SIN_WAVE, 0.1, 0.01, 0)
+ src2 = gr.sig_source_c(1, gr.GR_SIN_WAVE, 0.015, 0.01, 0)
+ src = gr.add_cc()
+ thr = gr.throttle(gr.sizeof_gr_complex, 20*fftsize)
+ self.snk = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS, -0.5, 0.5)
+
+ self.connect(src1, (src,0))
+ self.connect(src2, (src,1))
+ self.connect(src, thr, self.snk)
+
+if __name__ == "__main__":
+ tb = my_top_block();
+ tb.start()
+ tb.snk.start_app();
+ #tb.wait();
+
diff --git a/gr-qtgui/src/python/qttest_f.py b/gr-qtgui/src/python/qttest_f.py
new file mode 100755
index 000000000..a950b35b1
--- /dev/null
+++ b/gr-qtgui/src/python/qttest_f.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+
+from gnuradio import gr
+from gnuradio.qtgui import qtgui
+
+class my_top_block(gr.top_block):
+ def __init__(self):
+ gr.top_block.__init__(self)
+
+ fftsize = 8192
+
+ win = gr.firdes.window(gr.firdes.WIN_HANN, fftsize, 0)
+
+ src1 = gr.sig_source_f(1, gr.GR_SIN_WAVE, 0.1, 0.1, 0)
+ src2 = gr.sig_source_f(1, gr.GR_SIN_WAVE, 0.015, 0.1, 0)
+ src = gr.add_ff()
+ thr = gr.throttle(gr.sizeof_float, 20*fftsize)
+ self.snk = qtgui.sink_f(fftsize, win, -0.5, 0.5)
+
+ self.connect(src1, (src,0))
+ self.connect(src2, (src,1))
+ self.connect(src, thr, self.snk)
+
+if __name__ == "__main__":
+ tb = my_top_block();
+ tb.start()
+ tb.snk.start_app();
+ #tb.wait();
+