[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r8300 - in grc/trunk/src/grc_gnuradio: . blocks/misc b
From: |
jblum |
Subject: |
[Commit-gnuradio] r8300 - in grc/trunk/src/grc_gnuradio: . blocks/misc blocks/sinks blocks/sources data |
Date: |
Tue, 29 Apr 2008 23:55:36 -0600 (MDT) |
Author: jblum
Date: 2008-04-29 23:55:34 -0600 (Tue, 29 Apr 2008)
New Revision: 8300
Added:
grc/trunk/src/grc_gnuradio/blocks/misc/hier_block.xml
grc/trunk/src/grc_gnuradio/blocks/sinks/pad_sink.xml
grc/trunk/src/grc_gnuradio/blocks/sources/pad_source.xml
Modified:
grc/trunk/src/grc_gnuradio/Port.py
grc/trunk/src/grc_gnuradio/data/block_tree.xml
Log:
nports fix, hier block defs only
Modified: grc/trunk/src/grc_gnuradio/Port.py
===================================================================
--- grc/trunk/src/grc_gnuradio/Port.py 2008-04-30 04:50:06 UTC (rev 8299)
+++ grc/trunk/src/grc_gnuradio/Port.py 2008-04-30 05:55:34 UTC (rev 8300)
@@ -48,16 +48,6 @@
self._nports = nports
self._vlen = vlen
self._optional = bool(optional)
-
- def test(self):
- _Port.test(self)
- #if self.get_nports():
- # try: assert(int(self.get_key()) == 0)
- # except (AssertionError,ValueError):
self._exit_with_error('Port key must be "0" when nports is specified.')
- # try:
- # if self.is_sink():
assert(len(self.get_parent().get_sinks()) == 1)
- # elif self.is_source():
assert(len(self.get_parent().get_sources()) == 1)
- # except AssertionError: self._exit_with_error('Other
ports not allowed when nports is specified.')
def get_vlen(self):
"""
@@ -128,6 +118,9 @@
n['key'] = str(block._source_count)
block._source_count = block._source_count + 1
Port.__init__(self, block, n)
+
+ def __del__(self):
+ self.get_parent()._source_count =
self.get_parent()._source_count - 1
class Sink(Port):
@@ -137,3 +130,6 @@
n['key'] = str(block._sink_count)
block._sink_count = block._sink_count + 1
Port.__init__(self, block, n)
+
+ def __del__(self):
+ self.get_parent()._sink_count = self.get_parent()._sink_count -
1
Added: grc/trunk/src/grc_gnuradio/blocks/misc/hier_block.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/misc/hier_block.xml
(rev 0)
+++ grc/trunk/src/grc_gnuradio/blocks/misc/hier_block.xml 2008-04-30
05:55:34 UTC (rev 8300)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!--
+###################################################
+##Hier Block
+###################################################
+ -->
+<block>
+ <name>Hier Block</name>
+ <key>hier_block</key>
+ <make></make>
+ <param>
+ <name>Flow Graph File</name>
+ <key>flow_graph</key>
+ <type>file_open</type>
+ </param>
+ <doc>
+This is a block for instantiating hierarchical flow graphs. \
+Specify the file path to a saved flow graph. \
+Parameters and ports will be automatically loaded.
+ </doc>
+</block>
Added: grc/trunk/src/grc_gnuradio/blocks/sinks/pad_sink.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/sinks/pad_sink.xml
(rev 0)
+++ grc/trunk/src/grc_gnuradio/blocks/sinks/pad_sink.xml 2008-04-30
05:55:34 UTC (rev 8300)
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!--
+###################################################
+##Pad Sink: IO Pads
+###################################################
+ -->
+<block>
+ <name>Pad Sink</name>
+ <key>pad_sink</key>
+ <make></make>
+ <param>
+ <name>Num Inputs</name>
+ <key>num_inputs</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Input Type</name>
+ <key>type</key>
+ <type>enum</type>
+ <option>
+ <name>Complex</name>
+ <key>complex</key>
+ <opt>size:gr.sizeof_gr_complex</opt>
+ </option>
+ <option>
+ <name>Float</name>
+ <key>float</key>
+ <opt>size:gr.sizeof_float</opt>
+ </option>
+ <option>
+ <name>Int</name>
+ <key>int</key>
+ <opt>size:gr.sizeof_int</opt>
+ </option>
+ <option>
+ <name>Short</name>
+ <key>short</key>
+ <opt>size:gr.sizeof_short</opt>
+ </option>
+ <option>
+ <name>Byte</name>
+ <key>byte</key>
+ <opt>size:gr.sizeof_char</opt>
+ </option>
+ </param>
+ <param>
+ <name>Vec Length</name>
+ <key>vlen</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+ <check>$vlen > 0</check>
+ <check>0 < $num_inputs</check>
+ <sink>
+ <name>in</name>
+ <type>$type</type>
+ <vlen>$vlen</vlen>
+ <nports>$num_inputs</nports>
+ </sink>
+ <doc>
+This is a sink pad block for creating hierarchical flow graphs. \
+The inputs of this block will become the outputs to this flow graph when it is
instantiated as a hierarchical block. \
+Limit one sink pad block per flow graph.
+ </doc>
+</block>
Added: grc/trunk/src/grc_gnuradio/blocks/sources/pad_source.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/sources/pad_source.xml
(rev 0)
+++ grc/trunk/src/grc_gnuradio/blocks/sources/pad_source.xml 2008-04-30
05:55:34 UTC (rev 8300)
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!--
+###################################################
+##Pad Source: IO Pads
+###################################################
+ -->
+<block>
+ <name>Pad Source</name>
+ <key>pad_source</key>
+ <make></make>
+ <param>
+ <name>Num Outputs</name>
+ <key>num_outputs</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Output Type</name>
+ <key>type</key>
+ <type>enum</type>
+ <option>
+ <name>Complex</name>
+ <key>complex</key>
+ <opt>size:gr.sizeof_gr_complex</opt>
+ </option>
+ <option>
+ <name>Float</name>
+ <key>float</key>
+ <opt>size:gr.sizeof_float</opt>
+ </option>
+ <option>
+ <name>Int</name>
+ <key>int</key>
+ <opt>size:gr.sizeof_int</opt>
+ </option>
+ <option>
+ <name>Short</name>
+ <key>short</key>
+ <opt>size:gr.sizeof_short</opt>
+ </option>
+ <option>
+ <name>Byte</name>
+ <key>byte</key>
+ <opt>size:gr.sizeof_char</opt>
+ </option>
+ </param>
+ <param>
+ <name>Vec Length</name>
+ <key>vlen</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+ <check>$vlen > 0</check>
+ <check>0 < $num_outputs</check>
+ <source>
+ <name>out</name>
+ <type>$type</type>
+ <vlen>$vlen</vlen>
+ <nports>$num_outputs</nports>
+ </source>
+ <doc>
+This is a source pad block for creating hierarchical flow graphs. \
+The outputs of this block will become the inputs to this flow graph when it is
instantiated as a hierarchical block. \
+Limit one source pad block per flow graph.
+ </doc>
+</block>
Modified: grc/trunk/src/grc_gnuradio/data/block_tree.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/data/block_tree.xml 2008-04-30 04:50:06 UTC
(rev 8299)
+++ grc/trunk/src/grc_gnuradio/data/block_tree.xml 2008-04-30 05:55:34 UTC
(rev 8300)
@@ -17,6 +17,7 @@
<block>gr_udp_source</block>
<block>audio_source</block>
<block>gr_wavfile_source</block>
+ <block>pad_source</block>
</cat>
<cat>
<name>Sinks</name>
@@ -25,6 +26,7 @@
<block>gr_udp_sink</block>
<block>audio_sink</block>
<block>gr_wavfile_sink</block>
+ <block>pad_sink</block>
</cat>
<cat>
<name>Graphical Sinks</name>
@@ -242,5 +244,7 @@
<block>gr_kludge_copy</block>
<block>gr_nop</block>
+
+ <block>hier_block</block>
</cat>
</block_tree>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r8300 - in grc/trunk/src/grc_gnuradio: . blocks/misc blocks/sinks blocks/sources data,
jblum <=