summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--grc/blocks/pad_sink.xml20
-rw-r--r--grc/blocks/pad_source.xml20
-rw-r--r--grc/python/FlowGraph.py1
-rw-r--r--grc/python/convert_hier.py2
4 files changed, 43 insertions, 0 deletions
diff --git a/grc/blocks/pad_sink.xml b/grc/blocks/pad_sink.xml
index 2e9495260..f89eaa53c 100644
--- a/grc/blocks/pad_sink.xml
+++ b/grc/blocks/pad_sink.xml
@@ -43,6 +43,11 @@
<key>byte</key>
<opt>size:gr.sizeof_char</opt>
</option>
+ <option>
+ <name>Wildcard</name>
+ <key></key>
+ <opt>size:0</opt>
+ </option>
</param>
<param>
<name>Vec Length</name>
@@ -50,6 +55,21 @@
<value>1</value>
<type>int</type>
</param>
+ <param>
+ <name>Optional</name>
+ <key>optional</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>part</hide>
+ <option>
+ <name>Optional</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Required</name>
+ <key>False</key>
+ </option>
+ </param>
<check>$vlen &gt; 0</check>
<sink>
<name>in</name>
diff --git a/grc/blocks/pad_source.xml b/grc/blocks/pad_source.xml
index 7b2210cbb..cbf38eb39 100644
--- a/grc/blocks/pad_source.xml
+++ b/grc/blocks/pad_source.xml
@@ -43,6 +43,11 @@
<key>byte</key>
<opt>size:gr.sizeof_char</opt>
</option>
+ <option>
+ <name>Wildcard</name>
+ <key></key>
+ <opt>size:0</opt>
+ </option>
</param>
<param>
<name>Vec Length</name>
@@ -50,6 +55,21 @@
<value>1</value>
<type>int</type>
</param>
+ <param>
+ <name>Optional</name>
+ <key>optional</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>part</hide>
+ <option>
+ <name>Optional</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Required</name>
+ <key>False</key>
+ </option>
+ </param>
<check>$vlen &gt; 0</check>
<source>
<name>out</name>
diff --git a/grc/python/FlowGraph.py b/grc/python/FlowGraph.py
index 89a169355..efe362760 100644
--- a/grc/python/FlowGraph.py
+++ b/grc/python/FlowGraph.py
@@ -64,6 +64,7 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph):
'type': str(pad.get_param('type').get_evaluated()),
'vlen': str(pad.get_param('vlen').get_evaluated()),
'size': pad.get_param('type').get_opt('size'),
+ 'optional': bool(pad.get_param('optional').get_evaluated()),
} for pad in sorted_pads]
def get_pad_sources(self):
diff --git a/grc/python/convert_hier.py b/grc/python/convert_hier.py
index f4d082d59..b609af24a 100644
--- a/grc/python/convert_hier.py
+++ b/grc/python/convert_hier.py
@@ -62,6 +62,7 @@ def convert_hier(flow_graph, python_file):
sink_n['name'] = input_sig['label']
sink_n['type'] = input_sig['type']
sink_n['vlen'] = input_sig['vlen']
+ if input_sig['optional']: sink_n['optional'] = '1'
block_n['sink'].append(sink_n)
#source data
block_n['source'] = list()
@@ -70,6 +71,7 @@ def convert_hier(flow_graph, python_file):
source_n['name'] = output_sig['label']
source_n['type'] = output_sig['type']
source_n['vlen'] = output_sig['vlen']
+ if output_sig['optional']: source_n['optional'] = '1'
block_n['source'].append(source_n)
#doc data
block_n['doc'] = "%s\n%s\n%s"%(block_author, block_desc, python_file)