diff options
author | Josh Morman <mormjb@gmail.com> | 2020-04-23 07:51:39 -0400 |
---|---|---|
committer | Josh Morman <mormjb@gmail.com> | 2020-06-04 10:05:47 -0400 |
commit | ba16fdf0a0e9052163a5dd00b5927b2eccc0683f (patch) | |
tree | 59c7f11883e221287bb05802bb37c155549b605d /gnuradio-runtime/python/gnuradio | |
parent | 42fe41b9f2224e09fde9f00426cc6b10ba7b6416 (diff) |
runtime: add pybind11 bindings
Diffstat (limited to 'gnuradio-runtime/python/gnuradio')
106 files changed, 7342 insertions, 212 deletions
diff --git a/gnuradio-runtime/python/gnuradio/gr/CMakeLists.txt b/gnuradio-runtime/python/gnuradio/gr/CMakeLists.txt index 459c8bc022..4633445f17 100644 --- a/gnuradio-runtime/python/gnuradio/gr/CMakeLists.txt +++ b/gnuradio-runtime/python/gnuradio/gr/CMakeLists.txt @@ -29,11 +29,6 @@ if(ENABLE_TESTING) set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/gruel/src/python ${CMAKE_BINARY_DIR}/gnuradio-runtime/python - ${CMAKE_BINARY_DIR}/gnuradio-runtime/swig - ${CMAKE_BINARY_DIR}/gr-blocks/swig - ${CMAKE_BINARY_DIR}/gr-fft/swig - ${CMAKE_BINARY_DIR}/gr-filter/swig - ${CMAKE_BINARY_DIR}/gr-analog/swig ) include(GrTest) file(GLOB py_qa_test_files "qa_*.py") @@ -42,3 +37,5 @@ if(ENABLE_TESTING) GR_ADD_TEST(${py_qa_test_name} ${QA_PYTHON_EXECUTABLE} -B ${py_qa_test_file}) endforeach(py_qa_test_file) endif(ENABLE_TESTING) + +add_subdirectory(bindings) diff --git a/gnuradio-runtime/python/gnuradio/gr/__init__.py b/gnuradio-runtime/python/gnuradio/gr/__init__.py index a1c1d3f397..efe2aec7b9 100644 --- a/gnuradio-runtime/python/gnuradio/gr/__init__.py +++ b/gnuradio-runtime/python/gnuradio/gr/__init__.py @@ -16,19 +16,19 @@ from __future__ import absolute_import from __future__ import unicode_literals # This is the main GNU Radio python module. -# We pull the swig output and the other modules into the gnuradio.gr namespace +# We pull the pybind output and the other modules into the gnuradio.gr namespace -# If gnuradio is installed then the swig output will be in this directory. -# Otherwise it will reside in ../../../swig. +# If gnuradio is installed then the pybind output will be in this directory. +# Otherwise it will reside in bindings/. import os, sys try: - from .runtime_swig import * + from .gr_python import * except ImportError: dirname, filename = os.path.split(os.path.abspath(__file__)) - __path__.append(os.path.join(dirname, "..", "..", "..", "swig")) - from .runtime_swig import * + __path__.append(os.path.join(dirname, "bindings")) + from .gr_python import * from .exceptions import * from .top_block import * diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/CMakeLists.txt b/gnuradio-runtime/python/gnuradio/gr/bindings/CMakeLists.txt new file mode 100644 index 0000000000..b656fd95fa --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/CMakeLists.txt @@ -0,0 +1,90 @@ +include(GrPybind) + +######################################################################## +# Python Bindings +######################################################################## + +list(APPEND gr_python_files +messages/msg_accepter_msgq_python.cc +messages/msg_accepter_python.cc +messages/msg_passing_python.cc +messages/msg_producer_python.cc +messages/msg_queue_python.cc + # attributes_python.cc + basic_block_python.cc + block_python.cc + block_detail_python.cc + block_gateway_python.cc + # block_registry_python.cc + buffer_python.cc + constants_python.cc + endianness_python.cc + expj_python.cc + flowgraph_python.cc + fxpt_python.cc + fxpt_nco_python.cc + fxpt_vco_python.cc + # gr_complex_python.cc + hier_block2_python.cc + high_res_timer_python.cc + io_signature_python.cc + logger_python.cc + math_python.cc + + message_python.cc + msg_accepter_python.cc + # msg_accepter_msgq_python.cc + # msg_passing_python.cc + # msg_producer_python.cc + msg_queue_python.cc + # misc_python.cc + msg_accepter_python.cc + msg_handler_python.cc + msg_queue_python.cc + nco_python.cc + prefs_python.cc + # pycallback_object_python.cc + random_python.cc + realtime_python.cc + # realtime_impl_python.cc + # rpcbufferedget_python.cc + # rpccallbackregister_base_python.cc + # rpcmanager_python.cc + # rpcmanager_base_python.cc + # rpcpmtconverters_thrift_python.cc + # rpcregisterhelpers_python.cc + # rpcserver_aggregator_python.cc + # rpcserver_base_python.cc + # rpcserver_booter_aggregator_python.cc + # rpcserver_booter_base_python.cc + # rpcserver_booter_thrift_python.cc + # rpcserver_selector_python.cc + # rpcserver_thrift_python.cc + runtime_types_python.cc + sincos_python.cc + sptr_magic_python.cc + sync_block_python.cc + sync_decimator_python.cc + sync_interpolator_python.cc + sys_paths_python.cc + tag_checker_python.cc + tagged_stream_block_python.cc + tags_python.cc + # thread_python.cc + # thread_body_wrapper_python.cc + # thread_group_python.cc + # thrift_application_base_python.cc + # thrift_server_template_python.cc + top_block_python.cc + tpb_detail_python.cc + # types_python.cc + # unittests_python.cc + # xoroshiro128p_python.cc + python_bindings.cc) + +GR_PYBIND_MAKE(gr + ../../.. + gr::gr + "${gr_python_files}") + +install(TARGETS gr_python DESTINATION ${GR_PYTHON_DIR}/gnuradio/gr COMPONENT pythonapi) diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/basic_block_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/basic_block_python.cc new file mode 100644 index 0000000000..2629275c29 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/basic_block_python.cc @@ -0,0 +1,275 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/basic_block.h> +// pydoc.h is automatically generated in the build directory +#include <basic_block_pydoc.h> + +void bind_basic_block(py::module& m) +{ + + using basic_block = ::gr::basic_block; + + + py::class_<basic_block, gr::msg_accepter, std::shared_ptr<basic_block>>( + m, "basic_block", D(basic_block)) + + + .def("message_subscribers", + &basic_block::message_subscribers, + py::arg("port"), + D(basic_block, message_subscribers)) + + + .def("unique_id", &basic_block::unique_id, D(basic_block, unique_id)) + + + .def("symbolic_id", &basic_block::symbolic_id, D(basic_block, symbolic_id)) + + + .def("name", &basic_block::name, D(basic_block, name)) + + + .def("symbol_name", &basic_block::symbol_name, D(basic_block, symbol_name)) + + + .def("identifier", &basic_block::identifier, D(basic_block, identifier)) + + + .def("input_signature", + &basic_block::input_signature, + D(basic_block, input_signature)) + + + .def("output_signature", + &basic_block::output_signature, + D(basic_block, output_signature)) + + + .def("to_basic_block", + &basic_block::to_basic_block, + D(basic_block, to_basic_block)) + + + .def("alias_set", &basic_block::alias_set, D(basic_block, alias_set)) + + + .def("alias", &basic_block::alias, D(basic_block, alias)) + + + .def("alias_pmt", &basic_block::alias_pmt, D(basic_block, alias_pmt)) + + + .def("set_block_alias", + &basic_block::set_block_alias, + py::arg("name"), + D(basic_block, set_block_alias)) + + + .def("message_port_register_in", + &basic_block::message_port_register_in, + py::arg("port_id"), + D(basic_block, message_port_register_in)) + + + .def("message_port_register_out", + &basic_block::message_port_register_out, + py::arg("port_id"), + D(basic_block, message_port_register_out)) + + + .def("message_port_pub", + &basic_block::message_port_pub, + py::arg("port_id"), + py::arg("msg"), + D(basic_block, message_port_pub)) + + + .def("message_port_sub", + &basic_block::message_port_sub, + py::arg("port_id"), + py::arg("target"), + D(basic_block, message_port_sub)) + + + .def("message_port_unsub", + &basic_block::message_port_unsub, + py::arg("port_id"), + py::arg("target"), + D(basic_block, message_port_unsub)) + + + .def("message_port_is_hier", + &basic_block::message_port_is_hier, + py::arg("port_id"), + D(basic_block, message_port_is_hier)) + + + .def("message_port_is_hier_in", + &basic_block::message_port_is_hier_in, + py::arg("port_id"), + D(basic_block, message_port_is_hier_in)) + + + .def("message_port_is_hier_out", + &basic_block::message_port_is_hier_out, + py::arg("port_id"), + D(basic_block, message_port_is_hier_out)) + + + .def("message_ports_in", + &basic_block::message_ports_in, + D(basic_block, message_ports_in)) + + + .def("message_ports_out", + &basic_block::message_ports_out, + D(basic_block, message_ports_out)) + + + .def("_post", + &basic_block::_post, + py::arg("which_port"), + py::arg("msg"), + D(basic_block, _post)) + + + .def("empty_p", + (bool (basic_block::*)(pmt::pmt_t)) & basic_block::empty_p, + py::arg("which_port"), + D(basic_block, empty_p, 0)) + + + .def("empty_p", + (bool (basic_block::*)()) & basic_block::empty_p, + D(basic_block, empty_p, 1)) + + + .def("empty_handled_p", + (bool (basic_block::*)(pmt::pmt_t)) & basic_block::empty_handled_p, + py::arg("which_port"), + D(basic_block, empty_handled_p, 0)) + + + .def("empty_handled_p", + (bool (basic_block::*)()) & basic_block::empty_handled_p, + D(basic_block, empty_handled_p, 1)) + + + .def("nmsgs", &basic_block::nmsgs, py::arg("which_port"), D(basic_block, nmsgs)) + + + .def("insert_tail", + &basic_block::insert_tail, + py::arg("which_port"), + py::arg("msg"), + D(basic_block, insert_tail)) + + + .def("delete_head_nowait", + &basic_block::delete_head_nowait, + py::arg("which_port"), + D(basic_block, delete_head_nowait)) + + + .def("get_iterator", + &basic_block::get_iterator, + py::arg("which_port"), + D(basic_block, get_iterator)) + + + .def("erase_msg", + &basic_block::erase_msg, + py::arg("which_port"), + py::arg("it"), + D(basic_block, erase_msg)) + + + .def("has_msg_port", + &basic_block::has_msg_port, + py::arg("which_port"), + D(basic_block, has_msg_port)) + + + .def("get_msg_map", &basic_block::get_msg_map, D(basic_block, get_msg_map)) + + + // .def("add_rpc_variable",&basic_block::add_rpc_variable, + // py::arg("s"), + // D(basic_block,add_rpc_variable) + // ) + + + // .def("setup_rpc",&basic_block::setup_rpc, + // D(basic_block,setup_rpc) + // ) + + + // .def("is_rpc_set",&basic_block::is_rpc_set, + // D(basic_block,is_rpc_set) + // ) + + + // .def("rpc_set",&basic_block::rpc_set, + // D(basic_block,rpc_set) + // ) + + + .def("check_topology", + &basic_block::check_topology, + py::arg("ninputs"), + py::arg("noutputs"), + D(basic_block, check_topology)) + + + .def("set_processor_affinity", + &basic_block::set_processor_affinity, + py::arg("mask"), + D(basic_block, set_processor_affinity)) + + + .def("unset_processor_affinity", + &basic_block::unset_processor_affinity, + D(basic_block, unset_processor_affinity)) + + + .def("processor_affinity", + &basic_block::processor_affinity, + D(basic_block, processor_affinity)) + + + .def("set_log_level", + &basic_block::set_log_level, + py::arg("level"), + D(basic_block, set_log_level)) + + + .def("log_level", &basic_block::log_level, D(basic_block, log_level)) + + ; + + + m.def("basic_block_ncurrently_allocated", + &::gr::basic_block_ncurrently_allocated, + D(basic_block_ncurrently_allocated)); + + + py::module m_messages = m.def_submodule("messages"); + + + py::module m_thread = m.def_submodule("thread"); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/block_detail_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/block_detail_python.cc new file mode 100644 index 0000000000..476740c222 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/block_detail_python.cc @@ -0,0 +1,350 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/block_detail.h> +#include <gnuradio/buffer.h> +// pydoc.h is automatically generated in the build directory +#include <block_detail_pydoc.h> + +void bind_block_detail(py::module& m) +{ + + using block_detail = ::gr::block_detail; + + + py::class_<block_detail, std::shared_ptr<block_detail>>( + m, "block_detail", D(block_detail)) + + + .def("ninputs", &block_detail::ninputs, D(block_detail, ninputs)) + + + .def("noutputs", &block_detail::noutputs, D(block_detail, noutputs)) + + + .def("sink_p", &block_detail::sink_p, D(block_detail, sink_p)) + + + .def("source_p", &block_detail::source_p, D(block_detail, source_p)) + + + .def("set_done", + &block_detail::set_done, + py::arg("done"), + D(block_detail, set_done)) + + + .def("done", &block_detail::done, D(block_detail, done)) + + + .def("set_input", + &block_detail::set_input, + py::arg("which"), + py::arg("reader"), + D(block_detail, set_input)) + + + .def("input", &block_detail::input, py::arg("which"), D(block_detail, input)) + + + .def("set_output", + &block_detail::set_output, + py::arg("which"), + py::arg("buffer"), + D(block_detail, set_output)) + + + .def("output", &block_detail::output, py::arg("which"), D(block_detail, output)) + + + .def("consume", + &block_detail::consume, + py::arg("which_input"), + py::arg("how_many_items"), + D(block_detail, consume)) + + + .def("consume_each", + &block_detail::consume_each, + py::arg("how_many_items"), + D(block_detail, consume_each)) + + + .def("produce", + &block_detail::produce, + py::arg("which_output"), + py::arg("how_many_items"), + D(block_detail, produce)) + + + .def("produce_each", + &block_detail::produce_each, + py::arg("how_many_items"), + D(block_detail, produce_each)) + + + .def("nitems_read", + &block_detail::nitems_read, + py::arg("which_input"), + D(block_detail, nitems_read)) + + + .def("nitems_written", + &block_detail::nitems_written, + py::arg("which_output"), + D(block_detail, nitems_written)) + + + .def("reset_nitem_counters", + &block_detail::reset_nitem_counters, + D(block_detail, reset_nitem_counters)) + + + .def("clear_tags", &block_detail::clear_tags, D(block_detail, clear_tags)) + + + .def("add_item_tag", + &block_detail::add_item_tag, + py::arg("which_output"), + py::arg("tag"), + D(block_detail, add_item_tag)) + + + .def("remove_item_tag", + &block_detail::remove_item_tag, + py::arg("which_input"), + py::arg("tag"), + py::arg("id"), + D(block_detail, remove_item_tag)) + + + .def("get_tags_in_range", + (void (block_detail::*)(std::vector<gr::tag_t, std::allocator<gr::tag_t>>&, + unsigned int, + uint64_t, + uint64_t, + long int)) & + block_detail::get_tags_in_range, + py::arg("v"), + py::arg("which_input"), + py::arg("abs_start"), + py::arg("abs_end"), + py::arg("id"), + D(block_detail, get_tags_in_range, 0)) + + + .def("get_tags_in_range", + (void (block_detail::*)(std::vector<gr::tag_t, std::allocator<gr::tag_t>>&, + unsigned int, + uint64_t, + uint64_t, + pmt::pmt_t const&, + long int)) & + block_detail::get_tags_in_range, + py::arg("v"), + py::arg("which_input"), + py::arg("abs_start"), + py::arg("abs_end"), + py::arg("key"), + py::arg("id"), + D(block_detail, get_tags_in_range, 1)) + + + .def("set_processor_affinity", + &block_detail::set_processor_affinity, + py::arg("mask"), + D(block_detail, set_processor_affinity)) + + + .def("unset_processor_affinity", + &block_detail::unset_processor_affinity, + D(block_detail, unset_processor_affinity)) + + + .def("thread_priority", + &block_detail::thread_priority, + D(block_detail, thread_priority)) + + + .def("set_thread_priority", + &block_detail::set_thread_priority, + py::arg("priority"), + D(block_detail, set_thread_priority)) + + + .def("start_perf_counters", + &block_detail::start_perf_counters, + D(block_detail, start_perf_counters)) + + + .def("stop_perf_counters", + &block_detail::stop_perf_counters, + py::arg("noutput_items"), + py::arg("nproduced"), + D(block_detail, stop_perf_counters)) + + + .def("reset_perf_counters", + &block_detail::reset_perf_counters, + D(block_detail, reset_perf_counters)) + + + .def("pc_noutput_items", + &block_detail::pc_noutput_items, + D(block_detail, pc_noutput_items)) + + + .def("pc_nproduced", &block_detail::pc_nproduced, D(block_detail, pc_nproduced)) + + + .def("pc_input_buffers_full", + (float (block_detail::*)(size_t)) & block_detail::pc_input_buffers_full, + py::arg("which"), + D(block_detail, pc_input_buffers_full, 0)) + + + .def("pc_input_buffers_full", + (std::vector<float, std::allocator<float>>(block_detail::*)()) & + block_detail::pc_input_buffers_full, + D(block_detail, pc_input_buffers_full, 1)) + + + .def("pc_output_buffers_full", + (float (block_detail::*)(size_t)) & block_detail::pc_output_buffers_full, + py::arg("which"), + D(block_detail, pc_output_buffers_full, 0)) + + + .def("pc_output_buffers_full", + (std::vector<float, std::allocator<float>>(block_detail::*)()) & + block_detail::pc_output_buffers_full, + D(block_detail, pc_output_buffers_full, 1)) + + + .def("pc_work_time", &block_detail::pc_work_time, D(block_detail, pc_work_time)) + + + .def("pc_noutput_items_avg", + &block_detail::pc_noutput_items_avg, + D(block_detail, pc_noutput_items_avg)) + + + .def("pc_nproduced_avg", + &block_detail::pc_nproduced_avg, + D(block_detail, pc_nproduced_avg)) + + + .def("pc_input_buffers_full_avg", + (float (block_detail::*)(size_t)) & block_detail::pc_input_buffers_full_avg, + py::arg("which"), + D(block_detail, pc_input_buffers_full_avg, 0)) + + + .def("pc_input_buffers_full_avg", + (std::vector<float, std::allocator<float>>(block_detail::*)()) & + block_detail::pc_input_buffers_full_avg, + D(block_detail, pc_input_buffers_full_avg, 1)) + + + .def("pc_output_buffers_full_avg", + (float (block_detail::*)(size_t)) & block_detail::pc_output_buffers_full_avg, + py::arg("which"), + D(block_detail, pc_output_buffers_full_avg, 0)) + + + .def("pc_output_buffers_full_avg", + (std::vector<float, std::allocator<float>>(block_detail::*)()) & + block_detail::pc_output_buffers_full_avg, + D(block_detail, pc_output_buffers_full_avg, 1)) + + + .def("pc_work_time_avg", + &block_detail::pc_work_time_avg, + D(block_detail, pc_work_time_avg)) + + + .def("pc_throughput_avg", + &block_detail::pc_throughput_avg, + D(block_detail, pc_throughput_avg)) + + + .def("pc_noutput_items_var", + &block_detail::pc_noutput_items_var, + D(block_detail, pc_noutput_items_var)) + + + .def("pc_nproduced_var", + &block_detail::pc_nproduced_var, + D(block_detail, pc_nproduced_var)) + + + .def("pc_input_buffers_full_var", + (float (block_detail::*)(size_t)) & block_detail::pc_input_buffers_full_var, + py::arg("which"), + D(block_detail, pc_input_buffers_full_var, 0)) + + + .def("pc_input_buffers_full_var", + (std::vector<float, std::allocator<float>>(block_detail::*)()) & + block_detail::pc_input_buffers_full_var, + D(block_detail, pc_input_buffers_full_var, 1)) + + + .def("pc_output_buffers_full_var", + (float (block_detail::*)(size_t)) & block_detail::pc_output_buffers_full_var, + py::arg("which"), + D(block_detail, pc_output_buffers_full_var, 0)) + + + .def("pc_output_buffers_full_var", + (std::vector<float, std::allocator<float>>(block_detail::*)()) & + block_detail::pc_output_buffers_full_var, + D(block_detail, pc_output_buffers_full_var, 1)) + + + .def("pc_work_time_var", + &block_detail::pc_work_time_var, + D(block_detail, pc_work_time_var)) + + + .def("pc_work_time_total", + &block_detail::pc_work_time_total, + D(block_detail, pc_work_time_total)) + + + .def("consumed", &block_detail::consumed, D(block_detail, consumed)) + + ; + + + m.def("make_block_detail", + &::gr::make_block_detail, + py::arg("ninputs"), + py::arg("noutputs"), + D(make_block_detail)); + + + m.def("block_detail_ncurrently_allocated", + &::gr::block_detail_ncurrently_allocated, + D(block_detail_ncurrently_allocated)); + + + py::module m_thread = m.def_submodule("thread"); + + + py::module m_messages = m.def_submodule("messages"); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/block_gateway_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/block_gateway_python.cc new file mode 100644 index 0000000000..5766677bbe --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/block_gateway_python.cc @@ -0,0 +1,96 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/block_gateway.h> + +void bind_block_gateway(py::module& m) +{ + using block_gateway = gr::block_gateway; + py::class_<block_gateway, gr::block, gr::basic_block, std::shared_ptr<block_gateway>>( + m, "block_gateway") + + .def(py::init(&block_gateway::make), + py::arg("p"), + py::arg("name"), + py::arg("in_sig"), + py::arg("out_sig")) + + .def("add_item_tag", + (void (block_gateway::*)(unsigned int, const gr::tag_t&)) & + block_gateway::_add_item_tag, + py::arg("which_output"), + py::arg("tag")) + + .def("add_item_tag", + (void (block_gateway::*)(unsigned int, + uint64_t, + const pmt::pmt_t&, + const pmt::pmt_t&, + const pmt::pmt_t&)) & + block_gateway::_add_item_tag, + py::arg("which_output"), + py::arg("abs_offset"), + py::arg("key"), + py::arg("value"), + py::arg("srcid") = pmt::PMT_F) + + + .def( + "get_tags_in_range", + (std::vector<gr::tag_t>(block_gateway::*)(unsigned int, uint64_t, uint64_t)) & + block_gateway::_get_tags_in_range, + py::arg("which_input"), + py::arg("abs_start"), + py::arg("abs_end")) + + .def("get_tags_in_range", + (std::vector<gr::tag_t>(block_gateway::*)( + unsigned int, uint64_t, uint64_t, const pmt::pmt_t&)) & + block_gateway::_get_tags_in_range, + py::arg("which_input"), + py::arg("abs_start"), + py::arg("abs_end"), + py::arg("key")) + + .def( + "get_tags_in_window", + (std::vector<gr::tag_t>(block_gateway::*)(unsigned int, uint64_t, uint64_t)) & + block_gateway::_get_tags_in_range, + py::arg("which_input"), + py::arg("rel_start"), + py::arg("rel_end")) + + .def("get_tags_in_window", + (std::vector<gr::tag_t>(block_gateway::*)( + unsigned int, uint64_t, uint64_t, const pmt::pmt_t&)) & + block_gateway::_get_tags_in_range, + py::arg("which_input"), + py::arg("rel_start"), + py::arg("rel_end"), + py::arg("key")) + + .def("set_msg_handler_pybind", + &block_gateway::set_msg_handler_pybind, + py::arg("which_port"), + py::arg("handler_name")) + + ; + py::enum_<gr::gw_block_t>(m, "gw_block_t") + .value("GW_BLOCK_GENERAL", gr::GW_BLOCK_GENERAL) + .value("GW_BLOCK_SYNC", gr::GW_BLOCK_SYNC) + .value("GW_BLOCK_DECIM", gr::GW_BLOCK_DECIM) + .value("GW_BLOCK_INTERP", gr::GW_BLOCK_INTERP) + .export_values(); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/block_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/block_python.cc new file mode 100644 index 0000000000..2f2064ac34 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/block_python.cc @@ -0,0 +1,493 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/block.h> +// pydoc.h is automatically generated in the build directory +#include <gnuradio/block_detail.h> +#include <block_pydoc.h> + +void bind_block(py::module& m) +{ + + using block = ::gr::block; + + + py::class_<block, gr::basic_block, std::shared_ptr<block>>(m, "block", D(block)) + + + .def("history", &block::history, D(block, history)) + + + .def( + "set_history", &block::set_history, py::arg("history"), D(block, set_history)) + + + .def("declare_sample_delay", + (void (block::*)(int, unsigned int)) & block::declare_sample_delay, + py::arg("which"), + py::arg("delay"), + D(block, declare_sample_delay, 0)) + + + .def("declare_sample_delay", + (void (block::*)(unsigned int)) & block::declare_sample_delay, + py::arg("delay"), + D(block, declare_sample_delay, 1)) + + + .def("sample_delay", + &block::sample_delay, + py::arg("which"), + D(block, sample_delay)) + + + .def("fixed_rate", &block::fixed_rate, D(block, fixed_rate)) + + + .def("forecast", + &block::forecast, + py::arg("noutput_items"), + py::arg("ninput_items_required"), + D(block, forecast)) + + + .def("general_work", + &block::general_work, + py::arg("noutput_items"), + py::arg("ninput_items"), + py::arg("input_items"), + py::arg("output_items"), + D(block, general_work)) + + + .def("start", &block::start, D(block, start)) + + + .def("stop", &block::stop, D(block, stop)) + + + .def("set_output_multiple", + &block::set_output_multiple, + py::arg("multiple"), + D(block, set_output_multiple)) + + + .def("output_multiple", &block::output_multiple, D(block, output_multiple)) + + + .def("output_multiple_set", + &block::output_multiple_set, + D(block, output_multiple_set)) + + + .def("set_alignment", + &block::set_alignment, + py::arg("multiple"), + D(block, set_alignment)) + + + .def("alignment", &block::alignment, D(block, alignment)) + + + .def("set_unaligned", + &block::set_unaligned, + py::arg("na"), + D(block, set_unaligned)) + + + .def("unaligned", &block::unaligned, D(block, unaligned)) + + + .def("set_is_unaligned", + &block::set_is_unaligned, + py::arg("u"), + D(block, set_is_unaligned)) + + + .def("is_unaligned", &block::is_unaligned, D(block, is_unaligned)) + + + .def("consume", + &block::consume, + py::arg("which_input"), + py::arg("how_many_items"), + D(block, consume)) + + + .def("consume_each", + &block::consume_each, + py::arg("how_many_items"), + D(block, consume_each)) + + + .def("produce", + &block::produce, + py::arg("which_output"), + py::arg("how_many_items"), + D(block, produce)) + + + .def("set_relative_rate", + (void (block::*)(double)) & block::set_relative_rate, + py::arg("relative_rate"), + D(block, set_relative_rate, 0)) + + + .def("set_inverse_relative_rate", + &block::set_inverse_relative_rate, + py::arg("inverse_relative_rate"), + D(block, set_inverse_relative_rate)) + + + .def("set_relative_rate", + (void (block::*)(uint64_t, uint64_t)) & block::set_relative_rate, + py::arg("interpolation"), + py::arg("decimation"), + D(block, set_relative_rate, 1)) + + + .def("relative_rate", &block::relative_rate, D(block, relative_rate)) + + + .def("relative_rate_i", &block::relative_rate_i, D(block, relative_rate_i)) + + + .def("relative_rate_d", &block::relative_rate_d, D(block, relative_rate_d)) + + + .def("mp_relative_rate", &block::mp_relative_rate, D(block, mp_relative_rate)) + + + .def("fixed_rate_ninput_to_noutput", + &block::fixed_rate_ninput_to_noutput, + py::arg("ninput"), + D(block, fixed_rate_ninput_to_noutput)) + + + .def("fixed_rate_noutput_to_ninput", + &block::fixed_rate_noutput_to_ninput, + py::arg("noutput"), + D(block, fixed_rate_noutput_to_ninput)) + + + .def("nitems_read", + &block::nitems_read, + py::arg("which_input"), + D(block, nitems_read)) + + + .def("nitems_written", + &block::nitems_written, + py::arg("which_output"), + D(block, nitems_written)) + + + .def("tag_propagation_policy", + &block::tag_propagation_policy, + D(block, tag_propagation_policy)) + + + .def("set_tag_propagation_policy", + &block::set_tag_propagation_policy, + py::arg("p"), + D(block, set_tag_propagation_policy)) + + + .def("min_noutput_items", &block::min_noutput_items, D(block, min_noutput_items)) + + + .def("set_min_noutput_items", + &block::set_min_noutput_items, + py::arg("m"), + D(block, set_min_noutput_items)) + + + .def("max_noutput_items", &block::max_noutput_items, D(block, max_noutput_items)) + + + .def("set_max_noutput_items", + &block::set_max_noutput_items, + py::arg("m"), + D(block, set_max_noutput_items)) + + + .def("unset_max_noutput_items", + &block::unset_max_noutput_items, + D(block, unset_max_noutput_items)) + + + .def("is_set_max_noutput_items", + &block::is_set_max_noutput_items, + D(block, is_set_max_noutput_items)) + + + .def("expand_minmax_buffer", + &block::expand_minmax_buffer, + py::arg("port"), + D(block, expand_minmax_buffer)) + + + .def("max_output_buffer", + &block::max_output_buffer, + py::arg("i"), + D(block, max_output_buffer)) + + + .def("set_max_output_buffer", + (void (block::*)(long int)) & block::set_max_output_buffer, + py::arg("max_output_buffer"), + D(block, set_max_output_buffer, 0)) + + + .def("set_max_output_buffer", + (void (block::*)(int, long int)) & block::set_max_output_buffer, + py::arg("port"), + py::arg("max_output_buffer"), + D(block, set_max_output_buffer, 1)) + + + .def("min_output_buffer", + &block::min_output_buffer, + py::arg("i"), + D(block, min_output_buffer)) + + + .def("set_min_output_buffer", + (void (block::*)(long int)) & block::set_min_output_buffer, + py::arg("min_output_buffer"), + D(block, set_min_output_buffer, 0)) + + + .def("set_min_output_buffer", + (void (block::*)(int, long int)) & block::set_min_output_buffer, + py::arg("port"), + py::arg("min_output_buffer"), + D(block, set_min_output_buffer, 1)) + + + .def("pc_noutput_items", &block::pc_noutput_items, D(block, pc_noutput_items)) + + + .def("pc_noutput_items_avg", + &block::pc_noutput_items_avg, + D(block, pc_noutput_items_avg)) + + + .def("pc_noutput_items_var", + &block::pc_noutput_items_var, + D(block, pc_noutput_items_var)) + + + .def("pc_nproduced", &block::pc_nproduced, D(block, pc_nproduced)) + + + .def("pc_nproduced_avg", &block::pc_nproduced_avg, D(block, pc_nproduced_avg)) + + + .def("pc_nproduced_var", &block::pc_nproduced_var, D(block, pc_nproduced_var)) + + + .def("pc_input_buffers_full", + (float (block::*)(int)) & block::pc_input_buffers_full, + py::arg("which"), + D(block, pc_input_buffers_full, 0)) + + + .def("pc_input_buffers_full_avg", + (float (block::*)(int)) & block::pc_input_buffers_full_avg, + py::arg("which"), + D(block, pc_input_buffers_full_avg, 0)) + + + .def("pc_input_buffers_full_var", + (float (block::*)(int)) & block::pc_input_buffers_full_var, + py::arg("which"), + D(block, pc_input_buffers_full_var, 0)) + + + .def("pc_input_buffers_full", + (std::vector<float, std::allocator<float>>(block::*)()) & + block::pc_input_buffers_full, + D(block, pc_input_buffers_full, 1)) + + + .def("pc_input_buffers_full_avg", + (std::vector<float, std::allocator<float>>(block::*)()) & + block::pc_input_buffers_full_avg, + D(block, pc_input_buffers_full_avg, 1)) + + + .def("pc_input_buffers_full_var", + (std::vector<float, std::allocator<float>>(block::*)()) & + block::pc_input_buffers_full_var, + D(block, pc_input_buffers_full_var, 1)) + + + .def("pc_output_buffers_full", + (float (block::*)(int)) & block::pc_output_buffers_full, + py::arg("which"), + D(block, pc_output_buffers_full, 0)) + + + .def("pc_output_buffers_full_avg", + (float (block::*)(int)) & block::pc_output_buffers_full_avg, + py::arg("which"), + D(block, pc_output_buffers_full_avg, 0)) + + + .def("pc_output_buffers_full_var", + (float (block::*)(int)) & block::pc_output_buffers_full_var, + py::arg("which"), + D(block, pc_output_buffers_full_var, 0)) + + + .def("pc_output_buffers_full", + (std::vector<float, std::allocator<float>>(block::*)()) & + block::pc_output_buffers_full, + D(block, pc_output_buffers_full, 1)) + + + .def("pc_output_buffers_full_avg", + (std::vector<float, std::allocator<float>>(block::*)()) & + block::pc_output_buffers_full_avg, + D(block, pc_output_buffers_full_avg, 1)) + + + .def("pc_output_buffers_full_var", + (std::vector<float, std::allocator<float>>(block::*)()) & + block::pc_output_buffers_full_var, + D(block, pc_output_buffers_full_var, 1)) + + + .def("pc_work_time", &block::pc_work_time, D(block, pc_work_time)) + + + .def("pc_work_time_avg", &block::pc_work_time_avg, D(block, pc_work_time_avg)) + + + .def("pc_work_time_var", &block::pc_work_time_var, D(block, pc_work_time_var)) + + + .def("pc_work_time_total", + &block::pc_work_time_total, + D(block, pc_work_time_total)) + + + .def("pc_throughput_avg", &block::pc_throughput_avg, D(block, pc_throughput_avg)) + + + .def("reset_perf_counters", + &block::reset_perf_counters, + D(block, reset_perf_counters)) + + + .def("setup_pc_rpc", &block::setup_pc_rpc, D(block, setup_pc_rpc)) + + + .def("is_pc_rpc_set", &block::is_pc_rpc_set, D(block, is_pc_rpc_set)) + + + .def("no_pc_rpc", &block::no_pc_rpc, D(block, no_pc_rpc)) + + + .def("set_processor_affinity", + &block::set_processor_affinity, + py::arg("mask"), + D(block, set_processor_affinity)) + + + .def("unset_processor_affinity", + &block::unset_processor_affinity, + D(block, unset_processor_affinity)) + + + .def("processor_affinity", + &block::processor_affinity, + D(block, processor_affinity)) + + + .def("active_thread_priority", + &block::active_thread_priority, + D(block, active_thread_priority)) + + + .def("thread_priority", &block::thread_priority, D(block, thread_priority)) + + + .def("set_thread_priority", + &block::set_thread_priority, + py::arg("priority"), + D(block, set_thread_priority)) + + + .def("update_rate", &block::update_rate, D(block, update_rate)) + + + .def("system_handler", + &block::system_handler, + py::arg("msg"), + D(block, system_handler)) + + + .def("set_log_level", + &block::set_log_level, + py::arg("level"), + D(block, set_log_level)) + + + .def("log_level", &block::log_level, D(block, log_level)) + + + .def("finished", &block::finished, D(block, finished)) + + + .def("detail", &block::detail, D(block, detail)) + + + .def("set_detail", &block::set_detail, py::arg("detail"), D(block, set_detail)) + + + .def("notify_msg_neighbors", + &block::notify_msg_neighbors, + D(block, notify_msg_neighbors)) + + + .def("clear_finished", &block::clear_finished, D(block, clear_finished)) + + + .def("identifier", &block::identifier, D(block, identifier)) + + ; + + + m.def("cast_to_block_sptr", + &::gr::cast_to_block_sptr, + py::arg("p"), + D(cast_to_block_sptr)); + + + py::enum_<gr::block::work_return_t>(m, "work_return_t") + .value("WORK_CALLED_PRODUCE", gr::block::WORK_CALLED_PRODUCE) // -2 + .value("WORK_DONE", gr::block::WORK_DONE) // -1 + .export_values(); + py::enum_<gr::block::tag_propagation_policy_t>(m, "tag_propagation_policy_t") + .value("TPP_DONT", gr::block::TPP_DONT) // 0 + .value("TPP_ALL_TO_ALL", gr::block::TPP_ALL_TO_ALL) // 1 + .value("TPP_ONE_TO_ONE", gr::block::TPP_ONE_TO_ONE) // 2 + .value("TPP_CUSTOM", gr::block::TPP_CUSTOM) // 3 + .export_values(); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/buffer_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/buffer_python.cc new file mode 100644 index 0000000000..4dd740f0af --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/buffer_python.cc @@ -0,0 +1,226 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/block.h> +#include <gnuradio/buffer.h> +// pydoc.h is automatically generated in the build directory +#include <buffer_pydoc.h> + +void bind_buffer(py::module& m) +{ + + using buffer = ::gr::buffer; + using buffer_reader = ::gr::buffer_reader; + + + py::class_<buffer, std::shared_ptr<buffer>>(m, "buffer", D(buffer)) + + + .def("space_available", &buffer::space_available, D(buffer, space_available)) + + + .def("bufsize", &buffer::bufsize, D(buffer, bufsize)) + + + .def("base", &buffer::base, D(buffer, base)) + + + .def("write_pointer", &buffer::write_pointer, D(buffer, write_pointer)) + + + .def("update_write_pointer", + &buffer::update_write_pointer, + py::arg("nitems"), + D(buffer, update_write_pointer)) + + + .def("set_done", &buffer::set_done, py::arg("done"), D(buffer, set_done)) + + + .def("done", &buffer::done, D(buffer, done)) + + + .def("link", &buffer::link, D(buffer, link)) + + + .def("nreaders", &buffer::nreaders, D(buffer, nreaders)) + + + .def("reader", &buffer::reader, py::arg("index"), D(buffer, reader)) + + + .def("mutex", &buffer::mutex, D(buffer, mutex)) + + + .def("nitems_written", &buffer::nitems_written, D(buffer, nitems_written)) + + + .def("reset_nitem_counter", + &buffer::reset_nitem_counter, + D(buffer, reset_nitem_counter)) + + + .def("get_sizeof_item", &buffer::get_sizeof_item, D(buffer, get_sizeof_item)) + + + .def("add_item_tag", + &buffer::add_item_tag, + py::arg("tag"), + D(buffer, add_item_tag)) + + + .def("remove_item_tag", + &buffer::remove_item_tag, + py::arg("tag"), + py::arg("id"), + D(buffer, remove_item_tag)) + + + .def( + "prune_tags", &buffer::prune_tags, py::arg("max_time"), D(buffer, prune_tags)) + + + .def("get_tags_begin", &buffer::get_tags_begin, D(buffer, get_tags_begin)) + + + .def("get_tags_end", &buffer::get_tags_end, D(buffer, get_tags_end)) + + + .def("get_tags_lower_bound", + &buffer::get_tags_lower_bound, + py::arg("x"), + D(buffer, get_tags_lower_bound)) + + + .def("get_tags_upper_bound", + &buffer::get_tags_upper_bound, + py::arg("x"), + D(buffer, get_tags_upper_bound)) + + ; + + + py::class_<buffer_reader, std::shared_ptr<buffer_reader>>( + m, "buffer_reader", D(buffer_reader)) + + .def(py::init<gr::buffer_reader const&>(), + py::arg("arg0"), + D(buffer_reader, buffer_reader)) + + + .def("declare_sample_delay", + &buffer_reader::declare_sample_delay, + py::arg("delay"), + D(buffer_reader, declare_sample_delay)) + + + .def("sample_delay", &buffer_reader::sample_delay, D(buffer_reader, sample_delay)) + + + .def("items_available", + &buffer_reader::items_available, + D(buffer_reader, items_available)) + + + .def("buffer", &buffer_reader::buffer, D(buffer_reader, buffer)) + + + .def("max_possible_items_available", + &buffer_reader::max_possible_items_available, + D(buffer_reader, max_possible_items_available)) + + + .def("read_pointer", &buffer_reader::read_pointer, D(buffer_reader, read_pointer)) + + + .def("update_read_pointer", + &buffer_reader::update_read_pointer, + py::arg("nitems"), + D(buffer_reader, update_read_pointer)) + + + .def("set_done", + &buffer_reader::set_done, + py::arg("done"), + D(buffer_reader, set_done)) + + + .def("done", &buffer_reader::done, D(buffer_reader, done)) + + + .def("mutex", &buffer_reader::mutex, D(buffer_reader, mutex)) + + + .def("nitems_read", &buffer_reader::nitems_read, D(buffer_reader, nitems_read)) + + + .def("reset_nitem_counter", + &buffer_reader::reset_nitem_counter, + D(buffer_reader, reset_nitem_counter)) + + + .def("get_sizeof_item", + &buffer_reader::get_sizeof_item, + D(buffer_reader, get_sizeof_item)) + + + .def("link", &buffer_reader::link, D(buffer_reader, link)) + + + .def("get_tags_in_range", + &buffer_reader::get_tags_in_range, + py::arg("v"), + py::arg("abs_start"), + py::arg("abs_end"), + py::arg("id"), + D(buffer_reader, get_tags_in_range)) + + ; + + + m.def("make_buffer", + &::gr::make_buffer, + py::arg("nitems"), + py::arg("sizeof_item"), + py::arg("link") = gr::block_sptr(), + D(make_buffer)); + + + m.def("buffer_add_reader", + &::gr::buffer_add_reader, + py::arg("buf"), + py::arg("nzero_preload"), + py::arg("link") = gr::block_sptr(), + py::arg("delay") = 0, + D(buffer_add_reader)); + + + m.def("buffer_ncurrently_allocated", + &::gr::buffer_ncurrently_allocated, + D(buffer_ncurrently_allocated)); + + + m.def("buffer_reader_ncurrently_allocated", + &::gr::buffer_reader_ncurrently_allocated, + D(buffer_reader_ncurrently_allocated)); + + + py::module m_thread = m.def_submodule("thread"); + + + py::module m_messages = m.def_submodule("messages"); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/constants_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/constants_python.cc new file mode 100644 index 0000000000..1e0328136c --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/constants_python.cc @@ -0,0 +1,62 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/constants.h> +// pydoc.h is automatically generated in the build directory +#include <constants_pydoc.h> + +void bind_constants(py::module& m) +{ + + + m.def("prefix", &::gr::prefix, D(prefix)); + + + m.def("sysconfdir", &::gr::sysconfdir, D(sysconfdir)); + + + m.def("prefsdir", &::gr::prefsdir, D(prefsdir)); + + + m.def("build_date", &::gr::build_date, D(build_date)); + + + m.def("version", &::gr::version, D(version)); + + + m.def("major_version", &::gr::major_version, D(major_version)); + + + m.def("api_version", &::gr::api_version, D(api_version)); + + + m.def("minor_version", &::gr::minor_version, D(minor_version)); + + + m.def("c_compiler", &::gr::c_compiler, D(c_compiler)); + + + m.def("cxx_compiler", &::gr::cxx_compiler, D(cxx_compiler)); + + + m.def("compiler_flags", &::gr::compiler_flags, D(compiler_flags)); + + + m.def("build_time_enabled_components", + &::gr::build_time_enabled_components, + D(build_time_enabled_components)); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/basic_block_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/basic_block_pydoc_template.h new file mode 100644 index 0000000000..f51175f1b6 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/basic_block_pydoc_template.h @@ -0,0 +1,156 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_basic_block = R"doc()doc"; + + +static const char* __doc_gr_basic_block_message_subscribers = R"doc()doc"; + + +static const char* __doc_gr_basic_block_unique_id = R"doc()doc"; + + +static const char* __doc_gr_basic_block_symbolic_id = R"doc()doc"; + + +static const char* __doc_gr_basic_block_name = R"doc()doc"; + + +static const char* __doc_gr_basic_block_symbol_name = R"doc()doc"; + + +static const char* __doc_gr_basic_block_identifier = R"doc()doc"; + + +static const char* __doc_gr_basic_block_input_signature = R"doc()doc"; + + +static const char* __doc_gr_basic_block_output_signature = R"doc()doc"; + + +static const char* __doc_gr_basic_block_to_basic_block = R"doc()doc"; + + +static const char* __doc_gr_basic_block_alias_set = R"doc()doc"; + + +static const char* __doc_gr_basic_block_alias = R"doc()doc"; + + +static const char* __doc_gr_basic_block_alias_pmt = R"doc()doc"; + + +static const char* __doc_gr_basic_block_set_block_alias = R"doc()doc"; + + +static const char* __doc_gr_basic_block_message_port_register_in = R"doc()doc"; + + +static const char* __doc_gr_basic_block_message_port_register_out = R"doc()doc"; + + +static const char* __doc_gr_basic_block_message_port_pub = R"doc()doc"; + + +static const char* __doc_gr_basic_block_message_port_sub = R"doc()doc"; + + +static const char* __doc_gr_basic_block_message_port_unsub = R"doc()doc"; + + +static const char* __doc_gr_basic_block_message_port_is_hier = R"doc()doc"; + + +static const char* __doc_gr_basic_block_message_port_is_hier_in = R"doc()doc"; + + +static const char* __doc_gr_basic_block_message_port_is_hier_out = R"doc()doc"; + + +static const char* __doc_gr_basic_block_message_ports_in = R"doc()doc"; + + +static const char* __doc_gr_basic_block_message_ports_out = R"doc()doc"; + + +static const char* __doc_gr_basic_block__post = R"doc()doc"; + + +static const char* __doc_gr_basic_block_empty_p_0 = R"doc()doc"; + + +static const char* __doc_gr_basic_block_empty_p_1 = R"doc()doc"; + + +static const char* __doc_gr_basic_block_empty_handled_p_0 = R"doc()doc"; + + +static const char* __doc_gr_basic_block_empty_handled_p_1 = R"doc()doc"; + + +static const char* __doc_gr_basic_block_nmsgs = R"doc()doc"; + + +static const char* __doc_gr_basic_block_insert_tail = R"doc()doc"; + + +static const char* __doc_gr_basic_block_delete_head_nowait = R"doc()doc"; + + +static const char* __doc_gr_basic_block_get_iterator = R"doc()doc"; + + +static const char* __doc_gr_basic_block_erase_msg = R"doc()doc"; + + +static const char* __doc_gr_basic_block_has_msg_port = R"doc()doc"; + + +static const char* __doc_gr_basic_block_get_msg_map = R"doc()doc"; + + +static const char* __doc_gr_basic_block_add_rpc_variable = R"doc()doc"; + + +static const char* __doc_gr_basic_block_setup_rpc = R"doc()doc"; + + +static const char* __doc_gr_basic_block_is_rpc_set = R"doc()doc"; + + +static const char* __doc_gr_basic_block_rpc_set = R"doc()doc"; + + +static const char* __doc_gr_basic_block_check_topology = R"doc()doc"; + + +static const char* __doc_gr_basic_block_set_processor_affinity = R"doc()doc"; + + +static const char* __doc_gr_basic_block_unset_processor_affinity = R"doc()doc"; + + +static const char* __doc_gr_basic_block_processor_affinity = R"doc()doc"; + + +static const char* __doc_gr_basic_block_set_log_level = R"doc()doc"; + + +static const char* __doc_gr_basic_block_log_level = R"doc()doc"; + + +static const char* __doc_gr_basic_block_ncurrently_allocated = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/block_detail_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/block_detail_pydoc_template.h new file mode 100644 index 0000000000..eb010d04a4 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/block_detail_pydoc_template.h @@ -0,0 +1,183 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_block_detail = R"doc()doc"; + + +static const char* __doc_gr_block_detail_ninputs = R"doc()doc"; + + +static const char* __doc_gr_block_detail_noutputs = R"doc()doc"; + + +static const char* __doc_gr_block_detail_sink_p = R"doc()doc"; + + +static const char* __doc_gr_block_detail_source_p = R"doc()doc"; + + +static const char* __doc_gr_block_detail_set_done = R"doc()doc"; + + +static const char* __doc_gr_block_detail_done = R"doc()doc"; + + +static const char* __doc_gr_block_detail_set_input = R"doc()doc"; + + +static const char* __doc_gr_block_detail_input = R"doc()doc"; + + +static const char* __doc_gr_block_detail_set_output = R"doc()doc"; + + +static const char* __doc_gr_block_detail_output = R"doc()doc"; + + +static const char* __doc_gr_block_detail_consume = R"doc()doc"; + + +static const char* __doc_gr_block_detail_consume_each = R"doc()doc"; + + +static const char* __doc_gr_block_detail_produce = R"doc()doc"; + + +static const char* __doc_gr_block_detail_produce_each = R"doc()doc"; + + +static const char* __doc_gr_block_detail_nitems_read = R"doc()doc"; + + +static const char* __doc_gr_block_detail_nitems_written = R"doc()doc"; + + +static const char* __doc_gr_block_detail_reset_nitem_counters = R"doc()doc"; + + +static const char* __doc_gr_block_detail_clear_tags = R"doc()doc"; + + +static const char* __doc_gr_block_detail_add_item_tag = R"doc()doc"; + + +static const char* __doc_gr_block_detail_remove_item_tag = R"doc()doc"; + + +static const char* __doc_gr_block_detail_get_tags_in_range_0 = R"doc()doc"; + + +static const char* __doc_gr_block_detail_get_tags_in_range_1 = R"doc()doc"; + + +static const char* __doc_gr_block_detail_set_processor_affinity = R"doc()doc"; + + +static const char* __doc_gr_block_detail_unset_processor_affinity = R"doc()doc"; + + +static const char* __doc_gr_block_detail_thread_priority = R"doc()doc"; + + +static const char* __doc_gr_block_detail_set_thread_priority = R"doc()doc"; + + +static const char* __doc_gr_block_detail_start_perf_counters = R"doc()doc"; + + +static const char* __doc_gr_block_detail_stop_perf_counters = R"doc()doc"; + + +static const char* __doc_gr_block_detail_reset_perf_counters = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_noutput_items = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_nproduced = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_input_buffers_full_0 = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_input_buffers_full_1 = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_output_buffers_full_0 = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_output_buffers_full_1 = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_work_time = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_noutput_items_avg = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_nproduced_avg = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_input_buffers_full_avg_0 = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_input_buffers_full_avg_1 = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_output_buffers_full_avg_0 = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_output_buffers_full_avg_1 = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_work_time_avg = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_throughput_avg = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_noutput_items_var = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_nproduced_var = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_input_buffers_full_var_0 = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_input_buffers_full_var_1 = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_output_buffers_full_var_0 = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_output_buffers_full_var_1 = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_work_time_var = R"doc()doc"; + + +static const char* __doc_gr_block_detail_pc_work_time_total = R"doc()doc"; + + +static const char* __doc_gr_block_detail_consumed = R"doc()doc"; + + +static const char* __doc_gr_make_block_detail = R"doc()doc"; + + +static const char* __doc_gr_block_detail_ncurrently_allocated = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/block_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/block_pydoc_template.h new file mode 100644 index 0000000000..d60a699fec --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/block_pydoc_template.h @@ -0,0 +1,294 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_block = R"doc()doc"; + + +static const char* __doc_gr_block_history = R"doc()doc"; + + +static const char* __doc_gr_block_set_history = R"doc()doc"; + + +static const char* __doc_gr_block_declare_sample_delay_0 = R"doc()doc"; + + +static const char* __doc_gr_block_declare_sample_delay_1 = R"doc()doc"; + + +static const char* __doc_gr_block_sample_delay = R"doc()doc"; + + +static const char* __doc_gr_block_fixed_rate = R"doc()doc"; + + +static const char* __doc_gr_block_forecast = R"doc()doc"; + + +static const char* __doc_gr_block_general_work = R"doc()doc"; + + +static const char* __doc_gr_block_start = R"doc()doc"; + + +static const char* __doc_gr_block_stop = R"doc()doc"; + + +static const char* __doc_gr_block_set_output_multiple = R"doc()doc"; + + +static const char* __doc_gr_block_output_multiple = R"doc()doc"; + + +static const char* __doc_gr_block_output_multiple_set = R"doc()doc"; + + +static const char* __doc_gr_block_set_alignment = R"doc()doc"; + + +static const char* __doc_gr_block_alignment = R"doc()doc"; + + +static const char* __doc_gr_block_set_unaligned = R"doc()doc"; + + +static const char* __doc_gr_block_unaligned = R"doc()doc"; + + +static const char* __doc_gr_block_set_is_unaligned = R"doc()doc"; + + +static const char* __doc_gr_block_is_unaligned = R"doc()doc"; + + +static const char* __doc_gr_block_consume = R"doc()doc"; + + +static const char* __doc_gr_block_consume_each = R"doc()doc"; + + +static const char* __doc_gr_block_produce = R"doc()doc"; + + +static const char* __doc_gr_block_set_relative_rate_0 = R"doc()doc"; + + +static const char* __doc_gr_block_set_inverse_relative_rate = R"doc()doc"; + + +static const char* __doc_gr_block_set_relative_rate_1 = R"doc()doc"; + + +static const char* __doc_gr_block_relative_rate = R"doc()doc"; + + +static const char* __doc_gr_block_relative_rate_i = R"doc()doc"; + + +static const char* __doc_gr_block_relative_rate_d = R"doc()doc"; + + +static const char* __doc_gr_block_mp_relative_rate = R"doc()doc"; + + +static const char* __doc_gr_block_fixed_rate_ninput_to_noutput = R"doc()doc"; + + +static const char* __doc_gr_block_fixed_rate_noutput_to_ninput = R"doc()doc"; + + +static const char* __doc_gr_block_nitems_read = R"doc()doc"; + + +static const char* __doc_gr_block_nitems_written = R"doc()doc"; + + +static const char* __doc_gr_block_tag_propagation_policy = R"doc()doc"; + + +static const char* __doc_gr_block_set_tag_propagation_policy = R"doc()doc"; + + +static const char* __doc_gr_block_min_noutput_items = R"doc()doc"; + + +static const char* __doc_gr_block_set_min_noutput_items = R"doc()doc"; + + +static const char* __doc_gr_block_max_noutput_items = R"doc()doc"; + + +static const char* __doc_gr_block_set_max_noutput_items = R"doc()doc"; + + +static const char* __doc_gr_block_unset_max_noutput_items = R"doc()doc"; + + +static const char* __doc_gr_block_is_set_max_noutput_items = R"doc()doc"; + + +static const char* __doc_gr_block_expand_minmax_buffer = R"doc()doc"; + + +static const char* __doc_gr_block_max_output_buffer = R"doc()doc"; + + +static const char* __doc_gr_block_set_max_output_buffer_0 = R"doc()doc"; + + +static const char* __doc_gr_block_set_max_output_buffer_1 = R"doc()doc"; + + +static const char* __doc_gr_block_min_output_buffer = R"doc()doc"; + + +static const char* __doc_gr_block_set_min_output_buffer_0 = R"doc()doc"; + + +static const char* __doc_gr_block_set_min_output_buffer_1 = R"doc()doc"; + + +static const char* __doc_gr_block_pc_noutput_items = R"doc()doc"; + + +static const char* __doc_gr_block_pc_noutput_items_avg = R"doc()doc"; + + +static const char* __doc_gr_block_pc_noutput_items_var = R"doc()doc"; + + +static const char* __doc_gr_block_pc_nproduced = R"doc()doc"; + + +static const char* __doc_gr_block_pc_nproduced_avg = R"doc()doc"; + + +static const char* __doc_gr_block_pc_nproduced_var = R"doc()doc"; + + +static const char* __doc_gr_block_pc_input_buffers_full_0 = R"doc()doc"; + + +static const char* __doc_gr_block_pc_input_buffers_full_avg_0 = R"doc()doc"; + + +static const char* __doc_gr_block_pc_input_buffers_full_var_0 = R"doc()doc"; + + +static const char* __doc_gr_block_pc_input_buffers_full_1 = R"doc()doc"; + + +static const char* __doc_gr_block_pc_input_buffers_full_avg_1 = R"doc()doc"; + + +static const char* __doc_gr_block_pc_input_buffers_full_var_1 = R"doc()doc"; + + +static const char* __doc_gr_block_pc_output_buffers_full_0 = R"doc()doc"; + + +static const char* __doc_gr_block_pc_output_buffers_full_avg_0 = R"doc()doc"; + + +static const char* __doc_gr_block_pc_output_buffers_full_var_0 = R"doc()doc"; + + +static const char* __doc_gr_block_pc_output_buffers_full_1 = R"doc()doc"; + + +static const char* __doc_gr_block_pc_output_buffers_full_avg_1 = R"doc()doc"; + + +static const char* __doc_gr_block_pc_output_buffers_full_var_1 = R"doc()doc"; + + +static const char* __doc_gr_block_pc_work_time = R"doc()doc"; + + +static const char* __doc_gr_block_pc_work_time_avg = R"doc()doc"; + + +static const char* __doc_gr_block_pc_work_time_var = R"doc()doc"; + + +static const char* __doc_gr_block_pc_work_time_total = R"doc()doc"; + + +static const char* __doc_gr_block_pc_throughput_avg = R"doc()doc"; + + +static const char* __doc_gr_block_reset_perf_counters = R"doc()doc"; + + +static const char* __doc_gr_block_setup_pc_rpc = R"doc()doc"; + + +static const char* __doc_gr_block_is_pc_rpc_set = R"doc()doc"; + + +static const char* __doc_gr_block_no_pc_rpc = R"doc()doc"; + + +static const char* __doc_gr_block_set_processor_affinity = R"doc()doc"; + + +static const char* __doc_gr_block_unset_processor_affinity = R"doc()doc"; + + +static const char* __doc_gr_block_processor_affinity = R"doc()doc"; + + +static const char* __doc_gr_block_active_thread_priority = R"doc()doc"; + + +static const char* __doc_gr_block_thread_priority = R"doc()doc"; + + +static const char* __doc_gr_block_set_thread_priority = R"doc()doc"; + + +static const char* __doc_gr_block_update_rate = R"doc()doc"; + + +static const char* __doc_gr_block_system_handler = R"doc()doc"; + + +static const char* __doc_gr_block_set_log_level = R"doc()doc"; + + +static const char* __doc_gr_block_log_level = R"doc()doc"; + + +static const char* __doc_gr_block_finished = R"doc()doc"; + + +static const char* __doc_gr_block_detail = R"doc()doc"; + + +static const char* __doc_gr_block_set_detail = R"doc()doc"; + + +static const char* __doc_gr_block_notify_msg_neighbors = R"doc()doc"; + + +static const char* __doc_gr_block_clear_finished = R"doc()doc"; + + +static const char* __doc_gr_block_identifier = R"doc()doc"; + + +static const char* __doc_gr_cast_to_block_sptr = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/buffer_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/buffer_pydoc_template.h new file mode 100644 index 0000000000..72aec93fa9 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/buffer_pydoc_template.h @@ -0,0 +1,144 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_buffer = R"doc()doc"; + + +static const char* __doc_gr_buffer_space_available = R"doc()doc"; + + +static const char* __doc_gr_buffer_bufsize = R"doc()doc"; + + +static const char* __doc_gr_buffer_base = R"doc()doc"; + + +static const char* __doc_gr_buffer_write_pointer = R"doc()doc"; + + +static const char* __doc_gr_buffer_update_write_pointer = R"doc()doc"; + + +static const char* __doc_gr_buffer_set_done = R"doc()doc"; + + +static const char* __doc_gr_buffer_done = R"doc()doc"; + + +static const char* __doc_gr_buffer_link = R"doc()doc"; + + +static const char* __doc_gr_buffer_nreaders = R"doc()doc"; + + +static const char* __doc_gr_buffer_reader = R"doc()doc"; + + +static const char* __doc_gr_buffer_mutex = R"doc()doc"; + + +static const char* __doc_gr_buffer_nitems_written = R"doc()doc"; + + +static const char* __doc_gr_buffer_reset_nitem_counter = R"doc()doc"; + + +static const char* __doc_gr_buffer_get_sizeof_item = R"doc()doc"; + + +static const char* __doc_gr_buffer_add_item_tag = R"doc()doc"; + + +static const char* __doc_gr_buffer_remove_item_tag = R"doc()doc"; + + +static const char* __doc_gr_buffer_prune_tags = R"doc()doc"; + + +static const char* __doc_gr_buffer_get_tags_begin = R"doc()doc"; + + +static const char* __doc_gr_buffer_get_tags_end = R"doc()doc"; + + +static const char* __doc_gr_buffer_get_tags_lower_bound = R"doc()doc"; + + +static const char* __doc_gr_buffer_get_tags_upper_bound = R"doc()doc"; + + +// static const char *__doc_gr_buffer_reader = R"doc()doc"; + + +static const char* __doc_gr_buffer_reader_buffer_reader = R"doc()doc"; + + +static const char* __doc_gr_buffer_reader_declare_sample_delay = R"doc()doc"; + + +static const char* __doc_gr_buffer_reader_sample_delay = R"doc()doc"; + + +static const char* __doc_gr_buffer_reader_items_available = R"doc()doc"; + + +static const char* __doc_gr_buffer_reader_buffer = R"doc()doc"; + + +static const char* __doc_gr_buffer_reader_max_possible_items_available = R"doc()doc"; + + +static const char* __doc_gr_buffer_reader_read_pointer = R"doc()doc"; + + +static const char* __doc_gr_buffer_reader_update_read_pointer = R"doc()doc"; + + +static const char* __doc_gr_buffer_reader_set_done = R"doc()doc"; + + +static const char* __doc_gr_buffer_reader_done = R"doc()doc"; + + +static const char* __doc_gr_buffer_reader_mutex = R"doc()doc"; + + +static const char* __doc_gr_buffer_reader_nitems_read = R"doc()doc"; + + +static const char* __doc_gr_buffer_reader_reset_nitem_counter = R"doc()doc"; + + +static const char* __doc_gr_buffer_reader_get_sizeof_item = R"doc()doc"; + + +static const char* __doc_gr_buffer_reader_link = R"doc()doc"; + + +static const char* __doc_gr_buffer_reader_get_tags_in_range = R"doc()doc"; + + +static const char* __doc_gr_make_buffer = R"doc()doc"; + + +static const char* __doc_gr_buffer_add_reader = R"doc()doc"; + + +static const char* __doc_gr_buffer_ncurrently_allocated = R"doc()doc"; + + +static const char* __doc_gr_buffer_reader_ncurrently_allocated = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/constants_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/constants_pydoc_template.h new file mode 100644 index 0000000000..4ac45ae049 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/constants_pydoc_template.h @@ -0,0 +1,51 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_prefix = R"doc()doc"; + + +static const char* __doc_gr_sysconfdir = R"doc()doc"; + + +static const char* __doc_gr_prefsdir = R"doc()doc"; + + +static const char* __doc_gr_build_date = R"doc()doc"; + + +static const char* __doc_gr_version = R"doc()doc"; + + +static const char* __doc_gr_major_version = R"doc()doc"; + + +static const char* __doc_gr_api_version = R"doc()doc"; + + +static const char* __doc_gr_minor_version = R"doc()doc"; + + +static const char* __doc_gr_c_compiler = R"doc()doc"; + + +static const char* __doc_gr_cxx_compiler = R"doc()doc"; + + +static const char* __doc_gr_compiler_flags = R"doc()doc"; + + +static const char* __doc_gr_build_time_enabled_components = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/endianness_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/endianness_pydoc_template.h new file mode 100644 index 0000000000..a17028c0e7 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/endianness_pydoc_template.h @@ -0,0 +1,15 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/expj_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/expj_pydoc_template.h new file mode 100644 index 0000000000..a17028c0e7 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/expj_pydoc_template.h @@ -0,0 +1,15 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/flowgraph_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/flowgraph_pydoc_template.h new file mode 100644 index 0000000000..ff54686a4a --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/flowgraph_pydoc_template.h @@ -0,0 +1,156 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_flowgraph = R"doc()doc"; + + +static const char* __doc_gr_flowgraph_flowgraph = R"doc()doc"; + + +static const char* __doc_gr_flowgraph_connect_0 = R"doc()doc"; + + +static const char* __doc_gr_flowgraph_disconnect_0 = R"doc()doc"; + + +static const char* __doc_gr_flowgraph_connect_1 = R"doc()doc"; + + +static const char* __doc_gr_flowgraph_disconnect_1 = R"doc()doc"; + + +static const char* __doc_gr_flowgraph_connect_2 = R"doc()doc"; + + +static const char* __doc_gr_flowgraph_disconnect_2 = R"doc()doc"; + + +static const char* __doc_gr_flowgraph_validate = R"doc()doc"; + + +static const char* __doc_gr_flowgraph_clear = R"doc()doc"; + + +static const char* __doc_gr_flowgraph_edges = R"doc()doc"; + + +static const char* __doc_gr_flowgraph_msg_edges = R"doc()doc"; + + +static const char* __doc_gr_flowgraph_calc_used_blocks = R"doc()doc"; + + +static const char* __doc_gr_flowgraph_topological_sort = R"doc()doc"; + + +static const char* __doc_gr_flowgraph_partition = R"doc()doc"; + + +static const char* __doc_gr_endpoint = R"doc()doc"; + + +static const char* __doc_gr_endpoint_endpoint_0 = R"doc()doc"; + + +static const char* __doc_gr_endpoint_endpoint_1 = R"doc()doc"; + + +static const char* __doc_gr_endpoint_endpoint_2 = R"doc()doc"; + + +static const char* __doc_gr_endpoint_block = R"doc()doc"; + + +static const char* __doc_gr_endpoint_port = R"doc()doc"; + + +static const char* __doc_gr_endpoint_identifier = R"doc()doc"; + + +static const char* __doc_gr_msg_endpoint = R"doc()doc"; + + +static const char* __doc_gr_msg_endpoint_msg_endpoint_0 = R"doc()doc"; + + +static const char* __doc_gr_msg_endpoint_msg_endpoint_1 = R"doc()doc"; + + +static const char* __doc_gr_msg_endpoint_msg_endpoint_2 = R"doc()doc"; + + +static const char* __doc_gr_msg_endpoint_block = R"doc()doc"; + + +static const char* __doc_gr_msg_endpoint_port = R"doc()doc"; + + +static const char* __doc_gr_msg_endpoint_is_hier = R"doc()doc"; + + +static const char* __doc_gr_msg_endpoint_set_hier = R"doc()doc"; + + +static const char* __doc_gr_msg_endpoint_identifier = R"doc()doc"; + + +static const char* __doc_gr_edge = R"doc()doc"; + + +static const char* __doc_gr_edge_edge_0 = R"doc()doc"; + + +static const char* __doc_gr_edge_edge_1 = R"doc()doc"; + + +static const char* __doc_gr_edge_edge_2 = R"doc()doc"; + + +static const char* __doc_gr_edge_src = R"doc()doc"; + + +static const char* __doc_gr_edge_dst = R"doc()doc"; + + +static const char* __doc_gr_edge_identifier = R"doc()doc"; + + +static const char* __doc_gr_msg_edge = R"doc()doc"; + + +static const char* __doc_gr_msg_edge_msg_edge_0 = R"doc()doc"; + + +static const char* __doc_gr_msg_edge_msg_edge_1 = R"doc()doc"; + + +static const char* __doc_gr_msg_edge_msg_edge_2 = R"doc()doc"; + + +static const char* __doc_gr_msg_edge_src = R"doc()doc"; + + +static const char* __doc_gr_msg_edge_dst = R"doc()doc"; + + +static const char* __doc_gr_msg_edge_identifier = R"doc()doc"; + + +static const char* __doc_gr_make_flowgraph = R"doc()doc"; + + +static const char* __doc_gr_dot_graph_fg = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/fxpt_nco_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/fxpt_nco_pydoc_template.h new file mode 100644 index 0000000000..a3724fc645 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/fxpt_nco_pydoc_template.h @@ -0,0 +1,84 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_fxpt_nco = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_fxpt_nco_0 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_fxpt_nco_1 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_set_phase = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_adjust_phase = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_set_freq = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_adjust_freq = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_step_0 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_step_1 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_get_phase = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_get_freq = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_sincos_0 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_sincos_1 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_sin_0 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_cos_0 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_sin_1 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_cos_1 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_sin_2 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_cos_2 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_sin_3 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_cos_3 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_cos_4 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_nco_sin_4 = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/fxpt_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/fxpt_pydoc_template.h new file mode 100644 index 0000000000..1631008d09 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/fxpt_pydoc_template.h @@ -0,0 +1,39 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_fxpt = R"doc()doc"; + + +static const char* __doc_gr_fxpt_fxpt_0 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_fxpt_1 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_float_to_fixed = R"doc()doc"; + + +static const char* __doc_gr_fxpt_fixed_to_float = R"doc()doc"; + + +static const char* __doc_gr_fxpt_sin = R"doc()doc"; + + +static const char* __doc_gr_fxpt_cos = R"doc()doc"; + + +static const char* __doc_gr_fxpt_sincos = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/fxpt_vco_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/fxpt_vco_pydoc_template.h new file mode 100644 index 0000000000..1d8b91e973 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/fxpt_vco_pydoc_template.h @@ -0,0 +1,48 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_fxpt_vco = R"doc()doc"; + + +static const char* __doc_gr_fxpt_vco_fxpt_vco_0 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_vco_fxpt_vco_1 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_vco_set_phase = R"doc()doc"; + + +static const char* __doc_gr_fxpt_vco_adjust_phase = R"doc()doc"; + + +static const char* __doc_gr_fxpt_vco_get_phase = R"doc()doc"; + + +static const char* __doc_gr_fxpt_vco_sincos_0 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_vco_sincos_1 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_vco_cos_0 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_vco_cos_1 = R"doc()doc"; + + +static const char* __doc_gr_fxpt_vco_sin = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/hier_block2_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/hier_block2_pydoc_template.h new file mode 100644 index 0000000000..6c51aba45d --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/hier_block2_pydoc_template.h @@ -0,0 +1,126 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_hier_block2 = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_self = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_connect_0 = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_connect_1 = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_msg_connect_0 = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_msg_connect_1 = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_msg_disconnect_0 = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_msg_disconnect_1 = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_disconnect_0 = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_disconnect_1 = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_disconnect_all = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_lock = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_unlock = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_max_output_buffer = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_set_max_output_buffer_0 = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_set_max_output_buffer_1 = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_min_output_buffer = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_set_min_output_buffer_0 = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_set_min_output_buffer_1 = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_flatten = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_to_hier_block2 = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_has_msg_port = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_message_port_is_hier = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_message_port_is_hier_in = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_message_port_is_hier_out = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_message_port_register_hier_in = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_message_port_register_hier_out = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_set_processor_affinity = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_unset_processor_affinity = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_processor_affinity = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_set_log_level = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_log_level = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_all_min_output_buffer_p = R"doc()doc"; + + +static const char* __doc_gr_hier_block2_all_max_output_buffer_p = R"doc()doc"; + + +static const char* __doc_gr_make_hier_block2 = R"doc()doc"; + + +static const char* __doc_gr_dot_graph = R"doc()doc"; + + +static const char* __doc_gr_cast_to_hier_block2_sptr = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/high_res_timer_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/high_res_timer_pydoc_template.h new file mode 100644 index 0000000000..55409413f7 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/high_res_timer_pydoc_template.h @@ -0,0 +1,27 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_high_res_timer_now = R"doc()doc"; + + +static const char* __doc_gr_high_res_timer_now_perfmon = R"doc()doc"; + + +static const char* __doc_gr_high_res_timer_tps = R"doc()doc"; + + +static const char* __doc_gr_high_res_timer_epoch = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/io_signature_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/io_signature_pydoc_template.h new file mode 100644 index 0000000000..643f6a3653 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/io_signature_pydoc_template.h @@ -0,0 +1,45 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_io_signature = R"doc()doc"; + + +static const char* __doc_gr_io_signature_io_signature = R"doc()doc"; + + +static const char* __doc_gr_io_signature_make = R"doc()doc"; + + +static const char* __doc_gr_io_signature_make2 = R"doc()doc"; + + +static const char* __doc_gr_io_signature_make3 = R"doc()doc"; + + +static const char* __doc_gr_io_signature_makev = R"doc()doc"; + + +static const char* __doc_gr_io_signature_min_streams = R"doc()doc"; + + +static const char* __doc_gr_io_signature_max_streams = R"doc()doc"; + + +static const char* __doc_gr_io_signature_sizeof_stream_item = R"doc()doc"; + + +static const char* __doc_gr_io_signature_sizeof_stream_items = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/logger_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/logger_pydoc_template.h new file mode 100644 index 0000000000..84d2e5e9cf --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/logger_pydoc_template.h @@ -0,0 +1,147 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_logger = R"doc()doc"; + + +static const char* __doc_gr_logger_logger_0 = R"doc()doc"; + + +static const char* __doc_gr_logger_logger_1 = R"doc()doc"; + + +static const char* __doc_gr_logger_set_level = R"doc()doc"; + + +static const char* __doc_gr_logger_get_level = R"doc()doc"; + + +static const char* __doc_gr_logger_debug = R"doc()doc"; + + +static const char* __doc_gr_logger_info = R"doc()doc"; + + +static const char* __doc_gr_logger_notice = R"doc()doc"; + + +static const char* __doc_gr_logger_warn = R"doc()doc"; + + +static const char* __doc_gr_logger_error = R"doc()doc"; + + +static const char* __doc_gr_logger_crit = R"doc()doc"; + + +static const char* __doc_gr_logger_alert = R"doc()doc"; + + +static const char* __doc_gr_logger_fatal = R"doc()doc"; + + +static const char* __doc_gr_logger_emerg = R"doc()doc"; + + +static const char* __doc_gr_logger_errorIF = R"doc()doc"; + + +static const char* __doc_gr_logger_log_assert = R"doc()doc"; + + +static const char* __doc_gr_logger_add_console_appender = R"doc()doc"; + + +static const char* __doc_gr_logger_set_console_appender = R"doc()doc"; + + +static const char* __doc_gr_logger_add_file_appender = R"doc()doc"; + + +static const char* __doc_gr_logger_set_file_appender = R"doc()doc"; + + +static const char* __doc_gr_logger_add_rollingfile_appender = R"doc()doc"; + + +static const char* __doc_gr_logger_config = R"doc()doc"; + + +static const char* __doc_gr_logger_config_get_filename = R"doc()doc"; + + +static const char* __doc_gr_logger_config_get_watch_period = R"doc()doc"; + + +static const char* __doc_gr_logger_config_load_config = R"doc()doc"; + + +static const char* __doc_gr_logger_config_stop_watch = R"doc()doc"; + + +static const char* __doc_gr_logger_config_reset_config = R"doc()doc"; + + +static const char* __doc_gr_configure_default_loggers = R"doc()doc"; + + +static const char* __doc_gr_update_logger_alias = R"doc()doc"; + + +static const char* __doc_gr_logger_get_logger = R"doc()doc"; + + +static const char* __doc_gr_logger_load_config = R"doc()doc"; + + +static const char* __doc_gr_logger_reset_config = R"doc()doc"; + + +static const char* __doc_gr_logger_set_level_0 = R"doc()doc"; + + +static const char* __doc_gr_logger_set_level_1 = R"doc()doc"; + + +static const char* __doc_gr_logger_get_level_0 = R"doc()doc"; + + +static const char* __doc_gr_logger_get_level_1 = R"doc()doc"; + + +static const char* __doc_gr_logger_add_appender = R"doc()doc"; + + +static const char* __doc_gr_logger_set_appender = R"doc()doc"; + + +// static const char *__doc_gr_logger_add_console_appender = R"doc()doc"; + + +// static const char *__doc_gr_logger_set_console_appender = R"doc()doc"; + + +// static const char *__doc_gr_logger_add_file_appender = R"doc()doc"; + + +// static const char *__doc_gr_logger_set_file_appender = R"doc()doc"; + + +// static const char *__doc_gr_logger_add_rollingfile_appender = R"doc()doc"; + + +static const char* __doc_gr_logger_get_logger_names = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/math_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/math_pydoc_template.h new file mode 100644 index 0000000000..af352fe0b8 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/math_pydoc_template.h @@ -0,0 +1,75 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_fast_cc_multiply = R"doc()doc"; + + +static const char* __doc_gr_is_power_of_2 = R"doc()doc"; + + +static const char* __doc_gr_fast_atan2f_0 = R"doc()doc"; + + +static const char* __doc_gr_fast_atan2f_1 = R"doc()doc"; + + +static const char* __doc_gr_branchless_clip = R"doc()doc"; + + +static const char* __doc_gr_clip = R"doc()doc"; + + +static const char* __doc_gr_binary_slicer = R"doc()doc"; + + +static const char* __doc_gr_quad_45deg_slicer_0 = R"doc()doc"; + + +static const char* __doc_gr_quad_0deg_slicer_0 = R"doc()doc"; + + +static const char* __doc_gr_quad_45deg_slicer_1 = R"doc()doc"; + + +static const char* __doc_gr_quad_0deg_slicer_1 = R"doc()doc"; + + +static const char* __doc_gr_branchless_binary_slicer = R"doc()doc"; + + +static const char* __doc_gr_branchless_quad_0deg_slicer_0 = R"doc()doc"; + + +static const char* __doc_gr_branchless_quad_0deg_slicer_1 = R"doc()doc"; + + +static const char* __doc_gr_branchless_quad_45deg_slicer_0 = R"doc()doc"; + + +static const char* __doc_gr_branchless_quad_45deg_slicer_1 = R"doc()doc"; + + +static const char* __doc_gr_p2_round_down = R"doc()doc"; + + +static const char* __doc_gr_p2_round_up = R"doc()doc"; + + +static const char* __doc_gr_p2_modulo = R"doc()doc"; + + +static const char* __doc_gr_p2_modulo_neg = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/message_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/message_pydoc_template.h new file mode 100644 index 0000000000..5c9a174a90 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/message_pydoc_template.h @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_message = R"doc()doc"; + + +static const char* __doc_gr_message_message = R"doc()doc"; + + +static const char* __doc_gr_message_make = R"doc()doc"; + + +static const char* __doc_gr_message_make_from_string = R"doc()doc"; + + +static const char* __doc_gr_message_type = R"doc()doc"; + + +static const char* __doc_gr_message_arg1 = R"doc()doc"; + + +static const char* __doc_gr_message_arg2 = R"doc()doc"; + + +static const char* __doc_gr_message_set_type = R"doc()doc"; + + +static const char* __doc_gr_message_set_arg1 = R"doc()doc"; + + +static const char* __doc_gr_message_set_arg2 = R"doc()doc"; + + +static const char* __doc_gr_message_msg = R"doc()doc"; + + +static const char* __doc_gr_message_to_string = R"doc()doc"; + + +static const char* __doc_gr_message_ncurrently_allocated = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/msg_accepter_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/msg_accepter_pydoc_template.h new file mode 100644 index 0000000000..fee326c6a3 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/msg_accepter_pydoc_template.h @@ -0,0 +1,27 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_msg_accepter = R"doc()doc"; + + +static const char* __doc_gr_msg_accepter_msg_accepter_0 = R"doc()doc"; + + +static const char* __doc_gr_msg_accepter_msg_accepter_1 = R"doc()doc"; + + +static const char* __doc_gr_msg_accepter_post = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/msg_handler_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/msg_handler_pydoc_template.h new file mode 100644 index 0000000000..b68f16ec3b --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/msg_handler_pydoc_template.h @@ -0,0 +1,27 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_msg_handler = R"doc()doc"; + + +static const char* __doc_gr_msg_handler_msg_handler_0 = R"doc()doc"; + + +static const char* __doc_gr_msg_handler_msg_handler_1 = R"doc()doc"; + + +static const char* __doc_gr_msg_handler_handle = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/msg_queue_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/msg_queue_pydoc_template.h new file mode 100644 index 0000000000..6626bef81e --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/msg_queue_pydoc_template.h @@ -0,0 +1,51 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_msg_queue = R"doc()doc"; + + +static const char* __doc_gr_msg_queue_msg_queue = R"doc()doc"; + + +static const char* __doc_gr_msg_queue_make = R"doc()doc"; + + +static const char* __doc_gr_msg_queue_handle = R"doc()doc"; + + +static const char* __doc_gr_msg_queue_insert_tail = R"doc()doc"; + + +static const char* __doc_gr_msg_queue_delete_head = R"doc()doc"; + + +static const char* __doc_gr_msg_queue_delete_head_nowait = R"doc()doc"; + + +static const char* __doc_gr_msg_queue_flush = R"doc()doc"; + + +static const char* __doc_gr_msg_queue_empty_p = R"doc()doc"; + + +static const char* __doc_gr_msg_queue_full_p = R"doc()doc"; + + +static const char* __doc_gr_msg_queue_count = R"doc()doc"; + + +static const char* __doc_gr_msg_queue_limit = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/nco_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/nco_pydoc_template.h new file mode 100644 index 0000000000..a17028c0e7 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/nco_pydoc_template.h @@ -0,0 +1,15 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/prefs_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/prefs_pydoc_template.h new file mode 100644 index 0000000000..61b0e0f8fb --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/prefs_pydoc_template.h @@ -0,0 +1,63 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_prefs = R"doc()doc"; + + +static const char* __doc_gr_prefs_prefs = R"doc()doc"; + + +static const char* __doc_gr_prefs_singleton = R"doc()doc"; + + +static const char* __doc_gr_prefs_add_config_file = R"doc()doc"; + + +static const char* __doc_gr_prefs_to_string = R"doc()doc"; + + +static const char* __doc_gr_prefs_save = R"doc()doc"; + + +static const char* __doc_gr_prefs_has_section = R"doc()doc"; + + +static const char* __doc_gr_prefs_has_option = R"doc()doc"; + + +static const char* __doc_gr_prefs_get_string = R"doc()doc"; + + +static const char* __doc_gr_prefs_set_string = R"doc()doc"; + + +static const char* __doc_gr_prefs_get_bool = R"doc()doc"; + + +static const char* __doc_gr_prefs_set_bool = R"doc()doc"; + + +static const char* __doc_gr_prefs_get_long = R"doc()doc"; + + +static const char* __doc_gr_prefs_set_long = R"doc()doc"; + + +static const char* __doc_gr_prefs_get_double = R"doc()doc"; + + +static const char* __doc_gr_prefs_set_double = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/random_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/random_pydoc_template.h new file mode 100644 index 0000000000..71fdb84d39 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/random_pydoc_template.h @@ -0,0 +1,51 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_random = R"doc()doc"; + + +static const char* __doc_gr_random_random_0 = R"doc()doc"; + + +static const char* __doc_gr_random_random_1 = R"doc()doc"; + + +static const char* __doc_gr_random_reseed = R"doc()doc"; + + +static const char* __doc_gr_random_set_integer_limits = R"doc()doc"; + + +static const char* __doc_gr_random_ran_int = R"doc()doc"; + + +static const char* __doc_gr_random_ran1 = R"doc()doc"; + + +static const char* __doc_gr_random_gasdev = R"doc()doc"; + + +static const char* __doc_gr_random_laplacian = R"doc()doc"; + + +static const char* __doc_gr_random_rayleigh = R"doc()doc"; + + +static const char* __doc_gr_random_impulse = R"doc()doc"; + + +static const char* __doc_gr_random_rayleigh_complex = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/realtime_impl_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/realtime_impl_pydoc_template.h new file mode 100644 index 0000000000..88724212e3 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/realtime_impl_pydoc_template.h @@ -0,0 +1,39 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_impl_rt_sched_param = R"doc()doc"; + + +static const char* __doc_gr_impl_rt_sched_param_rt_sched_param_0 = R"doc()doc"; + + +static const char* __doc_gr_impl_rt_sched_param_rt_sched_param_1 = R"doc()doc"; + + +static const char* __doc_gr_impl_rt_sched_param_rt_sched_param_2 = R"doc()doc"; + + +static const char* __doc_gr_impl_rt_priority_min = R"doc()doc"; + + +static const char* __doc_gr_impl_rt_priority_max = R"doc()doc"; + + +static const char* __doc_gr_impl_rt_priority_default = R"doc()doc"; + + +static const char* __doc_gr_impl_enable_realtime_scheduling = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/realtime_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/realtime_pydoc_template.h new file mode 100644 index 0000000000..91a9607ae2 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/realtime_pydoc_template.h @@ -0,0 +1,18 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_enable_realtime_scheduling = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/rpccallbackregister_base_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/rpccallbackregister_base_pydoc_template.h new file mode 100644 index 0000000000..a17028c0e7 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/rpccallbackregister_base_pydoc_template.h @@ -0,0 +1,15 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/rpcmanager_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/rpcmanager_pydoc_template.h new file mode 100644 index 0000000000..a17028c0e7 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/rpcmanager_pydoc_template.h @@ -0,0 +1,15 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/rpcregisterhelpers_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/rpcregisterhelpers_pydoc_template.h new file mode 100644 index 0000000000..a17028c0e7 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/rpcregisterhelpers_pydoc_template.h @@ -0,0 +1,15 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/rpcserver_aggregator_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/rpcserver_aggregator_pydoc_template.h new file mode 100644 index 0000000000..a17028c0e7 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/rpcserver_aggregator_pydoc_template.h @@ -0,0 +1,15 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/rpcserver_base_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/rpcserver_base_pydoc_template.h new file mode 100644 index 0000000000..a17028c0e7 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/rpcserver_base_pydoc_template.h @@ -0,0 +1,15 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/rpcserver_booter_aggregator_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/rpcserver_booter_aggregator_pydoc_template.h new file mode 100644 index 0000000000..a17028c0e7 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/rpcserver_booter_aggregator_pydoc_template.h @@ -0,0 +1,15 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/runtime_types_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/runtime_types_pydoc_template.h new file mode 100644 index 0000000000..a17028c0e7 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/runtime_types_pydoc_template.h @@ -0,0 +1,15 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/sincos_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/sincos_pydoc_template.h new file mode 100644 index 0000000000..6d430b5983 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/sincos_pydoc_template.h @@ -0,0 +1,21 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_sincos = R"doc()doc"; + + +static const char* __doc_gr_sincosf = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/sptr_magic_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/sptr_magic_pydoc_template.h new file mode 100644 index 0000000000..a17028c0e7 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/sptr_magic_pydoc_template.h @@ -0,0 +1,15 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/sync_block_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/sync_block_pydoc_template.h new file mode 100644 index 0000000000..6034878624 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/sync_block_pydoc_template.h @@ -0,0 +1,33 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_sync_block = R"doc()doc"; + + +static const char* __doc_gr_sync_block_work = R"doc()doc"; + + +static const char* __doc_gr_sync_block_forecast = R"doc()doc"; + + +static const char* __doc_gr_sync_block_general_work = R"doc()doc"; + + +static const char* __doc_gr_sync_block_fixed_rate_ninput_to_noutput = R"doc()doc"; + + +static const char* __doc_gr_sync_block_fixed_rate_noutput_to_ninput = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/sync_decimator_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/sync_decimator_pydoc_template.h new file mode 100644 index 0000000000..f327d9f66e --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/sync_decimator_pydoc_template.h @@ -0,0 +1,36 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_sync_decimator = R"doc()doc"; + + +static const char* __doc_gr_sync_decimator_decimation = R"doc()doc"; + + +static const char* __doc_gr_sync_decimator_set_decimation = R"doc()doc"; + + +static const char* __doc_gr_sync_decimator_forecast = R"doc()doc"; + + +static const char* __doc_gr_sync_decimator_general_work = R"doc()doc"; + + +static const char* __doc_gr_sync_decimator_fixed_rate_ninput_to_noutput = R"doc()doc"; + + +static const char* __doc_gr_sync_decimator_fixed_rate_noutput_to_ninput = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/sync_interpolator_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/sync_interpolator_pydoc_template.h new file mode 100644 index 0000000000..3876790dbd --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/sync_interpolator_pydoc_template.h @@ -0,0 +1,36 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_sync_interpolator = R"doc()doc"; + + +static const char* __doc_gr_sync_interpolator_interpolation = R"doc()doc"; + + +static const char* __doc_gr_sync_interpolator_set_interpolation = R"doc()doc"; + + +static const char* __doc_gr_sync_interpolator_forecast = R"doc()doc"; + + +static const char* __doc_gr_sync_interpolator_general_work = R"doc()doc"; + + +static const char* __doc_gr_sync_interpolator_fixed_rate_ninput_to_noutput = R"doc()doc"; + + +static const char* __doc_gr_sync_interpolator_fixed_rate_noutput_to_ninput = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/sys_paths_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/sys_paths_pydoc_template.h new file mode 100644 index 0000000000..28a857d4cd --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/sys_paths_pydoc_template.h @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_tmp_path = R"doc()doc"; + + +static const char* __doc_gr_appdata_path = R"doc()doc"; + + +static const char* __doc_gr_userconf_path = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/tag_checker_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/tag_checker_pydoc_template.h new file mode 100644 index 0000000000..29d19d8e0f --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/tag_checker_pydoc_template.h @@ -0,0 +1,27 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_tag_checker = R"doc()doc"; + + +static const char* __doc_gr_tag_checker_tag_checker_0 = R"doc()doc"; + + +static const char* __doc_gr_tag_checker_tag_checker_1 = R"doc()doc"; + + +static const char* __doc_gr_tag_checker_get_tags = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/tagged_stream_block_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/tagged_stream_block_pydoc_template.h new file mode 100644 index 0000000000..efbd93e749 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/tagged_stream_block_pydoc_template.h @@ -0,0 +1,30 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_tagged_stream_block = R"doc()doc"; + + +static const char* __doc_gr_tagged_stream_block_forecast = R"doc()doc"; + + +static const char* __doc_gr_tagged_stream_block_check_topology = R"doc()doc"; + + +static const char* __doc_gr_tagged_stream_block_general_work = R"doc()doc"; + + +static const char* __doc_gr_tagged_stream_block_work = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/tags_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/tags_pydoc_template.h new file mode 100644 index 0000000000..43981ff697 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/tags_pydoc_template.h @@ -0,0 +1,27 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_tag_t = R"doc()doc"; + + +static const char* __doc_gr_tag_t_tag_t_0 = R"doc()doc"; + + +static const char* __doc_gr_tag_t_tag_t_1 = R"doc()doc"; + + +static const char* __doc_gr_tag_t_offset_compare = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/thrift_application_base_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/thrift_application_base_pydoc_template.h new file mode 100644 index 0000000000..a17028c0e7 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/thrift_application_base_pydoc_template.h @@ -0,0 +1,15 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/top_block_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/top_block_pydoc_template.h new file mode 100644 index 0000000000..e93ed7c3ee --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/top_block_pydoc_template.h @@ -0,0 +1,63 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_top_block = R"doc()doc"; + + +static const char* __doc_gr_top_block_run = R"doc()doc"; + + +static const char* __doc_gr_top_block_start = R"doc()doc"; + + +static const char* __doc_gr_top_block_stop = R"doc()doc"; + + +static const char* __doc_gr_top_block_wait = R"doc()doc"; + + +static const char* __doc_gr_top_block_lock = R"doc()doc"; + + +static const char* __doc_gr_top_block_unlock = R"doc()doc"; + + +static const char* __doc_gr_top_block_edge_list = R"doc()doc"; + + +static const char* __doc_gr_top_block_msg_edge_list = R"doc()doc"; + + +static const char* __doc_gr_top_block_dump = R"doc()doc"; + + +static const char* __doc_gr_top_block_max_noutput_items = R"doc()doc"; + + +static const char* __doc_gr_top_block_set_max_noutput_items = R"doc()doc"; + + +static const char* __doc_gr_top_block_to_top_block = R"doc()doc"; + + +static const char* __doc_gr_top_block_setup_rpc = R"doc()doc"; + + +static const char* __doc_gr_make_top_block = R"doc()doc"; + + +static const char* __doc_gr_cast_to_top_block_sptr = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/tpb_detail_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/tpb_detail_pydoc_template.h new file mode 100644 index 0000000000..2d7b4fa793 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/tpb_detail_pydoc_template.h @@ -0,0 +1,36 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ + + +static const char* __doc_gr_tpb_detail = R"doc()doc"; + + +static const char* __doc_gr_tpb_detail_tpb_detail = R"doc()doc"; + + +static const char* __doc_gr_tpb_detail_notify_upstream = R"doc()doc"; + + +static const char* __doc_gr_tpb_detail_notify_downstream = R"doc()doc"; + + +static const char* __doc_gr_tpb_detail_notify_neighbors = R"doc()doc"; + + +static const char* __doc_gr_tpb_detail_notify_msg = R"doc()doc"; + + +static const char* __doc_gr_tpb_detail_clear_changed = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/endianness_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/endianness_python.cc new file mode 100644 index 0000000000..fb07bf5851 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/endianness_python.cc @@ -0,0 +1,27 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/endianness.h> + +void bind_endianness(py::module& m) +{ + + py::enum_<gr::endianness_t>(m, "endianness_t") + .value("GR_MSB_FIRST", gr::GR_MSB_FIRST) // 0 + .value("GR_LSB_FIRST", gr::GR_LSB_FIRST) // 1 + .export_values(); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/expj_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/expj_python.cc new file mode 100644 index 0000000000..0b84b7d4d6 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/expj_python.cc @@ -0,0 +1,20 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/expj.h> + +void bind_expj(py::module& m) {} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/flowgraph_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/flowgraph_python.cc new file mode 100644 index 0000000000..9269bfb810 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/flowgraph_python.cc @@ -0,0 +1,218 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/flowgraph.h> +// pydoc.h is automatically generated in the build directory +#include <flowgraph_pydoc.h> + +void bind_flowgraph(py::module& m) +{ + + using flowgraph = ::gr::flowgraph; + using endpoint = ::gr::endpoint; + using msg_endpoint = ::gr::msg_endpoint; + using edge = ::gr::edge; + using msg_edge = ::gr::msg_edge; + + + py::class_<flowgraph, std::shared_ptr<flowgraph>>(m, "flowgraph", D(flowgraph)) + + .def(py::init<gr::flowgraph const&>(), py::arg("arg0"), D(flowgraph, flowgraph)) + + + .def("connect", + (void (flowgraph::*)(gr::endpoint const&, gr::endpoint const&)) & + flowgraph::connect, + py::arg("src"), + py::arg("dst"), + D(flowgraph, connect, 0)) + + + .def("disconnect", + (void (flowgraph::*)(gr::endpoint const&, gr::endpoint const&)) & + flowgraph::disconnect, + py::arg("src"), + py::arg("dst"), + D(flowgraph, disconnect, 0)) + + + .def("connect", + (void (flowgraph::*)(gr::basic_block_sptr, int, gr::basic_block_sptr, int)) & + flowgraph::connect, + py::arg("src_block"), + py::arg("src_port"), + py::arg("dst_block"), + py::arg("dst_port"), + D(flowgraph, connect, 1)) + + + .def("disconnect", + (void (flowgraph::*)(gr::basic_block_sptr, int, gr::basic_block_sptr, int)) & + flowgraph::disconnect, + py::arg("src_block"), + py::arg("src_port"), + py::arg("dst_block"), + py::arg("dst_port"), + D(flowgraph, disconnect, 1)) + + + .def("connect", + (void (flowgraph::*)(gr::msg_endpoint const&, gr::msg_endpoint const&)) & + flowgraph::connect, + py::arg("src"), + py::arg("dst"), + D(flowgraph, connect, 2)) + + + .def("disconnect", + (void (flowgraph::*)(gr::msg_endpoint const&, gr::msg_endpoint const&)) & + flowgraph::disconnect, + py::arg("src"), + py::arg("dst"), + D(flowgraph, disconnect, 2)) + + + .def("validate", &flowgraph::validate, D(flowgraph, validate)) + + + .def("clear", &flowgraph::clear, D(flowgraph, clear)) + + + .def("edges", &flowgraph::edges, D(flowgraph, edges)) + + + .def("msg_edges", &flowgraph::msg_edges, D(flowgraph, msg_edges)) + + + .def("calc_used_blocks", + &flowgraph::calc_used_blocks, + D(flowgraph, calc_used_blocks)) + + + .def("topological_sort", + &flowgraph::topological_sort, + py::arg("blocks"), + D(flowgraph, topological_sort)) + + + .def("partition", &flowgraph::partition, D(flowgraph, partition)) + + ; + + + py::class_<endpoint, std::shared_ptr<endpoint>>(m, "endpoint", D(endpoint)) + + .def(py::init<>(), D(endpoint, endpoint, 0)) + .def(py::init<gr::basic_block_sptr, int>(), + py::arg("block"), + py::arg("port"), + D(endpoint, endpoint, 1)) + .def(py::init<gr::endpoint const&>(), py::arg("arg0"), D(endpoint, endpoint, 2)) + + + .def("block", &endpoint::block, D(endpoint, block)) + + + .def("port", &endpoint::port, D(endpoint, port)) + + + .def("identifier", &endpoint::identifier, D(endpoint, identifier)) + + ; + + + py::class_<msg_endpoint, std::shared_ptr<msg_endpoint>>( + m, "msg_endpoint", D(msg_endpoint)) + + .def(py::init<>(), D(msg_endpoint, msg_endpoint, 0)) + .def(py::init<gr::basic_block_sptr, pmt::pmt_t, bool>(), + py::arg("block"), + py::arg("port"), + py::arg("is_hier") = false, + D(msg_endpoint, msg_endpoint, 1)) + .def(py::init<gr::msg_endpoint const&>(), + py::arg("arg0"), + D(msg_endpoint, msg_endpoint, 2)) + + + .def("block", &msg_endpoint::block, D(msg_endpoint, block)) + + + .def("port", &msg_endpoint::port, D(msg_endpoint, port)) + + + .def("is_hier", &msg_endpoint::is_hier, D(msg_endpoint, is_hier)) + + + .def("set_hier", &msg_endpoint::set_hier, py::arg("h"), D(msg_endpoint, set_hier)) + + + .def("identifier", &msg_endpoint::identifier, D(msg_endpoint, identifier)) + + ; + + + py::class_<edge, std::shared_ptr<edge>>(m, "edge", D(edge)) + + .def(py::init<>(), D(edge, edge, 0)) + .def(py::init<gr::endpoint const&, gr::endpoint const&>(), + py::arg("src"), + py::arg("dst"), + D(edge, edge, 1)) + .def(py::init<gr::edge const&>(), py::arg("arg0"), D(edge, edge, 2)) + + + .def("src", &edge::src, D(edge, src)) + + + .def("dst", &edge::dst, D(edge, dst)) + + + .def("identifier", &edge::identifier, D(edge, identifier)) + + ; + + + py::class_<msg_edge, std::shared_ptr<msg_edge>>(m, "msg_edge", D(msg_edge)) + + .def(py::init<>(), D(msg_edge, msg_edge, 0)) + .def(py::init<gr::msg_endpoint const&, gr::msg_endpoint const&>(), + py::arg("src"), + py::arg("dst"), + D(msg_edge, msg_edge, 1)) + .def(py::init<gr::msg_edge const&>(), py::arg("arg0"), D(msg_edge, msg_edge, 2)) + + + .def("src", &msg_edge::src, D(msg_edge, src)) + + + .def("dst", &msg_edge::dst, D(msg_edge, dst)) + + + .def("identifier", &msg_edge::identifier, D(msg_edge, identifier)) + + ; + + + m.def("make_flowgraph", &::gr::make_flowgraph, D(make_flowgraph)); + + + // m.def("dot_graph_fg",&::gr::dot_graph_fg, + // py::arg("fg"), + // D(dot_graph_fg) + // ); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/fxpt_nco_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/fxpt_nco_python.cc new file mode 100644 index 0000000000..41055cddba --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/fxpt_nco_python.cc @@ -0,0 +1,153 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/fxpt_nco.h> +// pydoc.h is automatically generated in the build directory +#include <fxpt_nco_pydoc.h> + +void bind_fxpt_nco(py::module& m) +{ + + using fxpt_nco = ::gr::fxpt_nco; + + + py::class_<fxpt_nco, std::shared_ptr<fxpt_nco>>(m, "fxpt_nco", D(fxpt_nco)) + + .def(py::init<>(), D(fxpt_nco, fxpt_nco, 0)) + .def(py::init<gr::fxpt_nco const&>(), py::arg("arg0"), D(fxpt_nco, fxpt_nco, 1)) + + + .def("set_phase", &fxpt_nco::set_phase, py::arg("angle"), D(fxpt_nco, set_phase)) + + + .def("adjust_phase", + &fxpt_nco::adjust_phase, + py::arg("delta_phase"), + D(fxpt_nco, adjust_phase)) + + + .def( + "set_freq", &fxpt_nco::set_freq, py::arg("angle_rate"), D(fxpt_nco, set_freq)) + + + .def("adjust_freq", + &fxpt_nco::adjust_freq, + py::arg("delta_angle_rate"), + D(fxpt_nco, adjust_freq)) + + + .def("step", (void (fxpt_nco::*)()) & fxpt_nco::step, D(fxpt_nco, step, 0)) + + + .def("step", + (void (fxpt_nco::*)(int)) & fxpt_nco::step, + py::arg("n"), + D(fxpt_nco, step, 1)) + + + .def("get_phase", &fxpt_nco::get_phase, D(fxpt_nco, get_phase)) + + + .def("get_freq", &fxpt_nco::get_freq, D(fxpt_nco, get_freq)) + + + .def("sincos", + (void (fxpt_nco::*)(float*, float*) const) & fxpt_nco::sincos, + py::arg("sinx"), + py::arg("cosx"), + D(fxpt_nco, sincos, 0)) + + + .def("sincos", + (void (fxpt_nco::*)(gr_complex*, int, double)) & fxpt_nco::sincos, + py::arg("output"), + py::arg("noutput_items"), + py::arg("ampl") = 1., + D(fxpt_nco, sincos, 1)) + + + .def("sin", + (void (fxpt_nco::*)(float*, int, double)) & fxpt_nco::sin, + py::arg("output"), + py::arg("noutput_items"), + py::arg("ampl") = 1., + D(fxpt_nco, sin, 0)) + + + .def("cos", + (void (fxpt_nco::*)(float*, int, double)) & fxpt_nco::cos, + py::arg("output"), + py::arg("noutput_items"), + py::arg("ampl") = 1., + D(fxpt_nco, cos, 0)) + + + .def("sin", + (void (fxpt_nco::*)(int8_t*, int, double)) & fxpt_nco::sin, + py::arg("output"), + py::arg("noutput_items"), + py::arg("ampl") = 1., + D(fxpt_nco, sin, 1)) + + + .def("cos", + (void (fxpt_nco::*)(int8_t*, int, double)) & fxpt_nco::cos, + py::arg("output"), + py::arg("noutput_items"), + py::arg("ampl") = 1., + D(fxpt_nco, cos, 1)) + + + .def("sin", + (void (fxpt_nco::*)(short int*, int, double)) & fxpt_nco::sin, + py::arg("output"), + py::arg("noutput_items"), + py::arg("ampl") = 1., + D(fxpt_nco, sin, 2)) + + + .def("cos", + (void (fxpt_nco::*)(short int*, int, double)) & fxpt_nco::cos, + py::arg("output"), + py::arg("noutput_items"), + py::arg("ampl") = 1., + D(fxpt_nco, cos, 2)) + + + .def("sin", + (void (fxpt_nco::*)(int*, int, double)) & fxpt_nco::sin, + py::arg("output"), + py::arg("noutput_items"), + py::arg("ampl") = 1., + D(fxpt_nco, sin, 3)) + + + .def("cos", + (void (fxpt_nco::*)(int*, int, double)) & fxpt_nco::cos, + py::arg("output"), + py::arg("noutput_items"), + py::arg("ampl") = 1., + D(fxpt_nco, cos, 3)) + + + .def("cos", (float (fxpt_nco::*)() const) & fxpt_nco::cos, D(fxpt_nco, cos, 4)) + + + .def("sin", (float (fxpt_nco::*)() const) & fxpt_nco::sin, D(fxpt_nco, sin, 4)) + + ; +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/fxpt_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/fxpt_python.cc new file mode 100644 index 0000000000..b72385987e --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/fxpt_python.cc @@ -0,0 +1,60 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/fxpt.h> +// pydoc.h is automatically generated in the build directory +#include <fxpt_pydoc.h> + +void bind_fxpt(py::module& m) +{ + + using fxpt = ::gr::fxpt; + + + py::class_<fxpt, std::shared_ptr<fxpt>>(m, "fxpt", D(fxpt)) + + .def(py::init<>(), D(fxpt, fxpt, 0)) + .def(py::init<gr::fxpt const&>(), py::arg("arg0"), D(fxpt, fxpt, 1)) + + + .def_static("float_to_fixed", + &fxpt::float_to_fixed, + py::arg("x"), + D(fxpt, float_to_fixed)) + + + .def_static("fixed_to_float", + &fxpt::fixed_to_float, + py::arg("x"), + D(fxpt, fixed_to_float)) + + + .def_static("sin", &fxpt::sin, py::arg("x"), D(fxpt, sin)) + + + .def_static("cos", &fxpt::cos, py::arg("x"), D(fxpt, cos)) + + + .def_static("sincos", + &fxpt::sincos, + py::arg("x"), + py::arg("s"), + py::arg("c"), + D(fxpt, sincos)) + + ; +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/fxpt_vco_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/fxpt_vco_python.cc new file mode 100644 index 0000000000..dfd7622e34 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/fxpt_vco_python.cc @@ -0,0 +1,81 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/fxpt_vco.h> +// pydoc.h is automatically generated in the build directory +#include <fxpt_vco_pydoc.h> + +void bind_fxpt_vco(py::module& m) +{ + + using fxpt_vco = ::gr::fxpt_vco; + + + py::class_<fxpt_vco, std::shared_ptr<fxpt_vco>>(m, "fxpt_vco", D(fxpt_vco)) + + .def(py::init<>(), D(fxpt_vco, fxpt_vco, 0)) + .def(py::init<gr::fxpt_vco const&>(), py::arg("arg0"), D(fxpt_vco, fxpt_vco, 1)) + + + .def("set_phase", &fxpt_vco::set_phase, py::arg("angle"), D(fxpt_vco, set_phase)) + + + .def("adjust_phase", + &fxpt_vco::adjust_phase, + py::arg("delta_phase"), + D(fxpt_vco, adjust_phase)) + + + .def("get_phase", &fxpt_vco::get_phase, D(fxpt_vco, get_phase)) + + + .def("sincos", + (void (fxpt_vco::*)(float*, float*) const) & fxpt_vco::sincos, + py::arg("sinx"), + py::arg("cosx"), + D(fxpt_vco, sincos, 0)) + + + .def("sincos", + (void (fxpt_vco::*)(gr_complex*, float const*, int, float, float)) & + fxpt_vco::sincos, + py::arg("output"), + py::arg("input"), + py::arg("noutput_items"), + py::arg("k"), + py::arg("ampl") = 1., + D(fxpt_vco, sincos, 1)) + + + .def("cos", + (void (fxpt_vco::*)(float*, float const*, int, float, float)) & + fxpt_vco::cos, + py::arg("output"), + py::arg("input"), + py::arg("noutput_items"), + py::arg("k"), + py::arg("ampl") = 1., + D(fxpt_vco, cos, 0)) + + + .def("cos", (float (fxpt_vco::*)() const) & fxpt_vco::cos, D(fxpt_vco, cos, 1)) + + + .def("sin", &fxpt_vco::sin, D(fxpt_vco, sin)) + + ; +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/hier_block2_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/hier_block2_python.cc new file mode 100644 index 0000000000..496a1796fa --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/hier_block2_python.cc @@ -0,0 +1,219 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/hier_block2.h> +// pydoc.h is automatically generated in the build directory +#include <hier_block2_pydoc.h> + +void bind_hier_block2(py::module& m) +{ + + using hier_block2 = ::gr::hier_block2; + + py::class_<hier_block2, + gr::basic_block, + gr::msg_accepter, + std::shared_ptr<hier_block2>>(m, "hier_block2_pb", D(hier_block2)) + + .def(py::init(&gr::make_hier_block2), + py::arg("name"), + py::arg("input_signature"), + py::arg("output_signature")) + + .def("self", &hier_block2::self) + .def("primitive_connect", + (void (hier_block2::*)(gr::basic_block_sptr)) & hier_block2::connect, + py::arg("block")) + .def("primitive_connect", + (void (hier_block2::*)( + gr::basic_block_sptr, int, gr::basic_block_sptr, int)) & + hier_block2::connect, + py::arg("src"), + py::arg("src_port"), + py::arg("dst"), + py::arg("dst_port"), + D(hier_block2, connect, 1)) + .def("primitive_msg_connect", + (void (hier_block2::*)( + gr::basic_block_sptr, pmt::pmt_t, gr::basic_block_sptr, pmt::pmt_t)) & + hier_block2::msg_connect, + py::arg("src"), + py::arg("srcport"), + py::arg("dst"), + py::arg("dstport"), + D(hier_block2, msg_connect, 0)) + .def("primitive_msg_connect", + (void (hier_block2::*)( + gr::basic_block_sptr, std::string, gr::basic_block_sptr, std::string)) & + hier_block2::msg_connect, + py::arg("src"), + py::arg("srcport"), + py::arg("dst"), + py::arg("dstport"), + D(hier_block2, msg_connect, 1)) + .def("primitive_msg_disconnect", + (void (hier_block2::*)( + gr::basic_block_sptr, pmt::pmt_t, gr::basic_block_sptr, pmt::pmt_t)) & + hier_block2::msg_disconnect, + py::arg("src"), + py::arg("srcport"), + py::arg("dst"), + py::arg("dstport"), + D(hier_block2, msg_disconnect, 0)) + .def("primitive_msg_disconnect", + (void (hier_block2::*)( + gr::basic_block_sptr, std::string, gr::basic_block_sptr, std::string)) & + hier_block2::msg_disconnect, + py::arg("src"), + py::arg("srcport"), + py::arg("dst"), + py::arg("dstport"), + D(hier_block2, msg_disconnect, 1)) + .def("primitive_disconnect", + (void (hier_block2::*)(gr::basic_block_sptr)) & hier_block2::disconnect, + py::arg("block"), + D(hier_block2, disconnect, 0)) + .def("primitive_disconnect", + (void (hier_block2::*)( + gr::basic_block_sptr, int, gr::basic_block_sptr, int)) & + hier_block2::disconnect, + py::arg("src"), + py::arg("src_port"), + py::arg("dst"), + py::arg("dst_port"), + D(hier_block2, disconnect, 1)) + + + .def("disconnect_all", + &hier_block2::disconnect_all, + D(hier_block2, disconnect_all)) + + + .def("lock", &hier_block2::lock, D(hier_block2, lock)) + + + .def("unlock", &hier_block2::unlock, D(hier_block2, unlock)) + + + .def("max_output_buffer", + &hier_block2::max_output_buffer, + py::arg("port") = 0, + D(hier_block2, max_output_buffer)) + .def("set_max_output_buffer", + (void (hier_block2::*)(int)) & hier_block2::set_max_output_buffer, + py::arg("max_output_buffer"), + D(hier_block2, set_max_output_buffer, 0)) + .def("set_max_output_buffer", + (void (hier_block2::*)(size_t, int)) & hier_block2::set_max_output_buffer, + py::arg("port"), + py::arg("max_output_buffer"), + D(hier_block2, set_max_output_buffer, 1)) + .def("min_output_buffer", + &hier_block2::min_output_buffer, + py::arg("port") = 0, + D(hier_block2, min_output_buffer)) + .def("set_min_output_buffer", + (void (hier_block2::*)(int)) & hier_block2::set_min_output_buffer, + py::arg("min_output_buffer"), + D(hier_block2, set_min_output_buffer, 0)) + .def("set_min_output_buffer", + (void (hier_block2::*)(size_t, int)) & hier_block2::set_min_output_buffer, + py::arg("port"), + py::arg("min_output_buffer"), + D(hier_block2, set_min_output_buffer, 1)) + // .def("flatten",&hier_block2::flatten) + .def("to_hier_block2", + &hier_block2::to_hier_block2, + D(hier_block2, to_hier_block2)) + + .def("has_msg_port", + &hier_block2::has_msg_port, + py::arg("which_port"), + D(hier_block2, has_msg_port)) + .def("message_port_is_hier", + &hier_block2::message_port_is_hier, + py::arg("port_id"), + D(hier_block2, message_port_is_hier)) + .def("message_port_is_hier_in", + &hier_block2::message_port_is_hier_in, + py::arg("port_id"), + D(hier_block2, message_port_is_hier_in)) + .def("message_port_is_hier_out", + &hier_block2::message_port_is_hier_out, + py::arg("port_id"), + D(hier_block2, message_port_is_hier_out)) + + + .def("primitive_message_port_register_hier_in", + &hier_block2::message_port_register_hier_in, + py::arg("port_id"), + D(hier_block2, message_port_register_hier_in)) + + + .def("primitive_message_port_register_hier_out", + &hier_block2::message_port_register_hier_out, + py::arg("port_id"), + D(hier_block2, message_port_register_hier_out)) + .def("set_processor_affinity", + &hier_block2::set_processor_affinity, + py::arg("mask"), + D(hier_block2, set_processor_affinity)) + + + .def("unset_processor_affinity", + &hier_block2::unset_processor_affinity, + D(hier_block2, unset_processor_affinity)) + + + .def("processor_affinity", + &hier_block2::processor_affinity, + D(hier_block2, processor_affinity)) + + + .def("set_log_level", + &hier_block2::set_log_level, + py::arg("level"), + D(hier_block2, set_log_level)) + + + .def("log_level", &hier_block2::log_level, D(hier_block2, log_level)) + + + .def("all_min_output_buffer_p", + &hier_block2::all_min_output_buffer_p, + D(hier_block2, all_min_output_buffer_p)) + + + .def("all_max_output_buffer_p", + &hier_block2::all_max_output_buffer_p, + D(hier_block2, all_max_output_buffer_p)) + + ; + + + // m.def("make_hier_block2",&gr::make_hier_block2, + // py::arg("name"), + // py::arg("input_signature"), + // py::arg("output_signature") + // ); + // m.def("dot_graph",&gr::dot_graph, + // py::arg("hierblock2") + // ); + // m.def("cast_to_hier_block2_sptr",&gr::cast_to_hier_block2_sptr, + // py::arg("block") + // ); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/high_res_timer_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/high_res_timer_python.cc new file mode 100644 index 0000000000..fc05adbd02 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/high_res_timer_python.cc @@ -0,0 +1,38 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/high_res_timer.h> +// pydoc.h is automatically generated in the build directory +#include <high_res_timer_pydoc.h> + +void bind_high_res_timer(py::module& m) +{ + + + m.def("high_res_timer_now", &::gr::high_res_timer_now, D(high_res_timer_now)); + + + m.def("high_res_timer_now_perfmon", + &::gr::high_res_timer_now_perfmon, + D(high_res_timer_now_perfmon)); + + + m.def("high_res_timer_tps", &::gr::high_res_timer_tps, D(high_res_timer_tps)); + + + m.def("high_res_timer_epoch", &::gr::high_res_timer_epoch, D(high_res_timer_epoch)); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/io_signature_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/io_signature_python.cc new file mode 100644 index 0000000000..68c330cdff --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/io_signature_python.cc @@ -0,0 +1,82 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/io_signature.h> +// pydoc.h is automatically generated in the build directory +#include <io_signature_pydoc.h> + +void bind_io_signature(py::module& m) +{ + + using io_signature = ::gr::io_signature; + + + py::class_<io_signature, std::shared_ptr<io_signature>>( + m, "io_signature", D(io_signature)) + + .def(py::init(&io_signature::make), + py::arg("min_streams"), + py::arg("max_streams"), + py::arg("sizeof_stream_item"), + D(io_signature, make)) + + + .def_static("make2", + &io_signature::make2, + py::arg("min_streams"), + py::arg("max_streams"), + py::arg("sizeof_stream_item1"), + py::arg("sizeof_stream_item2"), + D(io_signature, make2)) + + + .def_static("make3", + &io_signature::make3, + py::arg("min_streams"), + py::arg("max_streams"), + py::arg("sizeof_stream_item1"), + py::arg("sizeof_stream_item2"), + py::arg("sizeof_stream_item3"), + D(io_signature, make3)) + + + .def_static("makev", + &io_signature::makev, + py::arg("min_streams"), + py::arg("max_streams"), + py::arg("sizeof_stream_items"), + D(io_signature, makev)) + + + .def("min_streams", &io_signature::min_streams, D(io_signature, min_streams)) + + + .def("max_streams", &io_signature::max_streams, D(io_signature, max_streams)) + + + .def("sizeof_stream_item", + &io_signature::sizeof_stream_item, + py::arg("index"), + D(io_signature, sizeof_stream_item)) + + + .def("sizeof_stream_items", + &io_signature::sizeof_stream_items, + D(io_signature, sizeof_stream_items)) + + ; +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/logger_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/logger_python.cc new file mode 100644 index 0000000000..4e35f9c339 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/logger_python.cc @@ -0,0 +1,154 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/logger.h> + +void bind_logger(py::module& m) +{ + using logger = gr::logger; + using logger_config = gr::logger_config; + + + py::class_<logger, std::shared_ptr<logger>>(m, "logger") + + .def(py::init<std::string>(), py::arg("logger_name")) + .def(py::init<gr::logger const&>(), py::arg("arg0")) + + .def("set_level", &logger::set_level, py::arg("level")) + .def("get_level", &logger::get_level, py::arg("level")) + .def("debug", &logger::debug, py::arg("msg")) + .def("info", &logger::info, py::arg("msg")) + .def("notice", &logger::notice, py::arg("msg")) + .def("warn", &logger::warn, py::arg("msg")) + .def("error", &logger::error, py::arg("msg")) + .def("crit", &logger::crit, py::arg("msg")) + .def("alert", &logger::alert, py::arg("msg")) + .def("fatal", &logger::fatal, py::arg("msg")) + .def("emerg", &logger::emerg, py::arg("msg")) + .def("errorIF", &logger::errorIF, py::arg("cond"), py::arg("msg")) + .def("log_assert", &logger::log_assert, py::arg("cond"), py::arg("msg")) + .def("add_console_appender", + &logger::add_console_appender, + py::arg("target"), + py::arg("pattern")) + .def("set_console_appender", + &logger::set_console_appender, + py::arg("target"), + py::arg("pattern")) + .def("add_file_appender", + &logger::add_file_appender, + py::arg("filename"), + py::arg("append"), + py::arg("pattern")) + .def("set_file_appender", + &logger::set_file_appender, + py::arg("filename"), + py::arg("append"), + py::arg("pattern")) + .def("add_rollingfile_appender", + &logger::add_rollingfile_appender, + py::arg("filename"), + py::arg("filesize"), + py::arg("bkup_index"), + py::arg("append"), + py::arg("mode"), + py::arg("pattern")); + + + py::class_<logger_config, std::shared_ptr<logger_config>>(m, "logger_config") + + + .def_static("get_filename", &logger_config::get_filename) + .def_static("get_watch_period", &logger_config::get_watch_period) + .def_static("load_config", + &logger_config::load_config, + py::arg("filename"), + py::arg("watch_period") = 0) + .def_static("stop_watch", &logger_config::stop_watch) + .def_static("reset_config", &logger_config::reset_config); + + + // m.def("configure_default_loggers",&gr::configure_default_loggers, + // py::arg("l"), + // py::arg("d"), + // py::arg("name") + // ); + m.def("update_logger_alias", + &gr::update_logger_alias, + py::arg("name"), + py::arg("alias")); + m.def("logger_get_logger", &gr::logger_get_logger, py::arg("name")); + m.def("logger_load_config", &gr::logger_load_config, py::arg("config_filename") = ""); + m.def("gr_logger_reset_config", &gr_logger_reset_config); + m.def("logger_set_level", + (void (*)(gr::logger_ptr, std::string const&)) & gr::logger_set_level, + py::arg("logger"), + py::arg("level")); + m.def("logger_set_level", + (void (*)(gr::logger_ptr, log4cpp::Priority::Value)) & gr::logger_set_level, + py::arg("logger"), + py::arg("level")); + m.def("logger_get_level", + (void (*)(gr::logger_ptr, std::string&)) & gr::logger_get_level, + py::arg("logger"), + py::arg("level")); + // m.def("logger_get_level",(void (*)(gr::logger_ptr, log4cpp::Priority::Value + // &))&gr::logger_get_level, + // py::arg("logger"), + // py::arg("level") + // ); + // m.def("logger_add_appender",&gr::logger_add_appender, + // py::arg("logger"), + // py::arg("appender") + // ); // Not Implemented + // m.def("logger_set_appender",&gr::logger_set_appender, + // py::arg("logger"), + // py::arg("appender") + // ); // Not Implemented + m.def("logger_add_console_appender", + &gr::logger_add_console_appender, + py::arg("logger"), + py::arg("target"), + py::arg("pattern")); + m.def("logger_set_console_appender", + &gr::logger_set_console_appender, + py::arg("logger"), + py::arg("target"), + py::arg("pattern")); + m.def("logger_add_file_appender", + &gr::logger_add_file_appender, + py::arg("logger"), + py::arg("filename"), + py::arg("append"), + py::arg("pattern")); + m.def("logger_set_file_appender", + &gr::logger_set_file_appender, + py::arg("logger"), + py::arg("filename"), + py::arg("append"), + py::arg("pattern")); + m.def("logger_add_rollingfile_appender", + &gr::logger_add_rollingfile_appender, + py::arg("logger"), + py::arg("filename"), + py::arg("filesize"), + py::arg("bkup_index"), + py::arg("append"), + py::arg("mode"), + py::arg("pattern")); + m.def("logger_get_logger_names", &gr::logger_get_logger_names); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/math_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/math_python.cc new file mode 100644 index 0000000000..774789e53c --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/math_python.cc @@ -0,0 +1,140 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/math.h> +// pydoc.h is automatically generated in the build directory +#include <math_pydoc.h> + +void bind_math(py::module& m) +{ + + + m.def("fast_cc_multiply", + &::gr::fast_cc_multiply, + py::arg("out"), + py::arg("cc1"), + py::arg("cc2"), + D(fast_cc_multiply)); + + + m.def("is_power_of_2", &::gr::is_power_of_2, py::arg("x"), D(is_power_of_2)); + + + m.def("fast_atan2f", + (float (*)(float, float)) & ::gr::fast_atan2f, + py::arg("y"), + py::arg("x"), + D(fast_atan2f, 0)); + + + m.def("fast_atan2f", + (float (*)(gr_complex)) & ::gr::fast_atan2f, + py::arg("z"), + D(fast_atan2f, 1)); + + + m.def("branchless_clip", + &::gr::branchless_clip, + py::arg("x"), + py::arg("clip"), + D(branchless_clip)); + + + m.def("clip", &::gr::clip, py::arg("x"), py::arg("clip"), D(clip)); + + + m.def("binary_slicer", &::gr::binary_slicer, py::arg("x"), D(binary_slicer)); + + + m.def("quad_45deg_slicer", + (unsigned int (*)(float, float)) & ::gr::quad_45deg_slicer, + py::arg("r"), + py::arg("i"), + D(quad_45deg_slicer, 0)); + + + m.def("quad_0deg_slicer", + (unsigned int (*)(float, float)) & ::gr::quad_0deg_slicer, + py::arg("r"), + py::arg("i"), + D(quad_0deg_slicer, 0)); + + + m.def("quad_45deg_slicer", + (unsigned int (*)(gr_complex)) & ::gr::quad_45deg_slicer, + py::arg("x"), + D(quad_45deg_slicer, 1)); + + + m.def("quad_0deg_slicer", + (unsigned int (*)(gr_complex)) & ::gr::quad_0deg_slicer, + py::arg("x"), + D(quad_0deg_slicer, 1)); + + + m.def("branchless_binary_slicer", + &::gr::branchless_binary_slicer, + py::arg("x"), + D(branchless_binary_slicer)); + + + m.def("branchless_quad_0deg_slicer", + (unsigned int (*)(float, float)) & ::gr::branchless_quad_0deg_slicer, + py::arg("r"), + py::arg("i"), + D(branchless_quad_0deg_slicer, 0)); + + + m.def("branchless_quad_0deg_slicer", + (unsigned int (*)(gr_complex)) & ::gr::branchless_quad_0deg_slicer, + py::arg("x"), + D(branchless_quad_0deg_slicer, 1)); + + + m.def("branchless_quad_45deg_slicer", + (unsigned int (*)(float, float)) & ::gr::branchless_quad_45deg_slicer, + py::arg("r"), + py::arg("i"), + D(branchless_quad_45deg_slicer, 0)); + + + m.def("branchless_quad_45deg_slicer", + (unsigned int (*)(gr_complex)) & ::gr::branchless_quad_45deg_slicer, + py::arg("x"), + D(branchless_quad_45deg_slicer, 1)); + + + m.def("p2_round_down", + &::gr::p2_round_down, + py::arg("x"), + py::arg("pow2"), + D(p2_round_down)); + + + m.def( + "p2_round_up", &::gr::p2_round_up, py::arg("x"), py::arg("pow2"), D(p2_round_up)); + + + m.def("p2_modulo", &::gr::p2_modulo, py::arg("x"), py::arg("pow2"), D(p2_modulo)); + + + m.def("p2_modulo_neg", + &::gr::p2_modulo_neg, + py::arg("x"), + py::arg("pow2"), + D(p2_modulo_neg)); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/message_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/message_python.cc new file mode 100644 index 0000000000..a078b142b1 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/message_python.cc @@ -0,0 +1,83 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/message.h> +// pydoc.h is automatically generated in the build directory +#include <message_pydoc.h> + +void bind_message(py::module& m) +{ + + using message = ::gr::message; + + + py::class_<message, std::shared_ptr<message>>(m, "message", D(message)) + + .def(py::init(&message::make), + py::arg("type") = 0, + py::arg("arg1") = 0, + py::arg("arg2") = 0, + py::arg("length") = 0, + D(message, make)) + + + .def_static("make_from_string", + &message::make_from_string, + py::arg("s"), + py::arg("type") = 0, + py::arg("arg1") = 0, + py::arg("arg2") = 0, + D(message, make_from_string)) + + + .def("type", &message::type, D(message, type)) + + + .def("arg1", &message::arg1, D(message, arg1)) + + + .def("arg2", &message::arg2, D(message, arg2)) + + + .def("set_type", &message::set_type, py::arg("type"), D(message, set_type)) + .def("set_arg1", &message::set_arg1, py::arg("arg1"), D(message, set_arg1)) + .def("set_arg2", &message::set_arg2, py::arg("arg2"), D(message, set_arg2)) + .def("msg", &message::msg, D(message, msg)) + + .def("length", &message::length) + // .def("to_string",&message::to_string) + // pybind11 needs explicit conversion to handle non-utf8 strings + .def("to_string", + [](std::shared_ptr<message> msg) { + std::string s = msg->to_string(); + return py::bytes(s); // Return the data without transcoding + }) + + + ; + + + m.def("message_ncurrently_allocated", + &::gr::message_ncurrently_allocated, + D(message_ncurrently_allocated)); + m.def("message_from_string", + &message::make_from_string, + py::arg("s"), + py::arg("type") = 0, + py::arg("arg1") = 0, + py::arg("arg2") = 0); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/messages/msg_accepter_msgq_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/messages/msg_accepter_msgq_python.cc new file mode 100644 index 0000000000..57069f3f64 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/messages/msg_accepter_msgq_python.cc @@ -0,0 +1,33 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/messages/msg_accepter_msgq.h> + +void bind_messages_msg_accepter_msgq(py::module& m) +{ + using msg_accepter_msgq = gr::messages::msg_accepter_msgq; + + + py::class_<msg_accepter_msgq, std::shared_ptr<msg_accepter_msgq>>( + m, "messages_msg_accepter_msgq") + + .def(py::init<gr::messages::msg_queue_sptr>(), py::arg("msgq")) + .def(py::init<gr::messages::msg_accepter_msgq const&>(), py::arg("arg0")) + + .def("post", &msg_accepter_msgq::post, py::arg("msg")) + .def("msg_queue", &msg_accepter_msgq::msg_queue); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/messages/msg_accepter_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/messages/msg_accepter_python.cc new file mode 100644 index 0000000000..fbad2e5eea --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/messages/msg_accepter_python.cc @@ -0,0 +1,28 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/messages/msg_accepter.h> + +void bind_messages_msg_accepter(py::module& m) +{ + using msg_accepter = gr::messages::msg_accepter; + + + py::class_<msg_accepter, std::shared_ptr<msg_accepter>>(m, "messages_msg_accepter") + + .def("post", &msg_accepter::post, py::arg("which_port"), py::arg("msg")); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/messages/msg_passing_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/messages/msg_passing_python.cc new file mode 100644 index 0000000000..3564530a88 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/messages/msg_passing_python.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/messages/msg_passing.h> + +void bind_messages_msg_passing(py::module& m) +{ + + + m.def("send", + (pmt::pmt_t(*)( + gr::messages::msg_accepter_sptr, pmt::pmt_t const&, pmt::pmt_t const&)) & + gr::messages::send, + py::arg("accepter"), + py::arg("which_port"), + py::arg("msg")); + m.def("send", + (pmt::pmt_t(*)( + gr::messages::msg_accepter*, pmt::pmt_t const&, pmt::pmt_t const&)) & + gr::messages::send, + py::arg("accepter"), + py::arg("which_port"), + py::arg("msg")); + m.def("send", + (pmt::pmt_t(*)( + gr::messages::msg_accepter&, pmt::pmt_t const&, pmt::pmt_t const&)) & + gr::messages::send, + py::arg("accepter"), + py::arg("which_port"), + py::arg("msg")); + m.def("send", + (pmt::pmt_t(*)(pmt::pmt_t, pmt::pmt_t const&, pmt::pmt_t const&)) & + gr::messages::send, + py::arg("accepter"), + py::arg("which_port"), + py::arg("msg")); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/messages/msg_producer_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/messages/msg_producer_python.cc new file mode 100644 index 0000000000..d519247ea3 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/messages/msg_producer_python.cc @@ -0,0 +1,28 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/messages/msg_producer.h> + +void bind_messages_msg_producer(py::module& m) +{ + using msg_producer = gr::messages::msg_producer; + + + py::class_<msg_producer, std::shared_ptr<msg_producer>>(m, "messages_msg_producer") + + .def("retrieve", &msg_producer::retrieve); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/messages/msg_queue_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/messages/msg_queue_python.cc new file mode 100644 index 0000000000..c44a75b3c8 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/messages/msg_queue_python.cc @@ -0,0 +1,42 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/messages/msg_queue.h> + +void bind_messages_msg_queue(py::module& m) +{ + using msg_queue = gr::messages::msg_queue; + + + py::class_<msg_queue, std::shared_ptr<msg_queue>>(m, "messages_msg_queue") + + .def(py::init<unsigned int>(), py::arg("limit")) + + .def("insert_tail", &msg_queue::insert_tail, py::arg("msg")) + .def("delete_head", &msg_queue::delete_head) + .def("delete_head_nowait", &msg_queue::delete_head_nowait) + .def("flush", &msg_queue::flush) + .def("empty_p", &msg_queue::empty_p) + .def("full_p", &msg_queue::full_p) + .def("count", &msg_queue::count) + .def("limit", &msg_queue::limit); + + + // m.def("make_msg_queue",&gr::messages::make_msg_queue, + // py::arg("limit") = 0 + // ); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/msg_accepter_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/msg_accepter_python.cc new file mode 100644 index 0000000000..1a14b23977 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/msg_accepter_python.cc @@ -0,0 +1,47 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/msg_accepter.h> +// pydoc.h is automatically generated in the build directory +#include <msg_accepter_pydoc.h> + +void bind_msg_accepter(py::module& m) +{ + + using msg_accepter = ::gr::msg_accepter; + + + py::class_<msg_accepter, gr::messages::msg_accepter, std::shared_ptr<msg_accepter>>( + m, "msg_accepter", D(msg_accepter)) + + .def(py::init<>(), D(msg_accepter, msg_accepter, 0)) + .def(py::init<gr::msg_accepter const&>(), + py::arg("arg0"), + D(msg_accepter, msg_accepter, 1)) + + + .def("post", + &msg_accepter::post, + py::arg("which_port"), + py::arg("msg"), + D(msg_accepter, post)) + + ; + + + py::module m_messages = m.def_submodule("messages"); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/msg_handler_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/msg_handler_python.cc new file mode 100644 index 0000000000..1215a280b2 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/msg_handler_python.cc @@ -0,0 +1,40 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/msg_handler.h> +// pydoc.h is automatically generated in the build directory +#include <msg_handler_pydoc.h> + +void bind_msg_handler(py::module& m) +{ + + using msg_handler = ::gr::msg_handler; + + + py::class_<msg_handler, std::shared_ptr<msg_handler>>( + m, "msg_handler", D(msg_handler)) + + // .def(py::init<>(),D(msg_handler,msg_handler,0)) + // .def(py::init<gr::msg_handler const &>(), py::arg("arg0"), + // D(msg_handler,msg_handler,1) + // ) + + + .def("handle", &msg_handler::handle, py::arg("msg"), D(msg_handler, handle)) + + ; +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/msg_queue_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/msg_queue_python.cc new file mode 100644 index 0000000000..0f765f1115 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/msg_queue_python.cc @@ -0,0 +1,69 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/msg_queue.h> +// pydoc.h is automatically generated in the build directory +#include <msg_queue_pydoc.h> + +void bind_msg_queue(py::module& m) +{ + + using msg_queue = ::gr::msg_queue; + + + py::class_<msg_queue, gr::msg_handler, std::shared_ptr<msg_queue>>( + m, "msg_queue", D(msg_queue)) + + .def(py::init(&msg_queue::make), py::arg("limit") = 0, D(msg_queue, make)) + + + .def("handle", &msg_queue::handle, py::arg("msg"), D(msg_queue, handle)) + + + .def("insert_tail", + &msg_queue::insert_tail, + py::arg("msg"), + D(msg_queue, insert_tail)) + + + .def("delete_head", &msg_queue::delete_head, D(msg_queue, delete_head)) + + + .def("delete_head_nowait", + &msg_queue::delete_head_nowait, + D(msg_queue, delete_head_nowait)) + + + .def("flush", &msg_queue::flush, D(msg_queue, flush)) + + + .def("empty_p", &msg_queue::empty_p, D(msg_queue, empty_p)) + + + .def("full_p", &msg_queue::full_p, D(msg_queue, full_p)) + + + .def("count", &msg_queue::count, D(msg_queue, count)) + + + .def("limit", &msg_queue::limit, D(msg_queue, limit)) + + ; + + + py::module m_thread = m.def_submodule("thread"); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/nco_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/nco_python.cc new file mode 100644 index 0000000000..b5e2258087 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/nco_python.cc @@ -0,0 +1,22 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/nco.h> +// pydoc.h is automatically generated in the build directory +#include <nco_pydoc.h> + +void bind_nco(py::module& m) {} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/prefs_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/prefs_python.cc new file mode 100644 index 0000000000..275411809c --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/prefs_python.cc @@ -0,0 +1,126 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/prefs.h> +// pydoc.h is automatically generated in the build directory +#include <prefs_pydoc.h> + +void bind_prefs(py::module& m) +{ + + using prefs = ::gr::prefs; + + + py::class_<prefs, std::shared_ptr<prefs>>(m, "prefs", D(prefs)) + + .def(py::init<>(), D(prefs, prefs)) + + + .def_static("singleton", &prefs::singleton, D(prefs, singleton)) + + + .def("add_config_file", + &prefs::add_config_file, + py::arg("configfile"), + D(prefs, add_config_file)) + + + .def("to_string", &prefs::to_string, D(prefs, to_string)) + + + .def("save", &prefs::save, D(prefs, save)) + + + .def( + "has_section", &prefs::has_section, py::arg("section"), D(prefs, has_section)) + + + .def("has_option", + &prefs::has_option, + py::arg("section"), + py::arg("option"), + D(prefs, has_option)) + + + .def("get_string", + &prefs::get_string, + py::arg("section"), + py::arg("option"), + py::arg("default_val"), + D(prefs, get_string)) + + + .def("set_string", + &prefs::set_string, + py::arg("section"), + py::arg("option"), + py::arg("val"), + D(prefs, set_string)) + + + .def("get_bool", + &prefs::get_bool, + py::arg("section"), + py::arg("option"), + py::arg("default_val"), + D(prefs, get_bool)) + + + .def("set_bool", + &prefs::set_bool, + py::arg("section"), + py::arg("option"), + py::arg("val"), + D(prefs, set_bool)) + + + .def("get_long", + &prefs::get_long, + py::arg("section"), + py::arg("option"), + py::arg("default_val"), + D(prefs, get_long)) + + + .def("set_long", + &prefs::set_long, + py::arg("section"), + py::arg("option"), + py::arg("val"), + D(prefs, set_long)) + + + .def("get_double", + &prefs::get_double, + py::arg("section"), + py::arg("option"), + py::arg("default_val"), + D(prefs, get_double)) + + + .def("set_double", + &prefs::set_double, + py::arg("section"), + py::arg("option"), + py::arg("val"), + D(prefs, set_double)) + + ; + + + py::module m_thread = m.def_submodule("thread"); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/python_bindings.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/python_bindings.cc new file mode 100644 index 0000000000..a178d2ac65 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/python_bindings.cc @@ -0,0 +1,209 @@ + +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +#include <pybind11/pybind11.h> + +#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION +#include <gnuradio/gr_complex.h> +#include <numpy/arrayobject.h> + +namespace py = pybind11; + +void bind_messages_msg_accepter_msgq(py::module&); +void bind_messages_msg_accepter(py::module&); +void bind_messages_msg_passing(py::module&); +void bind_messages_msg_producer(py::module&); +void bind_messages_msg_queue(py::module&); + +// void bind_attributes(py::module&); +void bind_basic_block(py::module&); +void bind_block(py::module&); +void bind_block_detail(py::module&); +void bind_block_gateway(py::module&); +// void bind_block_registry(py::module&); +void bind_buffer(py::module&); +void bind_constants(py::module&); +void bind_endianness(py::module&); +void bind_expj(py::module&); +void bind_flowgraph(py::module&); +void bind_fxpt(py::module&); +void bind_fxpt_nco(py::module&); +void bind_fxpt_vco(py::module&); +// void bind_gr_complex(py::module&); +void bind_hier_block2(py::module&); +void bind_high_res_timer(py::module&); +void bind_io_signature(py::module&); +void bind_logger(py::module&); +void bind_math(py::module&); +void bind_message(py::module&); +void bind_msg_accepter(py::module&); +// void bind_msg_accepter_msgq(py::module&); +// void bind_msg_passing(py::module&); +// void bind_msg_producer(py::module&); +void bind_msg_queue(py::module&); +// void bind_misc(py::module&);; +void bind_msg_handler(py::module&); +void bind_msg_queue(py::module&); +void bind_nco(py::module&); +void bind_prefs(py::module&); +// void bind_pycallback_object(py::module&); +void bind_random(py::module&); +void bind_realtime(py::module&); +// void bind_realtime_impl(py::module&); +// void bind_rpcbufferedget(py::module&); +// void bind_rpccallbackregister_base(py::module&); +// void bind_rpcmanager(py::module&); +// void bind_rpcmanager_base(py::module&); +// void bind_rpcpmtconverters_thrift(py::module&); +// void bind_rpcregisterhelpers(py::module&); +// void bind_rpcserver_aggregator(py::module&); +// void bind_rpcserver_base(py::module&); +// void bind_rpcserver_booter_aggregator(py::module&); +// void bind_rpcserver_booter_base(py::module&); +// void bind_rpcserver_booter_thrift(py::module&); +// void bind_rpcserver_selector(py::module&); +// void bind_rpcserver_thrift(py::module&); +void bind_runtime_types(py::module&); +void bind_sincos(py::module&); +void bind_sptr_magic(py::module&); +void bind_sync_block(py::module&); +void bind_sync_decimator(py::module&); +void bind_sync_interpolator(py::module&); +void bind_sys_paths(py::module&); +void bind_tag_checker(py::module&); +void bind_tagged_stream_block(py::module&); +void bind_tags(py::module&); +// void bind_thread(py::module&); +// void bind_thread_body_wrapper(py::module&); +// void bind_thread_group(py::module&); +// void bind_thrift_application_base(py::module&); +// void bind_thrift_server_template(py::module&); +void bind_top_block(py::module&); +void bind_tpb_detail(py::module&); +// void bind_types(py::module&); +// void bind_unittests(py::module&); +// void bind_xoroshiro128p(py::module&); + +// We need this hack because import_array() returns NULL +// for newer Python versions. +// This function is also necessary because it ensures access to the C API +// and removes a warning. +void* init_numpy() +{ + import_array(); + return NULL; +} + +PYBIND11_MODULE(gr_python, m) +{ + // Initialize the numpy C API + // (otherwise we will see segmentation faults) + init_numpy(); + + // Allow access to base block methods + py::module::import("pmt"); + + + bind_messages_msg_accepter(m); + bind_messages_msg_queue(m); + bind_messages_msg_accepter_msgq(m); + bind_messages_msg_passing(m); + bind_messages_msg_producer(m); + + + bind_msg_accepter(m); + bind_msg_handler(m); + bind_msg_queue(m); + + bind_io_signature(m); + // // bind_attributes(m); + bind_basic_block(m); + bind_block(m); + bind_block_detail(m); + bind_block_gateway(m); + // // bind_block_registry(m); + bind_buffer(m); + bind_constants(m); + bind_endianness(m); + bind_expj(m); + bind_flowgraph(m); + bind_fxpt(m); + bind_fxpt_nco(m); + bind_fxpt_vco(m); + // // bind_gr_complex(m); + bind_hier_block2(m); + bind_high_res_timer(m); + + bind_logger(m); + bind_math(m); + bind_message(m); + + // // bind_msg_accepter_msgq(m); + // // bind_msg_passing(m); + // // bind_msg_producer(m); + + // // bind_misc(m); + + + bind_nco(m); + bind_prefs(m); + // // bind_pycallback_object(m); + bind_random(m); + bind_realtime(m); + // // bind_realtime_impl(m); + // // bind_rpcbufferedget(m); + // // bind_rpccallbackregister_base(m); + // // bind_rpcmanager(m); + // // bind_rpcmanager_base(m); + // // bind_rpcpmtconverters_thrift(m); + // // bind_rpcregisterhelpers(m); + // // bind_rpcserver_aggregator(m); + // // bind_rpcserver_base(m); + // // bind_rpcserver_booter_aggregator(m); + // // bind_rpcserver_booter_base(m); + // // bind_rpcserver_booter_thrift(m); + // // bind_rpcserver_selector(m); + // // bind_rpcserver_thrift(m); + bind_runtime_types(m); + bind_sincos(m); + bind_sptr_magic(m); + bind_sync_block(m); + bind_sync_decimator(m); + bind_sync_interpolator(m); + bind_sys_paths(m); + bind_tag_checker(m); + bind_tagged_stream_block(m); + bind_tags(m); + // // bind_thread(m); + // // bind_thread_body_wrapper(m); + // // bind_thread_group(m); + // // bind_thrift_application_base(m); + // // bind_thrift_server_template(m); + bind_top_block(m); + bind_tpb_detail(m); + // // bind_types(m); + // // bind_unittests(m); + // // bind_xoroshiro128p(m); + + + // TODO: Move into gr_types.hpp + // %constant int sizeof_char = sizeof(char); + m.attr("sizeof_char") = sizeof(char); + // %constant int sizeof_short = sizeof(short); + m.attr("sizeof_short") = sizeof(short); + // %constant int sizeof_int = sizeof(int); + m.attr("sizeof_int") = sizeof(int); + // %constant int sizeof_float = sizeof(float); + m.attr("sizeof_float") = sizeof(float); + // %constant int sizeof_double = sizeof(double); + m.attr("sizeof_double") = sizeof(double); + // %constant int sizeof_gr_complex = sizeof(gr_complex); + m.attr("sizeof_gr_complex") = sizeof(gr_complex); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/random_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/random_python.cc new file mode 100644 index 0000000000..db4ac6c785 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/random_python.cc @@ -0,0 +1,69 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/random.h> +// pydoc.h is automatically generated in the build directory +#include <random_pydoc.h> + +void bind_random(py::module& m) +{ + + using random = ::gr::random; + + + py::class_<random, std::shared_ptr<random>>(m, "random", D(random)) + + .def(py::init<unsigned int, int, int>(), + py::arg("seed") = 0, + py::arg("min_integer") = 0, + py::arg("max_integer") = 2, + D(random, random, 0)) + .def(py::init<gr::random const&>(), py::arg("arg0"), D(random, random, 1)) + + + .def("reseed", &random::reseed, py::arg("seed"), D(random, reseed)) + + + .def("set_integer_limits", + &random::set_integer_limits, + py::arg("minimum"), + py::arg("maximum"), + D(random, set_integer_limits)) + + + .def("ran_int", &random::ran_int, D(random, ran_int)) + + + .def("ran1", &random::ran1, D(random, ran1)) + + + .def("gasdev", &random::gasdev, D(random, gasdev)) + + + .def("laplacian", &random::laplacian, D(random, laplacian)) + + + .def("rayleigh", &random::rayleigh, D(random, rayleigh)) + + + .def("impulse", &random::impulse, py::arg("factor"), D(random, impulse)) + + + .def("rayleigh_complex", &random::rayleigh_complex, D(random, rayleigh_complex)) + + ; +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/realtime_impl_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/realtime_impl_python.cc new file mode 100644 index 0000000000..39ec88205e --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/realtime_impl_python.cc @@ -0,0 +1,73 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/realtime_impl.h> +// pydoc.h is automatically generated in the build directory +#include <realtime_impl_pydoc.h> + +void bind_realtime_impl(py::module& m) +{ + + + py::enum_<::gr::rt_status_t>(m, "rt_status_t") + .value("RT_OK", ::gr::RT_OK) // 0 + .value("RT_NOT_IMPLEMENTED", ::gr::RT_NOT_IMPLEMENTED) // 1 + .value("RT_NO_PRIVS", ::gr::RT_NO_PRIVS) // 2 + .value("RT_OTHER_ERROR", ::gr::RT_OTHER_ERROR) // 3 + .export_values(); + py::enum_<::gr::rt_sched_policy>(m, "rt_sched_policy") + .value("RT_SCHED_RR", ::gr::RT_SCHED_RR) // 0 + .value("RT_SCHED_FIFO", ::gr::RT_SCHED_FIFO) // 1 + .export_values(); + + + py::module m_impl = m.def_submodule("impl"); + + using rt_sched_param = ::gr::impl::rt_sched_param; + + + py::class_<rt_sched_param, std::shared_ptr<rt_sched_param>>( + m_impl, "rt_sched_param", D(impl, rt_sched_param)) + + .def(py::init<>(), D(impl, rt_sched_param, rt_sched_param, 0)) + .def(py::init<int, gr::rt_sched_policy>(), + py::arg("priority_"), + py::arg("policy_") = ::gr::rt_sched_policy::RT_SCHED_RR, + D(impl, rt_sched_param, rt_sched_param, 1)) + .def(py::init<gr::impl::rt_sched_param const&>(), + py::arg("arg0"), + D(impl, rt_sched_param, rt_sched_param, 2)) + + ; + + + m_impl.def("rt_priority_min", &::gr::impl::rt_priority_min, D(impl, rt_priority_min)); + + + m_impl.def("rt_priority_max", &::gr::impl::rt_priority_max, D(impl, rt_priority_max)); + + + m_impl.def("rt_priority_default", + &::gr::impl::rt_priority_default, + D(impl, rt_priority_default)); + + + m_impl.def("enable_realtime_scheduling", + &::gr::impl::enable_realtime_scheduling, + py::arg("arg0") = gr::impl::rt_sched_param(), + D(impl, enable_realtime_scheduling)); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/realtime_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/realtime_python.cc new file mode 100644 index 0000000000..58c5a8f069 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/realtime_python.cc @@ -0,0 +1,32 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/realtime.h> +// pydoc.h is automatically generated in the build directory +#include <realtime_pydoc.h> + +void bind_realtime(py::module& m) +{ + + + m.def("enable_realtime_scheduling", + &::gr::enable_realtime_scheduling, + D(enable_realtime_scheduling)); + + + py::module m_impl = m.def_submodule("impl"); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/rpccallbackregister_base_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/rpccallbackregister_base_python.cc new file mode 100644 index 0000000000..0011b8f55f --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/rpccallbackregister_base_python.cc @@ -0,0 +1,20 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/rpccallbackregister_base.h> + +void bind_rpccallbackregister_base(py::module& m) {} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/rpcmanager_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/rpcmanager_python.cc new file mode 100644 index 0000000000..6ac5805ea7 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/rpcmanager_python.cc @@ -0,0 +1,20 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/rpcmanager.h> + +void bind_rpcmanager(py::module& m) {} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/rpcregisterhelpers_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/rpcregisterhelpers_python.cc new file mode 100644 index 0000000000..4ba988abd6 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/rpcregisterhelpers_python.cc @@ -0,0 +1,20 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/rpcregisterhelpers.h> + +void bind_rpcregisterhelpers(py::module& m) {} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/rpcserver_aggregator_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/rpcserver_aggregator_python.cc new file mode 100644 index 0000000000..0c8926ea60 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/rpcserver_aggregator_python.cc @@ -0,0 +1,20 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/rpcserver_aggregator.h> + +void bind_rpcserver_aggregator(py::module& m) {} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/rpcserver_base_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/rpcserver_base_python.cc new file mode 100644 index 0000000000..87cc6724ec --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/rpcserver_base_python.cc @@ -0,0 +1,20 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/rpcserver_base.h> + +void bind_rpcserver_base(py::module& m) {} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/rpcserver_booter_aggregator_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/rpcserver_booter_aggregator_python.cc new file mode 100644 index 0000000000..c8f59aea8a --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/rpcserver_booter_aggregator_python.cc @@ -0,0 +1,20 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/rpcserver_booter_aggregator.h> + +void bind_rpcserver_booter_aggregator(py::module& m) {} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/runtime_types_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/runtime_types_python.cc new file mode 100644 index 0000000000..20b4c7fad2 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/runtime_types_python.cc @@ -0,0 +1,20 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/runtime_types.h> + +void bind_runtime_types(py::module& m) {} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/sincos_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/sincos_python.cc new file mode 100644 index 0000000000..5433f35714 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/sincos_python.cc @@ -0,0 +1,40 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/sincos.h> +// pydoc.h is automatically generated in the build directory +#include <sincos_pydoc.h> + +void bind_sincos(py::module& m) +{ + + + m.def("sincos", + &::gr::sincos, + py::arg("x"), + py::arg("sinx"), + py::arg("cosx"), + D(sincos)); + + + m.def("sincosf", + &::gr::sincosf, + py::arg("x"), + py::arg("sinx"), + py::arg("cosx"), + D(sincosf)); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/sptr_magic_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/sptr_magic_python.cc new file mode 100644 index 0000000000..fee86dc136 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/sptr_magic_python.cc @@ -0,0 +1,20 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/sptr_magic.h> + +void bind_sptr_magic(py::module& m) {} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/sync_block_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/sync_block_python.cc new file mode 100644 index 0000000000..fc18145244 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/sync_block_python.cc @@ -0,0 +1,74 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/sync_block.h> +// pydoc.h is automatically generated in the build directory +#include <sync_block_pydoc.h> + +void bind_sync_block(py::module& m) +{ + + using sync_block = ::gr::sync_block; + + + py::class_<sync_block, gr::block, gr::basic_block, std::shared_ptr<sync_block>>( + m, "sync_block", D(sync_block)) + + + .def("work", + &sync_block::work, + py::arg("noutput_items"), + py::arg("input_items"), + py::arg("output_items"), + D(sync_block, work)) + + + .def("forecast", + &sync_block::forecast, + py::arg("noutput_items"), + py::arg("ninput_items_required"), + D(sync_block, forecast)) + + + .def("general_work", + &sync_block::general_work, + py::arg("noutput_items"), + py::arg("ninput_items"), + py::arg("input_items"), + py::arg("output_items"), + D(sync_block, general_work)) + + + .def("fixed_rate_ninput_to_noutput", + &sync_block::fixed_rate_ninput_to_noutput, + py::arg("ninput"), + D(sync_block, fixed_rate_ninput_to_noutput)) + + + .def("fixed_rate_noutput_to_ninput", + &sync_block::fixed_rate_noutput_to_ninput, + py::arg("noutput"), + D(sync_block, fixed_rate_noutput_to_ninput)) + + ; + + + py::module m_messages = m.def_submodule("messages"); + + + py::module m_thread = m.def_submodule("thread"); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/sync_decimator_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/sync_decimator_python.cc new file mode 100644 index 0000000000..99d079c1f2 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/sync_decimator_python.cc @@ -0,0 +1,78 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/sync_decimator.h> +// pydoc.h is automatically generated in the build directory +#include <sync_decimator_pydoc.h> + +void bind_sync_decimator(py::module& m) +{ + + using sync_decimator = ::gr::sync_decimator; + + + py::class_<sync_decimator, + gr::sync_block, + gr::block, + gr::basic_block, + std::shared_ptr<sync_decimator>>(m, "sync_decimator", D(sync_decimator)) + + + .def("decimation", &sync_decimator::decimation, D(sync_decimator, decimation)) + + + .def("set_decimation", + &sync_decimator::set_decimation, + py::arg("decimation"), + D(sync_decimator, set_decimation)) + + + .def("forecast", + &sync_decimator::forecast, + py::arg("noutput_items"), + py::arg("ninput_items_required"), + D(sync_decimator, forecast)) + + + .def("general_work", + &sync_decimator::general_work, + py::arg("noutput_items"), + py::arg("ninput_items"), + py::arg("input_items"), + py::arg("output_items"), + D(sync_decimator, general_work)) + + + .def("fixed_rate_ninput_to_noutput", + &sync_decimator::fixed_rate_ninput_to_noutput, + py::arg("ninput"), + D(sync_decimator, fixed_rate_ninput_to_noutput)) + + + .def("fixed_rate_noutput_to_ninput", + &sync_decimator::fixed_rate_noutput_to_ninput, + py::arg("noutput"), + D(sync_decimator, fixed_rate_noutput_to_ninput)) + + ; + + + py::module m_messages = m.def_submodule("messages"); + + + py::module m_thread = m.def_submodule("thread"); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/sync_interpolator_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/sync_interpolator_python.cc new file mode 100644 index 0000000000..4650192c73 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/sync_interpolator_python.cc @@ -0,0 +1,81 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/sync_interpolator.h> +// pydoc.h is automatically generated in the build directory +#include <sync_interpolator_pydoc.h> + +void bind_sync_interpolator(py::module& m) +{ + + using sync_interpolator = ::gr::sync_interpolator; + + + py::class_<sync_interpolator, + gr::sync_block, + gr::block, + gr::basic_block, + std::shared_ptr<sync_interpolator>>( + m, "sync_interpolator", D(sync_interpolator)) + + + .def("interpolation", + &sync_interpolator::interpolation, + D(sync_interpolator, interpolation)) + + + .def("set_interpolation", + &sync_interpolator::set_interpolation, + py::arg("interpolation"), + D(sync_interpolator, set_interpolation)) + + + .def("forecast", + &sync_interpolator::forecast, + py::arg("noutput_items"), + py::arg("ninput_items_required"), + D(sync_interpolator, forecast)) + + + .def("general_work", + &sync_interpolator::general_work, + py::arg("noutput_items"), + py::arg("ninput_items"), + py::arg("input_items"), + py::arg("output_items"), + D(sync_interpolator, general_work)) + + + .def("fixed_rate_ninput_to_noutput", + &sync_interpolator::fixed_rate_ninput_to_noutput, + py::arg("ninput"), + D(sync_interpolator, fixed_rate_ninput_to_noutput)) + + + .def("fixed_rate_noutput_to_ninput", + &sync_interpolator::fixed_rate_noutput_to_ninput, + py::arg("noutput"), + D(sync_interpolator, fixed_rate_noutput_to_ninput)) + + ; + + + py::module m_messages = m.def_submodule("messages"); + + + py::module m_thread = m.def_submodule("thread"); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/sys_paths_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/sys_paths_python.cc new file mode 100644 index 0000000000..3112851b60 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/sys_paths_python.cc @@ -0,0 +1,33 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/sys_paths.h> +// pydoc.h is automatically generated in the build directory +#include <sys_paths_pydoc.h> + +void bind_sys_paths(py::module& m) +{ + + + m.def("tmp_path", &::gr::tmp_path, D(tmp_path)); + + + m.def("appdata_path", &::gr::appdata_path, D(appdata_path)); + + + m.def("userconf_path", &::gr::userconf_path, D(userconf_path)); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/tag_checker_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/tag_checker_python.cc new file mode 100644 index 0000000000..cfeef5b18e --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/tag_checker_python.cc @@ -0,0 +1,49 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/tag_checker.h> +// pydoc.h is automatically generated in the build directory +#include <tag_checker_pydoc.h> + +void bind_tag_checker(py::module& m) +{ + + using tag_checker = ::gr::tag_checker; + + + py::class_<tag_checker, std::shared_ptr<tag_checker>>( + m, "tag_checker", D(tag_checker)) + + .def(py::init<std::vector<gr::tag_t, std::allocator<gr::tag_t>>&>(), + py::arg("tags"), + D(tag_checker, tag_checker, 0)) + .def(py::init<gr::tag_checker const&>(), + py::arg("arg0"), + D(tag_checker, tag_checker, 1)) + + + .def("get_tags", + &tag_checker::get_tags, + py::arg("tag_list"), + py::arg("offset"), + D(tag_checker, get_tags)) + + ; + + + py::module m_messages = m.def_submodule("messages"); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/tagged_stream_block_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/tagged_stream_block_python.cc new file mode 100644 index 0000000000..fe09b0a699 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/tagged_stream_block_python.cc @@ -0,0 +1,73 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/tagged_stream_block.h> +// pydoc.h is automatically generated in the build directory +#include <tagged_stream_block_pydoc.h> + +void bind_tagged_stream_block(py::module& m) +{ + + using tagged_stream_block = ::gr::tagged_stream_block; + + + py::class_<tagged_stream_block, + gr::block, + gr::basic_block, + std::shared_ptr<tagged_stream_block>>( + m, "tagged_stream_block", D(tagged_stream_block)) + + + .def("forecast", + &tagged_stream_block::forecast, + py::arg("noutput_items"), + py::arg("ninput_items_required"), + D(tagged_stream_block, forecast)) + + + .def("check_topology", + &tagged_stream_block::check_topology, + py::arg("ninputs"), + py::arg("arg1"), + D(tagged_stream_block, check_topology)) + + + .def("general_work", + &tagged_stream_block::general_work, + py::arg("noutput_items"), + py::arg("ninput_items"), + py::arg("input_items"), + py::arg("output_items"), + D(tagged_stream_block, general_work)) + + + .def("work", + &tagged_stream_block::work, + py::arg("noutput_items"), + py::arg("ninput_items"), + py::arg("input_items"), + py::arg("output_items"), + D(tagged_stream_block, work)) + + ; + + + py::module m_messages = m.def_submodule("messages"); + + + py::module m_thread = m.def_submodule("thread"); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/tags_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/tags_python.cc new file mode 100644 index 0000000000..1e3d305111 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/tags_python.cc @@ -0,0 +1,47 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/tags.h> +// pydoc.h is automatically generated in the build directory +#include <tags_pydoc.h> + +void bind_tags(py::module& m) +{ + + using tag_t = ::gr::tag_t; + + + py::class_<tag_t, std::shared_ptr<tag_t>>(m, "tag_t", D(tag_t)) + + .def(py::init<>(), D(tag_t, tag_t, 0)) + .def(py::init<gr::tag_t const&>(), py::arg("rhs"), D(tag_t, tag_t, 1)) + + .def_static("offset_compare", + &tag_t::offset_compare, + py::arg("x"), + py::arg("y"), + D(tag_t, offset_compare)) + + .def_readwrite("offset", &tag_t::offset) + .def_readwrite("key", &tag_t::key) + .def_readwrite("value", &tag_t::value) + .def_readwrite("srcid", &tag_t::srcid) + .def_readwrite("marked_deleted", &tag_t::marked_deleted) + + // TODO - put in operators + ; +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/thread/thread_body_wrapper_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/thread/thread_body_wrapper_python.cc new file mode 100644 index 0000000000..b062a0d303 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/thread/thread_body_wrapper_python.cc @@ -0,0 +1,20 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/thread_body_wrapper.h> + +void bind_thread_body_wrapper(py::module& m) { m.def("mask_signals", &gr::mask_signals); } diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/thread/thread_group_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/thread/thread_group_python.cc new file mode 100644 index 0000000000..66666898a3 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/thread/thread_group_python.cc @@ -0,0 +1,37 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/thread_group.h> + +void bind_thread_group(py::module& m) +{ + using thread_group = gr::thread_group; + + + py::class_<thread_group, + boost::noncopyable_::noncopyable, + std::shared_ptr<thread_group>>(m, "thread_group") + + .def(py::init<>()) + + .def("create_thread", &thread_group::create_thread, py::arg("threadfunc")) + .def("add_thread", &thread_group::add_thread, py::arg("thrd")) + .def("remove_thread", &thread_group::remove_thread, py::arg("thrd")) + .def("join_all", &thread_group::join_all) + .def("interrupt_all", &thread_group::interrupt_all) + .def("size", &thread_group::size); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/thread/thread_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/thread/thread_python.cc new file mode 100644 index 0000000000..87e769ef88 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/thread/thread_python.cc @@ -0,0 +1,53 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/thread.h> + +void bind_thread(py::module& m) +{ + + + m.def("get_current_thread_id", &gr::get_current_thread_id); + m.def("thread_bind_to_processor", + (void (*)(std::vector<int, std::allocator<int>> const&)) & + gr::thread_bind_to_processor, + py::arg("mask")); + m.def("thread_bind_to_processor", + (void (*)(int)) & gr::thread_bind_to_processor, + py::arg("n")); + m.def("thread_bind_to_processor", + (void (*)(gr::thread::gr_thread_t, + std::vector<int, std::allocator<int>> const&)) & + gr::thread_bind_to_processor, + py::arg("thread"), + py::arg("mask")); + m.def("thread_bind_to_processor", + (void (*)(gr::thread::gr_thread_t, unsigned int)) & + gr::thread_bind_to_processor, + py::arg("thread"), + py::arg("n")); + m.def("thread_unbind", (void (*)()) & gr::thread_unbind); + m.def("thread_unbind", + (void (*)(gr::thread::gr_thread_t)) & gr::thread_unbind, + py::arg("thread")); + m.def("thread_priority", &gr::thread_priority, py::arg("thread")); + m.def("set_thread_priority", + &gr::set_thread_priority, + py::arg("thread"), + py::arg("priority")); + m.def("set_thread_name", &gr::set_thread_name, py::arg("thread"), py::arg("name")); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/thrift_application_base_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/thrift_application_base_python.cc new file mode 100644 index 0000000000..b545316631 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/thrift_application_base_python.cc @@ -0,0 +1,20 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/thrift_application_base.h> + +void bind_thrift_application_base(py::module& m) {} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/top_block_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/top_block_python.cc new file mode 100644 index 0000000000..37ec9e61c8 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/top_block_python.cc @@ -0,0 +1,146 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/runtime_types.h> +#include <gnuradio/top_block.h> +// pydoc.h is automatically generated in the build directory +#include <top_block_pydoc.h> + +#define GR_PYTHON_BLOCKING_CODE(code) \ + { \ + PyThreadState* _save; \ + _save = PyEval_SaveThread(); \ + try { \ + code \ + } catch (...) { \ + PyEval_RestoreThread(_save); \ + throw; \ + } \ + PyEval_RestoreThread(_save); \ + } + + +void top_block_run_unlocked(gr::top_block_sptr r) noexcept(false) +{ + GR_PYTHON_BLOCKING_CODE(r->run();) +} + +void top_block_start_unlocked(gr::top_block_sptr r, int max_noutput_items) noexcept(false) +{ + GR_PYTHON_BLOCKING_CODE(r->start(max_noutput_items);) +} + +void top_block_wait_unlocked(gr::top_block_sptr r) noexcept(false) +{ + GR_PYTHON_BLOCKING_CODE(r->wait();) +} + +void top_block_stop_unlocked(gr::top_block_sptr r) noexcept(false) +{ + GR_PYTHON_BLOCKING_CODE(r->stop();) +} + +void top_block_unlock_unlocked(gr::top_block_sptr r) noexcept(false) +{ + GR_PYTHON_BLOCKING_CODE(r->unlock();) +} + + +void bind_top_block(py::module& m) +{ + using top_block = gr::top_block; + + + py::class_<top_block, gr::hier_block2, gr::basic_block, std::shared_ptr<top_block>>( + m, "top_block_pb", D(top_block)) + + + .def(py::init(&gr::make_top_block), + py::arg("name"), + py::arg("catch_exceptions") = false) + + .def("run", + &top_block::run, + py::arg("max_noutput_items") = 100000000, + D(top_block, run)) + + + .def("start", + &top_block::start, + py::arg("max_noutput_items") = 100000000, + D(top_block, start)) + + + .def("stop", &top_block::stop, D(top_block, stop)) + + + .def("wait", &top_block::wait, D(top_block, wait)) + + + .def("lock", &top_block::lock, D(top_block, lock)) + + + .def("unlock", &top_block::unlock, D(top_block, unlock)) + + + .def("edge_list", &top_block::edge_list, D(top_block, edge_list)) + + + .def("msg_edge_list", &top_block::msg_edge_list, D(top_block, msg_edge_list)) + + + .def("dump", &top_block::dump, D(top_block, dump)) + + + .def("max_noutput_items", + &top_block::max_noutput_items, + D(top_block, max_noutput_items)) + + + .def("set_max_noutput_items", + &top_block::set_max_noutput_items, + py::arg("nmax"), + D(top_block, set_max_noutput_items)) + + + .def("to_top_block", &top_block::to_top_block, D(top_block, to_top_block)) + + + .def("setup_rpc", &top_block::setup_rpc, D(top_block, setup_rpc)) + + ; + + + m.def("make_top_block", + &::gr::make_top_block, + py::arg("name"), + py::arg("catch_exceptions") = true, + D(make_top_block)); + + + m.def("cast_to_top_block_sptr", + &::gr::cast_to_top_block_sptr, + py::arg("block"), + D(cast_to_top_block_sptr)); + + + m.def("top_block_run_unlocked", &top_block_run_unlocked); + m.def("top_block_start_unlocked", &top_block_start_unlocked); + m.def("top_block_wait_unlocked", &top_block_wait_unlocked); + m.def("top_block_stop_unlocked", &top_block_stop_unlocked); + m.def("top_block_unlock_unlocked", &top_block_unlock_unlocked); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/tpb_detail_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/tpb_detail_python.cc new file mode 100644 index 0000000000..669c7bcfe5 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/tpb_detail_python.cc @@ -0,0 +1,48 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/block_detail.h> +#include <gnuradio/tpb_detail.h> +// pydoc.h is automatically generated in the build directory +#include <tpb_detail_pydoc.h> + +void bind_tpb_detail(py::module& m) +{ + + using tpb_detail = ::gr::tpb_detail; + + + py::class_<tpb_detail, std::shared_ptr<tpb_detail>>(m, "tpb_detail", D(tpb_detail)) + + .def(py::init<>(), D(tpb_detail, tpb_detail)) + + + .def("notify_upstream", + &tpb_detail::notify_upstream, + py::arg("d"), + D(tpb_detail, notify_upstream)) + .def("notify_downstream", + &tpb_detail::notify_downstream, + py::arg("d"), + D(tpb_detail, notify_downstream)) + .def("notify_neighbors", + &tpb_detail::notify_neighbors, + py::arg("d"), + D(tpb_detail, notify_neighbors)) + .def("notify_msg", &tpb_detail::notify_msg) + .def("clear_changed", &tpb_detail::clear_changed); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/gateway.py b/gnuradio-runtime/python/gnuradio/gr/gateway.py index 71d15781d2..615027b833 100644 --- a/gnuradio-runtime/python/gnuradio/gr/gateway.py +++ b/gnuradio-runtime/python/gnuradio/gr/gateway.py @@ -1,5 +1,5 @@ # -# Copyright 2011-2012, 2018 Free Software Foundation, Inc. +# Copyright 2011-2012, 2018, 2020 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -12,11 +12,12 @@ from __future__ import unicode_literals import numpy +import ctypes + +from . import gr_python as gr +from .gr_python import io_signature # , io_signaturev +from .gr_python import block_gateway -from . import runtime_swig as gr -from .runtime_swig import io_signature, io_signaturev -from .runtime_swig import block_gw_message_type -from .runtime_swig import block_gateway ######################################################################## # Magic to turn pointers into numpy arrays @@ -25,54 +26,20 @@ from .runtime_swig import block_gateway def pointer_to_ndarray(addr, dtype, nitems): class array_like(object): __array_interface__ = { - 'data' : (int(addr), False), - 'typestr' : dtype.base.str, - 'descr' : dtype.base.descr, - 'shape' : (nitems,) + dtype.shape, - 'strides' : None, - 'version' : 3 + 'data': (int(addr), False), + 'typestr': dtype.base.str, + 'descr': dtype.base.descr, + 'shape': (nitems,) + dtype.shape, + 'strides': None, + 'version': 3 } return numpy.asarray(array_like()).view(dtype.base) ######################################################################## -# Handler that does callbacks from C++ -######################################################################## -class gateway_handler(gr.feval_ll): - - #don't put a constructor, it won't work - - def init(self, callback): - self._callback = callback - - def eval(self, arg): - try: self._callback() - except Exception as ex: - print("handler caught exception: %s"%ex) - import traceback; traceback.print_exc() - raise ex - return 0 - -######################################################################## -# Handler that does callbacks from C++ +# io_signature for Python ######################################################################## -class msg_handler(gr.feval_p): - - #don't put a constructor, it won't work - - def init(self, callback): - self._callback = callback - def eval(self, arg): - try: self._callback(arg) - except Exception as ex: - print("handler caught exception: %s"%ex) - import traceback; traceback.print_exc() - raise ex - return 0 -######################################################################## -# io_signature for Python -######################################################################## class py_io_signature(object): """ Describes the type/number of ports for block input or output. @@ -94,15 +61,15 @@ class py_io_signature(object): """ self.__min_ports = min_ports self.__max_ports = max_ports - self.__types = tuple( numpy.dtype(t) for t in type_list ) + self.__types = tuple(numpy.dtype(t) for t in type_list) def gr_io_signature(self): """ Make/return a gr.io_signature. A non-empty list of sizes is required, even if there are no ports. """ - return io_signaturev(self.__min_ports, self.__max_ports, - [t.itemsize for t in self.__types] or [0]) + return io_signature.makev(self.__min_ports, self.__max_ports, + [t.itemsize for t in self.__types] or [0]) def port_types(self, nports): """ @@ -129,14 +96,19 @@ class py_io_signature(object): ######################################################################## # The guts that make this into a gr block ######################################################################## + + class gateway_block(object): - def __init__(self, name, in_sig, out_sig, work_type, factor): + def __init__(self, name, in_sig, out_sig, block_type): + self._decim = 1 + self._interp = 1 + self._block_type = block_type # Normalize the many Python ways of saying 'nothing' to '()' in_sig = in_sig or () out_sig = out_sig or () - + # Backward compatibility: array of type strings -> py_io_signature if type(in_sig) is py_io_signature: self.__in_sig = in_sig @@ -145,98 +117,93 @@ class gateway_block(object): if type(out_sig) is py_io_signature: self.__out_sig = out_sig else: - self.__out_sig = py_io_signature(len(out_sig), len(out_sig), out_sig) - - #create internal gateway block - self.__handler = gateway_handler() - self.__handler.init(self.__gr_block_handle) - self.__gateway = block_gateway( - self.__handler, name, - self.__in_sig.gr_io_signature(), self.__out_sig.gr_io_signature(), - work_type, factor) - self.__message = self.__gateway.block_message() - - #dict to keep references to all message handlers - self.__msg_handlers = {} - - #register block functions - prefix = 'block__' - for attr in [x for x in dir(self.__gateway) if x.startswith(prefix)]: - setattr(self, attr.replace(prefix, ''), getattr(self.__gateway, attr)) - self.pop_msg_queue = lambda: gr.block_gw_pop_msg_queue_safe(self.__gateway) + self.__out_sig = py_io_signature( + len(out_sig), len(out_sig), out_sig) + + self.gateway = block_gateway( + self, name, self.__in_sig.gr_io_signature(), self.__out_sig.gr_io_signature()) + + self.msg_handlers = {} + + def __getattr__(self, name): + """ + Pass-through member requests to the C++ object. + """ + if not hasattr(self, "gateway"): + raise RuntimeError( + "{0}: invalid state -- did you forget to call {0}.__init__ in " + "a derived class?".format(self.__class__.__name__)) + return getattr(self.gateway, name) def to_basic_block(self): """ Makes this block connectable by hier/top block python """ - return self.__gateway.to_basic_block() + return self.gateway.to_basic_block() + + def fixed_rate_noutput_to_ninput(self, noutput_items): + return int((noutput_items * self._decim / self._interp) + self.gateway.history() - 1) - def __gr_block_handle(self): + def handle_forecast(self, noutput_items, ninputs): """ - Dispatch tasks according to the action type specified in the message. + This is the handler function for forecast calls from + block_gateway in c++ across pybind11 wrappers """ + return self.forecast(noutput_items, ninputs) + + # return ninput_items_required - if self.__message.action == gr.block_gw_message_type.ACTION_GENERAL_WORK: - # Actual number of inputs/output from scheduler - ninputs = len(self.__message.general_work_args_input_items) - noutputs = len(self.__message.general_work_args_output_items) - in_types = self.__in_sig.port_types(ninputs) - out_types = self.__out_sig.port_types(noutputs) - self.__message.general_work_args_return_value = self.general_work( - - input_items=[pointer_to_ndarray( - self.__message.general_work_args_input_items[i], - in_types[i], - self.__message.general_work_args_ninput_items[i] - ) for i in range(ninputs)], - - output_items=[pointer_to_ndarray( - self.__message.general_work_args_output_items[i], - out_types[i], - self.__message.general_work_args_noutput_items - ) for i in range(noutputs)], - ) - - elif self.__message.action == gr.block_gw_message_type.ACTION_WORK: - # Actual number of inputs/output from scheduler - ninputs = len(self.__message.work_args_input_items) - noutputs = len(self.__message.work_args_output_items) - in_types = self.__in_sig.port_types(ninputs) - out_types = self.__out_sig.port_types(noutputs) - self.__message.work_args_return_value = self.work( - - input_items=[pointer_to_ndarray( - self.__message.work_args_input_items[i], - in_types[i], - self.__message.work_args_ninput_items - ) for i in range(ninputs)], - - output_items=[pointer_to_ndarray( - self.__message.work_args_output_items[i], - out_types[i], - self.__message.work_args_noutput_items - ) for i in range(noutputs)], - ) - - elif self.__message.action == gr.block_gw_message_type.ACTION_FORECAST: - self.forecast( - noutput_items=self.__message.forecast_args_noutput_items, - ninput_items_required=self.__message.forecast_args_ninput_items_required, - ) - - elif self.__message.action == gr.block_gw_message_type.ACTION_START: - self.__message.start_args_return_value = self.start() - - elif self.__message.action == gr.block_gw_message_type.ACTION_STOP: - self.__message.stop_args_return_value = self.stop() - - def forecast(self, noutput_items, ninput_items_required): + def forecast(self, noutput_items, ninputs): """ forecast is only called from a general block this is the default implementation """ - for i in range(len(ninput_items_required)): - ninput_items_required[i] = noutput_items + self.history() - 1 + ninput_items_required = [0]*ninputs + for i in range(ninputs): + ninput_items_required[i] = noutput_items + self.gateway.history() - 1 + + return ninput_items_required + + def handle_general_work(self, noutput_items, + ninput_items, + input_items, + output_items): + + ninputs = len(input_items) + noutputs = len(output_items) + in_types = self.in_sig().port_types(ninputs) + out_types = self.out_sig().port_types(noutputs) + + + ctypes.pythonapi.PyCapsule_GetPointer.restype = ctypes.c_void_p + ctypes.pythonapi.PyCapsule_GetPointer.argtypes = [ctypes.py_object, ctypes.c_char_p] + + if self._block_type != gr.GW_BLOCK_GENERAL: + ii=[pointer_to_ndarray( + ctypes.pythonapi.PyCapsule_GetPointer(input_items[i],None), + in_types[i], + self.fixed_rate_noutput_to_ninput(noutput_items) + ) for i in range(ninputs)] + else: + ii=[pointer_to_ndarray( + ctypes.pythonapi.PyCapsule_GetPointer(input_items[i],None), + in_types[i], + ninput_items[i] + ) for i in range(ninputs)] + + oo=[pointer_to_ndarray( + ctypes.pythonapi.PyCapsule_GetPointer(output_items[i],None), + out_types[i], + noutput_items + ) for i in range(noutputs)] + + if self._block_type != gr.GW_BLOCK_GENERAL: + r = self.work(ii,oo) + self.consume_items(r) + else: + r = self.general_work(ii,oo) + + return r def general_work(self, *args, **kwargs): """general work to be overloaded in a derived class""" @@ -252,25 +219,43 @@ class gateway_block(object): def stop(self): return True - def set_msg_handler(self, which_port, handler_func): - handler = msg_handler() - handler.init(handler_func) - self.__gateway.set_msg_handler_feval(which_port, handler) - # Save handler object in class so it's not garbage collected - self.__msg_handlers[which_port] = handler - def in_sig(self): return self.__in_sig def out_sig(self): return self.__out_sig + def set_msg_handler(self, which_port, handler_function): + self.gateway.set_msg_handler_pybind(which_port, handler_function.__name__) + # Save handler object in class so it's not garbage collected + self.msg_handlers[which_port] = handler_function + + # TODO: Make gateway_block have an is-a instead of has-a relationship + # That way we don't have to wrap all these functions + + # def message_port_register_in(self, port_id): + # return self.gateway.message_port_register_in(port_id) + + # def message_port_register_out(self, port_id): + # return self.gateway.message_port_register_out(port_id) + + # def consume_each(self, how_many_items): + # return self.gateway.consume_each( how_many_items) + + # def consume(self, which_input, how_many_items): + # return self.gateway.consume(which_input, how_many_items) + + # def produce(self, which_output, how_many_items): + # return self.gateway.produce(which_output, how_many_items) + + ######################################################################## # Wrappers for the user to inherit from ######################################################################## -class basic_block(gateway_block): - """Args: +class basic_block(gateway_block): + """ + Args: name (str): block name in_sig (gr.py_io_signature): input port signature @@ -279,18 +264,19 @@ class basic_block(gateway_block): For backward compatibility, a sequence of numpy type names is also accepted as an io signature. - """ def __init__(self, name, in_sig, out_sig): gateway_block.__init__(self, - name=name, - in_sig=in_sig, - out_sig=out_sig, - work_type=gr.GR_BLOCK_GW_WORK_GENERAL, - factor=1, #not relevant factor - ) - -class sync_block(gateway_block): + name=name, + in_sig=in_sig, + out_sig=out_sig, + block_type=gr.GW_BLOCK_GENERAL + ) + + def consume_items(self, nitems ): + pass + +class sync_block(gateway_block): """ Args: name (str): block name @@ -304,12 +290,18 @@ class sync_block(gateway_block): """ def __init__(self, name, in_sig, out_sig): gateway_block.__init__(self, - name=name, - in_sig=in_sig, - out_sig=out_sig, - work_type=gr.GR_BLOCK_GW_WORK_SYNC, - factor=1, - ) + name=name, + in_sig=in_sig, + out_sig=out_sig, + block_type=gr.GW_BLOCK_SYNC + ) + self._decim = 1 + self._interp = 1 + + def consume_items(self, nitems ): + if (nitems > 0): + self.gateway.consume_each(nitems) + class decim_block(gateway_block): """ @@ -325,12 +317,24 @@ class decim_block(gateway_block): """ def __init__(self, name, in_sig, out_sig, decim): gateway_block.__init__(self, - name=name, - in_sig=in_sig, - out_sig=out_sig, - work_type=gr.GR_BLOCK_GW_WORK_DECIM, - factor=decim, - ) + name=name, + in_sig=in_sig, + out_sig=out_sig, + block_type=gr.GW_BLOCK_DECIM + ) + self._decim = decim + self._interp = 1 + self.gateway.set_relative_rate(self._interp, self._decim) + self.gateway.set_output_multiple(self._interp) + + def consume_items(self, nitems ): + if (nitems > 0): + self.gateway.consume_each(int(nitems * self._decim)) + + def forecast(self, noutput_items, ninputs): + return [self.fixed_rate_noutput_to_ninput(noutput_items) for ii in range(ninputs)] + + class interp_block(gateway_block): """ @@ -346,9 +350,22 @@ class interp_block(gateway_block): """ def __init__(self, name, in_sig, out_sig, interp): gateway_block.__init__(self, - name=name, - in_sig=in_sig, - out_sig=out_sig, - work_type=gr.GR_BLOCK_GW_WORK_INTERP, - factor=interp, - ) + name=name, + in_sig=in_sig, + out_sig=out_sig, + block_type=gr.GW_BLOCK_DECIM + ) + self._decim = 1 + self._interp = interp + self.gateway.set_relative_rate(self._interp, self._decim) + self.gateway.set_output_multiple(self._interp) + + + def consume_items(self, nitems ): + if (nitems > 0): + self.gateway.consume_each(int(nitems / self._interp)) + + def forecast(self, noutput_items, ninputs): + # print("{},{},{}".format(noutput_items, ninputs, [self.fixed_rate_noutput_to_ninput(noutput_items) for ii in range(ninputs)])) + + return [self.fixed_rate_noutput_to_ninput(noutput_items) for ii in range(ninputs)] diff --git a/gnuradio-runtime/python/gnuradio/gr/hier_block2.py b/gnuradio-runtime/python/gnuradio/gr/hier_block2.py index 60b7fdb5ac..ead607ba8a 100644 --- a/gnuradio-runtime/python/gnuradio/gr/hier_block2.py +++ b/gnuradio-runtime/python/gnuradio/gr/hier_block2.py @@ -10,7 +10,9 @@ from __future__ import unicode_literals import functools -from .runtime_swig import hier_block2_swig, dot_graph +# from .runtime_swig import hier_block2_swig, dot_graph +from .gr_python import hier_block2_pb + import pmt @@ -68,7 +70,7 @@ class hier_block2(object): """ Create a hierarchical block with a given name and I/O signatures. """ - self._impl = hier_block2_swig(name, input_signature, output_signature) + self._impl = hier_block2_pb(name, input_signature, output_signature) def __getattr__(self, name): """ @@ -140,8 +142,8 @@ class hier_block2(object): """ self.primitive_message_port_register_hier_out(pmt.intern(portname)) - def dot_graph(self): - """ - Return graph representation in dot language - """ - return dot_graph(self._impl) + # def dot_graph(self): + # """ + # Return graph representation in dot language + # """ + # return dot_graph(self._impl) diff --git a/gnuradio-runtime/python/gnuradio/gr/qa_flowgraph.py b/gnuradio-runtime/python/gnuradio/gr/qa_flowgraph.py index e5767e05d8..c92bea241e 100644 --- a/gnuradio-runtime/python/gnuradio/gr/qa_flowgraph.py +++ b/gnuradio-runtime/python/gnuradio/gr/qa_flowgraph.py @@ -40,7 +40,7 @@ class test_flowgraph (gr_unittest.TestCase): self.assertEqual(dbg.num_messages(), 1) data = pmt.u8vector_elements(pmt.cdr(dbg.get_message(0))) - self.assertEqual((1, 2, 3), data) + self.assertEqual([1, 2, 3], data) if __name__ == '__main__': gr_unittest.run(test_flowgraph, 'test_flowgraph.xml') diff --git a/gnuradio-runtime/python/gnuradio/gr/tag_utils.py b/gnuradio-runtime/python/gnuradio/gr/tag_utils.py index cdb3350ed0..26fd62b864 100644 --- a/gnuradio-runtime/python/gnuradio/gr/tag_utils.py +++ b/gnuradio-runtime/python/gnuradio/gr/tag_utils.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals import pmt -from . import runtime_swig as gr +from . import gr_python as gr class PythonTag(object): " Python container for tags " @@ -58,17 +58,17 @@ def python_to_tag(tag_struct): good = True if('key' in tag_struct): - if(isinstance(tag_struct['key'], pmt.swig_pmt_ptr)): + if(isinstance(tag_struct['key'], pmt.pmt_base)): tag.key = tag_struct['key'] good = True if('value' in tag_struct): - if(isinstance(tag_struct['value'], pmt.swig_pmt_ptr)): + if(isinstance(tag_struct['value'], pmt.pmt_base)): tag.value = tag_struct['value'] good = True if('srcid' in tag_struct): - if(isinstance(tag_struct['srcid'], pmt.swig_pmt_ptr)): + if(isinstance(tag_struct['srcid'], pmt.pmt_base)): tag.srcid = tag_struct['srcid'] good = True @@ -78,15 +78,15 @@ def python_to_tag(tag_struct): tag.offset = tag_struct[0] good = True - if(isinstance(tag_struct[1], pmt.swig_pmt_ptr)): + if(isinstance(tag_struct[1], pmt.pmt_base)): tag.key = tag_struct[1] good = True - if(isinstance(tag_struct[2], pmt.swig_pmt_ptr)): + if(isinstance(tag_struct[2], pmt.pmt_base)): tag.value = tag_struct[2] good = True - if(isinstance(tag_struct[3], pmt.swig_pmt_ptr)): + if(isinstance(tag_struct[3], pmt.pmt_base)): tag.srcid = tag_struct[3] good = True @@ -95,11 +95,11 @@ def python_to_tag(tag_struct): tag.offset = tag_struct[0] good = True - if(isinstance(tag_struct[1], pmt.swig_pmt_ptr)): + if(isinstance(tag_struct[1], pmt.pmt_base)): tag.key = tag_struct[1] good = True - if(isinstance(tag_struct[2], pmt.swig_pmt_ptr)): + if(isinstance(tag_struct[2], pmt.pmt_base)): tag.value = tag_struct[2] good = True @@ -112,33 +112,33 @@ def python_to_tag(tag_struct): def tag_t_offset_compare_key(): """ - Convert a tag_t_offset_compare function into a key=function + Convert a tag_t.offset_compare function into a key=function This method is modeled after functools.cmp_to_key(_func_). It can be used by functions that accept a key function, such as sorted(), min(), max(), etc. to compare tags by their offsets, - e.g., sorted(tag_list, key=gr.tag_t_offset_compare_key()). + e.g., sorted(tag_list, key=gr.tag_t.offset_compare_key()). """ class K(object): def __init__(self, obj, *args): self.obj = obj def __lt__(self, other): # x.offset < y.offset - return gr.tag_t_offset_compare(self.obj, other.obj) + return gr.tag_t.offset_compare(self.obj, other.obj) def __gt__(self, other): # y.offset < x.offset - return gr.tag_t_offset_compare(other.obj, self.obj) + return gr.tag_t.offset_compare(other.obj, self.obj) def __eq__(self, other): # not (x.offset < y.offset) and not (y.offset < x.offset) - return not gr.tag_t_offset_compare(self.obj, other.obj) and \ - not gr.tag_t_offset_compare(other.obj, self.obj) + return not gr.tag_t.offset_compare(self.obj, other.obj) and \ + not gr.tag_t.offset_compare(other.obj, self.obj) def __le__(self, other): # not (y.offset < x.offset) - return not gr.tag_t_offset_compare(other.obj, self.obj) + return not gr.tag_t.offset_compare(other.obj, self.obj) def __ge__(self, other): # not (x.offset < y.offset) - return not gr.tag_t_offset_compare(self.obj, other.obj) + return not gr.tag_t.offset_compare(self.obj, other.obj) def __ne__(self, other): # (x.offset < y.offset) or (y.offset < x.offset) - return gr.tag_t_offset_compare(self.obj, other.obj) or \ - gr.tag_t_offset_compare(other.obj, self.obj) + return gr.tag_t.offset_compare(self.obj, other.obj) or \ + gr.tag_t.offset_compare(other.obj, self.obj) return K diff --git a/gnuradio-runtime/python/gnuradio/gr/top_block.py b/gnuradio-runtime/python/gnuradio/gr/top_block.py index e8a18b2d07..9523e4e91d 100644 --- a/gnuradio-runtime/python/gnuradio/gr/top_block.py +++ b/gnuradio-runtime/python/gnuradio/gr/top_block.py @@ -10,11 +10,12 @@ from __future__ import absolute_import from __future__ import unicode_literals -from .runtime_swig import (top_block_swig, +from .gr_python import (top_block_pb, top_block_wait_unlocked, top_block_run_unlocked, top_block_start_unlocked, top_block_stop_unlocked, - top_block_unlock_unlocked, dot_graph_tb) + top_block_unlock_unlocked) #, dot_graph_tb) +from .hier_block2 import hier_block2 import threading from .hier_block2 import hier_block2 @@ -89,7 +90,7 @@ class top_block(hier_block2): Create a top block with a given name. """ # not calling hier_block2.__init__, we set our own _impl - self._impl = top_block_swig(name, catch_exceptions) + self._impl = top_block_pb(name) self.handle_sigint = True def start(self, max_noutput_items=10000000): @@ -123,8 +124,8 @@ class top_block(hier_block2): """ _top_block_waiter(self._impl).wait(self.handle_sigint) - def dot_graph(self): - """ - Return graph representation in dot language - """ - return dot_graph_tb(self._impl) + # def dot_graph(self): + # """ + # Return graph representation in dot language + # """ + # return dot_graph_tb(self._impl) |