summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Blum2013-01-13 17:28:01 -0800
committerJosh Blum2013-01-13 17:28:01 -0800
commitb383c4ec3fe6c5f2bbace2f529760b91b77122ef (patch)
tree318abc1ec2565542f4667463474deed8c01085b9
parente826097e09fdfb04d14bf87861646b88229db881 (diff)
downloadgnuradio-b383c4ec3fe6c5f2bbace2f529760b91b77122ef.tar.gz
gnuradio-b383c4ec3fe6c5f2bbace2f529760b91b77122ef.tar.bz2
gnuradio-b383c4ec3fe6c5f2bbace2f529760b91b77122ef.zip
gras: fixed the misc issues w/ gr python block
There was an bug in the get_tags_in_range impl, found incidentally. Just a little swig + python misc changes.
-rw-r--r--gnuradio-core/src/lib/runtime/gr_block.cc2
-rw-r--r--gnuradio-core/src/lib/runtime/gr_io_signature.h3
-rw-r--r--gnuradio-core/src/lib/runtime/runtime.i11
-rw-r--r--gnuradio-core/src/python/gnuradio/gr/__init__.py2
-rw-r--r--gnuradio-core/src/python/gnuradio/gr/gateway.py3
5 files changed, 12 insertions, 9 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_block.cc b/gnuradio-core/src/lib/runtime/gr_block.cc
index 8032b29fc..63df6aa18 100644
--- a/gnuradio-core/src/lib/runtime/gr_block.cc
+++ b/gnuradio-core/src/lib/runtime/gr_block.cc
@@ -431,7 +431,7 @@ void gr_block::get_tags_in_range(
if (tag.offset >= abs_start and tag.offset <= abs_end)
{
gr_tag_t t = Tag2gr_tag(tag);
- if (key or pmt::pmt_equal(t.key, key)) tags.push_back(t);
+ if (not key or pmt::pmt_equal(t.key, key)) tags.push_back(t);
}
}
}
diff --git a/gnuradio-core/src/lib/runtime/gr_io_signature.h b/gnuradio-core/src/lib/runtime/gr_io_signature.h
index 78b1502f0..4c1eec4e8 100644
--- a/gnuradio-core/src/lib/runtime/gr_io_signature.h
+++ b/gnuradio-core/src/lib/runtime/gr_io_signature.h
@@ -68,11 +68,10 @@ inline gr_io_signature_sptr gr_make_io_signature3(
return io_sig;
}
-template <typename T>
inline gr_io_signature_sptr gr_make_io_signaturev(
int min_streams,
int max_streams,
- const std::vector<T> &sizeof_stream_items
+ const std::vector<int> &sizeof_stream_items
){
gr_io_signature io_sig(min_streams, max_streams);
for (unsigned i = 0; i < sizeof_stream_items.size(); i++)
diff --git a/gnuradio-core/src/lib/runtime/runtime.i b/gnuradio-core/src/lib/runtime/runtime.i
index c8927f336..4dff7fabe 100644
--- a/gnuradio-core/src/lib/runtime/runtime.i
+++ b/gnuradio-core/src/lib/runtime/runtime.i
@@ -40,18 +40,19 @@
%}
+%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;
+
%include <gr_message.i>
%include <gr_msg_handler.i>
%include <gr_msg_queue.i>
%include <gr_swig_block_magic.i>
+%include <gr_io_signature.h>
#ifdef SW_RUNTIME
-%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);
diff --git a/gnuradio-core/src/python/gnuradio/gr/__init__.py b/gnuradio-core/src/python/gnuradio/gr/__init__.py
index d88c1b842..66d57f77a 100644
--- a/gnuradio-core/src/python/gnuradio/gr/__init__.py
+++ b/gnuradio-core/src/python/gnuradio/gr/__init__.py
@@ -28,7 +28,7 @@ from gnuradio_core import *
from exceptions import *
#from hier_block2 import *
#from top_block import *
-#from gateway import basic_block, sync_block, decim_block, interp_block
+from gateway import basic_block, sync_block, decim_block, interp_block
from gras import HierBlock as hier_block2
from gras import TopBlock as top_block
diff --git a/gnuradio-core/src/python/gnuradio/gr/gateway.py b/gnuradio-core/src/python/gnuradio/gr/gateway.py
index 244b8b592..ad99804d1 100644
--- a/gnuradio-core/src/python/gnuradio/gr/gateway.py
+++ b/gnuradio-core/src/python/gnuradio/gr/gateway.py
@@ -97,6 +97,9 @@ class gateway_block(object):
setattr(self, attr.replace(prefix, ''), getattr(self.__gateway, attr))
self.pop_msg_queue = lambda: gr_core.gr_block_gw_pop_msg_queue_safe(self.__gateway)
+ #gras version of the to_basic_block()
+ def shared_to_element(self): return self.__gateway.shared_to_element()
+
def to_basic_block(self):
"""
Makes this block connectable by hier/top block python