[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r7806 - in gnuradio/branches/releases/3.1/gnuradio-cor
From: |
jcorgan |
Subject: |
[Commit-gnuradio] r7806 - in gnuradio/branches/releases/3.1/gnuradio-core/src: lib/runtime python/gnuradio/gr |
Date: |
Sun, 24 Feb 2008 11:17:18 -0700 (MST) |
Author: jcorgan
Date: 2008-02-24 11:17:17 -0700 (Sun, 24 Feb 2008)
New Revision: 7806
Modified:
gnuradio/branches/releases/3.1/gnuradio-core/src/lib/runtime/gr_hier_block2.h
gnuradio/branches/releases/3.1/gnuradio-core/src/lib/runtime/gr_top_block.h
gnuradio/branches/releases/3.1/gnuradio-core/src/python/gnuradio/gr/hier_block2.py
Log:
Applied changeset r7718 on trunk to release branch.
Modified:
gnuradio/branches/releases/3.1/gnuradio-core/src/lib/runtime/gr_hier_block2.h
===================================================================
---
gnuradio/branches/releases/3.1/gnuradio-core/src/lib/runtime/gr_hier_block2.h
2008-02-24 07:11:56 UTC (rev 7805)
+++
gnuradio/branches/releases/3.1/gnuradio-core/src/lib/runtime/gr_hier_block2.h
2008-02-24 18:17:17 UTC (rev 7806)
@@ -60,20 +60,75 @@
public:
virtual ~gr_hier_block2();
+ /*!
+ * \brief Add a stand-alone (possibly hierarchical) block to internal graph
+ *
+ * This adds a gr-block or hierarchical block to the internal graph
+ * without wiring it to anything else.
+ */
void connect(gr_basic_block_sptr block);
+ /*!
+ * \brief Add gr-blocks or hierarchical blocks to internal graph and wire
together
+ *
+ * This adds (if not done earlier by another connect) a pair of gr-blocks or
+ * hierarchical blocks to the internal flowgraph, and wires the specified
output
+ * port to the specified input port.
+ */
void connect(gr_basic_block_sptr src, int src_port,
gr_basic_block_sptr dst, int dst_port);
+ /*!
+ * \brief Remove a gr-block or hierarchical block from the internal
flowgraph.
+ *
+ * This removes a gr-block or hierarchical block from the internal flowgraph,
+ * disconnecting it from other blocks as needed.
+ *
+ */
void disconnect(gr_basic_block_sptr block);
+ /*!
+ * \brief Disconnect a pair of gr-blocks or hierarchical blocks in internal
+ * flowgraph.
+ *
+ * This disconnects the specified input port from the specified output port
+ * of a pair of gr-blocks or hierarchical blocks.
+ */
void disconnect(gr_basic_block_sptr src, int src_port,
gr_basic_block_sptr dst, int dst_port);
+ /*!
+ * \brief Disconnect all connections in the internal flowgraph.
+ *
+ * This call removes all output port to input port connections in the
internal
+ * flowgraph.
+ */
void disconnect_all();
+
+ /*!
+ * Lock a flowgraph in preparation for reconfiguration. When an equal
+ * number of calls to lock() and unlock() have occurred, the flowgraph
+ * will be restarted automatically.
+ *
+ * N.B. lock() and unlock() cannot be called from a flowgraph thread
+ * (E.g., gr_block::work method) or deadlock will occur when
+ * reconfiguration happens.
+ */
virtual void lock();
+
+ /*!
+ * Unlock a flowgraph in preparation for reconfiguration. When an equal
+ * number of calls to lock() and unlock() have occurred, the flowgraph
+ * will be restarted automatically.
+ *
+ * N.B. lock() and unlock() cannot be called from a flowgraph thread
+ * (E.g., gr_block::work method) or deadlock will occur when
+ * reconfiguration happens.
+ */
virtual void unlock();
+ // This is a public method for ease of code organization, but should be
+ // ignored by the user.
gr_flat_flowgraph_sptr flatten() const;
};
Modified:
gnuradio/branches/releases/3.1/gnuradio-core/src/lib/runtime/gr_top_block.h
===================================================================
--- gnuradio/branches/releases/3.1/gnuradio-core/src/lib/runtime/gr_top_block.h
2008-02-24 07:11:56 UTC (rev 7805)
+++ gnuradio/branches/releases/3.1/gnuradio-core/src/lib/runtime/gr_top_block.h
2008-02-24 18:17:17 UTC (rev 7806)
@@ -89,7 +89,7 @@
virtual void lock();
/*!
- * Lock a flowgraph in preparation for reconfiguration. When an equal
+ * Unlock a flowgraph in preparation for reconfiguration. When an equal
* number of calls to lock() and unlock() have occurred, the flowgraph
* will be restarted automatically.
*
Modified:
gnuradio/branches/releases/3.1/gnuradio-core/src/python/gnuradio/gr/hier_block2.py
===================================================================
---
gnuradio/branches/releases/3.1/gnuradio-core/src/python/gnuradio/gr/hier_block2.py
2008-02-24 07:11:56 UTC (rev 7805)
+++
gnuradio/branches/releases/3.1/gnuradio-core/src/python/gnuradio/gr/hier_block2.py
2008-02-24 18:17:17 UTC (rev 7806)
@@ -30,16 +30,36 @@
# It also allows us to intercept method calls if needed
#
class hier_block2(object):
+ """
+ Python wrapper around the C++ hierarchical block implementation.
+ Provides convenience functions and allows proper Python subclassing.
+ """
+
def __init__(self, name, input_signature, output_signature):
+ """
+ Create a hierarchical block with a given name and I/O signatures.
+ """
self._hb = hier_block2_swig(name, input_signature, output_signature)
def __getattr__(self, name):
+ """
+ Pass-through member requests to the C++ object.
+ """
return getattr(self._hb, name)
def connect(self, *points):
- '''connect requires one or more arguments that can be coerced to
endpoints.
- If more than two arguments are provided, they are connected together
successively.
- '''
+ """
+ Connect two or more block endpoints. An endpoint is either a (block,
port)
+ tuple, or just a block type. In the latter case, the port number is
assumed
+ to be zero.
+
+ To connect the hierarchical block external inputs or outputs to
internal block
+ inputs or outputs, use 'self' in the connect call.
+
+ If multiple arguments are provided, connect will attempt to wire them
in series,
+ interpreting the endpoints as inputs or outputs as appropriate.
+ """
+
if len (points) < 1:
raise ValueError, ("connect requires at least one endpoint; %d
provided." % (len (points),))
else:
@@ -65,9 +85,15 @@
raise ValueError("unable to coerce endpoint")
def disconnect(self, *points):
- '''connect requires one or more arguments that can be coerced to
endpoints.
+ """
+ Disconnect two endpoints in the flowgraph.
+
+ To disconnect the hierarchical block external inputs or outputs to
internal block
+ inputs or outputs, use 'self' in the connect call.
+
If more than two arguments are provided, they are disconnected
successively.
- '''
+ """
+
if len (points) < 1:
raise ValueError, ("disconnect requires at least two endpoints; %d
provided." % (len (points),))
else:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r7806 - in gnuradio/branches/releases/3.1/gnuradio-core/src: lib/runtime python/gnuradio/gr,
jcorgan <=