Skip to content

Commit 7f7fa2f

Browse files
skoslowskijmcorgan
authored andcommitted
grc: added yaml/mako support
Includes basic converter from XML/Cheetah to YAML/Mako based block format.
1 parent 44cae38 commit 7f7fa2f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+7219
-4592
lines changed

gr-digital/examples/demod/pam_timing.grc

+1,419-1,210
Large diffs are not rendered by default.

grc/CMakeLists.txt

+2-7
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ GR_PYTHON_CHECK_MODULE_RAW(
3232
PYTHON_MIN_VER_FOUND
3333
)
3434

35-
GR_PYTHON_CHECK_MODULE_RAW(
36-
"Cheetah >= 2.0.0"
37-
"import Cheetah; assert Cheetah.Version >= '2.0.0'"
38-
CHEETAH_FOUND
39-
)
40-
4135
GR_PYTHON_CHECK_MODULE_RAW(
4236
"PyYAML >= 3.10"
4337
"import yaml; assert yaml.__version__ >= '3.11'"
@@ -94,7 +88,8 @@ include(GrComponent)
9488
if(NOT CMAKE_CROSSCOMPILING)
9589
set(grc_python_deps
9690
PYTHON_MIN_VER_FOUND
97-
CHEETAH_FOUND
91+
PYYAML_FOUND
92+
MAKO_FOUND
9893
LXML_FOUND
9994
PYGI_FOUND
10095
GTK_GI_FOUND

grc/blocks/block_tree.xml

-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
<block>virtual_source</block>
99
<block>virtual_sink</block>
1010

11-
<block>bus_sink</block>
12-
<block>bus_source</block>
13-
<block>bus_structure_sink</block>
14-
<block>bus_structure_source</block>
15-
16-
<block>epy_block</block>
1711
<block>epy_module</block>
1812

1913
<block>note</block>

grc/blocks/bus_sink.xml

-27
This file was deleted.

grc/blocks/bus_source.xml

-27
This file was deleted.

grc/blocks/bus_structure_sink.xml

-18
This file was deleted.

grc/blocks/bus_structure_source.xml

-18
This file was deleted.

grc/blocks/epy_block.xml

-58
This file was deleted.

grc/blocks/epy_module.xml

-32
This file was deleted.

grc/blocks/gr_message_domain.xml

-19
This file was deleted.

grc/blocks/gr_stream_domain.xml

-18
This file was deleted.

grc/blocks/import.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<block>
88
<name>Import</name>
99
<key>import</key>
10-
<import>$import</import>
10+
<import>$imports</import>
1111
<make></make>
1212
<param>
1313
<name>Import</name>
14-
<key>import</key>
14+
<key>imports</key>
1515
<value></value>
1616
<type>import</type>
1717
</param>

grc/blocks/message.domain.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
id: message
2+
label: Message
3+
color: "#FFFFFF"
4+
5+
multiple_connections_per_input: true
6+
multiple_connections_per_output: true
7+
8+
templates:
9+
- type: [message, message]
10+
connect: self.msg_connect(${ make_port_sig(source) }, ${ make_port_sig(sink) })

grc/blocks/options.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ else: self.stop(); self.wait()</callback>
100100
<key>run</key>
101101
<value>True</value>
102102
<type>bool</type>
103-
<hide>#if $generate_options() == 'qt_gui' then ('part' if $run() else 'none') else 'all'#</hide>
103+
<hide>#if $generate_options() != 'qt_gui' then 'all' else ('part' if $run() else 'none')#</hide>
104104
<option>
105105
<name>Autostart</name>
106106
<key>True</key>
@@ -137,7 +137,7 @@ else: self.stop(); self.wait()</callback>
137137
<key>qt_qss_theme</key>
138138
<value></value>
139139
<type>file_open</type>
140-
<hide>#if $generate_options() == 'qt_gui' then ('none' if $qt_qss_theme() else 'part') else 'all'#</hide>
140+
<hide>#if $generate_options() != 'qt_gui' then 'all' else ('none' if $qt_qss_theme() else 'part')#</hide>
141141
</param>
142142
<param>
143143
<name>Thread-safe setters</name>

grc/blocks/stream.domain.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
id: stream
2+
label: Stream
3+
color: "#000000"
4+
5+
multiple_connections_per_input: false
6+
multiple_connections_per_output: true
7+
8+
templates:
9+
- type: [stream, stream]
10+
connect: self.connect(${ make_port_sig(source) }, ${ make_port_sig(sink) })

grc/compiler.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from gnuradio import gr
2727

2828
from .core import Messages
29-
from .core.Platform import Platform
29+
from .core.platform import Platform
3030

3131

3232
def argument_parser():
@@ -53,6 +53,8 @@ def main(args=None):
5353
version=gr.version(),
5454
version_parts=(gr.major_version(), gr.api_version(), gr.minor_version())
5555
)
56+
platform.build_library()
57+
5658
out_dir = args.output if not args.user_lib_dir else platform.config.hier_block_lib_dir
5759
if os.path.exists(out_dir):
5860
pass # all is well

grc/converter/__init__.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2016 Free Software Foundation, Inc.
2+
# This file is part of GNU Radio
3+
#
4+
# GNU Radio Companion is free software; you can redistribute it and/or modify
5+
# it under the terms of the GNU General Public License as published by the
6+
# Free Software Foundation; either version 2 of the License, or (at your
7+
# option) any later version.
8+
#
9+
# GNU Radio Companion is distributed in the hope that it will be useful, but
10+
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12+
# details.
13+
#
14+
# You should have received a copy of the GNU General Public License along with
15+
# this program; if not, write to the Free Software Foundation, Inc.,
16+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
17+
18+
from __future__ import absolute_import
19+
20+
from .main import Converter

grc/converter/__main__.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2016 Free Software Foundation, Inc.
2+
# This file is part of GNU Radio
3+
#
4+
# GNU Radio Companion is free software; you can redistribute it and/or modify
5+
# it under the terms of the GNU General Public License as published by the
6+
# Free Software Foundation; either version 2 of the License, or (at your
7+
# option) any later version.
8+
#
9+
# GNU Radio Companion is distributed in the hope that it will be useful, but
10+
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12+
# details.
13+
#
14+
# You should have received a copy of the GNU General Public License along with
15+
# this program; if not, write to the Free Software Foundation, Inc.,
16+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
17+
18+
from __future__ import absolute_import
19+
20+
# TODO: implement cli
21+
File renamed without changes.

0 commit comments

Comments
 (0)