summaryrefslogtreecommitdiff
path: root/grc
diff options
context:
space:
mode:
authorjblum2009-01-28 20:06:20 +0000
committerjblum2009-01-28 20:06:20 +0000
commitc75a990177a8729993caf2dd1b17d9bae1b5ced0 (patch)
tree300f78495f1cbd4b3629ccaff9cafe37ad98462b /grc
parentf6d78800dc5b9db2025ffc2855f09f5cc79b16a6 (diff)
downloadgnuradio-c75a990177a8729993caf2dd1b17d9bae1b5ced0.tar.gz
gnuradio-c75a990177a8729993caf2dd1b17d9bae1b5ced0.tar.bz2
gnuradio-c75a990177a8729993caf2dd1b17d9bae1b5ced0.zip
constant source convenience wrapper
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10330 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc')
-rw-r--r--grc/data/platforms/python/block_tree.xml1
-rw-r--r--grc/data/platforms/python/blocks/Makefile.am1
-rw-r--r--grc/data/platforms/python/blocks/const_source_x.xml52
3 files changed, 54 insertions, 0 deletions
diff --git a/grc/data/platforms/python/block_tree.xml b/grc/data/platforms/python/block_tree.xml
index cdeef8ba1..b56073bbf 100644
--- a/grc/data/platforms/python/block_tree.xml
+++ b/grc/data/platforms/python/block_tree.xml
@@ -8,6 +8,7 @@
<name></name> <!-- Blank for Root Name -->
<cat>
<name>Sources</name>
+ <block>const_source_x</block>
<block>gr_sig_source_x</block>
<block>gr_noise_source_x</block>
<block>gr_vector_source_x</block>
diff --git a/grc/data/platforms/python/blocks/Makefile.am b/grc/data/platforms/python/blocks/Makefile.am
index 9eadba487..3655b1311 100644
--- a/grc/data/platforms/python/blocks/Makefile.am
+++ b/grc/data/platforms/python/blocks/Makefile.am
@@ -55,6 +55,7 @@ dist_ourdata_DATA = \
blks2_wfm_rcv.xml \
blks2_wfm_rcv_pll.xml \
blks2_wfm_tx.xml \
+ const_source_x.xml \
gr_add_const_vxx.xml \
gr_add_vxx.xml \
gr_agc2_xx.xml \
diff --git a/grc/data/platforms/python/blocks/const_source_x.xml b/grc/data/platforms/python/blocks/const_source_x.xml
new file mode 100644
index 000000000..fe8e56ec4
--- /dev/null
+++ b/grc/data/platforms/python/blocks/const_source_x.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##Constant Source: Custom wrapper
+###################################################
+ -->
+<block>
+ <name>Constant Source</name>
+ <key>const_source_x</key>
+ <import>from gnuradio import gr</import>
+ <make>gr.sig_source_$(type.fcn)(0, gr.GR_CONST_WAVE, 0, 0, $const)</make>
+ <callback>set_offset($const)</callback>
+ <param>
+ <name>Output Type</name>
+ <key>type</key>
+ <type>enum</type>
+ <option>
+ <name>Complex</name>
+ <key>complex</key>
+ <opt>fcn:c</opt>
+ <opt>const_type:complex</opt>
+ </option>
+ <option>
+ <name>Float</name>
+ <key>float</key>
+ <opt>fcn:f</opt>
+ <opt>const_type:real</opt>
+ </option>
+ <option>
+ <name>Int</name>
+ <key>int</key>
+ <opt>fcn:i</opt>
+ <opt>const_type:int</opt>
+ </option>
+ <option>
+ <name>Short</name>
+ <key>short</key>
+ <opt>fcn:s</opt>
+ <opt>const_type:int</opt>
+ </option>
+ </param>
+ <param>
+ <name>Constant</name>
+ <key>const</key>
+ <value>0</value>
+ <type>$type.const_type</type>
+ </param>
+ <source>
+ <name>out</name>
+ <type>$type</type>
+ </source>
+</block>