summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt62
-rw-r--r--cmake/Modules/CMakeOverloads.cmake69
-rw-r--r--cmake/Modules/FindCppUnit.cmake7
-rw-r--r--docs/doxygen/other/msg_passing.dox236
-rw-r--r--docs/doxygen/other/stream_tags.dox96
-rw-r--r--gnuradio-runtime/lib/hier_block2_detail.cc17
-rw-r--r--gr-blocks/examples/ctrlport/simple_copy.grc50
-rw-r--r--gr-blocks/lib/tuntap_pdu_impl.cc2
-rw-r--r--gr-blocks/python/blocks/qa_moving_average.py37
-rw-r--r--gr-digital/examples/demod/symbol_sync_test_complex.grc778
-rw-r--r--gr-digital/examples/demod/symbol_sync_test_float.grc693
-rw-r--r--gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc7
-rw-r--r--gr-uhd/doc/uhd.dox1
-rw-r--r--gr-uhd/include/gnuradio/uhd/usrp_source.h27
-rw-r--r--gr-uhd/lib/usrp_block_impl.cc16
-rw-r--r--gr-uhd/lib/usrp_block_impl.h12
-rw-r--r--gr-uhd/lib/usrp_sink_impl.cc12
-rw-r--r--gr-uhd/lib/usrp_sink_impl.h2
-rw-r--r--gr-uhd/lib/usrp_source_impl.cc26
-rw-r--r--gr-uhd/lib/usrp_source_impl.h6
-rw-r--r--gr-zeromq/include/gnuradio/zeromq/pub_msg_sink.h2
-rw-r--r--gr-zeromq/include/gnuradio/zeromq/pub_sink.h2
-rw-r--r--gr-zeromq/include/gnuradio/zeromq/pull_msg_source.h2
-rw-r--r--gr-zeromq/include/gnuradio/zeromq/pull_source.h2
-rw-r--r--gr-zeromq/include/gnuradio/zeromq/push_msg_sink.h2
-rw-r--r--gr-zeromq/include/gnuradio/zeromq/push_sink.h2
-rw-r--r--gr-zeromq/include/gnuradio/zeromq/rep_msg_sink.h2
-rw-r--r--gr-zeromq/include/gnuradio/zeromq/rep_sink.h2
-rw-r--r--gr-zeromq/include/gnuradio/zeromq/req_msg_source.h2
-rw-r--r--gr-zeromq/include/gnuradio/zeromq/req_source.h2
-rw-r--r--gr-zeromq/include/gnuradio/zeromq/sub_msg_source.h2
-rw-r--r--gr-zeromq/include/gnuradio/zeromq/sub_source.h2
-rw-r--r--grc/blocks/options.xml51
-rw-r--r--grc/core/Platform.py4
-rw-r--r--grc/core/generator/flow_graph.tmpl58
-rw-r--r--grc/core/utils/__init__.py1
-rw-r--r--grc/core/utils/hide_bokeh_gui_options_if_not_installed.py28
-rw-r--r--grc/gui/MainWindow.py7
38 files changed, 975 insertions, 1354 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4de54d674a..a832cf20ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -131,32 +131,31 @@ ELSE()
MESSAGE(status "Skipping compiler version check.")
ENDIF()
-# Configure C++ and C standards
-IF(CMAKE_VERSION VERSION_LESS "3.1")
- IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
- ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
- ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
- ELSE()
- MESSAGE(warning "C++ standard could not be set because compiler is not GNU, Clang or MSVC.")
- ENDIF()
+# Configure C++ standard if not externally specified (will actually be
+# set after CppUnit check below). Use the variable CMAKE_CXX_STANDARD
+# since it will actually be used for this purposes starting in CMake 3.1.
- IF(CMAKE_C_COMPILER_ID STREQUAL "GNU")
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
- ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "Clang")
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
- ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
- ELSE()
- MESSAGE(warning "C standard could not be set because compiler is not GNU, Clang or MSVC.")
- ENDIF()
-ELSE()
- SET(CMAKE_C_STANDARD 90)
+IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
SET(CMAKE_CXX_STANDARD 98)
+ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ SET(CMAKE_CXX_STANDARD 98)
+ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ SET(CMAKE_CXX_STANDARD 98)
+ELSE()
+ message(warning "C++ standard could not be set because compiler is not GNU, Clang or MSVC.")
+ENDIF()
+
+IF(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
+ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "Clang")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
+ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
+ELSE()
+ message(warning "C standard could not be set because compiler is not GNU, Clang or MSVC.")
ENDIF()
+
########################################################################
# Environment setup
########################################################################
@@ -177,6 +176,12 @@ set(EXPORT_FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake)
file(WRITE ${EXPORT_FILE}) #blank the file (subdirs will append)
########################################################################
+# Incorporate CMake function/macros overloading.
+########################################################################
+
+include(CMakeOverloads)
+
+########################################################################
# Compiler specific setup
########################################################################
include(GrMiscUtils) #compiler flag check
@@ -369,6 +374,19 @@ GR_REGISTER_COMPONENT("testing-support" ENABLE_TESTING
CPPUNIT_FOUND
)
+# check if CppUnit version is 1.14.0 or greater; requires c++11 ...
+
+if(CPPUNIT_FOUND AND NOT "${CPPUNIT_VERSION}" VERSION_LESS "1.14.0")
+ message(WARNING "\nWarning: CppUnit version is ${CPPUNIT_VERSION} which requires C++11 for building. Trying to set CMake internally to use C++11 ...")
+ SET(CMAKE_CXX_STANDARD 11)
+endif()
+
+# if cmake version is < 3.1, explicitly set C++ standard to use.
+
+if(${CMAKE_VERSION} VERSION_LESS "3.1")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++${CMAKE_CXX_STANDARD}")
+endif()
+
########################################################################
# Add optional dlls specified in DLL_PATHS
########################################################################
diff --git a/cmake/Modules/CMakeOverloads.cmake b/cmake/Modules/CMakeOverloads.cmake
new file mode 100644
index 0000000000..450d44c95a
--- /dev/null
+++ b/cmake/Modules/CMakeOverloads.cmake
@@ -0,0 +1,69 @@
+# Copyright 2017 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+
+########################################################################
+# This file contains functions that override those provided by CMake.
+# We do this to allow for more generic use of these functions than as
+# provided by CMake.
+########################################################################
+
+if(DEFINED __INCLUDED_CMAKE_OVERLOADS)
+ return()
+endif()
+set(__INCLUDED_CMAKE_OVERLOADS TRUE)
+
+# overload INCLUDE_DIRECTORIES to be a little smarter
+#
+# NOTE: moving all include directories to either BEFORE (internal to
+# source or build) or AFTER (external to source or build) will work in
+# general. The primary time it could fail is when include ordering is
+# required to find a specific version of a header when multiple of the
+# same name are available in the various include directories. This
+# situation seems like it's unlikely, so we ignore it here.
+
+macro(INCLUDE_DIRECTORIES)
+ # for each provided include directory ...
+ foreach(inc_dir ${ARGN})
+
+ # is this dir the literal string "BEFORE" or "AFTER"?
+ string(FIND ${inc_dir} BEFORE IS_BEFORE)
+ string(FIND ${inc_dir} AFTER IS_AFTER)
+ if(NOT ${IS_BEFORE} EQUAL 0 AND NOT ${IS_AFTER} EQUAL 0)
+
+ # not "BEFORE" or "AFTER"; a real directory.
+ # get absolute path of this include directory
+ get_filename_component(inc_dir_abs ${inc_dir} ABSOLUTE)
+
+ # is this include directory located within the SOURCE or BUILD?
+ string(FIND ${inc_dir_abs} ${CMAKE_SOURCE_DIR} IS_IN_SOURCE)
+ string(FIND ${inc_dir_abs} ${CMAKE_BINARY_DIR} IS_IN_BINARY)
+ if(${IS_IN_SOURCE} EQUAL 0 OR ${IS_IN_BINARY} EQUAL 0)
+ # yes: local SOURCE or BINARY; internal.
+ # call the overloaded INCLUDE_DIRECTORIES,
+ # prepending this internal directory.
+ _include_directories(BEFORE ${inc_dir_abs})
+ else()
+ # no: not SOURCE or BUILD; must be external.
+ # call the overloaded INCLUDE_DIRECTORIES,
+ # appending this external directory.
+ _include_directories(AFTER ${inc_dir_abs})
+ endif()
+ endif()
+ endforeach()
+endmacro(INCLUDE_DIRECTORIES)
diff --git a/cmake/Modules/FindCppUnit.cmake b/cmake/Modules/FindCppUnit.cmake
index f93ade3412..4e9469f9f6 100644
--- a/cmake/Modules/FindCppUnit.cmake
+++ b/cmake/Modules/FindCppUnit.cmake
@@ -37,3 +37,10 @@ LIST(APPEND CPPUNIT_LIBRARIES ${CMAKE_DL_LIBS})
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS)
MARK_AS_ADVANCED(CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS)
+
+
+# set version to be useable by calling script
+
+IF(CPPUNIT_FOUND)
+ set(CPPUNIT_VERSION ${PC_CPPUNIT_VERSION} CACHE INTERNAL "CppUnit Version" FORCE)
+ENDIF()
diff --git a/docs/doxygen/other/msg_passing.dox b/docs/doxygen/other/msg_passing.dox
index 827ad4ee62..14de7bae4c 100644
--- a/docs/doxygen/other/msg_passing.dox
+++ b/docs/doxygen/other/msg_passing.dox
@@ -14,7 +14,7 @@
GNU Radio was originally a streaming system with no other mechanism to
pass data between blocks. Streams of data are a model that work well
for samples, bits, etc., but are not really the right mechanism for
-control data, metadata, and, often, packet structures (at least at
+control data, metadata, or packet structures (at least at
some point in the processing chain).
We solved part of this problem by introducing the tag stream (see \ref
@@ -32,7 +32,7 @@ We want a more general message passing system for a couple of
reasons. The first is to allow blocks downstream to communicate back
to blocks upstream. The second is to allow an easier way for us to
communicate back and forth between external applications and GNU
-Radio. The new message passing interface handles these cases, although
+Radio. GNU Radio's message passing interface handles these cases, although
it does so on an asynchronous basis.
The message passing interface heavily relies on Polymorphic Types
@@ -57,20 +57,33 @@ to register a new port are:
void message_port_register_out(pmt::pmt_t port_id)
\endcode
+In Python:
+
+\code
+ self.message_port_register_in(pmt.intern("port name"))
+ self.message_port_register_out(pmt.intern("port name"))
+\endcode
+
The ports are now identifiable by that port name. Other blocks who may
want to post or receive messages on a port must subscribe to it. When
a block has a message to send, they are published on a particular
-port. The subscribe and publish API looks like:
+port using the following API:
\code
- void message_port_pub(pmt::pmt_t port_id,
- pmt::pmt_t msg);
- void message_port_sub(pmt::pmt_t port_id,
- pmt::pmt_t target);
- void message_port_unsub(pmt::pmt_t port_id,
- pmt::pmt_t target);
+ void message_port_pub(pmt::pmt_t port_id, pmt::pmt_t msg);
\endcode
+In Python:
+
+\code
+ self.message_port_pub(pmt.intern("port name"), <pmt message>)
+\endcode
+
+Subscribing is usually done in the form of connecting message ports
+as part of the flowgraph, as discussed later. Internally, when message
+ports are connected, the gr::basic_block::message_port_sub method is
+called.
+
Any block that has a subscription to another block's output message
port will receive the message when it is published. Internally, when a
block publishes a message, it simply iterates through all blocks that
@@ -91,6 +104,14 @@ Boost's 'bind' function:
boost::bind(&block_class::message_handler_function, this, _1));
\endcode
+In Python:
+
+\code
+ self.set_msg_handler(pmt.intern("port name"), <msg handler function>)
+\endcode
+
+When a new message is pushed onto a port's message queue,
+it is this function that is used to process the message.
The 'port_id' is the same PMT as used when registering the input
port. The 'block_class::message_handler_function' is the member
function of the class designated to handle messages to this port. The
@@ -104,16 +125,22 @@ is:
void block_class::message_handler_function(pmt::pmt_t msg);
\endcode
-We give an example of using this below.
+In Python the equivalent function would be:
+
+\code
+ def handle_msg(self, msg):
+\endcode
+
+We give examples of using this below.
\subsection msg_passing_fg_connect Connecting Messages through the Flowgraph
From the flowgraph level, we have instrumented a gr::hier_block2::msg_connect
method to make it easy to subscribe blocks to other blocks'
-messages. The message connection method looks like the following
-code. Assume that the block \b src has an output message port named
-\a pdus and the block \b dbg has an input port named \a print.
+messages. Assume that the block \b src has an output message port named
+\a pdus and the block \b dbg has an input port named \a print. The message
+connection in the flowgraph (in Python) looks like the following:
\code
self.tb.msg_connect(src, "pdus", dbg, "print")
@@ -144,24 +171,92 @@ gr::basic_block::_post method of the blocks as the way to access the
message queue. So the message queue of the right name will have a new
message. Posting messages also has the benefit of waking up the
block's thread if it is in a wait state. So if idle, as soon as a
-message is posted, it will wake up and and call the message handler.
+message is posted, it will wake up and call the message handler.
-The other side of the action in a block is in the message
-handler. When a block has an input message port, it needs a callback
-function to handle messages received on that port. We use a Boost bind
-operator to bind the message port to the message handling
-function. When a new message is pushed onto a port's message queue,
-it is this function that is used to process the message.
+\section msg_passing_posting Posting from External Sources
-\section msg_passing_python Message Passing in Python Blocks
+An important feature of the message passing architecture
+is how it can be used to take in messages from an external source. We
+can call a block's gr::basic_block::_post method directly and pass it a
+message. So any block with an input message port can receive messages
+from the outside in this way.
+
+The following example uses a gr::blocks::pdu_to_tagged_stream block
+as the source block to a flowgraph. Its purpose is to wait for
+messages as PDUs posted to it and convert them to a normal stream. The
+payload will be sent on as a normal stream while the meta data will be
+decoded into tags and sent on the tagged stream.
+
+So if we have created a \b src block as a PDU to stream, it has a \a
+pdus input port, which is how we will inject PDU messages into the
+flowgraph. These PDUs could come from another block or flowgraph, but
+here, we will create and insert them by hand.
+
+\code
+ port = pmt.intern("pdus")
+ msg = pmt.cons(pmt.PMT_NIL, pmt.make_u8vector(16, 0xFF))
+ src.to_basic_block()._post(port, msg)
+\endcode
+
+The PDU's metadata section is empty, hence the pmt::PMT_NIL
+object. The payload is now just a simple vector of 16 bytes of all
+1's. To post the message, we have to access the block's gr::basic_block
+class, which we do using the gr::basic_block::to_basic_block method and
+then call the gr::basic_block::_post method to pass the PDU to the
+right port.
+
+All of these mechanisms are explored and tested in the QA code of the
+file qa_pdu.py.
+
+There are some examples of using the message passing infrastructure
+through GRC in gr-blocks/examples/msg_passing.
+
+
+\section msg_passing_commands Using messages as commands
+
+One important use of messages is to send commands to blocks. Examples for this include:
+
+- gr::qtgui::freq_sink_c: The scaling of the frequency axis can be changed by messages
+- gr::uhd::usrp_source and gr::uhd::usrp_sink: Many transceiver-related settings can
+ be manipulated through command messages, such as frequency, gain and LO offset
+- gr::digital::header_payload_demux, which receives an acknowledgement from a header parser
+ block on how many payload items there are to process
+
+There is no special PMT type to encode commands, however, it is strongly recommended
+to use one of the following formats:
+
+- pmt::cons(KEY, VALUE): This format is useful for commands that take a single value.
+ Think of KEY and VALUE as the argument name and value, respectively. For the case of
+ the QT GUI Frequency Sink, KEY would be "freq" and VALUE would be the new center frequency
+ in Hz.
+- pmt::dict((KEY1: VALUE1), (KEY2: VALUE2), ...): This is basically the same as the
+ previous format, but you can provide multiple key/value pairs. This is particularly
+ useful when a single command takes multiple arguments which can't be broken into
+ multiple command messages (e.g., the USRP blocks might have both a timestamp and a
+ center frequency in a command message, which are closely associated).
+
+In both cases, all KEYs should be pmt::symbols (i.e. strings). VALUEs can be
+whatever the block requires.
+
+It might be tempting to deviate from this format, e.g. the QT Frequency sink could
+simply take a float value as a command message, and it would still work fine.
+However, there are some very good reasons to stick to this format:
-ADD STUFF HERE
+- Interoperability: The more people use the standard format, the more likely it
+ is that blocks from different sources can work together
+- Inspectability: A message debug block will display more useful information about
+ a message if it's containing both a value and a key
+- Intuition: This format is pretty versatile and unlikely to create situations
+ where it is not sufficient (especially considering that values are PMTs themselves).
+ As a counterexample, using positional arguments (something like "the first argument
+ is the frequency, the second the gain") is easily forgotten, or changed in one place
+ and not another, etc.
\section msg_passing_examples Code Examples
-The following is snippets of code from blocks current in GNU Radio
+The following is snippets of code from blocks currently in GNU Radio
that take advantage of message passing. We will be using
gr::blocks::message_debug and gr::blocks::tagged_stream_to_pdu below
to show setting up both input and output message passing capabilities.
@@ -193,10 +288,10 @@ The constructor of this block looks like this:
}
\endcode
-So the three ports are registered by their respective names. We then
-use the gr::basic_block::set_msg_handler function to identify this
-particular port name with a callback function. The Boost \a bind
-function (<a target="_blank"
+The three message input ports are registered by their respective
+names. We then use the gr::basic_block::set_msg_handler function to
+identify this particular port name with a callback function. The
+Boost \a bind function (<a target="_blank"
href="http://www.boost.org/doc/libs/1_52_0/libs/bind/bind.html">Boost::bind</a>)
here binds the callback to a function of this block's class. So now
the functions in the block's private implementation class,
@@ -217,7 +312,7 @@ message_debug_impl::print(pmt::pmt_t msg)
The function simply takes in the PMT message and prints it. The method
pmt::print is a function in the PMT library to print the
-PMT in a friendly, (mostly) pretty manner.
+PMT in a friendly and (mostly) pretty manner.
The gr::blocks::tagged_stream_to_pdu block only defines a single
output message port. In this case, its constructor contains the line:
@@ -231,8 +326,8 @@ output message port. In this case, its constructor contains the line:
So we are only creating a single output port where \a pdu_port_id
is defined in the file pdu.h as \a pdus.
-This blocks purpose is to take in a stream of samples along with
-stream tags and construct a predefined PDU message from this. In GNU
+This block's purpose is to take in a stream of samples along with
+stream tags and construct a predefined PDU message from it. In GNU
Radio, we define a PDU as a PMT pair of (metadata, data). The metadata
describes the samples found in the data portion of the
pair. Specifically, the metadata can contain the length of the data
@@ -266,7 +361,7 @@ tagged_stream_to_pdu_impl::send_message()
}
\endcode
-This function does a bit of checking to make sure the PDU is ok as
+This function does a bit of checking to make sure the PDU is OK as
well as some cleanup in the end. But it is the line where the message
is published that is important to this discussion. Here, the block
posts the PDU message to any subscribers by calling
@@ -281,83 +376,6 @@ them. The data is then converted into an output stream of items and
passed along. The next section describes how PDUs can be passed into a
flowgraph using the gr::blocks::pdu_to_tagged_stream block.
-\section msg_passing_posting Posting from External Sources
-
-The last feature of the message passing architecture to discuss here
-is how it can be used to take in messages from an external source. We
-can call a block's gr::basic_block::_post method directly and pass it a
-message. So any block with an input message port can receive messages
-from the outside in this way.
-
-The following example uses a gr::blocks::pdu_to_tagged_stream block
-as the source block to a flowgraph. Its purpose is to wait for
-messages as PDUs posted to it and convert them to a normal stream. The
-payload will be sent on as a normal stream while the meta data will be
-decoded into tags and sent on the tagged stream.
-
-So if we have created a \b src block as a PDU to stream, it has a \a
-pdus input port, which is how we will inject PDU messages to the
-flowgraph. These PDUs could come from another block or flowgraph, but
-here, we will create and insert them by hand.
-
-\code
- port = pmt.intern("pdus")
- msg = pmt.cons(pmt.PMT_NIL,
- pmt.make_u8vector(16, 0xFF))
- src.to_basic_block()._post(port, msg)
-\endcode
-
-The PDU's metadata section is empty, hence the pmt::PMT_NIL
-object. The payload is now just a simple vector of 16 bytes of all
-1's. To post the message, we have to access the block's gr::basic_block
-class, which we do using the gr::basic_block::to_basic_block method and
-then call the gr::basic_block::_post method to pass the PDU to the
-right port.
-
-All of these mechanisms are explored and tested in the QA code of the
-file qa_pdu.py.
-
-There are some examples of using the message passing infrastructure
-through GRC in gr-blocks/examples/msg_passing.
-
-\section msg_passing_commands Using messages as commands
-
-Messages can be used to send commands to blocks. Examples for this include:
-
-- gr::qtgui::freq_sink_c: The scaling of the frequency axis can be changed by messages
-- gr::uhd::usrp_source and gr::uhd::usrp_sink: Many transceiver-related settings can
- be manipulated through command messages, such as frequency, gain and LO offset
-- gr::digital::header_payload_demux, which receives an acknowledgement from a header parser
- block on how many payload items there are to process
-
-There is no special PMT type to encode commands, however, it is strongly recommended
-to use one of the following formats:
-
-- pmt::cons(KEY, VALUE): This format is useful for commands that take a single value.
- Think of KEY and VALUE as the argument name and value, respectively. For the case of
- the QT GUI Frequency Sink, KEY would be "freq" and VALUE would be the new center frequency
- in Hz.
-- pmt::dict((KEY1: VALUE1), (KEY2: VALUE2), ...): This is basically the same as the
- previous format, but you can provide multiple key/value pairs. This is particularly
- useful when a single command takes multiple arguments which can't be broken into
- multiple command messages (e.g., the USRP blocks might have both a timestamp and a
- center frequency in a command message, which are closely associated).
-
-In both cases, all KEYs should be pmt::symbols (i.e. strings). VALUEs can be
-whatever the block requires.
-
-It might be tempting to deviate from this format, e.g. the QT Frequency sink could
-simply take a float value as a command message, and it would still work fine.
-However, there are some very good reasons to stick to this format:
-
-- Interoperability: The more people use the standard format, the more likely it
- is that blocks from different sources can work together
-- Inspectability: A message debug block will display more useful information about
- a message if its containing both a value and a key
-- Intuition: This format is pretty versatile and unlikely to create situations
- where it is not sufficient (especially considering that values are PMTs themselves).
- As a counterexample, using positional arguments (something like "the first argument
- is the frequency, the second the gain") is easily forgotten, or changed in one place
- and not another, etc.
+For a Python block example, see \ref pyblocks_msgs.
*/
diff --git a/docs/doxygen/other/stream_tags.dox b/docs/doxygen/other/stream_tags.dox
index 8edc598e96..146218796e 100644
--- a/docs/doxygen/other/stream_tags.dox
+++ b/docs/doxygen/other/stream_tags.dox
@@ -15,7 +15,7 @@ GNU Radio was originally a streaming system with no other mechanism to
pass data between blocks. Streams of data are a model that work well
for samples, bits, etc., but can lack for control and meta data.
-Part of this is solved using the message passing interface, which
+Part of this is solved using the existing message passing interface, which
allows blocks to subscribe to messages published by any other block in
the flowgraph (see \ref page_msg_passing). The main drawback to the
message passing system is that is works asynchronously, meaning that
@@ -24,18 +24,18 @@ stream.
Stream tags are an isosynchronous data stream that runs parallel to
the main data stream. A stream \a tag is generated by a block's work
-function and from there on flows downstream with a particular sample
+function and from there on flows downstream alongside a particular sample,
until it reaches a sink or is forced to stop propagating by another
block.
Stream tags are defined for a specific item in the data stream and are
-formed as a key:value pair. The \a key identifies what the \a value is
+formed as a key:value pair. The \a key identifies what the \a value represents
while the value holds the data that the tag contains. Both \a key and
\a value are PMTs (\ref page_pmt) where the \a key is a PMT symbol while
-the \a value any type of PMT and can therefore handle any data we wish
-to pass. A fourth part of the tag is the \a srcid, which is a PMT
+the \a value is any type of PMT and can therefore handle any data we wish
+to pass. An additional part of the tag is the \a srcid, which is a PMT
symbol and is used to identify the block that created the tag (which
-is usually the block's alias()).
+is usually the block's alias).
\section stream_tags_block_api_extensions API Extensions to the gr::block
@@ -45,10 +45,10 @@ understand \a absolute item numbers. In the data stream model, each
block's work function is given a buffer in the data stream that is
referenced from 0 to N-1. This is a \a relative offset into the data
stream. The absolute reference starts from the beginning of the
-flowgraph and continues to count up with ever item. Each input stream
+flowgraph and continues to count up with every item. Each input stream
is associated with a concept of the 'number of items read' and each
-output stream has a 'number of items written.' These are programmed
-using the two API calls:
+output stream has a 'number of items written'. These are retrieved during
+runtime using the two API calls:
\code
unsigned long int nitems_read(unsigned int which_input);
@@ -69,40 +69,25 @@ at <em>nitems_written(0)+i</em> for the 0th output port.
\section stream_tags_api Stream Tags API
-The stream tags API consists of four functions, two to add and two to
-get the stream tags. These functions are only meant to be accessed
-within a call to general_work/work. While they can be called elsewhere
+The stream tags API is split into two parts: adding tags to a stream,
+and getting tags from a stream.
+Note that the functions described below are only meant to be accessed
+within a call to general_work/work. While they can be called at other points
in time by a block, the behavior outside of work is undefined without
exact knowledge of the item counts in the buffers.
-\li gr::block::add_item_tag: Adds an item tag to a particular output port using a
-gr::tag_t data type.
-\li gr::block::add_item_tag: Adds an item tag to a particular output
-port where each value of the tag is explicitly given.
-
-\li gr::block::get_tags_in_range: Gets all tags from a particular
-input port between a certain range of items (in absolute item time).
-
-\li gr::block::get_tags_in_range: Gets any tag that has a specified
-key from a particular input port between a certain range of items (in
-absolute item time).
-
-\li gr::block::get_tags_in_window: Gets all tags from a particular
-input port between a certain range of items (in relative item time
-within the work function).
-
-\li gr::block::get_tags_in_range: Gets any tag that has a specified
-key from a particular input port between a certain range of items (in
-relative item time within the work function).
+\subsection stream_tags_add_item_tag Adding a Tag to a Stream
+We add a tag to a particular output stream of the block using:
-\subsection stream_tags_add_item_tag Adding a Tag to a Stream
+\li gr::block::add_item_tag: Adds an item tag to a particular output port
+using a gr::tag_t data type or by specifying the tag values.
-The two function calls to add items tags are defined here. We add a
-tag to a particular output stream of the block. We can output them to
-multiple output streams if we want, but to do so means calling one of
-these functions once for each port.
+We can output them to multiple output streams if we want, but to do so
+means calling this function once for each port. This function can be
+provided with a gr::tag_t data type, or each value of the tag can be
+explicitly given.
Again, a tag is defined as:
@@ -136,14 +121,25 @@ of the tag information in the function call:
\subsection stream_tags_get_item_tags Getting tags from a Stream
-To get tags from a particular input stream, we again have two
-functions we can use. Both of these pass back vectors of
-gr::tag_t. The second function allows us to specify a particular key
-(as a PMT symbol) that filters out all but the key we are interested
-in, which reduces the effort inside the work function for getting the
-right tag's data.
+To get tags from a particular input stream, we have two
+functions we can use:
+
+\li gr::block::get_tags_in_range: Gets all tags from a particular
+input port between a certain range of items (in absolute item time).
+
+\li gr::block::get_tags_in_window: Gets all tags from a particular
+input port between a certain range of items (in relative item time
+within the work function).
-The first call just returns any tags between the given range of items:
+The difference between these functions is working in absolute item
+time versus relative item time. Both of these pass back vectors of
+gr::tag_t, and they both allow
+specifying a particular key (as a PMT symbol) to filter against
+(or the fifth argument can be left out to search for all keys).
+Filtering for a certain key reduces the effort inside the work function
+for getting the right tag's data.
+
+For example, this call just returns any tags between the given range of items:
\code
void get_tags_in_range(std::vector<tag_t> &v,
@@ -167,7 +163,7 @@ key \a key.
\section stream_tags_propagation Tag Propagation
Tags are propagated downstream from block to block like the normal
-data streams. How blocks are actually moved depends on a specific
+data streams. How tags are actually moved depends on a specific
propagation policy. We defined three types of policies:
\li All-to-All: all tags from any input port are replicated to all
@@ -175,7 +171,7 @@ output ports
\li One-to-One: tags from input port \a i are only copied to output
port \a i (depends on num inputs = num outputs).
\li Dont: Does not propagate tags. Tags are either stopped here or the
-work function propagates them itself.
+work function recreates them in some manner.
The default behavior of a block is the 'All-to-All' method of
propagation.
@@ -217,9 +213,9 @@ block. This becomes relevant when using \ref page_tagged_stream_blocks.
Tags can be very useful to an application, and their use is
spreading. USRP sources generate tag information on the time, sample
rate, and frequency of the board if anything changes. We have a meta
-data file source/sink that use tags to store information about the
-data stream. But there are things to think about when using tags in a
-block.
+data file source/sink (see \ref page_metadata) that use tags to store
+information about the data stream. But there are things to think about
+when using tags in a block.
First, when tags are not being used, there is almost no effect on the
scheduler. However, when we use tags, we add overhead by getting and
@@ -233,7 +229,7 @@ necessary and try to provide some control over how tags are generated
to control their frequency. A good example is the USRP source, which
generates a time tag. If it generated a tag with every sample, we
would have thousands of tags per second, which would add a significant
-amount of overhead. Conversely, if we started at time <em>t0</em> at
+amount of overhead. This is because if we started at time <em>t0</em> at
sample rate <em>sr</em>, then after <em>N</em> samples, we know that
we are now at time <em>t0 + N/sr</em>. So continuously producing new
tags adds no information.
@@ -243,7 +239,7 @@ there is a discontinuity in the packets received from the USRP. Since
we have no way of knowing in the flowgraph how many samples were
potentially lost, we have lost track of the timing information. The
USRP driver recognizes when packets have been dropped and uses this to
-queue another tag, which allows us to resync. Likewise, any time the
+queue another tag, which allows us to resync. Likewise, any point the
sample rate or frequency changes, a new tag is issued.
*/
diff --git a/gnuradio-runtime/lib/hier_block2_detail.cc b/gnuradio-runtime/lib/hier_block2_detail.cc
index 49eb34a6d1..82a40fe211 100644
--- a/gnuradio-runtime/lib/hier_block2_detail.cc
+++ b/gnuradio-runtime/lib/hier_block2_detail.cc
@@ -787,13 +787,6 @@ namespace gr {
std::vector<basic_block_sptr>::const_iterator b; // Because flatten_aux is const
for(b = d_blocks.begin(); b != d_blocks.end(); b++) {
tmp.push_back(*b);
- // for every block, attempt to setup RPC
- if(ctrlport_on) {
- if(!(*b)->is_rpc_set()) {
- (*b)->setup_rpc();
- (*b)->rpc_set();
- }
- }
}
// Now add the list of connected input blocks
@@ -901,6 +894,16 @@ namespace gr {
std::cout << "flatten_aux finished in top_block" << std::endl;
sfg->dump();
}
+
+ // if ctrlport is enabled, call setup RPC for all blocks in the flowgraph
+ if(ctrlport_on) {
+ for(b = blocks.begin(); b != blocks.end(); b++) {
+ if(!(*b)->is_rpc_set()) {
+ (*b)->setup_rpc();
+ (*b)->rpc_set();
+ }
+ }
+ }
}
void
diff --git a/gr-blocks/examples/ctrlport/simple_copy.grc b/gr-blocks/examples/ctrlport/simple_copy.grc
index a52c350ded..f61c6cd18a 100644
--- a/gr-blocks/examples/ctrlport/simple_copy.grc
+++ b/gr-blocks/examples/ctrlport/simple_copy.grc
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
-<?grc format='1' created='3.7.11'?>
+<?grc format='1' created='3.7.12'?>
<flow_graph>
<timestamp>Sat Mar 16 22:03:14 2013</timestamp>
<block>
@@ -393,48 +393,6 @@ to enable/disablethis block</value>
</param>
</block>
<block>
- <key>epy_block</key>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>_io_cache</key>
- <value>('Null Msg Source', 'blk', [], [], [('fake_output', 'message', 1)], '', [])</value>
- </param>
- <param>
- <key>_source_code</key>
- <value># Block that doesn't do anything, just used to get a msg input port on another block exposed to ControlPort
-from gnuradio import gr
-import pmt
-class blk(gr.basic_block):
- def __init__(self):
- gr.basic_block.__init__(self,name='Null Msg Source',in_sig=[],out_sig=[])
- self.message_port_register_out(pmt.intern("fake_output"))
-</value>
- </param>
- <param>
- <key>comment</key>
- <value></value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(357, 218)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- <param>
- <key>id</key>
- <value>epy_block_0</value>
- </param>
- </block>
- <block>
<key>note</key>
<param>
<key>alias</key>
@@ -861,10 +819,4 @@ python simple_copy_controller.py 127.0.0.1 &lt;PORT&gt; true</value>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
- <connection>
- <source_block_id>epy_block_0</source_block_id>
- <sink_block_id>blocks_copy_0</sink_block_id>
- <source_key>fake_output</source_key>
- <sink_key>en</sink_key>
- </connection>
</flow_graph>
diff --git a/gr-blocks/lib/tuntap_pdu_impl.cc b/gr-blocks/lib/tuntap_pdu_impl.cc
index 391b33937a..7bd0889d5e 100644
--- a/gr-blocks/lib/tuntap_pdu_impl.cc
+++ b/gr-blocks/lib/tuntap_pdu_impl.cc
@@ -57,7 +57,7 @@ namespace gr {
: block("tuntap_pdu",
io_signature::make (0, 0, 0),
io_signature::make (0, 0, 0)),
- stream_pdu_base(MTU),
+ stream_pdu_base(istunflag ? MTU : MTU + 14),
d_dev(dev),
d_istunflag(istunflag)
{
diff --git a/gr-blocks/python/blocks/qa_moving_average.py b/gr-blocks/python/blocks/qa_moving_average.py
index 2e517a92b1..b76f81392d 100644
--- a/gr-blocks/python/blocks/qa_moving_average.py
+++ b/gr-blocks/python/blocks/qa_moving_average.py
@@ -45,6 +45,10 @@ class test_moving_average(gr_unittest.TestCase):
def tearDown(self):
self.tb = None
+ # These tests will always pass and are therefore useless. 100 random numbers [-1,1) are
+ # getting summed up and scaled with 0.001. Then, an assertion verifies a result near 0,
+ # which is the case even if the block is malfunctioning.
+
def test_01(self):
tb = self.tb
@@ -87,6 +91,8 @@ class test_moving_average(gr_unittest.TestCase):
# make sure result is close to zero
self.assertComplexTuplesAlmostEqual(expected_result, dst_data, 1)
+ # This tests implement own moving average to verify correct behaviour of the block
+
def test_03(self):
tb = self.tb
@@ -110,7 +116,6 @@ class test_moving_average(gr_unittest.TestCase):
for idx, single in enumerate(isolated):
tb.connect((one_to_many,idx), single, (many_to_vector,idx))
-
tb.run()
dut_data = dut_dst.data()
@@ -118,5 +123,35 @@ class test_moving_average(gr_unittest.TestCase):
# make sure result is close to zero
self.assertTupleEqual(dut_data, ref_data)
+
+ def test_04(self):
+ tb = self.tb
+
+ N = 10000 # number of samples
+ history = 100 # num of samples to average
+ data = make_random_complex_tuple(N, 1) # generate random data
+
+ # pythonic MA filter
+ data_padded = (history-1)*[0.0+1j*0.0]+list(data) # history
+ expected_result = []
+ moving_sum = sum(data_padded[:history-1])
+ for i in range(N):
+ moving_sum += data_padded[i+history-1]
+ expected_result.append(moving_sum)
+ moving_sum -= data_padded[i]
+
+ src = blocks.vector_source_c(data, False)
+ op = blocks.moving_average_cc(history, 1)
+ dst = blocks.vector_sink_c()
+
+ tb.connect(src, op)
+ tb.connect(op, dst)
+ tb.run()
+
+ dst_data = dst.data()
+
+ # make sure result is close to zero
+ self.assertComplexTuplesAlmostEqual(expected_result, dst_data, 4)
+
if __name__ == '__main__':
gr_unittest.run(test_moving_average, "test_moving_average.xml")
diff --git a/gr-digital/examples/demod/symbol_sync_test_complex.grc b/gr-digital/examples/demod/symbol_sync_test_complex.grc
index 77bacdeb12..28812e20cd 100644
--- a/gr-digital/examples/demod/symbol_sync_test_complex.grc
+++ b/gr-digital/examples/demod/symbol_sync_test_complex.grc
@@ -1,25 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.12'?>
-<!--
- Copyright (C) 2017 Free Software Foundation
-
- This file is part of GNU Radio
-
- GNU Radio is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GNU Radio is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU Radio; see the file COPYING. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street,
- Boston, MA 02110-1301, USA.
--->
<flow_graph>
<timestamp>Mon Jan 12 16:38:01 2015</timestamp>
<block>
@@ -50,7 +30,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(10, 10)</value>
+ <value>(0, 0)</value>
</param>
<param>
<key>_rotation</key>
@@ -66,7 +46,7 @@
</param>
<param>
<key>id</key>
- <value>symbol_sync_test_complex</value>
+ <value>symbol_sync_test_float</value>
</param>
<param>
<key>max_nouts</key>
@@ -98,7 +78,7 @@
</param>
<param>
<key>title</key>
- <value>Symbol Sync Test (Complex)</value>
+ <value>Symbol Sync Test (Float)</value>
</param>
</block>
<block>
@@ -136,7 +116,7 @@
</param>
<param>
<key>value</key>
- <value>4</value>
+ <value>(0,0,0,0,1)</value>
</param>
<param>
<key>_enabled</key>
@@ -144,7 +124,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(392, 48)</value>
+ <value>(344, 0)</value>
</param>
<param>
<key>gui_hint</key>
@@ -180,7 +160,7 @@
</param>
<param>
<key>label</key>
- <value></value>
+ <value>Data Source</value>
</param>
<param>
<key>labels</key>
@@ -192,23 +172,23 @@
</param>
<param>
<key>option0</key>
- <value>0</value>
+ <value>(1,0,0,0,0)</value>
</param>
<param>
<key>option1</key>
- <value>1</value>
+ <value>(0,1,0,0,0)</value>
</param>
<param>
<key>option2</key>
- <value>2</value>
+ <value>(0,0,1,0,0)</value>
</param>
<param>
<key>option3</key>
- <value>3</value>
+ <value>(0,0,0,1,0)</value>
</param>
<param>
<key>option4</key>
- <value>4</value>
+ <value>(0,0,0,0,1)</value>
</param>
<param>
<key>options</key>
@@ -220,7 +200,7 @@
</param>
<param>
<key>type</key>
- <value>int</value>
+ <value>raw</value>
</param>
<param>
<key>widget</key>
@@ -239,7 +219,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2288, 588)</value>
+ <value>(1488, 556)</value>
</param>
<param>
<key>_rotation</key>
@@ -274,7 +254,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2760, 484)</value>
+ <value>(1984, 460)</value>
</param>
<param>
<key>gui_hint</key>
@@ -309,7 +289,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2288, 460)</value>
+ <value>(1488, 428)</value>
</param>
<param>
<key>_rotation</key>
@@ -332,7 +312,7 @@
</param>
<param>
<key>value</key>
- <value>0.25</value>
+ <value>0.125</value>
</param>
<param>
<key>_enabled</key>
@@ -340,7 +320,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2440, 568)</value>
+ <value>(1632, 424)</value>
</param>
<param>
<key>gui_hint</key>
@@ -399,7 +379,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2608, 212)</value>
+ <value>(2128, 196)</value>
</param>
<param>
<key>_rotation</key>
@@ -426,7 +406,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(8, 600)</value>
+ <value>(0, 544)</value>
</param>
<param>
<key>_rotation</key>
@@ -465,7 +445,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2288, 524)</value>
+ <value>(1488, 492)</value>
</param>
<param>
<key>_rotation</key>
@@ -500,7 +480,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2760, 564)</value>
+ <value>(1984, 540)</value>
</param>
<param>
<key>gui_hint</key>
@@ -535,7 +515,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1336, 236)</value>
+ <value>(1280, 228)</value>
</param>
<param>
<key>_rotation</key>
@@ -558,7 +538,7 @@
</param>
<param>
<key>value</key>
- <value>1.0</value>
+ <value>0.28365</value>
</param>
<param>
<key>_enabled</key>
@@ -566,7 +546,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2608, 568)</value>
+ <value>(1808, 544)</value>
</param>
<param>
<key>gui_hint</key>
@@ -629,7 +609,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2440, 448)</value>
+ <value>(1632, 544)</value>
</param>
<param>
<key>gui_hint</key>
@@ -696,7 +676,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(8, 192)</value>
+ <value>(0, 128)</value>
</param>
<param>
<key>_rotation</key>
@@ -736,151 +716,6 @@
</param>
</block>
<block>
- <key>blocks_add_xx</key>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>comment</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(448, 264)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- <param>
- <key>id</key>
- <value>blocks_add_xx_0</value>
- </param>
- <param>
- <key>type</key>
- <value>short</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>num_inputs</key>
- <value>5</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- </block>
- <block>
- <key>blocks_char_to_float</key>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>comment</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(1160, 324)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- <param>
- <key>id</key>
- <value>blocks_char_to_float_2</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>scale</key>
- <value>1</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- </block>
- <block>
- <key>blocks_float_to_char</key>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>comment</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(872, 324)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- <param>
- <key>id</key>
- <value>blocks_float_to_char_0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>scale</key>
- <value>1</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- </block>
- <block>
<key>blocks_float_to_complex</key>
<param>
<key>alias</key>
@@ -900,7 +735,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2752, 328)</value>
+ <value>(2248, 328)</value>
</param>
<param>
<key>_rotation</key>
@@ -943,7 +778,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2752, 392)</value>
+ <value>(2248, 392)</value>
</param>
<param>
<key>_rotation</key>
@@ -986,7 +821,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1936, 328)</value>
+ <value>(1512, 328)</value>
</param>
<param>
<key>_rotation</key>
@@ -1021,160 +856,7 @@
</param>
<param>
<key>const</key>
- <value>1 if data_src == 4 else 0</value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(224, 540)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- <param>
- <key>id</key>
- <value>blocks_multiply_const_vxx_0</value>
- </param>
- <param>
- <key>type</key>
- <value>short</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- </block>
- <block>
- <key>blocks_multiply_const_vxx</key>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>comment</key>
- <value></value>
- </param>
- <param>
- <key>const</key>
- <value>1 if data_src == 3 else 0</value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(216, 460)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- <param>
- <key>id</key>
- <value>blocks_multiply_const_vxx_0_0</value>
- </param>
- <param>
- <key>type</key>
- <value>short</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- </block>
- <block>
- <key>blocks_multiply_const_vxx</key>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>comment</key>
- <value></value>
- </param>
- <param>
- <key>const</key>
- <value>1 if data_src == 2 else 0</value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(216, 380)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- <param>
- <key>id</key>
- <value>blocks_multiply_const_vxx_0_0_0</value>
- </param>
- <param>
- <key>type</key>
- <value>short</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- </block>
- <block>
- <key>blocks_multiply_const_vxx</key>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>comment</key>
- <value></value>
- </param>
- <param>
- <key>const</key>
- <value>1 if data_src == 1 else 0</value>
+ <value>0.707+0.707j</value>
</param>
<param>
<key>affinity</key>
@@ -1186,7 +868,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(216, 308)</value>
+ <value>(1696, 340)</value>
</param>
<param>
<key>_rotation</key>
@@ -1194,11 +876,11 @@
</param>
<param>
<key>id</key>
- <value>blocks_multiply_const_vxx_0_0_0_0</value>
+ <value>blocks_multiply_const_vxx_1</value>
</param>
<param>
<key>type</key>
- <value>short</value>
+ <value>complex</value>
</param>
<param>
<key>maxoutbuf</key>
@@ -1214,7 +896,7 @@
</param>
</block>
<block>
- <key>blocks_multiply_const_vxx</key>
+ <key>blocks_multiply_matrix_xx</key>
<param>
<key>alias</key>
<value></value>
@@ -1224,10 +906,6 @@
<value></value>
</param>
<param>
- <key>const</key>
- <value>1 if data_src == 0 else 0</value>
- </param>
- <param>
<key>affinity</key>
<value></value>
</param>
@@ -1237,7 +915,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(208, 212)</value>
+ <value>(360, 248)</value>
</param>
<param>
<key>_rotation</key>
@@ -1245,62 +923,15 @@
</param>
<param>
<key>id</key>
- <value>blocks_multiply_const_vxx_0_0_0_0_0</value>
+ <value>blocks_multiply_matrix_xx_0</value>
</param>
<param>
<key>type</key>
- <value>short</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- </block>
- <block>
- <key>blocks_multiply_const_vxx</key>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>comment</key>
- <value></value>
- </param>
- <param>
- <key>const</key>
- <value>0.707+0.707j</value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(2128, 340)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- <param>
- <key>id</key>
- <value>blocks_multiply_const_vxx_1</value>
+ <value>float</value>
</param>
<param>
- <key>type</key>
- <value>complex</value>
+ <key>A</key>
+ <value>(data_src,)</value>
</param>
<param>
<key>maxoutbuf</key>
@@ -1311,8 +942,8 @@
<value>0</value>
</param>
<param>
- <key>vlen</key>
- <value>1</value>
+ <key>tag_propagation_policy</key>
+ <value>gr.TPP_ALL_TO_ALL</value>
</param>
</block>
<block>
@@ -1323,7 +954,7 @@
</param>
<param>
<key>comment</key>
- <value></value>
+ <value>Pulse Shaping</value>
</param>
<param>
<key>affinity</key>
@@ -1335,7 +966,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1312, 324)</value>
+ <value>(912, 332)</value>
</param>
<param>
<key>_rotation</key>
@@ -1343,7 +974,7 @@
</param>
<param>
<key>id</key>
- <value>blocks_repeat_0</value>
+ <value>blocks_repeat_0_0</value>
</param>
<param>
<key>interp</key>
@@ -1386,7 +1017,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(712, 324)</value>
+ <value>(192, 148)</value>
</param>
<param>
<key>_rotation</key>
@@ -1394,7 +1025,7 @@
</param>
<param>
<key>id</key>
- <value>blocks_short_to_float_0</value>
+ <value>blocks_short_to_float_1</value>
</param>
<param>
<key>maxoutbuf</key>
@@ -1461,7 +1092,7 @@
</param>
<param>
<key>type</key>
- <value>short</value>
+ <value>float</value>
</param>
<param>
<key>vlen</key>
@@ -1488,7 +1119,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(8, 364)</value>
+ <value>(0, 300)</value>
</param>
<param>
<key>_rotation</key>
@@ -1508,7 +1139,7 @@
</param>
<param>
<key>type</key>
- <value>short</value>
+ <value>float</value>
</param>
<param>
<key>repeat</key>
@@ -1547,7 +1178,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(8, 284)</value>
+ <value>(0, 220)</value>
</param>
<param>
<key>_rotation</key>
@@ -1567,7 +1198,7 @@
</param>
<param>
<key>type</key>
- <value>short</value>
+ <value>float</value>
</param>
<param>
<key>repeat</key>
@@ -1606,7 +1237,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(8, 444)</value>
+ <value>(0, 380)</value>
</param>
<param>
<key>_rotation</key>
@@ -1626,7 +1257,7 @@
</param>
<param>
<key>type</key>
- <value>short</value>
+ <value>float</value>
</param>
<param>
<key>repeat</key>
@@ -1665,7 +1296,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(8, 524)</value>
+ <value>(0, 460)</value>
</param>
<param>
<key>_rotation</key>
@@ -1685,7 +1316,7 @@
</param>
<param>
<key>type</key>
- <value>short</value>
+ <value>float</value>
</param>
<param>
<key>repeat</key>
@@ -1705,49 +1336,6 @@
</param>
</block>
<block>
- <key>digital_map_bb</key>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>comment</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(1024, 324)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- <param>
- <key>id</key>
- <value>digital_map_bb_0</value>
- </param>
- <param>
- <key>map</key>
- <value>[-1, 1,0]</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- </block>
- <block>
<key>digital_symbol_sync_xx</key>
<param>
<key>alias</key>
@@ -1779,7 +1367,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2376, 292)</value>
+ <value>(1920, 292)</value>
</param>
<param>
<key>_rotation</key>
@@ -1827,7 +1415,7 @@
</param>
<param>
<key>constellation</key>
- <value>digital.constellation_qpsk().base()</value>
+ <value>digital.constellation_bpsk().base()</value>
</param>
<param>
<key>ted_type</key>
@@ -1835,16 +1423,83 @@
</param>
</block>
<block>
- <key>fir_filter_xxx</key>
+ <key>epy_block</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
+ <key>_io_cache</key>
+ <value>('Bit -&gt; Symbol Map', 'ConstMap', [], [('0', 'float', 1)], [('0', 'float', 1)], '\n Map 0, 1 to -1, 1\n ', [])</value>
+ </param>
+ <param>
+ <key>_source_code</key>
+ <value>"""
+Embedded Python Blocks:
+
+Each time this file is saved, GRC will instantiate the first class it finds
+to get ports and parameters of your block. The arguments to __init__ will
+be the parameters. All of them are required to have default values!
+"""
+
+import numpy as np
+from gnuradio import gr
+
+class ConstMap(gr.sync_block):
+ """
+ Map 0, 1 to -1, 1
+ """
+ def __init__(self):
+ gr.sync_block.__init__(
+ self,
+ name='Bit -&gt; Symbol Map',
+ in_sig=[np.float32],
+ out_sig=[np.float32]
+ )
+
+ def work(self, input_items, output_items):
+ """
+ map
+ """
+ sym_map = {0.0: -1.0, 1.0: 1.0, 2.0: 0.0}
+ output_items[0][:] = [sym_map[x] for x in input_items[0]]
+ return len(output_items[0])
+</value>
+ </param>
+ <param>
<key>comment</key>
+ <value>BPSK Modulation</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(696, 328)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>id</key>
+ <value>epy_block_0_0</value>
+ </param>
+ </block>
+ <block>
+ <key>fir_filter_xxx</key>
+ <param>
+ <key>alias</key>
<value></value>
</param>
<param>
+ <key>comment</key>
+ <value>Matched Filter (almost).
+Because the input stream has 6 2/3
+samples per symbol, this incurs a slight ISI.</value>
+ </param>
+ <param>
<key>affinity</key>
<value></value>
</param>
@@ -1858,7 +1513,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1688, 316)</value>
+ <value>(1264, 324)</value>
</param>
<param>
<key>_rotation</key>
@@ -1866,7 +1521,7 @@
</param>
<param>
<key>id</key>
- <value>fir_filter_xxx_0_1_0_0_0</value>
+ <value>fir_filter_xxx_0_1_0_0_0_0</value>
</param>
<param>
<key>maxoutbuf</key>
@@ -1905,7 +1560,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(184, 12)</value>
+ <value>(184, 4)</value>
</param>
<param>
<key>_rotation</key>
@@ -1921,6 +1576,68 @@
</param>
</block>
<block>
+ <key>import</key>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
+ <key>comment</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(184, 52)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>id</key>
+ <value>import_0_0</value>
+ </param>
+ <param>
+ <key>import</key>
+ <value>from gnuradio import digital</value>
+ </param>
+ </block>
+ <block>
+ <key>note</key>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
+ <key>comment</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(320, 316)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>id</key>
+ <value>note_0</value>
+ </param>
+ <param>
+ <key>note</key>
+ <value>Bit Pattern Generation</value>
+ </param>
+ </block>
+ <block>
<key>qtgui_time_sink_x</key>
<param>
<key>autoscale</key>
@@ -1956,7 +1673,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2992, 296)</value>
+ <value>(2472, 296)</value>
</param>
<param>
<key>gui_hint</key>
@@ -1972,7 +1689,7 @@
</param>
<param>
<key>id</key>
- <value>qtgui_time_sink_x_0_0_0_0_0</value>
+ <value>qtgui_time_sink_x_0_0_0_0_0_0</value>
</param>
<param>
<key>legend</key>
@@ -2319,7 +2036,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2376, 204)</value>
+ <value>(1920, 196)</value>
</param>
<param>
<key>gui_hint</key>
@@ -2351,7 +2068,7 @@
</param>
<param>
<key>label1</key>
- <value>Re</value>
+ <value></value>
</param>
<param>
<key>marker1</key>
@@ -2399,7 +2116,7 @@
</param>
<param>
<key>label2</key>
- <value>Im</value>
+ <value></value>
</param>
<param>
<key>marker2</key>
@@ -2654,7 +2371,8 @@
</param>
<param>
<key>comment</key>
- <value></value>
+ <value>Resampling to 6 2/3 samples
+per symbol ("clock desync")</value>
</param>
<param>
<key>affinity</key>
@@ -2674,7 +2392,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1480, 304)</value>
+ <value>(1080, 312)</value>
</param>
<param>
<key>_rotation</key>
@@ -2707,37 +2425,19 @@
</block>
<connection>
<source_block_id>analog_random_source_x_0</source_block_id>
- <sink_block_id>blocks_multiply_const_vxx_0_0_0_0_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_add_xx_0</source_block_id>
- <sink_block_id>blocks_throttle_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_char_to_float_2</source_block_id>
- <sink_block_id>blocks_repeat_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_float_to_char_0</source_block_id>
- <sink_block_id>digital_map_bb_0</sink_block_id>
+ <sink_block_id>blocks_short_to_float_1</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>blocks_float_to_complex_0_0</source_block_id>
- <sink_block_id>qtgui_time_sink_x_0_0_0_0_0</sink_block_id>
+ <sink_block_id>qtgui_time_sink_x_0_0_0_0_0_0</sink_block_id>
<source_key>0</source_key>
<sink_key>1</sink_key>
</connection>
<connection>
<source_block_id>blocks_float_to_complex_1_0</source_block_id>
- <sink_block_id>qtgui_time_sink_x_0_0_0_0_0</sink_block_id>
+ <sink_block_id>qtgui_time_sink_x_0_0_0_0_0_0</sink_block_id>
<source_key>0</source_key>
<sink_key>2</sink_key>
</connection>
@@ -2748,94 +2448,64 @@
<sink_key>0</sink_key>
</connection>
<connection>
- <source_block_id>blocks_multiply_const_vxx_0</source_block_id>
- <sink_block_id>blocks_add_xx_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>4</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_multiply_const_vxx_0_0</source_block_id>
- <sink_block_id>blocks_add_xx_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>3</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_multiply_const_vxx_0_0_0</source_block_id>
- <sink_block_id>blocks_add_xx_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>2</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_multiply_const_vxx_0_0_0_0</source_block_id>
- <sink_block_id>blocks_add_xx_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>1</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_multiply_const_vxx_0_0_0_0_0</source_block_id>
- <sink_block_id>blocks_add_xx_0</sink_block_id>
+ <source_block_id>blocks_multiply_const_vxx_1</source_block_id>
+ <sink_block_id>digital_symbol_sync_xx_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>blocks_multiply_const_vxx_1</source_block_id>
- <sink_block_id>digital_symbol_sync_xx_0</sink_block_id>
+ <sink_block_id>qtgui_time_sink_x_0_1_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
- <source_block_id>blocks_multiply_const_vxx_1</source_block_id>
- <sink_block_id>qtgui_time_sink_x_0_1_0</sink_block_id>
+ <source_block_id>blocks_multiply_matrix_xx_0</source_block_id>
+ <sink_block_id>blocks_throttle_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
- <source_block_id>blocks_repeat_0</source_block_id>
+ <source_block_id>blocks_repeat_0_0</source_block_id>
<sink_block_id>rational_resampler_xxx_0_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
- <source_block_id>blocks_short_to_float_0</source_block_id>
- <sink_block_id>blocks_float_to_char_0</sink_block_id>
+ <source_block_id>blocks_short_to_float_1</source_block_id>
+ <sink_block_id>blocks_multiply_matrix_xx_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>blocks_throttle_0</source_block_id>
- <sink_block_id>blocks_short_to_float_0</sink_block_id>
+ <sink_block_id>epy_block_0_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>blocks_vector_source_x_0_0</source_block_id>
- <sink_block_id>blocks_multiply_const_vxx_0_0_0</sink_block_id>
+ <sink_block_id>blocks_multiply_matrix_xx_0</sink_block_id>
<source_key>0</source_key>
- <sink_key>0</sink_key>
+ <sink_key>2</sink_key>
</connection>
<connection>
<source_block_id>blocks_vector_source_x_0_0_0</source_block_id>
- <sink_block_id>blocks_multiply_const_vxx_0_0_0_0</sink_block_id>
+ <sink_block_id>blocks_multiply_matrix_xx_0</sink_block_id>
<source_key>0</source_key>
- <sink_key>0</sink_key>
+ <sink_key>1</sink_key>
</connection>
<connection>
<source_block_id>blocks_vector_source_x_0_0_1</source_block_id>
- <sink_block_id>blocks_multiply_const_vxx_0_0</sink_block_id>
+ <sink_block_id>blocks_multiply_matrix_xx_0</sink_block_id>
<source_key>0</source_key>
- <sink_key>0</sink_key>
+ <sink_key>3</sink_key>
</connection>
<connection>
<source_block_id>blocks_vector_source_x_0_0_1_0</source_block_id>
- <sink_block_id>blocks_multiply_const_vxx_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>digital_map_bb_0</source_block_id>
- <sink_block_id>blocks_char_to_float_2</sink_block_id>
+ <sink_block_id>blocks_multiply_matrix_xx_0</sink_block_id>
<source_key>0</source_key>
- <sink_key>0</sink_key>
+ <sink_key>4</sink_key>
</connection>
<connection>
<source_block_id>digital_symbol_sync_xx_0</source_block_id>
@@ -2857,19 +2527,25 @@
</connection>
<connection>
<source_block_id>digital_symbol_sync_xx_0</source_block_id>
- <sink_block_id>qtgui_time_sink_x_0_0_0_0_0</sink_block_id>
+ <sink_block_id>qtgui_time_sink_x_0_0_0_0_0_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>epy_block_0_0</source_block_id>
+ <sink_block_id>blocks_repeat_0_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
- <source_block_id>fir_filter_xxx_0_1_0_0_0</source_block_id>
+ <source_block_id>fir_filter_xxx_0_1_0_0_0_0</source_block_id>
<sink_block_id>blocks_float_to_complex_3</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>rational_resampler_xxx_0_0</source_block_id>
- <sink_block_id>fir_filter_xxx_0_1_0_0_0</sink_block_id>
+ <sink_block_id>fir_filter_xxx_0_1_0_0_0_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
diff --git a/gr-digital/examples/demod/symbol_sync_test_float.grc b/gr-digital/examples/demod/symbol_sync_test_float.grc
index ce1b24ba4b..f072b1cd89 100644
--- a/gr-digital/examples/demod/symbol_sync_test_float.grc
+++ b/gr-digital/examples/demod/symbol_sync_test_float.grc
@@ -1,25 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.12'?>
-<!--
- Copyright (C) 2017 Free Software Foundation
-
- This file is part of GNU Radio
-
- GNU Radio is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GNU Radio is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU Radio; see the file COPYING. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street,
- Boston, MA 02110-1301, USA.
--->
<flow_graph>
<timestamp>Mon Jan 12 16:38:01 2015</timestamp>
<block>
@@ -50,7 +30,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(10, 10)</value>
+ <value>(0, 0)</value>
</param>
<param>
<key>_rotation</key>
@@ -136,7 +116,7 @@
</param>
<param>
<key>value</key>
- <value>4</value>
+ <value>(0,0,0,0,1)</value>
</param>
<param>
<key>_enabled</key>
@@ -144,7 +124,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(392, 48)</value>
+ <value>(344, 0)</value>
</param>
<param>
<key>gui_hint</key>
@@ -180,7 +160,7 @@
</param>
<param>
<key>label</key>
- <value></value>
+ <value>Data Source</value>
</param>
<param>
<key>labels</key>
@@ -192,23 +172,23 @@
</param>
<param>
<key>option0</key>
- <value>0</value>
+ <value>(1,0,0,0,0)</value>
</param>
<param>
<key>option1</key>
- <value>1</value>
+ <value>(0,1,0,0,0)</value>
</param>
<param>
<key>option2</key>
- <value>2</value>
+ <value>(0,0,1,0,0)</value>
</param>
<param>
<key>option3</key>
- <value>3</value>
+ <value>(0,0,0,1,0)</value>
</param>
<param>
<key>option4</key>
- <value>4</value>
+ <value>(0,0,0,0,1)</value>
</param>
<param>
<key>options</key>
@@ -220,7 +200,7 @@
</param>
<param>
<key>type</key>
- <value>int</value>
+ <value>raw</value>
</param>
<param>
<key>widget</key>
@@ -239,7 +219,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1800, 548)</value>
+ <value>(1488, 556)</value>
</param>
<param>
<key>_rotation</key>
@@ -274,7 +254,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2296, 420)</value>
+ <value>(1984, 428)</value>
</param>
<param>
<key>gui_hint</key>
@@ -309,7 +289,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1800, 420)</value>
+ <value>(1488, 428)</value>
</param>
<param>
<key>_rotation</key>
@@ -340,7 +320,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1944, 416)</value>
+ <value>(1632, 424)</value>
</param>
<param>
<key>gui_hint</key>
@@ -399,7 +379,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2192, 196)</value>
+ <value>(1848, 196)</value>
</param>
<param>
<key>_rotation</key>
@@ -426,7 +406,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(8, 600)</value>
+ <value>(0, 544)</value>
</param>
<param>
<key>_rotation</key>
@@ -465,7 +445,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1800, 484)</value>
+ <value>(1488, 492)</value>
</param>
<param>
<key>_rotation</key>
@@ -500,7 +480,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2296, 500)</value>
+ <value>(1984, 508)</value>
</param>
<param>
<key>gui_hint</key>
@@ -566,7 +546,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2120, 536)</value>
+ <value>(1808, 544)</value>
</param>
<param>
<key>gui_hint</key>
@@ -629,7 +609,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1944, 536)</value>
+ <value>(1632, 544)</value>
</param>
<param>
<key>gui_hint</key>
@@ -696,7 +676,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(8, 192)</value>
+ <value>(0, 128)</value>
</param>
<param>
<key>_rotation</key>
@@ -736,254 +716,7 @@
</param>
</block>
<block>
- <key>blocks_add_xx</key>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>comment</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(448, 264)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- <param>
- <key>id</key>
- <value>blocks_add_xx_0</value>
- </param>
- <param>
- <key>type</key>
- <value>short</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>num_inputs</key>
- <value>5</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- </block>
- <block>
- <key>blocks_char_to_float</key>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>comment</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(1160, 324)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- <param>
- <key>id</key>
- <value>blocks_char_to_float_2</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>scale</key>
- <value>1</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- </block>
- <block>
- <key>blocks_float_to_char</key>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>comment</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(872, 324)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- <param>
- <key>id</key>
- <value>blocks_float_to_char_0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>scale</key>
- <value>1</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- </block>
- <block>
- <key>blocks_multiply_const_vxx</key>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>comment</key>
- <value></value>
- </param>
- <param>
- <key>const</key>
- <value>1 if data_src == 4 else 0</value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(224, 540)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- <param>
- <key>id</key>
- <value>blocks_multiply_const_vxx_0</value>
- </param>
- <param>
- <key>type</key>
- <value>short</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- </block>
- <block>
- <key>blocks_multiply_const_vxx</key>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>comment</key>
- <value></value>
- </param>
- <param>
- <key>const</key>
- <value>1 if data_src == 3 else 0</value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(216, 460)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- <param>
- <key>id</key>
- <value>blocks_multiply_const_vxx_0_0</value>
- </param>
- <param>
- <key>type</key>
- <value>short</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- </block>
- <block>
- <key>blocks_multiply_const_vxx</key>
+ <key>blocks_multiply_matrix_xx</key>
<param>
<key>alias</key>
<value></value>
@@ -993,10 +726,6 @@
<value></value>
</param>
<param>
- <key>const</key>
- <value>1 if data_src == 2 else 0</value>
- </param>
- <param>
<key>affinity</key>
<value></value>
</param>
@@ -1006,7 +735,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(216, 380)</value>
+ <value>(360, 248)</value>
</param>
<param>
<key>_rotation</key>
@@ -1014,113 +743,15 @@
</param>
<param>
<key>id</key>
- <value>blocks_multiply_const_vxx_0_0_0</value>
+ <value>blocks_multiply_matrix_xx_0</value>
</param>
<param>
<key>type</key>
- <value>short</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- </block>
- <block>
- <key>blocks_multiply_const_vxx</key>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>comment</key>
- <value></value>
- </param>
- <param>
- <key>const</key>
- <value>1 if data_src == 1 else 0</value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(216, 308)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- <param>
- <key>id</key>
- <value>blocks_multiply_const_vxx_0_0_0_0</value>
- </param>
- <param>
- <key>type</key>
- <value>short</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- </block>
- <block>
- <key>blocks_multiply_const_vxx</key>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>comment</key>
- <value></value>
- </param>
- <param>
- <key>const</key>
- <value>1 if data_src == 0 else 0</value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(208, 212)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
+ <value>float</value>
</param>
<param>
- <key>id</key>
- <value>blocks_multiply_const_vxx_0_0_0_0_0</value>
- </param>
- <param>
- <key>type</key>
- <value>short</value>
+ <key>A</key>
+ <value>(data_src,)</value>
</param>
<param>
<key>maxoutbuf</key>
@@ -1131,8 +762,8 @@
<value>0</value>
</param>
<param>
- <key>vlen</key>
- <value>1</value>
+ <key>tag_propagation_policy</key>
+ <value>gr.TPP_ALL_TO_ALL</value>
</param>
</block>
<block>
@@ -1143,7 +774,7 @@
</param>
<param>
<key>comment</key>
- <value></value>
+ <value>Pulse Shaping</value>
</param>
<param>
<key>affinity</key>
@@ -1155,7 +786,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1312, 324)</value>
+ <value>(928, 324)</value>
</param>
<param>
<key>_rotation</key>
@@ -1206,7 +837,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(712, 324)</value>
+ <value>(192, 148)</value>
</param>
<param>
<key>_rotation</key>
@@ -1214,7 +845,7 @@
</param>
<param>
<key>id</key>
- <value>blocks_short_to_float_0</value>
+ <value>blocks_short_to_float_1</value>
</param>
<param>
<key>maxoutbuf</key>
@@ -1281,7 +912,7 @@
</param>
<param>
<key>type</key>
- <value>short</value>
+ <value>float</value>
</param>
<param>
<key>vlen</key>
@@ -1308,7 +939,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(8, 364)</value>
+ <value>(0, 300)</value>
</param>
<param>
<key>_rotation</key>
@@ -1328,7 +959,7 @@
</param>
<param>
<key>type</key>
- <value>short</value>
+ <value>float</value>
</param>
<param>
<key>repeat</key>
@@ -1367,7 +998,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(8, 284)</value>
+ <value>(0, 220)</value>
</param>
<param>
<key>_rotation</key>
@@ -1387,7 +1018,7 @@
</param>
<param>
<key>type</key>
- <value>short</value>
+ <value>float</value>
</param>
<param>
<key>repeat</key>
@@ -1426,7 +1057,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(8, 444)</value>
+ <value>(0, 380)</value>
</param>
<param>
<key>_rotation</key>
@@ -1446,7 +1077,7 @@
</param>
<param>
<key>type</key>
- <value>short</value>
+ <value>float</value>
</param>
<param>
<key>repeat</key>
@@ -1485,7 +1116,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(8, 524)</value>
+ <value>(0, 460)</value>
</param>
<param>
<key>_rotation</key>
@@ -1505,7 +1136,7 @@
</param>
<param>
<key>type</key>
- <value>short</value>
+ <value>float</value>
</param>
<param>
<key>repeat</key>
@@ -1525,49 +1156,6 @@
</param>
</block>
<block>
- <key>digital_map_bb</key>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>comment</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(1024, 324)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- <param>
- <key>id</key>
- <value>digital_map_bb_0</value>
- </param>
- <param>
- <key>map</key>
- <value>[-1, 1,0]</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- </block>
- <block>
<key>digital_symbol_sync_xx</key>
<param>
<key>alias</key>
@@ -1599,7 +1187,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1944, 276)</value>
+ <value>(1600, 276)</value>
</param>
<param>
<key>_rotation</key>
@@ -1655,16 +1243,83 @@
</param>
</block>
<block>
- <key>fir_filter_xxx</key>
+ <key>epy_block</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
+ <key>_io_cache</key>
+ <value>('Bit -&gt; Symbol Map', 'ConstMap', [], [('0', 'float', 1)], [('0', 'float', 1)], '\n Map 0, 1 to -1, 1\n ', [])</value>
+ </param>
+ <param>
+ <key>_source_code</key>
+ <value>"""
+Embedded Python Blocks:
+
+Each time this file is saved, GRC will instantiate the first class it finds
+to get ports and parameters of your block. The arguments to __init__ will
+be the parameters. All of them are required to have default values!
+"""
+
+import numpy as np
+from gnuradio import gr
+
+class ConstMap(gr.sync_block):
+ """
+ Map 0, 1 to -1, 1
+ """
+ def __init__(self):
+ gr.sync_block.__init__(
+ self,
+ name='Bit -&gt; Symbol Map',
+ in_sig=[np.float32],
+ out_sig=[np.float32]
+ )
+
+ def work(self, input_items, output_items):
+ """
+ map
+ """
+ sym_map = {0.0: -1.0, 1.0: 1.0, 2.0: 0.0}
+ output_items[0][:] = [sym_map[x] for x in input_items[0]]
+ return len(output_items[0])
+</value>
+ </param>
+ <param>
<key>comment</key>
+ <value>BPSK Modulation</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(712, 328)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>id</key>
+ <value>epy_block_0</value>
+ </param>
+ </block>
+ <block>
+ <key>fir_filter_xxx</key>
+ <param>
+ <key>alias</key>
<value></value>
</param>
<param>
+ <key>comment</key>
+ <value>Matched Filter (almost).
+Because the input stream has 6 2/3
+samples per symbol, this incurs a slight ISI.</value>
+ </param>
+ <param>
<key>affinity</key>
<value></value>
</param>
@@ -1678,7 +1333,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1672, 316)</value>
+ <value>(1336, 316)</value>
</param>
<param>
<key>_rotation</key>
@@ -1725,7 +1380,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(184, 12)</value>
+ <value>(184, 4)</value>
</param>
<param>
<key>_rotation</key>
@@ -1756,7 +1411,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(184, 60)</value>
+ <value>(184, 52)</value>
</param>
<param>
<key>_rotation</key>
@@ -1772,6 +1427,37 @@
</param>
</block>
<block>
+ <key>note</key>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
+ <key>comment</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(320, 316)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>id</key>
+ <value>note_0</value>
+ </param>
+ <param>
+ <key>note</key>
+ <value>Bit Pattern Generation</value>
+ </param>
+ </block>
+ <block>
<key>qtgui_time_sink_x</key>
<param>
<key>autoscale</key>
@@ -1807,7 +1493,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(2296, 280)</value>
+ <value>(1952, 280)</value>
</param>
<param>
<key>gui_hint</key>
@@ -2170,7 +1856,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1976, 172)</value>
+ <value>(1632, 172)</value>
</param>
<param>
<key>gui_hint</key>
@@ -2505,7 +2191,8 @@
</param>
<param>
<key>comment</key>
- <value></value>
+ <value>Resampling to 6 2/3 samples
+per symbol ("clock desync")</value>
</param>
<param>
<key>affinity</key>
@@ -2525,7 +2212,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1472, 304)</value>
+ <value>(1120, 304)</value>
</param>
<param>
<key>_rotation</key>
@@ -2558,105 +2245,57 @@
</block>
<connection>
<source_block_id>analog_random_source_x_0</source_block_id>
- <sink_block_id>blocks_multiply_const_vxx_0_0_0_0_0</sink_block_id>
+ <sink_block_id>blocks_short_to_float_1</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
- <source_block_id>blocks_add_xx_0</source_block_id>
+ <source_block_id>blocks_multiply_matrix_xx_0</source_block_id>
<sink_block_id>blocks_throttle_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
- <source_block_id>blocks_char_to_float_2</source_block_id>
- <sink_block_id>blocks_repeat_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_float_to_char_0</source_block_id>
- <sink_block_id>digital_map_bb_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_multiply_const_vxx_0</source_block_id>
- <sink_block_id>blocks_add_xx_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>4</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_multiply_const_vxx_0_0</source_block_id>
- <sink_block_id>blocks_add_xx_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>3</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_multiply_const_vxx_0_0_0</source_block_id>
- <sink_block_id>blocks_add_xx_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>2</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_multiply_const_vxx_0_0_0_0</source_block_id>
- <sink_block_id>blocks_add_xx_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>1</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_multiply_const_vxx_0_0_0_0_0</source_block_id>
- <sink_block_id>blocks_add_xx_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
<source_block_id>blocks_repeat_0</source_block_id>
<sink_block_id>rational_resampler_xxx_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
- <source_block_id>blocks_short_to_float_0</source_block_id>
- <sink_block_id>blocks_float_to_char_0</sink_block_id>
+ <source_block_id>blocks_short_to_float_1</source_block_id>
+ <sink_block_id>blocks_multiply_matrix_xx_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>blocks_throttle_0</source_block_id>
- <sink_block_id>blocks_short_to_float_0</sink_block_id>
+ <sink_block_id>epy_block_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>blocks_vector_source_x_0_0</source_block_id>
- <sink_block_id>blocks_multiply_const_vxx_0_0_0</sink_block_id>
+ <sink_block_id>blocks_multiply_matrix_xx_0</sink_block_id>
<source_key>0</source_key>
- <sink_key>0</sink_key>
+ <sink_key>2</sink_key>
</connection>
<connection>
<source_block_id>blocks_vector_source_x_0_0_0</source_block_id>
- <sink_block_id>blocks_multiply_const_vxx_0_0_0_0</sink_block_id>
+ <sink_block_id>blocks_multiply_matrix_xx_0</sink_block_id>
<source_key>0</source_key>
- <sink_key>0</sink_key>
+ <sink_key>1</sink_key>
</connection>
<connection>
<source_block_id>blocks_vector_source_x_0_0_1</source_block_id>
- <sink_block_id>blocks_multiply_const_vxx_0_0</sink_block_id>
+ <sink_block_id>blocks_multiply_matrix_xx_0</sink_block_id>
<source_key>0</source_key>
- <sink_key>0</sink_key>
+ <sink_key>3</sink_key>
</connection>
<connection>
<source_block_id>blocks_vector_source_x_0_0_1_0</source_block_id>
- <sink_block_id>blocks_multiply_const_vxx_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>digital_map_bb_0</source_block_id>
- <sink_block_id>blocks_char_to_float_2</sink_block_id>
+ <sink_block_id>blocks_multiply_matrix_xx_0</sink_block_id>
<source_key>0</source_key>
- <sink_key>0</sink_key>
+ <sink_key>4</sink_key>
</connection>
<connection>
<source_block_id>digital_symbol_sync_xx_0</source_block_id>
@@ -2683,6 +2322,12 @@
<sink_key>0</sink_key>
</connection>
<connection>
+ <source_block_id>epy_block_0</source_block_id>
+ <sink_block_id>blocks_repeat_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
<source_block_id>fir_filter_xxx_0_1_0_0_0</source_block_id>
<sink_block_id>digital_symbol_sync_xx_0</sink_block_id>
<source_key>0</source_key>
diff --git a/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc b/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc
index aa581aeda8..f92f9fa6d8 100644
--- a/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc
+++ b/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc
@@ -908,7 +908,12 @@ namespace gr {
//Clause 4.6.2.9
set_tps_bits(39, 38, config.d_transmission_mode);
//Clause 4.6.2.10
- set_tps_bits(47, 40, config.d_cell_id);
+ if (d_frame_index % 2) {
+ set_tps_bits(47, 40, config.d_cell_id & 0xff);
+ }
+ else {
+ set_tps_bits(47, 40, (config.d_cell_id >> 8) & 0xff);
+ }
//These bits are set to zero
set_tps_bits(53, 48, 0);
//Clause 4.6.2.11
diff --git a/gr-uhd/doc/uhd.dox b/gr-uhd/doc/uhd.dox
index a3de8e3a24..69381610cd 100644
--- a/gr-uhd/doc/uhd.dox
+++ b/gr-uhd/doc/uhd.dox
@@ -93,6 +93,7 @@ Command name | Value Type | Description
`tune` | tune_request | Like freq, but sets a full tune request (i.e. center frequency and DSP offset). Defaults to all channels.
`lo_freq` | double | For fully manual tuning: Set the LO frequency (RF frequency). Conflicts with `freq`, `lo_offset`, and `tune`.
`dsp_freq` | double | For fully manual tuning: Set the DSP frequency (CORDIC frequency). Conflicts with `freq`, `lo_offset`, and `tune`.
+`direction` | string | Used for timed transceiver tuning to ensure tuning order is maintained. Values other than 'TX' or 'RX' will be ignored.
`rate` | double | See usrp_block::set_samp_rate(). *Always* affects all channels.
`bandwidth` | double | See usrp_block::set_bandwidth(). Defaults to all channels.
`time` | timestamp | Sets a command time. See usrp_block::set_command_time(). A value of PMT_NIL will clear the command time.
diff --git a/gr-uhd/include/gnuradio/uhd/usrp_source.h b/gr-uhd/include/gnuradio/uhd/usrp_source.h
index a0022b3876..027202e764 100644
--- a/gr-uhd/include/gnuradio/uhd/usrp_source.h
+++ b/gr-uhd/include/gnuradio/uhd/usrp_source.h
@@ -131,6 +131,33 @@ namespace gr {
*/
virtual void issue_stream_cmd(const ::uhd::stream_cmd_t &cmd) = 0;
+ /*! Configure the timeout value on the UHD recv() call
+ *
+ * This is an advanced use parameter. Changing the timeout value affects
+ * the latency of this block; a high timeout value can be more optimal
+ * for high-throughput applications (e.g., 1 second) and setting it to
+ * zero will have the best latency. Changing the timeout value may also
+ * be useful for custom FPGA modifications, where traffic might not be
+ * continuously streaming.
+ * For specialized high-performance use cases, twiddling these knobs may
+ * improve performance, but changes are not generally applicable.
+ *
+ * Note that UHD's recv() call may block until the timeout is over, which
+ * means this block might also block for up to the timeout value.
+ *
+ * \param timeout Timeout parameter in seconds. Cf. the UHD manual for
+ * uhd::rx_streamer::recv() for more details. A lower
+ * value will mean lower latency, but higher CPU load.
+ * \param one_packet If true, only receive one packet at a time. Cf. the
+ * UHD manual for uhd::rx_streamer::recv() for more
+ * details. A value of true will mean lower latency,
+ * but higher CPU load.
+ */
+ virtual void set_recv_timeout(
+ const double timeout,
+ const bool one_packet=true
+ ) = 0;
+
/*!
* Returns identifying information about this USRP's configuration.
* Returns motherboard ID, name, and serial.
diff --git a/gr-uhd/lib/usrp_block_impl.cc b/gr-uhd/lib/usrp_block_impl.cc
index 7f3478c1a5..803cfd71ec 100644
--- a/gr-uhd/lib/usrp_block_impl.cc
+++ b/gr-uhd/lib/usrp_block_impl.cc
@@ -39,6 +39,7 @@ const pmt::pmt_t CMD_BANDWIDTH_KEY = pmt::mp("bandwidth");
const pmt::pmt_t CMD_TIME_KEY = pmt::mp("time");
const pmt::pmt_t CMD_MBOARD_KEY = pmt::mp("mboard");
const pmt::pmt_t CMD_ANTENNA_KEY = pmt::mp("antenna");
+const pmt::pmt_t CMD_DIRECTION_KEY = pmt::mp("direction");
/**********************************************************************
@@ -209,11 +210,11 @@ bool usrp_block_impl::_check_mboard_sensors_locked()
}
void
-usrp_block_impl::_set_center_freq_from_internals_allchans()
+usrp_block_impl::_set_center_freq_from_internals_allchans(pmt::pmt_t direction)
{
while (_chans_to_tune.any()) {
// This resets() bits, so this loop should not run indefinitely
- _set_center_freq_from_internals(_chans_to_tune.find_first());
+ _set_center_freq_from_internals(_chans_to_tune.find_first(), direction);
}
}
@@ -539,8 +540,14 @@ void usrp_block_impl::msg_handler_command(pmt::pmt_t msg)
}
}
- /// 4) Check if we need to re-tune
- _set_center_freq_from_internals_allchans();
+ /// 4) See if a direction was specified
+ pmt::pmt_t direction = pmt::dict_ref(
+ msg, CMD_DIRECTION_KEY,
+ pmt::PMT_NIL // Anything except "TX" or "RX will default to the messaged block direction"
+ );
+
+ /// 5) Check if we need to re-tune
+ _set_center_freq_from_internals_allchans(direction);
}
@@ -699,4 +706,3 @@ void usrp_block_impl::_cmd_handler_dspfreq(const pmt::pmt_t &dspfreq, int chan,
_update_curr_tune_req(new_tune_request, chan);
}
-
diff --git a/gr-uhd/lib/usrp_block_impl.h b/gr-uhd/lib/usrp_block_impl.h
index a1bbf97826..6b097505e1 100644
--- a/gr-uhd/lib/usrp_block_impl.h
+++ b/gr-uhd/lib/usrp_block_impl.h
@@ -29,13 +29,6 @@
#include <boost/dynamic_bitset.hpp>
#include <boost/bind.hpp>
-#define SET_CENTER_FREQ_FROM_INTERNALS(usrp_class, tune_method) \
- ::uhd::tune_result_t \
- usrp_class::_set_center_freq_from_internals(size_t chan) \
- { \
- _chans_to_tune.reset(chan); \
- return _dev->tune_method(_curr_tune_req[chan], _stream_args.channels[chan]); \
- }
namespace gr {
namespace uhd {
@@ -213,10 +206,10 @@ namespace gr {
}
//! Like set_center_freq(), but uses _curr_freq and _curr_lo_offset
- virtual ::uhd::tune_result_t _set_center_freq_from_internals(size_t chan) = 0;
+ virtual ::uhd::tune_result_t _set_center_freq_from_internals(size_t chan, pmt::pmt_t direction) = 0;
//! Calls _set_center_freq_from_internals() on all channels
- void _set_center_freq_from_internals_allchans();
+ void _set_center_freq_from_internals_allchans(pmt::pmt_t direction);
/**********************************************************************
* Members
@@ -247,4 +240,3 @@ namespace gr {
} /* namespace gr */
#endif /* INCLUDED_GR_UHD_BLOCK_IMPL_H */
-
diff --git a/gr-uhd/lib/usrp_sink_impl.cc b/gr-uhd/lib/usrp_sink_impl.cc
index 2d347e3823..117b6e0a7d 100644
--- a/gr-uhd/lib/usrp_sink_impl.cc
+++ b/gr-uhd/lib/usrp_sink_impl.cc
@@ -135,7 +135,17 @@ namespace gr {
return _dev->set_tx_freq(tune_request, chan);
}
- SET_CENTER_FREQ_FROM_INTERNALS(usrp_sink_impl, set_tx_freq);
+ ::uhd::tune_result_t
+ usrp_sink_impl::_set_center_freq_from_internals(size_t chan, pmt::pmt_t direction)
+ {
+ _chans_to_tune.reset(chan);
+ if (pmt::eqv(direction, pmt::mp("RX"))) {
+ // TODO: what happens if the RX device is not instantiated? Catch error?
+ return _dev->set_rx_freq(_curr_tune_req[chan], _stream_args.channels[chan]);
+ } else {
+ return _dev->set_tx_freq(_curr_tune_req[chan], _stream_args.channels[chan]);
+ }
+ }
double
usrp_sink_impl::get_center_freq(size_t chan)
diff --git a/gr-uhd/lib/usrp_sink_impl.h b/gr-uhd/lib/usrp_sink_impl.h
index d509baef90..f46d57cc0c 100644
--- a/gr-uhd/lib/usrp_sink_impl.h
+++ b/gr-uhd/lib/usrp_sink_impl.h
@@ -107,7 +107,7 @@ namespace gr {
private:
//! Like set_center_freq(), but uses _curr_freq and _curr_lo_offset
- ::uhd::tune_result_t _set_center_freq_from_internals(size_t chan);
+ ::uhd::tune_result_t _set_center_freq_from_internals(size_t chan, pmt::pmt_t direction);
#ifdef GR_UHD_USE_STREAM_API
::uhd::tx_streamer::sptr _tx_stream;
diff --git a/gr-uhd/lib/usrp_source_impl.cc b/gr-uhd/lib/usrp_source_impl.cc
index 23b94c684f..894a6d849b 100644
--- a/gr-uhd/lib/usrp_source_impl.cc
+++ b/gr-uhd/lib/usrp_source_impl.cc
@@ -71,6 +71,7 @@ namespace gr {
args_to_io_sig(stream_args)),
usrp_block_impl(device_addr, stream_args, ""),
_recv_timeout(0.1), // seconds
+ _recv_one_packet(true),
_tag_now(false),
_issue_stream_cmd_on_start(issue_stream_cmd_on_start)
{
@@ -149,7 +150,17 @@ namespace gr {
return res;
}
- SET_CENTER_FREQ_FROM_INTERNALS(usrp_source_impl, set_rx_freq);
+ ::uhd::tune_result_t
+ usrp_source_impl::_set_center_freq_from_internals(size_t chan, pmt::pmt_t direction)
+ {
+ _chans_to_tune.reset(chan);
+ if (pmt::eqv(direction, pmt::mp("TX"))) {
+ // TODO: what happens if the TX device is not instantiated? Catch error?
+ return _dev->set_tx_freq(_curr_tune_req[chan], _stream_args.channels[chan]);
+ } else {
+ return _dev->set_rx_freq(_curr_tune_req[chan], _stream_args.channels[chan]);
+ }
+ }
double
usrp_source_impl::get_center_freq(size_t chan)
@@ -489,6 +500,15 @@ namespace gr {
_tag_now = true;
}
+ void
+ usrp_source_impl::set_recv_timeout(
+ const double timeout,
+ const bool one_packet
+ ) {
+ _recv_timeout = timeout;
+ _recv_one_packet = one_packet;
+ }
+
bool
usrp_source_impl::start(void)
{
@@ -534,7 +554,7 @@ namespace gr {
_rx_stream->recv(outputs, nbytes/bpi, _metadata, 0.0);
else
// no rx streamer -- nothing to flush
- break;
+ break;
#else
_dev->get_device()->recv
(outputs, nbytes/_type->size, _metadata, *_type,
@@ -625,7 +645,7 @@ namespace gr {
noutput_items,
_metadata,
_recv_timeout,
- true /* one packet -> minimize latency */
+ _recv_one_packet
);
#else
size_t num_samps = _dev->get_device()->recv
diff --git a/gr-uhd/lib/usrp_source_impl.h b/gr-uhd/lib/usrp_source_impl.h
index 7ee5a138d4..d91fcec754 100644
--- a/gr-uhd/lib/usrp_source_impl.h
+++ b/gr-uhd/lib/usrp_source_impl.h
@@ -107,6 +107,7 @@ namespace gr {
double set_lo_freq(double freq, const std::string &name, size_t chan);
void issue_stream_cmd(const ::uhd::stream_cmd_t &cmd);
+ void set_recv_timeout(const double timeout, const bool one_packet);
void flush(void);
bool start(void);
bool stop(void);
@@ -120,13 +121,16 @@ namespace gr {
private:
//! Like set_center_freq(), but uses _curr_freq and _curr_lo_offset
- ::uhd::tune_result_t _set_center_freq_from_internals(size_t chan);
+ ::uhd::tune_result_t _set_center_freq_from_internals(size_t chan, pmt::pmt_t direction);
void _cmd_handler_tag(const pmt::pmt_t &tag);
#ifdef GR_UHD_USE_STREAM_API
::uhd::rx_streamer::sptr _rx_stream;
size_t _samps_per_packet;
+ //! Timeout value for UHD's recv() call. Lower values mean lower latency.
double _recv_timeout;
+ //! one_packet value for UHD's recv() call. 'true' is lower latency.
+ bool _recv_one_packet;
#endif
bool _tag_now;
::uhd::rx_metadata_t _metadata;
diff --git a/gr-zeromq/include/gnuradio/zeromq/pub_msg_sink.h b/gr-zeromq/include/gnuradio/zeromq/pub_msg_sink.h
index 8cf4bcfab4..fb046ca84b 100644
--- a/gr-zeromq/include/gnuradio/zeromq/pub_msg_sink.h
+++ b/gr-zeromq/include/gnuradio/zeromq/pub_msg_sink.h
@@ -49,7 +49,7 @@ namespace gr {
* \brief Return a shared_ptr to a new instance of zeromq::pub_msg_sink.
*
* \param address ZMQ socket address specifier
- * \param timeout Receive timeout in seconds, default is 100ms, 1us increments
+ * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments
*/
static sptr make(char *address, int timeout=100);
};
diff --git a/gr-zeromq/include/gnuradio/zeromq/pub_sink.h b/gr-zeromq/include/gnuradio/zeromq/pub_sink.h
index e87c5522f9..3fecc10b59 100644
--- a/gr-zeromq/include/gnuradio/zeromq/pub_sink.h
+++ b/gr-zeromq/include/gnuradio/zeromq/pub_sink.h
@@ -51,7 +51,7 @@ namespace gr {
* \param itemsize Size of a stream item in bytes.
* \param vlen Vector length of the input items. Note that one vector is one item.
* \param address ZMQ socket address specifier.
- * \param timeout Receive timeout in seconds, default is 100ms, 1us increments.
+ * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments.
* \param pass_tags Whether sink will serialize and pass tags over the link.
* \param hwm High Watermark to configure the socket to (-1 => zmq's default)
*/
diff --git a/gr-zeromq/include/gnuradio/zeromq/pull_msg_source.h b/gr-zeromq/include/gnuradio/zeromq/pull_msg_source.h
index 17495152b8..13857ead5f 100644
--- a/gr-zeromq/include/gnuradio/zeromq/pull_msg_source.h
+++ b/gr-zeromq/include/gnuradio/zeromq/pull_msg_source.h
@@ -46,7 +46,7 @@ namespace gr {
* \brief Return a shared_ptr to a new instance of gr::zeromq::pull_msg_source.
*
* \param address ZMQ socket address specifier
- * \param timeout Receive timeout in seconds, default is 100ms, 1us increments
+ * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments
*
*/
static sptr make(char *address, int timeout=100);
diff --git a/gr-zeromq/include/gnuradio/zeromq/pull_source.h b/gr-zeromq/include/gnuradio/zeromq/pull_source.h
index 07cf6af128..ecfe508b0a 100644
--- a/gr-zeromq/include/gnuradio/zeromq/pull_source.h
+++ b/gr-zeromq/include/gnuradio/zeromq/pull_source.h
@@ -48,7 +48,7 @@ namespace gr {
* \param itemsize Size of a stream item in bytes.
* \param vlen Vector length of the input items. Note that one vector is one item.
* \param address ZMQ socket address specifier.
- * \param timeout Receive timeout in seconds, default is 100ms, 1us increments.
+ * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments.
* \param pass_tags Whether source will look for and deserialize tags.
* \param hwm High Watermark to configure the socket to (-1 => zmq's default)
*/
diff --git a/gr-zeromq/include/gnuradio/zeromq/push_msg_sink.h b/gr-zeromq/include/gnuradio/zeromq/push_msg_sink.h
index 3ce6ebbdc0..941ad549f5 100644
--- a/gr-zeromq/include/gnuradio/zeromq/push_msg_sink.h
+++ b/gr-zeromq/include/gnuradio/zeromq/push_msg_sink.h
@@ -48,7 +48,7 @@ namespace gr {
* \brief Return a shared_ptr to a new instance of gr::zeromq::push_msg_sink
*
* \param address ZMQ socket address specifier
- * \param timeout Receive timeout in seconds, default is 100ms, 1us increments
+ * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments
*
*/
static sptr make(char *address, int timeout=100);
diff --git a/gr-zeromq/include/gnuradio/zeromq/push_sink.h b/gr-zeromq/include/gnuradio/zeromq/push_sink.h
index e2260aa3f6..f81dcaa941 100644
--- a/gr-zeromq/include/gnuradio/zeromq/push_sink.h
+++ b/gr-zeromq/include/gnuradio/zeromq/push_sink.h
@@ -52,7 +52,7 @@ namespace gr {
* \param itemsize Size of a stream item in bytes.
* \param vlen Vector length of the input items. Note that one vector is one item.
* \param address ZMQ socket address specifier.
- * \param timeout Receive timeout in seconds, default is 100ms, 1us increments.
+ * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments.
* \param pass_tags Whether sink will serialize and pass tags over the link.
* \param hwm High Watermark to configure the socket to (-1 => zmq's default)
*/
diff --git a/gr-zeromq/include/gnuradio/zeromq/rep_msg_sink.h b/gr-zeromq/include/gnuradio/zeromq/rep_msg_sink.h
index 97f3d831ad..d11550d149 100644
--- a/gr-zeromq/include/gnuradio/zeromq/rep_msg_sink.h
+++ b/gr-zeromq/include/gnuradio/zeromq/rep_msg_sink.h
@@ -48,7 +48,7 @@ namespace gr {
* \brief Return a shared_ptr to a new instance of zeromq::rep_msg_sink.
*
* \param address ZMQ socket address specifier
- * \param timeout Receive timeout in seconds, default is 100ms, 1us increments
+ * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments
*
*/
static sptr make(char *address, int timeout=100);
diff --git a/gr-zeromq/include/gnuradio/zeromq/rep_sink.h b/gr-zeromq/include/gnuradio/zeromq/rep_sink.h
index 220bd34416..c1d2d370fc 100644
--- a/gr-zeromq/include/gnuradio/zeromq/rep_sink.h
+++ b/gr-zeromq/include/gnuradio/zeromq/rep_sink.h
@@ -50,7 +50,7 @@ namespace gr {
* \param itemsize Size of a stream item in bytes.
* \param vlen Vector length of the input items. Note that one vector is one item.
* \param address ZMQ socket address specifier.
- * \param timeout Receive timeout in seconds, default is 100ms, 1us increments.
+ * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments.
* \param pass_tags Whether sink will serialize and pass tags over the link.
* \param hwm High Watermark to configure the socket to (-1 => zmq's default)
*/
diff --git a/gr-zeromq/include/gnuradio/zeromq/req_msg_source.h b/gr-zeromq/include/gnuradio/zeromq/req_msg_source.h
index 05d80b8e7f..28ac9f84f3 100644
--- a/gr-zeromq/include/gnuradio/zeromq/req_msg_source.h
+++ b/gr-zeromq/include/gnuradio/zeromq/req_msg_source.h
@@ -46,7 +46,7 @@ namespace gr {
* \brief Return a shared_ptr to a new instance of zeromq::req_msg_source.
*
* \param address ZMQ socket address specifier
- * \param timeout Receive timeout in seconds, default is 100ms, 1us increments
+ * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments
*
*/
static sptr make(char *address, int timeout=100);
diff --git a/gr-zeromq/include/gnuradio/zeromq/req_source.h b/gr-zeromq/include/gnuradio/zeromq/req_source.h
index 461f653b43..103da90f71 100644
--- a/gr-zeromq/include/gnuradio/zeromq/req_source.h
+++ b/gr-zeromq/include/gnuradio/zeromq/req_source.h
@@ -48,7 +48,7 @@ namespace gr {
* \param itemsize Size of a stream item in bytes.
* \param vlen Vector length of the input items. Note that one vector is one item.
* \param address ZMQ socket address specifier.
- * \param timeout Receive timeout in seconds, default is 100ms, 1us increments.
+ * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments.
* \param pass_tags Whether source will look for and deserialize tags.
* \param hwm High Watermark to configure the socket to (-1 => zmq's default)
*/
diff --git a/gr-zeromq/include/gnuradio/zeromq/sub_msg_source.h b/gr-zeromq/include/gnuradio/zeromq/sub_msg_source.h
index d06a83c1fd..5c91d1e1ed 100644
--- a/gr-zeromq/include/gnuradio/zeromq/sub_msg_source.h
+++ b/gr-zeromq/include/gnuradio/zeromq/sub_msg_source.h
@@ -46,7 +46,7 @@ namespace gr {
* \brief Return a shared_ptr to a new instance of gr::zeromq::sub_msg_source.
*
* \param address ZMQ socket address specifier
- * \param timeout Receive timeout in seconds, default is 100ms, 1us increments
+ * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments
*
*/
static sptr make(char *address, int timeout=100);
diff --git a/gr-zeromq/include/gnuradio/zeromq/sub_source.h b/gr-zeromq/include/gnuradio/zeromq/sub_source.h
index def3a703e6..990c74cabd 100644
--- a/gr-zeromq/include/gnuradio/zeromq/sub_source.h
+++ b/gr-zeromq/include/gnuradio/zeromq/sub_source.h
@@ -48,7 +48,7 @@ namespace gr {
* \param itemsize Size of a stream item in bytes.
* \param vlen Vector length of the input items. Note that one vector is one item.
* \param address ZMQ socket address specifier.
- * \param timeout Receive timeout in seconds, default is 100ms, 1us increments.
+ * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments.
* \param pass_tags Whether source will look for and deserialize tags.
* \param hwm High Watermark to configure the socket to (-1 => zmq's default)
*/
diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml
index 1dee986c5c..6f3c8d5cf0 100644
--- a/grc/blocks/options.xml
+++ b/grc/blocks/options.xml
@@ -19,6 +19,13 @@ import wx
from PyQt4 import Qt
import sys
#end if
+#if $generate_options() == 'bokeh_gui'
+import time
+import signal
+import functools
+from bokeh.client import push_session
+from bokeh.plotting import curdoc
+#end if
#if not $generate_options().startswith('hb')
from optparse import OptionParser
from gnuradio.eng_option import eng_option
@@ -61,6 +68,10 @@ else: self.stop(); self.wait()</callback>
<value>qt_gui</value>
<type>enum</type>
<option>
+ <name>Bokeh GUI</name>
+ <key>bokeh_gui</key>
+ </option>
+ <option>
<name>QT GUI</name>
<key>qt_gui</key>
</option>
@@ -104,12 +115,46 @@ else: self.stop(); self.wait()</callback>
</option>
</param>
<param>
+ <name>Widget Placement</name>
+ <key>placement</key>
+ <value>(0,0)</value>
+ <type>int_vector</type>
+ <hide>#if $generate_options() == 'bokeh_gui' then 'part' else 'all'#</hide>
+ </param>
+ <param>
+ <name>Sizing Mode</name>
+ <key>sizing_mode</key>
+ <value>fixed</value>
+ <type>enum</type>
+ <hide>#if $generate_options() == 'bokeh_gui' then 'part' else 'all'#</hide>
+ <option>
+ <name>Fixed</name>
+ <key>fixed</key>
+ </option>
+ <option>
+ <name>Stretch Both</name>
+ <key>stretch_both</key>
+ </option>
+ <option>
+ <name>Scale Width</name>
+ <key>scale_width</key>
+ </option>
+ <option>
+ <name>Scale Height</name>
+ <key>scale_height</key>
+ </option>
+ <option>
+ <name>Scale Both</name>
+ <key>scale_both</key>
+ </option>
+ </param>
+ <param>
<name>Run</name>
<key>run</key>
<value>True</value>
<type>bool</type>
<hide>
-#if $generate_options() in ('qt_gui', 'wx_gui')
+#if $generate_options() in ('qt_gui', 'wx_gui', 'bokeh_gui')
#if $run()
part
#else
@@ -218,7 +263,9 @@ part#slurp
<check>not $window_size or len($window_size) == 2</check>
<check>not $window_size or 300 &lt;= $(window_size)[0] &lt;= 4096</check>
<check>not $window_size or 300 &lt;= $(window_size)[1] &lt;= 4096</check>
- <doc>
+ <check>len($placement) == 4 or len($placement) == 2</check>
+ <check>all(i &gt;= 0 for i in $(placement))</check>
+ <doc>
The options block sets special parameters for the flow graph. \
Only one option block is allowed per flow graph.
diff --git a/grc/core/Platform.py b/grc/core/Platform.py
index 297e8b0ae5..258f38cc62 100644
--- a/grc/core/Platform.py
+++ b/grc/core/Platform.py
@@ -31,7 +31,7 @@ from .Block import Block
from .Port import Port
from .Param import Param
-from .utils import odict, extract_docs
+from .utils import odict, extract_docs, hide_bokeh_gui_options_if_not_installed
class Platform(Element):
@@ -172,6 +172,8 @@ class Platform(Element):
self._docstring_extractor.finish()
# self._docstring_extractor.wait()
+ hide_bokeh_gui_options_if_not_installed(self.blocks['options'])
+
def iter_xml_files(self):
"""Iterator for block descriptions and category trees"""
for block_path in self.config.block_paths:
diff --git a/grc/core/generator/flow_graph.tmpl b/grc/core/generator/flow_graph.tmpl
index 1ef251c46b..5550dca823 100644
--- a/grc/core/generator/flow_graph.tmpl
+++ b/grc/core/generator/flow_graph.tmpl
@@ -38,7 +38,7 @@ import threading
## Call XInitThreads as the _very_ first thing.
## After some Qt import, it's too late
-#if $generate_options in ('wx_gui', 'qt_gui')
+#if $generate_options in ('wx_gui', 'qt_gui', 'bokeh_gui')
if __name__ == '__main__':
import ctypes
import sys
@@ -119,6 +119,15 @@ class $(class_name)(gr.top_block, Qt.QWidget):
self.settings = Qt.QSettings("GNU Radio", "$class_name")
self.restoreGeometry(self.settings.value("geometry").toByteArray())
+
+#elif $generate_options == 'bokeh_gui'
+
+class $(class_name)(gr.top_block):
+ def __init__(self, doc):
+ gr.top_block.__init__(self, "$title")
+ self.doc = doc
+ self.plot_lst = []
+ self.widget_lst = []
#elif $generate_options == 'no_gui'
@@ -237,6 +246,22 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))])
#end if
#end if
#end for
+
+##########################################################
+## Create a layout entry if not manually done for BokehGUI
+##########################################################
+#if $generate_options == 'bokeh_gui'
+ if self.widget_lst:
+ input_t = bokehgui.BokehLayout.widgetbox(self.widget_lst)
+ widgetbox = bokehgui.BokehLayout.WidgetLayout(input_t)
+ widgetbox.set_layout(*($flow_graph.get_option('placement')))
+ list_obj = [widgetbox] + self.plot_lst
+ else:
+ list_obj = self.plot_lst
+ layout_t = bokehgui.BokehLayout.create_layout(list_obj, "$flow_graph.get_option('sizing_mode')")
+ self.doc.add_root(layout_t)
+#end if
+
########################################################
##Create Connections
## The port name should be the id of the parent block.
@@ -378,6 +403,37 @@ def main(top_block_cls=$(class_name), options=None):
#end for
tb.Wait()
#end if
+ #elif $generate_options == 'bokeh_gui'
+ serverProc, port = bokehgui.utils.create_server()
+ def killProc(signum, frame, tb):
+ tb.stop()
+ tb.wait()
+ serverProc.terminate()
+ serverProc.kill()
+ time.sleep(1)
+ try:
+ \# Define the document instance
+ doc = curdoc()
+ #if $flow_graph.get_option('author')
+ doc.title = "$title - $flow_graph.get_option('author')"
+ #else
+ doc.title = "$title"
+ #end if
+ session = push_session(doc, session_id="$flow_graph.get_option('id')",
+ url = "http://localhost:" + port + "/bokehgui")
+ \# Create Top Block instance
+ tb = top_block_cls(doc)
+ try:
+ tb.start()
+ signal.signal(signal.SIGTERM, functools.partial(killProc, tb=tb))
+ session.loop_until_closed()
+ finally:
+ print "Exiting the simulation. Stopping Bokeh Server"
+ tb.stop()
+ tb.wait()
+ finally:
+ serverProc.terminate()
+ serverProc.kill()
#elif $generate_options == 'qt_gui'
from distutils.version import StrictVersion
if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
diff --git a/grc/core/utils/__init__.py b/grc/core/utils/__init__.py
index 6b23da2723..2aed42d762 100644
--- a/grc/core/utils/__init__.py
+++ b/grc/core/utils/__init__.py
@@ -20,3 +20,4 @@ import epy_block_io
import extract_docs
from odict import odict
+from hide_bokeh_gui_options_if_not_installed import hide_bokeh_gui_options_if_not_installed
diff --git a/grc/core/utils/hide_bokeh_gui_options_if_not_installed.py b/grc/core/utils/hide_bokeh_gui_options_if_not_installed.py
new file mode 100644
index 0000000000..fc0141851a
--- /dev/null
+++ b/grc/core/utils/hide_bokeh_gui_options_if_not_installed.py
@@ -0,0 +1,28 @@
+# Copyright 2008-2017 Free Software Foundation, Inc.
+# This file is part of GNU Radio
+#
+# GNU Radio Companion is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# GNU Radio Companion is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+
+def hide_bokeh_gui_options_if_not_installed(options):
+ try:
+ import bokehgui
+ except ImportError:
+ generate_option = options.get_param('generate_options')
+ list_generate_option = generate_option.get_options()
+ for option in list_generate_option:
+ if option.get_key() == 'bokeh_gui':
+ list_generate_option.remove(option)
+ return
diff --git a/grc/gui/MainWindow.py b/grc/gui/MainWindow.py
index 54141af547..9a2823a7ab 100644
--- a/grc/gui/MainWindow.py
+++ b/grc/gui/MainWindow.py
@@ -91,8 +91,11 @@ class MainWindow(gtk.Window):
vbox = gtk.VBox()
self.add(vbox)
- # Set window icon
- self.set_icon_from_file(os.path.dirname(os.path.abspath(__file__)) + "/icon.png")
+ icon_theme = gtk.icon_theme_get_default()
+ icon = icon_theme.lookup_icon("gnuradio-grc", 48, 0)
+ if not icon:
+ # Set window icon
+ self.set_icon_from_file(os.path.dirname(os.path.abspath(__file__)) + "/icon.png")
# Create the menu bar and toolbar
self.add_accel_group(Actions.get_accel_group())