summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt10
m---------PMC0
m---------gnuradio0
-rw-r--r--include/gras/block.hpp8
-rw-r--r--include/gras/element.i4
-rw-r--r--lib/block_task.cpp8
-rw-r--r--python/gras/GRAS_HierBlock.i32
-rw-r--r--tests/CMakeLists.txt5
8 files changed, 48 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c692cc5..bb8574f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -47,6 +47,14 @@ list(APPEND GRAS_INCLUDE_DIRS ${GRAS_SOURCE_DIR}/PMC/include)
list(APPEND GRAS_INCLUDE_DIRS ${GRAS_SOURCE_DIR}/include)
########################################################################
+# Paths for python
+########################################################################
+list(APPEND GRAS_PYTHON_DIRS ${GRAS_SOURCE_DIR}/python)
+list(APPEND GRAS_PYTHON_DIRS ${GRAS_BINARY_DIR}/python)
+list(APPEND GRAS_PYTHON_DIRS ${GRAS_BINARY_DIR}/python/gras)
+list(APPEND GRAS_PYTHON_DIRS ${GRAS_BINARY_DIR}/python/gras/${CMAKE_BUILD_TYPE})
+
+########################################################################
# Add subdirectories
########################################################################
add_subdirectory(include/gras)
@@ -61,6 +69,8 @@ add_subdirectory(tests)
set(CMAKE_SOURCE_DIR ${GRAS_SOURCE_DIR}/gnuradio)
set(CMAKE_BINARY_DIR ${GRAS_BINARY_DIR}/gnuradio)
+set(GR_TEST_EXTRA_PYTHON_DIRS ${GRAS_PYTHON_DIRS}) #helps QA tests
+
set(GRAS_LIBRARIES gras) #for submodule linking
add_subdirectory(gnuradio)
diff --git a/PMC b/PMC
-Subproject 571087e9e35834a738fc6c180e19c30ce9e4ed8
+Subproject a945e88c23e2cd7057ab902b44a836231823aba
diff --git a/gnuradio b/gnuradio
-Subproject 18ec3b75b6b20b693867596d38c62db70a650c3
+Subproject 62f06d99bbd2dd650961c2cc1b473e4484e15a5
diff --git a/include/gras/block.hpp b/include/gras/block.hpp
index 24f5674..dcdd505 100644
--- a/include/gras/block.hpp
+++ b/include/gras/block.hpp
@@ -151,14 +151,6 @@ struct GRAS_API Block : Element
* Deal with data production and consumption
******************************************************************/
- //! Return options for the work call
- enum
- {
- WORK_DONE_ON_INPUT = -3,
- WORK_CALLED_PRODUCE = -2,
- WORK_DONE = -1
- };
-
//! Call during work to consume items
void consume(const size_t which_input, const size_t how_many_items);
diff --git a/include/gras/element.i b/include/gras/element.i
index c4ff853..ef1eb95 100644
--- a/include/gras/element.i
+++ b/include/gras/element.i
@@ -23,8 +23,8 @@
%include <std_string.i>
-%include <boost_shared_ptr.i>
-%shared_ptr(gras::ElementImpl)
+//remove base class warning
+#pragma SWIG nowarn=401
%include <gras/element.hpp>
diff --git a/lib/block_task.cpp b/lib/block_task.cpp
index 01a9072..c763476 100644
--- a/lib/block_task.cpp
+++ b/lib/block_task.cpp
@@ -170,7 +170,13 @@ void BlockActor::handle_task(void)
this->task_work();
}
- if (work_ret == Block::WORK_DONE)
+ if (work_ret >= 0)
+ {
+ this->input_fail(work_ret);
+ return;
+ }
+
+ if (work_ret == -1)
{
this->mark_done();
return;
diff --git a/python/gras/GRAS_HierBlock.i b/python/gras/GRAS_HierBlock.i
index 413ee2a..5a26203 100644
--- a/python/gras/GRAS_HierBlock.i
+++ b/python/gras/GRAS_HierBlock.i
@@ -85,6 +85,32 @@ struct TopBlockPython : TopBlock
return ret;
}
};
+
+struct HierBlockPython : HierBlock
+{
+ HierBlockPython(void)
+ {
+ //NOP
+ }
+
+ HierBlockPython(const std::string &name):
+ HierBlock(name)
+ {
+ //NOP
+ }
+
+ HierBlockPython(
+ const std::string &name,
+ const IOSignature &input_signature,
+ const IOSignature &output_signature
+ ):
+ HierBlock(name)
+ {
+ this->set_input_signature(input_signature);
+ this->set_output_signature(output_signature);
+ }
+};
+
}
%}
@@ -122,16 +148,14 @@ class TopBlock(TopBlockPython):
def disconnect(self, *args):
return internal_connect__(TopBlockPython.disconnect, self, *args)
-HierBlockPython = HierBlock
-
class HierBlock(HierBlockPython):
def __init__(self, *args, **kwargs):
HierBlockPython.__init__(self, *args, **kwargs)
def connect(self, *args):
- return internal_connect__(HierBlock.connect, self, *args)
+ return internal_connect__(HierBlockPython.connect, self, *args)
def disconnect(self, *args):
- return internal_connect__(HierBlock.disconnect, self, *args)
+ return internal_connect__(HierBlockPython.disconnect, self, *args)
%}
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 6315014..695d71a 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -7,9 +7,6 @@ include(GrTest)
include(GrPython)
set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B})
-list(APPEND GR_TEST_PYTHON_DIRS ${GRAS_SOURCE_DIR}/python)
-list(APPEND GR_TEST_PYTHON_DIRS ${GRAS_BINARY_DIR}/python)
-list(APPEND GR_TEST_PYTHON_DIRS ${GRAS_BINARY_DIR}/python/gras)
-list(APPEND GR_TEST_PYTHON_DIRS ${GRAS_BINARY_DIR}/python/gras/${CMAKE_BUILD_TYPE})
+set(GR_TEST_PYTHON_DIRS ${GRAS_PYTHON_DIRS})
GR_ADD_TEST(hier_block ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/hier_block_test.py)
GR_ADD_TEST(thread_pool ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/thread_pool_test.py)