summaryrefslogtreecommitdiff
path: root/grc/tests/resources
diff options
context:
space:
mode:
Diffstat (limited to 'grc/tests/resources')
-rw-r--r--grc/tests/resources/file1.xml58
-rw-r--r--grc/tests/resources/file2.xml80
-rw-r--r--grc/tests/resources/file3.xml100
3 files changed, 238 insertions, 0 deletions
diff --git a/grc/tests/resources/file1.xml b/grc/tests/resources/file1.xml
new file mode 100644
index 0000000000..f03288b85d
--- /dev/null
+++ b/grc/tests/resources/file1.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<!--
+Copyright 2014 Free Software Foundation, Inc.
+This file is part of GNU Radio
+
+GNU Radio Companion 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 2 of the License, or (at your
+option) any later version.
+
+GNU Radio Companion 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
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+-->
+<block>
+ <name>testname</name>
+ <key>block_key</key>
+ <make>blocks.complex_to_mag_squared($(vlen))</make>
+ <param>
+ <name>Vec Length</name>
+ <key>vlen</key>
+ <value>1</value>
+ <type>int</type>
+ <tab>test</tab>
+ </param>
+ <param>
+ <name>Vec Length</name>
+ <key>out_type</key>
+ <value>complex</value>
+ <type>string</type>
+ </param>
+ <param>
+ <name>Alpha</name>
+ <key>a</key>
+ <value>0</value>
+ <type>($out_type)</type>
+ </param>
+ <check>$vlen &gt; 0</check>
+ <sink>
+ <name>in</name>
+ <type>complex</type>
+ <vlen>2 * $vlen</vlen>
+ </sink>
+ <sink>
+ <name>in2</name>
+ <type>message</type>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>$out_type</type>
+ <vlen>$vlen</vlen>
+ </source>
+</block>
diff --git a/grc/tests/resources/file2.xml b/grc/tests/resources/file2.xml
new file mode 100644
index 0000000000..1300c7f5a1
--- /dev/null
+++ b/grc/tests/resources/file2.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0"?>
+<!--
+Copyright 2014 Free Software Foundation, Inc.
+This file is part of GNU Radio
+
+GNU Radio Companion 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 2 of the License, or (at your
+option) any later version.
+
+GNU Radio Companion 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
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+-->
+<!--
+###################################################
+## And Const Block:
+## all types, 1 output, 1 input & const
+###################################################
+ -->
+<block>
+ <name>And Const</name>
+ <key>blocks_and_const_xx</key>
+ <category>test</category>
+ <throttle>1</throttle>
+ <import>from gnuradio import blocks</import>
+ <make>blocks.and_const_$(type.fcn)($const)</make>
+ <callback>set_k($const)</callback>
+ <param>
+ <name>IO Type</name>
+ <key>type</key>
+ <type>enum</type>
+ <option>
+ <name>Int</name>
+ <key>int</key>
+ <opt>fcn:ii</opt>
+ </option>
+ <option>
+ <name>Short</name>
+ <key>short</key>
+ <opt>fcn:ss</opt>
+ </option>
+ <option>
+ <name>Byte</name>
+ <key>byte</key>
+ <opt>fcn:bb</opt>
+ </option>
+ </param>
+ <param>
+ <name>Constant</name>
+ <key>const</key>
+ <value>0</value>
+ <type>${type}</type>
+ <hide>#if $log then 'none' else 'part'#</hide>
+ </param>
+ <sink>
+ <name>in</name>
+ <type>$type</type>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>$(type.fcn)</type>
+ </source>
+ <doc>
+This block creates a variable check box. \
+Leave the label blank to use the variable id as the label.
+
+A check box selects between two values of similar type. \
+Te values do not necessarily need to be of boolean type.
+
+The GUI hint can be used to position the widget within the application. \
+The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \
+Both the tab specification and the grid position are optional.
+ </doc>
+</block>
diff --git a/grc/tests/resources/file3.xml b/grc/tests/resources/file3.xml
new file mode 100644
index 0000000000..71753badb1
--- /dev/null
+++ b/grc/tests/resources/file3.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0"?>
+<!--
+Copyright 2014 Free Software Foundation, Inc.
+This file is part of GNU Radio
+
+GNU Radio Companion 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 2 of the License, or (at your
+option) any later version.
+
+GNU Radio Companion 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
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+-->
+<!--
+###################################################
+##Variable Check Box:
+## a gui check box form
+###################################################
+ -->
+<block>
+ <name>QT GUI Check Box</name>
+ <key>variable_qtgui_check_box</key>
+ <import>from PyQt4 import Qt</import>
+ <var_make>self.$(id) = $(id) = $value</var_make>
+ <make>#set $win = '_%s_check_box'%$id
+#if not $label()
+ #set $label = '"%s"'%$id
+#end if
+$win = Qt.QCheckBox($label)
+self._$(id)_choices = {True: $true, False: $false}
+self._$(id)_choices_inv = dict((v,k) for k,v in self._$(id)_choices.iteritems())
+self._$(id)_callback = lambda i: Qt.QMetaObject.invokeMethod($(win), "setChecked", Qt.Q_ARG("bool", self._$(id)_choices_inv[i]))
+self._$(id)_callback(self.$id)
+$(win).stateChanged.connect(lambda i: self.set_$(id)(self._$(id)_choices[bool(i)]))
+$(gui_hint()($win))</make>
+ <callback>self.set_$(id)($value)</callback>
+ <callback>self._$(id)_callback($id)</callback>
+ <param>
+ <name>Label</name>
+ <key>label</key>
+ <value></value>
+ <type>string</type>
+ <hide>#if $label() then 'none' else 'part'#</hide>
+ </param>
+ <param>
+ <name>Type</name>
+ <key>type</key>
+ <value>int</value>
+ <type>enum</type>
+ <hide>part</hide>
+ <option><name>Float</name><key>real</key><opt>conv:float</opt></option>
+ <option><name>Integer</name><key>int</key><opt>conv:int</opt></option>
+ <option><name>String</name><key>string</key><opt>conv:str</opt></option>
+ <option><name>Boolean</name><key>bool</key><opt>conv:bool</opt></option>
+ <option><name>Any</name><key>raw</key><opt>conv:eval</opt></option>
+ </param>
+ <param>
+ <name>Default Value</name>
+ <key>value</key>
+ <value>True</value>
+ <type>$type</type>
+ </param>
+ <param>
+ <name>True</name>
+ <key>true</key>
+ <value>True</value>
+ <type>$type</type>
+ </param>
+ <param>
+ <name>False</name>
+ <key>false</key>
+ <value>False</value>
+ <type>$type</type>
+ </param>
+ <param>
+ <name>GUI Hint</name>
+ <key>gui_hint</key>
+ <value></value>
+ <type>gui_hint</type>
+ <hide>part</hide>
+ </param>
+ <check>$value in ($true, $false)</check>
+ <doc>
+This block creates a variable check box. \
+Leave the label blank to use the variable id as the label.
+
+A check box selects between two values of similar type. \
+Te values do not necessarily need to be of boolean type.
+
+The GUI hint can be used to position the widget within the application. \
+The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \
+Both the tab specification and the grid position are optional.
+ </doc>
+</block>