From 899fb2be7dac5ce7d53656114b59fe0ebbddcaed Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 7 Sep 2012 22:21:25 -0700 Subject: added a few missing swig things --- swig/runtime.i | 1 + swig/sw_runtime.i | 28 ++++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) (limited to 'swig') diff --git a/swig/runtime.i b/swig/runtime.i index bc2525e..43af044 100644 --- a/swig/runtime.i +++ b/swig/runtime.i @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/swig/sw_runtime.i b/swig/sw_runtime.i index 88fd591..5e09222 100644 --- a/swig/sw_runtime.i +++ b/swig/sw_runtime.i @@ -14,6 +14,11 @@ // You should have received a copy of the GNU Lesser General Public License // along with io_sig program. If not, see . +%rename(io_signature) gr_make_io_signature; +%rename(io_signature2) gr_make_io_signature2; +%rename(io_signature3) gr_make_io_signature3; +%rename(io_signaturev) gr_make_io_signaturev; + //const size types used by blocks in python %constant int sizeof_char = sizeof(char); %constant int sizeof_short = sizeof(short); @@ -34,10 +39,14 @@ %include %include %include +%include %include %include %include +//////////////////////////////////////////////////////////////////////// +// Make a special top block with python safe unlocking wait +//////////////////////////////////////////////////////////////////////// %include "gruel_common.i" %inline %{ @@ -71,6 +80,9 @@ struct TopBlockPython : TopBlock %} +//////////////////////////////////////////////////////////////////////// +// Remake top block and hier block for multi-arg connnect +//////////////////////////////////////////////////////////////////////// %pythoncode %{ def internal_connect__(fcn, obj, *args): @@ -91,7 +103,7 @@ def internal_connect__(fcn, obj, *args): except: sink_index = 0 fcn(obj, to_element(src), src_index, to_element(sink), sink_index) -class top_block(TopBlockPython): +class TopBlock(TopBlockPython): def __init__(self, *args, **kwargs): TopBlockPython.__init__(self, *args, **kwargs) @@ -101,7 +113,7 @@ class top_block(TopBlockPython): def disconnect(self, *args): return internal_connect__(TopBlockPython.disconnect, self, *args) -class hier_block(HierBlock): +class HierBlock(HierBlock): def __init__(self, *args, **kwargs): HierBlock.__init__(self, *args, **kwargs) @@ -111,6 +123,18 @@ class hier_block(HierBlock): def disconnect(self, *args): return internal_connect__(HierBlock.disconnect, self, *args) +top_block = TopBlock + +class hier_block(gr_hier_block2): + def __init__(self, *args, **kwargs): + gr_hier_block2.__init__(self, *args, **kwargs) + + def connect(self, *args): + return internal_connect__(gr_hier_block2.connect, self, *args) + + def disconnect(self, *args): + return internal_connect__(gr_hier_block2.disconnect, self, *args) + hier_block2 = hier_block %} -- cgit