summaryrefslogtreecommitdiff
path: root/grc/blocks
diff options
context:
space:
mode:
Diffstat (limited to 'grc/blocks')
-rw-r--r--grc/blocks/block_tree.xml6
-rw-r--r--grc/blocks/bus_sink.xml27
-rw-r--r--grc/blocks/bus_source.xml27
-rw-r--r--grc/blocks/bus_structure_sink.xml18
-rw-r--r--grc/blocks/bus_structure_source.xml18
-rw-r--r--grc/blocks/epy_block.xml58
-rw-r--r--grc/blocks/epy_module.xml32
-rw-r--r--grc/blocks/gr_message_domain.xml19
-rw-r--r--grc/blocks/gr_stream_domain.xml18
-rw-r--r--grc/blocks/import.xml4
-rw-r--r--grc/blocks/message.domain.yml10
-rw-r--r--grc/blocks/options.xml4
-rw-r--r--grc/blocks/stream.domain.yml10
13 files changed, 24 insertions, 227 deletions
diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml
index 3125864d4d..2a063f1f60 100644
--- a/grc/blocks/block_tree.xml
+++ b/grc/blocks/block_tree.xml
@@ -8,12 +8,6 @@
<block>virtual_source</block>
<block>virtual_sink</block>
- <block>bus_sink</block>
- <block>bus_source</block>
- <block>bus_structure_sink</block>
- <block>bus_structure_source</block>
-
- <block>epy_block</block>
<block>epy_module</block>
<block>note</block>
diff --git a/grc/blocks/bus_sink.xml b/grc/blocks/bus_sink.xml
deleted file mode 100644
index 029820dc2c..0000000000
--- a/grc/blocks/bus_sink.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Bus Sink
-###################################################
- -->
-<block>
- <name>Bus Sink</name>
- <key>bus_sink</key>
- <make>$yesno.yesno</make>
-
- <param>
- <name>On/Off</name>
- <key>yesno</key>
- <type>enum</type>
- <option>
- <name>On</name>
- <key>on</key>
- <opt>yesno:True</opt>
- </option>
- <option>
- <name>Off</name>
- <key>off</key>
- <opt>yesno:False</opt>
- </option>
- </param>
-</block>
diff --git a/grc/blocks/bus_source.xml b/grc/blocks/bus_source.xml
deleted file mode 100644
index e5b5c2b9bf..0000000000
--- a/grc/blocks/bus_source.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Bus Sink
-###################################################
- -->
-<block>
- <name>Bus Source</name>
- <key>bus_source</key>
- <make>$yesno.yesno</make>
-
- <param>
- <name>On/Off</name>
- <key>yesno</key>
- <type>enum</type>
- <option>
- <name>On</name>
- <key>on</key>
- <opt>yesno:True</opt>
- </option>
- <option>
- <name>Off</name>
- <key>off</key>
- <opt>yesno:False</opt>
- </option>
- </param>
-</block>
diff --git a/grc/blocks/bus_structure_sink.xml b/grc/blocks/bus_structure_sink.xml
deleted file mode 100644
index 3adac92810..0000000000
--- a/grc/blocks/bus_structure_sink.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Bus Sink
-###################################################
- -->
-<block>
- <name>Bus Sink Structure</name>
- <key>bus_structure_sink</key>
- <make>None</make>
-
- <param>
- <name>Structure</name>
- <key>struct</key>
- <value></value>
- <type>raw</type>
- </param>
-</block>
diff --git a/grc/blocks/bus_structure_source.xml b/grc/blocks/bus_structure_source.xml
deleted file mode 100644
index 34e7c049a2..0000000000
--- a/grc/blocks/bus_structure_source.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Bus Sink
-###################################################
- -->
-<block>
- <name>Bus Source Structure</name>
- <key>bus_structure_source</key>
- <make>None</make>
-
- <param>
- <name>Structure</name>
- <key>struct</key>
- <value></value>
- <type>raw</type>
- </param>
-</block>
diff --git a/grc/blocks/epy_block.xml b/grc/blocks/epy_block.xml
deleted file mode 100644
index 65e78c4062..0000000000
--- a/grc/blocks/epy_block.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0"?>
-<block>
- <name>Python Block</name>
- <key>epy_block</key>
- <import></import>
- <make></make>
- <param><!-- Cache the last working block IO to keep FG sane -->
- <name>Block Io</name>
- <key>_io_cache</key>
- <type>string</type>
- <hide>all</hide>
- </param>
- <param>
- <name>Code</name>
- <key>_source_code</key>
- <value>"""
-Embedded Python Blocks:
-
-Each time this file is saved, GRC will instantiate the first class it finds
-to get ports and parameters of your block. The arguments to __init__ will
-be the parameters. All of them are required to have default values!
-"""
-
-import numpy as np
-from gnuradio import gr
-
-
-class blk(gr.sync_block): # other base classes are basic_block, decim_block, interp_block
- """Embedded Python Block example - a simple multiply const"""
-
- def __init__(self, example_param=1.0): # only default arguments here
- """arguments to this function show up as parameters in GRC"""
- gr.sync_block.__init__(
- self,
- name='Embedded Python Block', # will show up in GRC
- in_sig=[np.complex64],
- out_sig=[np.complex64]
- )
- # if an attribute with the same name as a parameter is found,
- # a callback is registered (properties work, too).
- self.example_param = example_param
-
- def work(self, input_items, output_items):
- """example: multiply with constant"""
- output_items[0][:] = input_items[0] * self.example_param
- return len(output_items[0])
-</value>
- <type>_multiline_python_external</type>
- <hide>part</hide>
- </param>
- <doc>This block represents an arbitrary GNU Radio Python Block.
-
-Its source code can be accessed through the parameter 'Code' which opens your editor. Each time you save changes in the editor, GRC will update the block. This includes the number, names and defaults of the parameters, the ports (stream and message) and the block name and documentation.
-
-Block Documentation:
-(will be replaced the docstring of your block class)
-</doc>
-</block>
diff --git a/grc/blocks/epy_module.xml b/grc/blocks/epy_module.xml
deleted file mode 100644
index fa3e5f91f4..0000000000
--- a/grc/blocks/epy_module.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<block>
- <name>Python Module</name>
- <key>epy_module</key>
- <import>import $id # embedded python module</import>
- <make></make>
- <param>
- <name>Code</name>
- <key>source_code</key>
- <value># this module will be imported in the into your flowgraph</value>
- <type>_multiline_python_external</type>
- <hide>part</hide>
- </param>
- <doc>This block lets you embed a python module in your flowgraph.
-
-Code you put in this module is accessible in other blocks using the ID of this
-block. Example:
-
-If you put
-
- a = 2
-
- def double(arg):
- return 2 * arg
-
-in a Python Module Block with the ID 'stuff' you can use code like
-
- stuff.a # evals to 2
- stuff.double(3) # evals to 6
-
-to set parameters of other blocks in your flowgraph.</doc>
-</block>
diff --git a/grc/blocks/gr_message_domain.xml b/grc/blocks/gr_message_domain.xml
deleted file mode 100644
index bc8add99ab..0000000000
--- a/grc/blocks/gr_message_domain.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##GNU Radio default domain 'gr_message'
-###################################################
- -->
- <domain>
- <name>GR Message</name>
- <key>gr_message</key>
- <color>#000</color>
- <multiple_sources>True</multiple_sources>
- <connection>
- <source_domain>gr_message</source_domain>
- <sink_domain>gr_message</sink_domain>
- <make>#slurp
- self.msg_connect($make_port_sig($source), $make_port_sig($sink))#slurp
- </make>
- </connection>
-</domain>
diff --git a/grc/blocks/gr_stream_domain.xml b/grc/blocks/gr_stream_domain.xml
deleted file mode 100644
index 66026448ca..0000000000
--- a/grc/blocks/gr_stream_domain.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##GNU Radio default domain 'gr_stream'
-###################################################
- -->
- <domain>
- <name>GR Stream</name>
- <key>gr_stream</key>
- <color>#000</color>
- <connection>
- <source_domain>gr_stream</source_domain>
- <sink_domain>gr_stream</sink_domain>
- <make>#slurp
- self.connect($make_port_sig($source), $make_port_sig($sink))#slurp
- </make>
- </connection>
-</domain>
diff --git a/grc/blocks/import.xml b/grc/blocks/import.xml
index 59f807bacb..58e99a2d01 100644
--- a/grc/blocks/import.xml
+++ b/grc/blocks/import.xml
@@ -7,11 +7,11 @@
<block>
<name>Import</name>
<key>import</key>
- <import>$import</import>
+ <import>$imports</import>
<make></make>
<param>
<name>Import</name>
- <key>import</key>
+ <key>imports</key>
<value></value>
<type>import</type>
</param>
diff --git a/grc/blocks/message.domain.yml b/grc/blocks/message.domain.yml
new file mode 100644
index 0000000000..7e6cc529d9
--- /dev/null
+++ b/grc/blocks/message.domain.yml
@@ -0,0 +1,10 @@
+id: message
+label: Message
+color: "#FFFFFF"
+
+multiple_connections_per_input: true
+multiple_connections_per_output: true
+
+templates:
+- type: [message, message]
+ connect: self.msg_connect(${ make_port_sig(source) }, ${ make_port_sig(sink) })
diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml
index 252a0b2e2d..c349cd956a 100644
--- a/grc/blocks/options.xml
+++ b/grc/blocks/options.xml
@@ -100,7 +100,7 @@ else: self.stop(); self.wait()</callback>
<key>run</key>
<value>True</value>
<type>bool</type>
- <hide>#if $generate_options() == 'qt_gui' then ('part' if $run() else 'none') else 'all'#</hide>
+ <hide>#if $generate_options() != 'qt_gui' then 'all' else ('part' if $run() else 'none')#</hide>
<option>
<name>Autostart</name>
<key>True</key>
@@ -137,7 +137,7 @@ else: self.stop(); self.wait()</callback>
<key>qt_qss_theme</key>
<value></value>
<type>file_open</type>
- <hide>#if $generate_options() == 'qt_gui' then ('none' if $qt_qss_theme() else 'part') else 'all'#</hide>
+ <hide>#if $generate_options() != 'qt_gui' then 'all' else ('none' if $qt_qss_theme() else 'part')#</hide>
</param>
<param>
<name>Thread-safe setters</name>
diff --git a/grc/blocks/stream.domain.yml b/grc/blocks/stream.domain.yml
new file mode 100644
index 0000000000..a4d786f8b4
--- /dev/null
+++ b/grc/blocks/stream.domain.yml
@@ -0,0 +1,10 @@
+id: stream
+label: Stream
+color: "#000000"
+
+multiple_connections_per_input: false
+multiple_connections_per_output: true
+
+templates:
+- type: [stream, stream]
+ connect: self.connect(${ make_port_sig(source) }, ${ make_port_sig(sink) })