diff options
author | manojgudi | 2014-03-15 20:31:21 +0530 |
---|---|---|
committer | manojgudi | 2014-03-15 20:31:21 +0530 |
commit | 56dfdfd2885446138edd210c42e0ef70d07d1dc2 (patch) | |
tree | 73b2f0108d6ae1090de726c2c686cc1eb4a4cc78 /code/.grc_gnuradio/my_block.xml | |
parent | cb95976e9c184470effcd64b2b84b6475742c5e4 (diff) | |
download | sandhi-docs-56dfdfd2885446138edd210c42e0ef70d07d1dc2.tar.gz sandhi-docs-56dfdfd2885446138edd210c42e0ef70d07d1dc2.tar.bz2 sandhi-docs-56dfdfd2885446138edd210c42e0ef70d07d1dc2.zip |
added sample my_block code
Diffstat (limited to 'code/.grc_gnuradio/my_block.xml')
-rw-r--r-- | code/.grc_gnuradio/my_block.xml | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/code/.grc_gnuradio/my_block.xml b/code/.grc_gnuradio/my_block.xml new file mode 100644 index 0000000..36326ca --- /dev/null +++ b/code/.grc_gnuradio/my_block.xml @@ -0,0 +1,82 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Add Block: +## all types, 1 output, 2 to inf inputs +################################################### + --> +<block> + <name>my_block</name> + <key>my_block_key</key> + <category>My Block</category> + +<!-- This section is Cheetah Script +--> + <import>import my_block</import> + <make>my_block.MyBlock() +self.$(id).set_parameters($value) + </make> + <param> + <name>IO Type</name> + <key>type</key> + <type>enum</type> + <option><name>F32_F32</name><key>f32_f32</key></option> + <option><name>S32_S32</name><key>s32_s32</key></option> + <option><name>S16_S16</name><key>s16_s16</key></option> + <option><name>S8_S8</name><key>s8_s8</key></option> + </param> + <param> + <name>Num Inputs</name> + <key>num_inputs</key> + <value>2</value> + <type>int</type> + </param> + + <param> + <name>Vec Length</name> + <key>vlen</key> + <value>1</value> + <type>int</type> + </param> + + <!-- My Block parameter, this value is used to sum with input; and pass that as output of my block + --> + <param> + <name>Value</name> + <key>value</key> + <value>1</value> + <type>int</type> + </param> + + <!-- + Check if number of inputs are greater than 0, and if vector length + is greater than 0. + --> + <check>$num_inputs > 0</check> + <check>$vlen > 0</check> + + <!-- + Input of the block + --> + <sink> + <name>in</name> + <type>$(str($type).split('_')[0])</type> + <vlen>$vlen</vlen> + <nports>$num_inputs</nports> + </sink> + + <!-- + Output of the block + --> + <source> + <name>out</name> + <type>$(str($type).split('_')[1])</type> + <vlen>$vlen</vlen> + </source> + <doc> + Your Documentation Goes Here + + This block outputs sum of value and input and prints "Hello World" onto the terminal + output = input + value + </doc> +</block> |