summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt10
-rw-r--r--cmake/Modules/FindSWIG.cmake4
-rw-r--r--cmake/Modules/UseSWIG.cmake4
-rw-r--r--gnuradio-runtime/CMakeLists.txt10
-rw-r--r--gnuradio-runtime/lib/controlport/CMakeLists.txt28
-rw-r--r--gnuradio-runtime/python/gnuradio/ctrlport/CMakeLists.txt35
-rw-r--r--gr-blocks/swig/CMakeLists.txt5
-rw-r--r--gr-blocks/swig/blocks_swig.py.in5
-rw-r--r--gr-blocks/swig/blocks_swig0.i1
-rw-r--r--gr-blocks/swig/blocks_swig1.i46
-rw-r--r--gr-blocks/swig/blocks_swig10.i90
-rw-r--r--gr-blocks/swig/blocks_swig2.i75
-rw-r--r--gr-blocks/swig/blocks_swig3.i81
-rw-r--r--gr-blocks/swig/blocks_swig4.i36
-rw-r--r--gr-blocks/swig/blocks_swig5.i72
-rw-r--r--gr-blocks/swig/blocks_swig6.i107
-rw-r--r--gr-blocks/swig/blocks_swig7.i96
-rw-r--r--gr-blocks/swig/blocks_swig8.i93
-rw-r--r--gr-blocks/swig/blocks_swig9.i93
-rw-r--r--gr-digital/grc/variable_header_format_default.xml13
-rw-r--r--gr-digital/include/gnuradio/digital/header_format_counter.h1
-rw-r--r--gr-digital/include/gnuradio/digital/header_format_default.h10
-rw-r--r--gr-digital/lib/header_format_counter.cc3
-rw-r--r--gr-digital/lib/header_format_default.cc10
-rw-r--r--gr-digital/python/digital/qa_packet_format.py47
-rw-r--r--gr-dtv/lib/dvbt2/dvbt2_modulator_bc_impl.cc357
-rw-r--r--gr-uhd/apps/uhd_app.py73
-rwxr-xr-xgr-uhd/apps/uhd_fft5
-rw-r--r--gr-uhd/lib/usrp_source_impl.cc5
-rw-r--r--gr-uhd/lib/usrp_source_impl.h1
-rw-r--r--gr-utils/python/modtool/gr-newmod/cmake/Modules/UseSWIG.cmake4
-rw-r--r--grc/core/Param.py23
-rw-r--r--grc/gui/ActionHandler.py27
-rw-r--r--grc/gui/Actions.py10
-rw-r--r--grc/gui/Bars.py2
35 files changed, 719 insertions, 763 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 650cfe3ac4..eab6d9bd52 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,8 +46,8 @@ message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.")
# Set the version information here
set(VERSION_INFO_MAJOR_VERSION 3)
set(VERSION_INFO_API_COMPAT 7)
-set(VERSION_INFO_MINOR_VERSION 11)
-set(VERSION_INFO_MAINT_VERSION 1)
+set(VERSION_INFO_MINOR_VERSION 12)
+set(VERSION_INFO_MAINT_VERSION git)
include(GrVersion) #setup version info
# Append -O2 optimization flag for Debug builds (Not on MSVC since conflicts with RTC1 flag)
@@ -287,9 +287,11 @@ find_package(PythonLibs 2)
find_package(SWIG)
if(SWIG_FOUND)
- # Minimum SWIG version required is 1.3.31
+ # Minimum SWIG version required is 2.0.4
+ # Recommended revisit: EOL of Ubuntu 12.04 LTS, bump to 2.0.7
+ # see https://github.com/gnuradio/gnuradio/issues/1222
set(SWIG_VERSION_CHECK FALSE)
- if("${SWIG_VERSION}" VERSION_GREATER "1.3.30")
+ if("${SWIG_VERSION}" VERSION_GREATER "2.0.3")
set(SWIG_VERSION_CHECK TRUE)
endif()
endif(SWIG_FOUND)
diff --git a/cmake/Modules/FindSWIG.cmake b/cmake/Modules/FindSWIG.cmake
index 156bd5ed52..ed1ac93341 100644
--- a/cmake/Modules/FindSWIG.cmake
+++ b/cmake/Modules/FindSWIG.cmake
@@ -86,7 +86,7 @@ if(SWIG_FOUND)
# SWIG was found; make sure the version meets GR's needs
message(STATUS "Found SWIG version ${SWIG_VERSION}.")
- if("${SWIG_VERSION}" VERSION_GREATER "1.3.30")
+ if("${SWIG_VERSION}" VERSION_GREATER "2.0.3")
if(NOT "${SWIG_VERSION}" VERSION_EQUAL "3.0.3" AND
NOT "${SWIG_VERSION}" VERSION_EQUAL "3.0.4")
set(SWIG_VERSION_CHECK TRUE)
@@ -94,7 +94,7 @@ if(SWIG_FOUND)
message(STATUS "SWIG versions 3.0.3 and 3.0.4 fail to work with GNU Radio.")
endif()
else()
- message(STATUS "Minimum SWIG version required is 1.3.31 for GNU Radio.")
+ message(STATUS "Minimum SWIG version required is 2.0.4 for GNU Radio.")
endif()
else()
diff --git a/cmake/Modules/UseSWIG.cmake b/cmake/Modules/UseSWIG.cmake
index d1014943de..b7e3e05dc5 100644
--- a/cmake/Modules/UseSWIG.cmake
+++ b/cmake/Modules/UseSWIG.cmake
@@ -224,9 +224,9 @@ print(re.sub('\\W', '_', '${name} ${reldir} ' + unique))"
foreach(swig_gen_file ${${outfiles}})
add_custom_command(
OUTPUT ${swig_gen_file}
- COMMAND
+ COMMAND "${CMAKE_COMMAND}" -E touch_nocreate "${swig_gen_file}"
DEPENDS ${_target}
- COMMENT
+ COMMENT "dummy command to show ${_target} dependency of ${swig_gen_file}"
)
endforeach()
diff --git a/gnuradio-runtime/CMakeLists.txt b/gnuradio-runtime/CMakeLists.txt
index 7660642509..17fc61e393 100644
--- a/gnuradio-runtime/CMakeLists.txt
+++ b/gnuradio-runtime/CMakeLists.txt
@@ -62,16 +62,6 @@ GR_SET_GLOBAL(GNURADIO_RUNTIME_PYTHONPATH ${GNURADIO_RUNTIME_PYTHONPATH})
FIND_PACKAGE(SWIG)
-if(SWIG_FOUND)
- set(SWIG_VERSION_CHECK FALSE)
- if("${SWIG_VERSION}" VERSION_GREATER "2.0.0")
- set(SWIG_VERSION_CHECK TRUE)
- else("${SWIG_VERSION}" VERSION_GREATER "2.0.0")
- message(STATUS "")
- message(STATUS "Ctrlport requires SWIG version >= 2.0")
- endif()
-endif(SWIG_FOUND)
-
GR_REGISTER_COMPONENT("gr-ctrlport" ENABLE_GR_CTRLPORT
Boost_FOUND
SWIG_FOUND
diff --git a/gnuradio-runtime/lib/controlport/CMakeLists.txt b/gnuradio-runtime/lib/controlport/CMakeLists.txt
index c9bdeb949e..0d5d0376cc 100644
--- a/gnuradio-runtime/lib/controlport/CMakeLists.txt
+++ b/gnuradio-runtime/lib/controlport/CMakeLists.txt
@@ -51,28 +51,28 @@ MATH(EXPR CTRLPORT_BACKENDS "${CTRLPORT_BACKENDS} + 1")
message(STATUS "Found and enabling Thrift backend to ControlPort")
GR_APPEND_SUBCOMPONENT("thrift")
-# Run Thrrift To compile C++ and Python files
+# Run Thrift To compile C++ and Python files
message(STATUS "Running thrift to build C++ bindings")
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/thrift/)
-EXECUTE_PROCESS(
- COMMAND ${THRIFT_BIN} --gen cpp -out ${CMAKE_CURRENT_BINARY_DIR}/thrift/ ${CMAKE_CURRENT_SOURCE_DIR}/thrift/gnuradio.thrift
- OUTPUT_VARIABLE THRIFT_CPP_OUTPUT
- ERROR_VARIABLE THRIFT_CPP_ERROR
- )
+list(APPEND gnuradio_thrift_generated_sources
+ ${CMAKE_CURRENT_BINARY_DIR}/thrift/gnuradio_types.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/thrift/gnuradio_constants.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/thrift/ControlPort.cpp
+ )
+add_custom_command(
+ DEPENDS ${CMAKE_SOURCE_DIR}/gnuradio-runtime/lib/controlport/thrift/gnuradio.thrift
+ OUTPUT ${gnuradio_thrift_generated_sources}
+ COMMAND ${THRIFT_BIN} --gen cpp -out ${CMAKE_CURRENT_BINARY_DIR}/thrift/ ${CMAKE_CURRENT_SOURCE_DIR}/thrift/gnuradio.thrift
+ )
list(APPEND gnuradio_ctrlport_sources
${CMAKE_CURRENT_SOURCE_DIR}/thrift/rpcserver_thrift.cc
${CMAKE_CURRENT_SOURCE_DIR}/thrift/rpcpmtconverters_thrift.cc
${CMAKE_CURRENT_SOURCE_DIR}/thrift/rpcserver_booter_thrift.cc
${CMAKE_CURRENT_SOURCE_DIR}/thrift/thrift_application_base.cc
-)
-
-# add files built by compiling gnuradio.thrift
-list(APPEND gnuradio_ctrlport_sources
- ${CMAKE_CURRENT_BINARY_DIR}/thrift/gnuradio_types.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/thrift/gnuradio_constants.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/thrift/ControlPort.cpp
-)
+ # add files built by compiling gnuradio.thrift
+ ${gnuradio_thrift_generated_sources}
+ )
# Add required libraries here
list(APPEND gnuradio_runtime_libs
diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/CMakeLists.txt b/gnuradio-runtime/python/gnuradio/ctrlport/CMakeLists.txt
index f40f253a72..be959467cf 100644
--- a/gnuradio-runtime/python/gnuradio/ctrlport/CMakeLists.txt
+++ b/gnuradio-runtime/python/gnuradio/ctrlport/CMakeLists.txt
@@ -50,21 +50,7 @@ GR_PYTHON_INSTALL(
if(THRIFT_FOUND)
-EXECUTE_PROCESS(
- COMMAND ${THRIFT_BIN} --gen py -out ${CMAKE_CURRENT_BINARY_DIR}/ ${CMAKE_SOURCE_DIR}/gnuradio-runtime/lib/controlport/thrift/gnuradio.thrift
- OUTPUT_VARIABLE THRIFT_PY_OUTPUT
- ERROR_VARIABLE THRIFT_PY_ERROR
- )
-
-GR_PYTHON_INSTALL(
- FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/RPCConnectionThrift.py
- DESTINATION ${GR_PYTHON_DIR}/gnuradio/ctrlport/
- COMPONENT "runtime_python"
-)
-
-GR_PYTHON_INSTALL(
- FILES
+ list(APPEND thrift_targets
${CMAKE_CURRENT_BINARY_DIR}/GNURadio/__init__.py
${CMAKE_CURRENT_BINARY_DIR}/GNURadio/constants.py
${CMAKE_CURRENT_BINARY_DIR}/GNURadio/ControlPort.py
@@ -72,8 +58,25 @@ GR_PYTHON_INSTALL(
${CMAKE_CURRENT_BINARY_DIR}/GNURadio/StreamReceiver.py
${CMAKE_CURRENT_BINARY_DIR}/GNURadio/StreamReceiver-remote
${CMAKE_CURRENT_BINARY_DIR}/GNURadio/ttypes.py
+ )
+ add_custom_command(
+ DEPENDS ${CMAKE_SOURCE_DIR}/gnuradio-runtime/lib/controlport/thrift/gnuradio.thrift
+ OUTPUT ${thrift_targets}
+ COMMAND ${THRIFT_BIN} --gen py -out ${CMAKE_CURRENT_BINARY_DIR}/ ${CMAKE_SOURCE_DIR}/gnuradio-runtime/lib/controlport/thrift/gnuradio.thrift
+ )
+
+ GR_PYTHON_INSTALL(
+ FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/RPCConnectionThrift.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/ctrlport/
+ COMPONENT "runtime_python"
+ )
+
+ GR_PYTHON_INSTALL(
+ FILES
+ ${thrift_targets}
DESTINATION ${GR_PYTHON_DIR}/gnuradio/ctrlport/GNURadio
COMPONENT "runtime_python"
-)
+ )
endif(THRIFT_FOUND)
diff --git a/gr-blocks/swig/CMakeLists.txt b/gr-blocks/swig/CMakeLists.txt
index c128a9b26c..d64c347919 100644
--- a/gr-blocks/swig/CMakeLists.txt
+++ b/gr-blocks/swig/CMakeLists.txt
@@ -52,6 +52,11 @@ set(GR_SWIG_BLOCK_IFILES
blocks_swig3
blocks_swig4
blocks_swig5
+ blocks_swig6
+ blocks_swig7
+ blocks_swig8
+ blocks_swig9
+ blocks_swig10
)
foreach(swigfile ${GR_SWIG_BLOCK_IFILES})
diff --git a/gr-blocks/swig/blocks_swig.py.in b/gr-blocks/swig/blocks_swig.py.in
index a0bd574c18..7682f17d83 100644
--- a/gr-blocks/swig/blocks_swig.py.in
+++ b/gr-blocks/swig/blocks_swig.py.in
@@ -25,3 +25,8 @@ from blocks_swig2 import *
from blocks_swig3 import *
from blocks_swig4 import *
from blocks_swig5 import *
+from blocks_swig6 import *
+from blocks_swig7 import *
+from blocks_swig8 import *
+from blocks_swig9 import *
+from blocks_swig10 import *
diff --git a/gr-blocks/swig/blocks_swig0.i b/gr-blocks/swig/blocks_swig0.i
index 37b8ef6b0b..66e6ca10f8 100644
--- a/gr-blocks/swig/blocks_swig0.i
+++ b/gr-blocks/swig/blocks_swig0.i
@@ -24,6 +24,7 @@
%include "gnuradio.i"
+//load generated python docstrings
%include "blocks_swig0_doc.i"
%{
diff --git a/gr-blocks/swig/blocks_swig1.i b/gr-blocks/swig/blocks_swig1.i
index 24483fcf91..cbff920d02 100644
--- a/gr-blocks/swig/blocks_swig1.i
+++ b/gr-blocks/swig/blocks_swig1.i
@@ -24,24 +24,10 @@
%include "gnuradio.i"
+//load generated python docstrings
%include "blocks_swig1_doc.i"
%{
-#include "gnuradio/blocks/skiphead.h"
-#include "gnuradio/blocks/stream_mux.h"
-#include "gnuradio/blocks/stream_to_streams.h"
-#include "gnuradio/blocks/stream_to_tagged_stream.h"
-#include "gnuradio/blocks/stream_to_vector.h"
-#include "gnuradio/blocks/streams_to_stream.h"
-#include "gnuradio/blocks/streams_to_vector.h"
-#include "gnuradio/blocks/tag_debug.h"
-#include "gnuradio/blocks/tagged_file_sink.h"
-#include "gnuradio/blocks/tsb_vector_sink_b.h"
-#include "gnuradio/blocks/tsb_vector_sink_c.h"
-#include "gnuradio/blocks/tsb_vector_sink_f.h"
-#include "gnuradio/blocks/tsb_vector_sink_i.h"
-#include "gnuradio/blocks/tsb_vector_sink_s.h"
-#include "gnuradio/blocks/throttle.h"
#include "gnuradio/blocks/vector_map.h"
#include "gnuradio/blocks/vector_to_stream.h"
#include "gnuradio/blocks/vector_to_streams.h"
@@ -64,21 +50,6 @@
#include "gnuradio/blocks/wavfile_source.h"
%}
-%include "gnuradio/blocks/skiphead.h"
-%include "gnuradio/blocks/stream_mux.h"
-%include "gnuradio/blocks/stream_to_streams.h"
-%include "gnuradio/blocks/stream_to_tagged_stream.h"
-%include "gnuradio/blocks/stream_to_vector.h"
-%include "gnuradio/blocks/streams_to_stream.h"
-%include "gnuradio/blocks/streams_to_vector.h"
-%include "gnuradio/blocks/tag_debug.h"
-%include "gnuradio/blocks/tagged_file_sink.h"
-%include "gnuradio/blocks/tsb_vector_sink_b.h"
-%include "gnuradio/blocks/tsb_vector_sink_c.h"
-%include "gnuradio/blocks/tsb_vector_sink_f.h"
-%include "gnuradio/blocks/tsb_vector_sink_i.h"
-%include "gnuradio/blocks/tsb_vector_sink_s.h"
-%include "gnuradio/blocks/throttle.h"
%include "gnuradio/blocks/vector_map.h"
%include "gnuradio/blocks/vector_to_stream.h"
%include "gnuradio/blocks/vector_to_streams.h"
@@ -100,21 +71,6 @@
%include "gnuradio/blocks/wavfile_sink.h"
%include "gnuradio/blocks/wavfile_source.h"
-GR_SWIG_BLOCK_MAGIC2(blocks, skiphead);
-GR_SWIG_BLOCK_MAGIC2(blocks, stream_mux);
-GR_SWIG_BLOCK_MAGIC2(blocks, stream_to_streams);
-GR_SWIG_BLOCK_MAGIC2(blocks, stream_to_tagged_stream);
-GR_SWIG_BLOCK_MAGIC2(blocks, stream_to_vector);
-GR_SWIG_BLOCK_MAGIC2(blocks, streams_to_stream);
-GR_SWIG_BLOCK_MAGIC2(blocks, streams_to_vector);
-GR_SWIG_BLOCK_MAGIC2(blocks, tag_debug);
-GR_SWIG_BLOCK_MAGIC2(blocks, tagged_file_sink);
-GR_SWIG_BLOCK_MAGIC2(blocks, tsb_vector_sink_b);
-GR_SWIG_BLOCK_MAGIC2(blocks, tsb_vector_sink_c);
-GR_SWIG_BLOCK_MAGIC2(blocks, tsb_vector_sink_f);
-GR_SWIG_BLOCK_MAGIC2(blocks, tsb_vector_sink_i);
-GR_SWIG_BLOCK_MAGIC2(blocks, tsb_vector_sink_s);
-GR_SWIG_BLOCK_MAGIC2(blocks, throttle);
GR_SWIG_BLOCK_MAGIC2(blocks, vector_map);
GR_SWIG_BLOCK_MAGIC2(blocks, vector_to_stream);
GR_SWIG_BLOCK_MAGIC2(blocks, vector_to_streams);
diff --git a/gr-blocks/swig/blocks_swig10.i b/gr-blocks/swig/blocks_swig10.i
new file mode 100644
index 0000000000..5872b17cf3
--- /dev/null
+++ b/gr-blocks/swig/blocks_swig10.i
@@ -0,0 +1,90 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#define BLOCKS_API
+
+%include "gnuradio.i"
+
+//load generated python docstrings
+%include "blocks_swig10_doc.i"
+
+%{
+#include "gnuradio/blocks/min_ff.h"
+#include "gnuradio/blocks/min_ii.h"
+#include "gnuradio/blocks/min_ss.h"
+#include "gnuradio/blocks/moving_average_cc.h"
+#include "gnuradio/blocks/moving_average_ff.h"
+#include "gnuradio/blocks/moving_average_ii.h"
+#include "gnuradio/blocks/moving_average_ss.h"
+#include "gnuradio/blocks/nlog10_ff.h"
+#include "gnuradio/blocks/not_bb.h"
+#include "gnuradio/blocks/not_ss.h"
+#include "gnuradio/blocks/not_ii.h"
+#include "gnuradio/blocks/or_bb.h"
+#include "gnuradio/blocks/or_ss.h"
+#include "gnuradio/blocks/or_ii.h"
+#include "gnuradio/blocks/patterned_interleaver.h"
+#include "gnuradio/blocks/pack_k_bits_bb.h"
+#include "gnuradio/blocks/packed_to_unpacked_bb.h"
+#include "gnuradio/blocks/packed_to_unpacked_ss.h"
+#include "gnuradio/blocks/packed_to_unpacked_ii.h"
+%}
+
+%include "gnuradio/blocks/min_ff.h"
+%include "gnuradio/blocks/min_ii.h"
+%include "gnuradio/blocks/min_ss.h"
+%include "gnuradio/blocks/moving_average_cc.h"
+%include "gnuradio/blocks/moving_average_ff.h"
+%include "gnuradio/blocks/moving_average_ii.h"
+%include "gnuradio/blocks/moving_average_ss.h"
+%include "gnuradio/blocks/nlog10_ff.h"
+%include "gnuradio/blocks/not_bb.h"
+%include "gnuradio/blocks/not_ss.h"
+%include "gnuradio/blocks/not_ii.h"
+%include "gnuradio/blocks/or_bb.h"
+%include "gnuradio/blocks/or_ss.h"
+%include "gnuradio/blocks/or_ii.h"
+%include "gnuradio/blocks/patterned_interleaver.h"
+%include "gnuradio/blocks/pack_k_bits_bb.h"
+%include "gnuradio/blocks/packed_to_unpacked_bb.h"
+%include "gnuradio/blocks/packed_to_unpacked_ss.h"
+%include "gnuradio/blocks/packed_to_unpacked_ii.h"
+
+GR_SWIG_BLOCK_MAGIC2(blocks, min_ff);
+GR_SWIG_BLOCK_MAGIC2(blocks, min_ii);
+GR_SWIG_BLOCK_MAGIC2(blocks, min_ss);
+GR_SWIG_BLOCK_MAGIC2(blocks, moving_average_cc);
+GR_SWIG_BLOCK_MAGIC2(blocks, moving_average_ff);
+GR_SWIG_BLOCK_MAGIC2(blocks, moving_average_ii);
+GR_SWIG_BLOCK_MAGIC2(blocks, moving_average_ss);
+GR_SWIG_BLOCK_MAGIC2(blocks, nlog10_ff);
+GR_SWIG_BLOCK_MAGIC2(blocks, not_bb);
+GR_SWIG_BLOCK_MAGIC2(blocks, not_ss);
+GR_SWIG_BLOCK_MAGIC2(blocks, not_ii);
+GR_SWIG_BLOCK_MAGIC2(blocks, or_bb);
+GR_SWIG_BLOCK_MAGIC2(blocks, or_ss);
+GR_SWIG_BLOCK_MAGIC2(blocks, or_ii);
+GR_SWIG_BLOCK_MAGIC2(blocks, patterned_interleaver);
+GR_SWIG_BLOCK_MAGIC2(blocks, pack_k_bits_bb);
+GR_SWIG_BLOCK_MAGIC2(blocks, packed_to_unpacked_bb);
+GR_SWIG_BLOCK_MAGIC2(blocks, packed_to_unpacked_ss);
+GR_SWIG_BLOCK_MAGIC2(blocks, packed_to_unpacked_ii);
diff --git a/gr-blocks/swig/blocks_swig2.i b/gr-blocks/swig/blocks_swig2.i
index 92db800d95..ea25a6bccc 100644
--- a/gr-blocks/swig/blocks_swig2.i
+++ b/gr-blocks/swig/blocks_swig2.i
@@ -31,26 +31,6 @@
%include "feval.i"
%{
-#include "gnuradio/blocks/abs_ff.h"
-#include "gnuradio/blocks/abs_ss.h"
-#include "gnuradio/blocks/abs_ii.h"
-#include "gnuradio/blocks/add_ff.h"
-#include "gnuradio/blocks/add_ss.h"
-#include "gnuradio/blocks/add_ii.h"
-#include "gnuradio/blocks/add_cc.h"
-#include "gnuradio/blocks/add_const_bb.h"
-#include "gnuradio/blocks/add_const_ff.h"
-#include "gnuradio/blocks/add_const_ss.h"
-#include "gnuradio/blocks/add_const_ii.h"
-#include "gnuradio/blocks/add_const_cc.h"
-#include "gnuradio/blocks/add_const_vbb.h"
-#include "gnuradio/blocks/add_const_vff.h"
-#include "gnuradio/blocks/add_const_vss.h"
-#include "gnuradio/blocks/add_const_vii.h"
-#include "gnuradio/blocks/add_const_vcc.h"
-#include "gnuradio/blocks/and_bb.h"
-#include "gnuradio/blocks/and_ss.h"
-#include "gnuradio/blocks/and_ii.h"
#include "gnuradio/blocks/and_const_bb.h"
#include "gnuradio/blocks/and_const_ss.h"
#include "gnuradio/blocks/and_const_ii.h"
@@ -72,33 +52,8 @@
#include "gnuradio/blocks/complex_to_mag_squared.h"
#include "gnuradio/blocks/complex_to_arg.h"
#include "gnuradio/blocks/conjugate_cc.h"
-#include "gnuradio/blocks/deinterleave.h"
-#include "gnuradio/blocks/divide_ff.h"
-#include "gnuradio/blocks/divide_ss.h"
-#include "gnuradio/blocks/divide_ii.h"
-#include "gnuradio/blocks/divide_cc.h"
%}
-%include "gnuradio/blocks/abs_ff.h"
-%include "gnuradio/blocks/abs_ss.h"
-%include "gnuradio/blocks/abs_ii.h"
-%include "gnuradio/blocks/add_ff.h"
-%include "gnuradio/blocks/add_ss.h"
-%include "gnuradio/blocks/add_ii.h"
-%include "gnuradio/blocks/add_cc.h"
-%include "gnuradio/blocks/add_const_bb.h"
-%include "gnuradio/blocks/add_const_ff.h"
-%include "gnuradio/blocks/add_const_ss.h"
-%include "gnuradio/blocks/add_const_ii.h"
-%include "gnuradio/blocks/add_const_cc.h"
-%include "gnuradio/blocks/add_const_vbb.h"
-%include "gnuradio/blocks/add_const_vff.h"
-%include "gnuradio/blocks/add_const_vss.h"
-%include "gnuradio/blocks/add_const_vii.h"
-%include "gnuradio/blocks/add_const_vcc.h"
-%include "gnuradio/blocks/and_bb.h"
-%include "gnuradio/blocks/and_ss.h"
-%include "gnuradio/blocks/and_ii.h"
%include "gnuradio/blocks/and_const_bb.h"
%include "gnuradio/blocks/and_const_ss.h"
%include "gnuradio/blocks/and_const_ii.h"
@@ -120,32 +75,7 @@
%include "gnuradio/blocks/complex_to_mag_squared.h"
%include "gnuradio/blocks/complex_to_arg.h"
%include "gnuradio/blocks/conjugate_cc.h"
-%include "gnuradio/blocks/deinterleave.h"
-%include "gnuradio/blocks/divide_ff.h"
-%include "gnuradio/blocks/divide_ss.h"
-%include "gnuradio/blocks/divide_ii.h"
-%include "gnuradio/blocks/divide_cc.h"
-GR_SWIG_BLOCK_MAGIC2(blocks, abs_ff);
-GR_SWIG_BLOCK_MAGIC2(blocks, abs_ss);
-GR_SWIG_BLOCK_MAGIC2(blocks, abs_ii);
-GR_SWIG_BLOCK_MAGIC2(blocks, add_ff);
-GR_SWIG_BLOCK_MAGIC2(blocks, add_ss);
-GR_SWIG_BLOCK_MAGIC2(blocks, add_ii);
-GR_SWIG_BLOCK_MAGIC2(blocks, add_cc);
-GR_SWIG_BLOCK_MAGIC2(blocks, add_const_bb);
-GR_SWIG_BLOCK_MAGIC2(blocks, add_const_ff);
-GR_SWIG_BLOCK_MAGIC2(blocks, add_const_ss);
-GR_SWIG_BLOCK_MAGIC2(blocks, add_const_ii);
-GR_SWIG_BLOCK_MAGIC2(blocks, add_const_cc);
-GR_SWIG_BLOCK_MAGIC2(blocks, add_const_vbb);
-GR_SWIG_BLOCK_MAGIC2(blocks, add_const_vff);
-GR_SWIG_BLOCK_MAGIC2(blocks, add_const_vss);
-GR_SWIG_BLOCK_MAGIC2(blocks, add_const_vii);
-GR_SWIG_BLOCK_MAGIC2(blocks, add_const_vcc);
-GR_SWIG_BLOCK_MAGIC2(blocks, and_bb);
-GR_SWIG_BLOCK_MAGIC2(blocks, and_ss);
-GR_SWIG_BLOCK_MAGIC2(blocks, and_ii);
GR_SWIG_BLOCK_MAGIC2(blocks, and_const_bb);
GR_SWIG_BLOCK_MAGIC2(blocks, and_const_ss);
GR_SWIG_BLOCK_MAGIC2(blocks, and_const_ii);
@@ -167,8 +97,3 @@ GR_SWIG_BLOCK_MAGIC2(blocks, complex_to_mag);
GR_SWIG_BLOCK_MAGIC2(blocks, complex_to_mag_squared);
GR_SWIG_BLOCK_MAGIC2(blocks, complex_to_arg);
GR_SWIG_BLOCK_MAGIC2(blocks, conjugate_cc);
-GR_SWIG_BLOCK_MAGIC2(blocks, deinterleave);
-GR_SWIG_BLOCK_MAGIC2(blocks, divide_ff);
-GR_SWIG_BLOCK_MAGIC2(blocks, divide_ss);
-GR_SWIG_BLOCK_MAGIC2(blocks, divide_ii);
-GR_SWIG_BLOCK_MAGIC2(blocks, divide_cc);
diff --git a/gr-blocks/swig/blocks_swig3.i b/gr-blocks/swig/blocks_swig3.i
index 629ada54ea..6794b75d57 100644
--- a/gr-blocks/swig/blocks_swig3.i
+++ b/gr-blocks/swig/blocks_swig3.i
@@ -28,33 +28,6 @@
%include "blocks_swig3_doc.i"
%{
-#include "gnuradio/blocks/float_to_char.h"
-#include "gnuradio/blocks/float_to_complex.h"
-#include "gnuradio/blocks/magphase_to_complex.h"
-#include "gnuradio/blocks/float_to_int.h"
-#include "gnuradio/blocks/float_to_short.h"
-#include "gnuradio/blocks/float_to_uchar.h"
-#include "gnuradio/blocks/int_to_float.h"
-#include "gnuradio/blocks/integrate_ss.h"
-#include "gnuradio/blocks/integrate_ii.h"
-#include "gnuradio/blocks/integrate_ff.h"
-#include "gnuradio/blocks/integrate_cc.h"
-#include "gnuradio/blocks/interleave.h"
-#include "gnuradio/blocks/interleaved_short_to_complex.h"
-#include "gnuradio/blocks/interleaved_char_to_complex.h"
-#include "gnuradio/blocks/keep_m_in_n.h"
-#include "gnuradio/blocks/keep_one_in_n.h"
-#include "gnuradio/blocks/lfsr_32k_source_s.h"
-#include "gnuradio/blocks/max_ff.h"
-#include "gnuradio/blocks/max_ii.h"
-#include "gnuradio/blocks/max_ss.h"
-#include "gnuradio/blocks/min_ff.h"
-#include "gnuradio/blocks/min_ii.h"
-#include "gnuradio/blocks/min_ss.h"
-#include "gnuradio/blocks/moving_average_cc.h"
-#include "gnuradio/blocks/moving_average_ff.h"
-#include "gnuradio/blocks/moving_average_ii.h"
-#include "gnuradio/blocks/moving_average_ss.h"
#include "gnuradio/blocks/multiply_ss.h"
#include "gnuradio/blocks/multiply_ii.h"
#include "gnuradio/blocks/multiply_ff.h"
@@ -77,33 +50,6 @@
#include "gnuradio/blocks/mute_cc.h"
%}
-%include "gnuradio/blocks/float_to_char.h"
-%include "gnuradio/blocks/float_to_complex.h"
-%include "gnuradio/blocks/magphase_to_complex.h"
-%include "gnuradio/blocks/float_to_int.h"
-%include "gnuradio/blocks/float_to_short.h"
-%include "gnuradio/blocks/float_to_uchar.h"
-%include "gnuradio/blocks/int_to_float.h"
-%include "gnuradio/blocks/integrate_ss.h"
-%include "gnuradio/blocks/integrate_ii.h"
-%include "gnuradio/blocks/integrate_ff.h"
-%include "gnuradio/blocks/integrate_cc.h"
-%include "gnuradio/blocks/interleave.h"
-%include "gnuradio/blocks/interleaved_short_to_complex.h"
-%include "gnuradio/blocks/interleaved_char_to_complex.h"
-%include "gnuradio/blocks/keep_m_in_n.h"
-%include "gnuradio/blocks/keep_one_in_n.h"
-%include "gnuradio/blocks/lfsr_32k_source_s.h"
-%include "gnuradio/blocks/max_ff.h"
-%include "gnuradio/blocks/max_ii.h"
-%include "gnuradio/blocks/max_ss.h"
-%include "gnuradio/blocks/min_ff.h"
-%include "gnuradio/blocks/min_ii.h"
-%include "gnuradio/blocks/min_ss.h"
-%include "gnuradio/blocks/moving_average_cc.h"
-%include "gnuradio/blocks/moving_average_ff.h"
-%include "gnuradio/blocks/moving_average_ii.h"
-%include "gnuradio/blocks/moving_average_ss.h"
%include "gnuradio/blocks/multiply_ss.h"
%include "gnuradio/blocks/multiply_ii.h"
%include "gnuradio/blocks/multiply_ff.h"
@@ -125,33 +71,6 @@
%include "gnuradio/blocks/mute_ff.h"
%include "gnuradio/blocks/mute_cc.h"
-GR_SWIG_BLOCK_MAGIC2(blocks, float_to_char);
-GR_SWIG_BLOCK_MAGIC2(blocks, float_to_complex);
-GR_SWIG_BLOCK_MAGIC2(blocks, magphase_to_complex);
-GR_SWIG_BLOCK_MAGIC2(blocks, float_to_int);
-GR_SWIG_BLOCK_MAGIC2(blocks, float_to_short);
-GR_SWIG_BLOCK_MAGIC2(blocks, float_to_uchar);
-GR_SWIG_BLOCK_MAGIC2(blocks, int_to_float);
-GR_SWIG_BLOCK_MAGIC2(blocks, integrate_ss);
-GR_SWIG_BLOCK_MAGIC2(blocks, integrate_ii);
-GR_SWIG_BLOCK_MAGIC2(blocks, integrate_ff);
-GR_SWIG_BLOCK_MAGIC2(blocks, integrate_cc);
-GR_SWIG_BLOCK_MAGIC2(blocks, interleave);
-GR_SWIG_BLOCK_MAGIC2(blocks, interleaved_short_to_complex);
-GR_SWIG_BLOCK_MAGIC2(blocks, interleaved_char_to_complex);
-GR_SWIG_BLOCK_MAGIC2(blocks, keep_m_in_n);
-GR_SWIG_BLOCK_MAGIC2(blocks, keep_one_in_n);
-GR_SWIG_BLOCK_MAGIC2(blocks, lfsr_32k_source_s);
-GR_SWIG_BLOCK_MAGIC2(blocks, max_ff);
-GR_SWIG_BLOCK_MAGIC2(blocks, max_ii);
-GR_SWIG_BLOCK_MAGIC2(blocks, max_ss);
-GR_SWIG_BLOCK_MAGIC2(blocks, min_ff);
-GR_SWIG_BLOCK_MAGIC2(blocks, min_ii);
-GR_SWIG_BLOCK_MAGIC2(blocks, min_ss);
-GR_SWIG_BLOCK_MAGIC2(blocks, moving_average_cc);
-GR_SWIG_BLOCK_MAGIC2(blocks, moving_average_ff);
-GR_SWIG_BLOCK_MAGIC2(blocks, moving_average_ii);
-GR_SWIG_BLOCK_MAGIC2(blocks, moving_average_ss);
GR_SWIG_BLOCK_MAGIC2(blocks, multiply_ss);
GR_SWIG_BLOCK_MAGIC2(blocks, multiply_ii);
GR_SWIG_BLOCK_MAGIC2(blocks, multiply_ff);
diff --git a/gr-blocks/swig/blocks_swig4.i b/gr-blocks/swig/blocks_swig4.i
index 4c2c93e6b1..bb39740123 100644
--- a/gr-blocks/swig/blocks_swig4.i
+++ b/gr-blocks/swig/blocks_swig4.i
@@ -31,15 +31,6 @@
%include "blocks_swig4_doc.i"
%{
-#include "gnuradio/blocks/nlog10_ff.h"
-#include "gnuradio/blocks/not_bb.h"
-#include "gnuradio/blocks/not_ss.h"
-#include "gnuradio/blocks/not_ii.h"
-#include "gnuradio/blocks/patterned_interleaver.h"
-#include "gnuradio/blocks/pack_k_bits_bb.h"
-#include "gnuradio/blocks/packed_to_unpacked_bb.h"
-#include "gnuradio/blocks/packed_to_unpacked_ss.h"
-#include "gnuradio/blocks/packed_to_unpacked_ii.h"
#include "gnuradio/blocks/pdu_filter.h"
#include "gnuradio/blocks/pdu_set.h"
#include "gnuradio/blocks/pdu_remove.h"
@@ -60,15 +51,8 @@
#include "gnuradio/blocks/probe_signal_vi.h"
#include "gnuradio/blocks/probe_signal_vf.h"
#include "gnuradio/blocks/probe_signal_vc.h"
-#include "gnuradio/blocks/or_bb.h"
-#include "gnuradio/blocks/or_ss.h"
-#include "gnuradio/blocks/or_ii.h"
%}
-%include "gnuradio/blocks/nlog10_ff.h"
-%include "gnuradio/blocks/not_bb.h"
-%include "gnuradio/blocks/not_ss.h"
-%include "gnuradio/blocks/not_ii.h"
%include "gnuradio/blocks/probe_signal_b.h"
%include "gnuradio/blocks/probe_signal_s.h"
%include "gnuradio/blocks/probe_signal_i.h"
@@ -79,14 +63,6 @@
%include "gnuradio/blocks/probe_signal_vi.h"
%include "gnuradio/blocks/probe_signal_vf.h"
%include "gnuradio/blocks/probe_signal_vc.h"
-%include "gnuradio/blocks/or_bb.h"
-%include "gnuradio/blocks/or_ss.h"
-%include "gnuradio/blocks/or_ii.h"
-%include "gnuradio/blocks/pack_k_bits_bb.h"
-%include "gnuradio/blocks/packed_to_unpacked_bb.h"
-%include "gnuradio/blocks/packed_to_unpacked_ss.h"
-%include "gnuradio/blocks/packed_to_unpacked_ii.h"
-%include "gnuradio/blocks/patterned_interleaver.h"
%include "gnuradio/blocks/pdu_filter.h"
%include "gnuradio/blocks/pdu_set.h"
%include "gnuradio/blocks/pdu_remove.h"
@@ -98,15 +74,6 @@
%include "gnuradio/blocks/plateau_detector_fb.h"
%include "gnuradio/blocks/probe_rate.h"
-GR_SWIG_BLOCK_MAGIC2(blocks, nlog10_ff);
-GR_SWIG_BLOCK_MAGIC2(blocks, not_bb);
-GR_SWIG_BLOCK_MAGIC2(blocks, not_ss);
-GR_SWIG_BLOCK_MAGIC2(blocks, not_ii);
-GR_SWIG_BLOCK_MAGIC2(blocks, patterned_interleaver);
-GR_SWIG_BLOCK_MAGIC2(blocks, pack_k_bits_bb);
-GR_SWIG_BLOCK_MAGIC2(blocks, packed_to_unpacked_bb);
-GR_SWIG_BLOCK_MAGIC2(blocks, packed_to_unpacked_ss);
-GR_SWIG_BLOCK_MAGIC2(blocks, packed_to_unpacked_ii);
GR_SWIG_BLOCK_MAGIC2(blocks, peak_detector_fb);
GR_SWIG_BLOCK_MAGIC2(blocks, peak_detector_ib);
GR_SWIG_BLOCK_MAGIC2(blocks, peak_detector_sb);
@@ -117,9 +84,6 @@ GR_SWIG_BLOCK_MAGIC2(blocks, pdu_set);
GR_SWIG_BLOCK_MAGIC2(blocks, pdu_remove);
GR_SWIG_BLOCK_MAGIC2(blocks, pdu_to_tagged_stream);
GR_SWIG_BLOCK_MAGIC2(blocks, probe_rate);
-GR_SWIG_BLOCK_MAGIC2(blocks, or_bb);
-GR_SWIG_BLOCK_MAGIC2(blocks, or_ss);
-GR_SWIG_BLOCK_MAGIC2(blocks, or_ii);
GR_SWIG_BLOCK_MAGIC2(blocks, probe_signal_b);
GR_SWIG_BLOCK_MAGIC2(blocks, probe_signal_s);
GR_SWIG_BLOCK_MAGIC2(blocks, probe_signal_i);
diff --git a/gr-blocks/swig/blocks_swig5.i b/gr-blocks/swig/blocks_swig5.i
index 761b0a855a..da8048370a 100644
--- a/gr-blocks/swig/blocks_swig5.i
+++ b/gr-blocks/swig/blocks_swig5.i
@@ -31,6 +31,7 @@
%include "blocks_swig5_doc.i"
%{
+#include "gnuradio/blocks/pdu.h"
#include "gnuradio/blocks/random_pdu.h"
#include "gnuradio/blocks/regenerate_bb.h"
#include "gnuradio/blocks/repack_bits_bb.h"
@@ -50,30 +51,6 @@
#include "gnuradio/blocks/sub_ss.h"
#include "gnuradio/blocks/sub_ii.h"
#include "gnuradio/blocks/sub_cc.h"
-#include "gnuradio/blocks/tag_gate.h"
-#include "gnuradio/blocks/tagged_stream_align.h"
-#include "gnuradio/blocks/tagged_stream_mux.h"
-#include "gnuradio/blocks/tagged_stream_multiply_length.h"
-#include "gnuradio/blocks/tagged_stream_to_pdu.h"
-#include "gnuradio/blocks/tags_strobe.h"
-#include "gnuradio/blocks/tcp_server_sink.h"
-#include "gnuradio/blocks/test_tag_variable_rate_ff.h"
-#include "gnuradio/blocks/threshold_ff.h"
-#include "gnuradio/blocks/transcendental.h"
-#include "gnuradio/blocks/tuntap_pdu.h"
-#include "gnuradio/blocks/uchar_to_float.h"
-#include "gnuradio/blocks/udp_sink.h"
-#include "gnuradio/blocks/udp_source.h"
-#include "gnuradio/blocks/unpack_k_bits.h"
-#include "gnuradio/blocks/unpack_k_bits_bb.h"
-#include "gnuradio/blocks/unpacked_to_packed_bb.h"
-#include "gnuradio/blocks/unpacked_to_packed_ss.h"
-#include "gnuradio/blocks/unpacked_to_packed_ii.h"
-#include "gnuradio/blocks/vco_f.h"
-#include "gnuradio/blocks/vco_c.h"
-#include "gnuradio/blocks/xor_bb.h"
-#include "gnuradio/blocks/xor_ss.h"
-#include "gnuradio/blocks/xor_ii.h"
%}
%include "gnuradio/blocks/random_pdu.h"
@@ -95,30 +72,6 @@
%include "gnuradio/blocks/sub_ss.h"
%include "gnuradio/blocks/sub_ii.h"
%include "gnuradio/blocks/sub_cc.h"
-%include "gnuradio/blocks/tag_gate.h"
-%include "gnuradio/blocks/tagged_stream_align.h"
-%include "gnuradio/blocks/tagged_stream_mux.h"
-%include "gnuradio/blocks/tagged_stream_multiply_length.h"
-%include "gnuradio/blocks/tagged_stream_to_pdu.h"
-%include "gnuradio/blocks/tags_strobe.h"
-%include "gnuradio/blocks/tcp_server_sink.h"
-%include "gnuradio/blocks/test_tag_variable_rate_ff.h"
-%include "gnuradio/blocks/threshold_ff.h"
-%include "gnuradio/blocks/transcendental.h"
-%include "gnuradio/blocks/tuntap_pdu.h"
-%include "gnuradio/blocks/uchar_to_float.h"
-%include "gnuradio/blocks/udp_sink.h"
-%include "gnuradio/blocks/udp_source.h"
-%include "gnuradio/blocks/unpack_k_bits.h"
-%include "gnuradio/blocks/unpack_k_bits_bb.h"
-%include "gnuradio/blocks/unpacked_to_packed_bb.h"
-%include "gnuradio/blocks/unpacked_to_packed_ss.h"
-%include "gnuradio/blocks/unpacked_to_packed_ii.h"
-%include "gnuradio/blocks/vco_f.h"
-%include "gnuradio/blocks/vco_c.h"
-%include "gnuradio/blocks/xor_bb.h"
-%include "gnuradio/blocks/xor_ss.h"
-%include "gnuradio/blocks/xor_ii.h"
GR_SWIG_BLOCK_MAGIC2(blocks, random_pdu);
GR_SWIG_BLOCK_MAGIC2(blocks, regenerate_bb);
@@ -139,26 +92,3 @@ GR_SWIG_BLOCK_MAGIC2(blocks, sub_ff);
GR_SWIG_BLOCK_MAGIC2(blocks, sub_ss);
GR_SWIG_BLOCK_MAGIC2(blocks, sub_ii);
GR_SWIG_BLOCK_MAGIC2(blocks, sub_cc);
-GR_SWIG_BLOCK_MAGIC2(blocks, tag_gate);
-GR_SWIG_BLOCK_MAGIC2(blocks, tagged_stream_align);
-GR_SWIG_BLOCK_MAGIC2(blocks, tagged_stream_mux);
-GR_SWIG_BLOCK_MAGIC2(blocks, tagged_stream_multiply_length);
-GR_SWIG_BLOCK_MAGIC2(blocks, tagged_stream_to_pdu);
-GR_SWIG_BLOCK_MAGIC2(blocks, tags_strobe);
-GR_SWIG_BLOCK_MAGIC2(blocks, tcp_server_sink);
-GR_SWIG_BLOCK_MAGIC2(blocks, test_tag_variable_rate_ff);
-GR_SWIG_BLOCK_MAGIC2(blocks, threshold_ff);
-GR_SWIG_BLOCK_MAGIC2(blocks, transcendental);
-GR_SWIG_BLOCK_MAGIC2(blocks, tuntap_pdu);
-GR_SWIG_BLOCK_MAGIC2(blocks, uchar_to_float);
-GR_SWIG_BLOCK_MAGIC2(blocks, udp_sink);
-GR_SWIG_BLOCK_MAGIC2(blocks, udp_source);
-GR_SWIG_BLOCK_MAGIC2(blocks, unpack_k_bits_bb);
-GR_SWIG_BLOCK_MAGIC2(blocks, unpacked_to_packed_bb);
-GR_SWIG_BLOCK_MAGIC2(blocks, unpacked_to_packed_ss);
-GR_SWIG_BLOCK_MAGIC2(blocks, unpacked_to_packed_ii);
-GR_SWIG_BLOCK_MAGIC2(blocks, vco_f);
-GR_SWIG_BLOCK_MAGIC2(blocks, vco_c);
-GR_SWIG_BLOCK_MAGIC2(blocks, xor_bb);
-GR_SWIG_BLOCK_MAGIC2(blocks, xor_ss);
-GR_SWIG_BLOCK_MAGIC2(blocks, xor_ii);
diff --git a/gr-blocks/swig/blocks_swig6.i b/gr-blocks/swig/blocks_swig6.i
new file mode 100644
index 0000000000..8c1baa3d98
--- /dev/null
+++ b/gr-blocks/swig/blocks_swig6.i
@@ -0,0 +1,107 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#define BLOCKS_API
+
+%include "gnuradio.i"
+%include "gnuradio/blocks/pdu.h"
+
+%include <gnuradio/endianness.h>
+
+//load generated python docstrings
+%include "blocks_swig6_doc.i"
+
+%{
+#include "gnuradio/blocks/tag_gate.h"
+#include "gnuradio/blocks/tagged_stream_align.h"
+#include "gnuradio/blocks/tagged_stream_mux.h"
+#include "gnuradio/blocks/tagged_stream_multiply_length.h"
+#include "gnuradio/blocks/tagged_stream_to_pdu.h"
+#include "gnuradio/blocks/tags_strobe.h"
+#include "gnuradio/blocks/tcp_server_sink.h"
+#include "gnuradio/blocks/test_tag_variable_rate_ff.h"
+#include "gnuradio/blocks/threshold_ff.h"
+#include "gnuradio/blocks/transcendental.h"
+#include "gnuradio/blocks/tuntap_pdu.h"
+#include "gnuradio/blocks/uchar_to_float.h"
+#include "gnuradio/blocks/udp_sink.h"
+#include "gnuradio/blocks/udp_source.h"
+#include "gnuradio/blocks/unpack_k_bits.h"
+#include "gnuradio/blocks/unpack_k_bits_bb.h"
+#include "gnuradio/blocks/unpacked_to_packed_bb.h"
+#include "gnuradio/blocks/unpacked_to_packed_ss.h"
+#include "gnuradio/blocks/unpacked_to_packed_ii.h"
+#include "gnuradio/blocks/vco_f.h"
+#include "gnuradio/blocks/vco_c.h"
+#include "gnuradio/blocks/xor_bb.h"
+#include "gnuradio/blocks/xor_ss.h"
+#include "gnuradio/blocks/xor_ii.h"
+%}
+
+%include "gnuradio/blocks/tag_gate.h"
+%include "gnuradio/blocks/tagged_stream_align.h"
+%include "gnuradio/blocks/tagged_stream_mux.h"
+%include "gnuradio/blocks/tagged_stream_multiply_length.h"
+%include "gnuradio/blocks/tagged_stream_to_pdu.h"
+%include "gnuradio/blocks/tags_strobe.h"
+%include "gnuradio/blocks/tcp_server_sink.h"
+%include "gnuradio/blocks/test_tag_variable_rate_ff.h"
+%include "gnuradio/blocks/threshold_ff.h"
+%include "gnuradio/blocks/transcendental.h"
+%include "gnuradio/blocks/tuntap_pdu.h"
+%include "gnuradio/blocks/uchar_to_float.h"
+%include "gnuradio/blocks/udp_sink.h"
+%include "gnuradio/blocks/udp_source.h"
+%include "gnuradio/blocks/unpack_k_bits.h"
+%include "gnuradio/blocks/unpack_k_bits_bb.h"
+%include "gnuradio/blocks/unpacked_to_packed_bb.h"
+%include "gnuradio/blocks/unpacked_to_packed_ss.h"
+%include "gnuradio/blocks/unpacked_to_packed_ii.h"
+%include "gnuradio/blocks/vco_f.h"
+%include "gnuradio/blocks/vco_c.h"
+%include "gnuradio/blocks/xor_bb.h"
+%include "gnuradio/blocks/xor_ss.h"
+%include "gnuradio/blocks/xor_ii.h"
+
+GR_SWIG_BLOCK_MAGIC2(blocks, tag_gate);
+GR_SWIG_BLOCK_MAGIC2(blocks, tagged_stream_align);
+GR_SWIG_BLOCK_MAGIC2(blocks, tagged_stream_mux);
+GR_SWIG_BLOCK_MAGIC2(blocks, tagged_stream_multiply_length);
+GR_SWIG_BLOCK_MAGIC2(blocks, tagged_stream_to_pdu);
+GR_SWIG_BLOCK_MAGIC2(blocks, tags_strobe);
+GR_SWIG_BLOCK_MAGIC2(blocks, tcp_server_sink);
+GR_SWIG_BLOCK_MAGIC2(blocks, test_tag_variable_rate_ff);
+GR_SWIG_BLOCK_MAGIC2(blocks, threshold_ff);
+GR_SWIG_BLOCK_MAGIC2(blocks, transcendental);
+GR_SWIG_BLOCK_MAGIC2(blocks, tuntap_pdu);
+GR_SWIG_BLOCK_MAGIC2(blocks, uchar_to_float);
+GR_SWIG_BLOCK_MAGIC2(blocks, udp_sink);
+GR_SWIG_BLOCK_MAGIC2(blocks, udp_source);
+GR_SWIG_BLOCK_MAGIC2(blocks, unpack_k_bits_bb);
+GR_SWIG_BLOCK_MAGIC2(blocks, unpacked_to_packed_bb);
+GR_SWIG_BLOCK_MAGIC2(blocks, unpacked_to_packed_ss);
+GR_SWIG_BLOCK_MAGIC2(blocks, unpacked_to_packed_ii);
+GR_SWIG_BLOCK_MAGIC2(blocks, vco_f);
+GR_SWIG_BLOCK_MAGIC2(blocks, vco_c);
+GR_SWIG_BLOCK_MAGIC2(blocks, xor_bb);
+GR_SWIG_BLOCK_MAGIC2(blocks, xor_ss);
+GR_SWIG_BLOCK_MAGIC2(blocks, xor_ii);
diff --git a/gr-blocks/swig/blocks_swig7.i b/gr-blocks/swig/blocks_swig7.i
new file mode 100644
index 0000000000..d48ea8324d
--- /dev/null
+++ b/gr-blocks/swig/blocks_swig7.i
@@ -0,0 +1,96 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#define BLOCKS_API
+#define GR_RUNTIME_API
+
+%include "gnuradio.i"
+
+//load generated python docstrings
+%include "blocks_swig7_doc.i"
+
+%include "feval.i"
+
+%{
+#include "gnuradio/blocks/deinterleave.h"
+#include "gnuradio/blocks/divide_ff.h"
+#include "gnuradio/blocks/divide_ss.h"
+#include "gnuradio/blocks/divide_ii.h"
+#include "gnuradio/blocks/divide_cc.h"
+#include "gnuradio/blocks/skiphead.h"
+#include "gnuradio/blocks/stream_mux.h"
+#include "gnuradio/blocks/stream_to_streams.h"
+#include "gnuradio/blocks/stream_to_tagged_stream.h"
+#include "gnuradio/blocks/stream_to_vector.h"
+#include "gnuradio/blocks/streams_to_stream.h"
+#include "gnuradio/blocks/streams_to_vector.h"
+#include "gnuradio/blocks/tag_debug.h"
+#include "gnuradio/blocks/tagged_file_sink.h"
+#include "gnuradio/blocks/tsb_vector_sink_b.h"
+#include "gnuradio/blocks/tsb_vector_sink_c.h"
+#include "gnuradio/blocks/tsb_vector_sink_f.h"
+#include "gnuradio/blocks/tsb_vector_sink_i.h"
+#include "gnuradio/blocks/tsb_vector_sink_s.h"
+#include "gnuradio/blocks/throttle.h"
+%}
+
+%include "gnuradio/blocks/deinterleave.h"
+%include "gnuradio/blocks/divide_ff.h"
+%include "gnuradio/blocks/divide_ss.h"
+%include "gnuradio/blocks/divide_ii.h"
+%include "gnuradio/blocks/divide_cc.h"
+%include "gnuradio/blocks/skiphead.h"
+%include "gnuradio/blocks/stream_mux.h"
+%include "gnuradio/blocks/stream_to_streams.h"
+%include "gnuradio/blocks/stream_to_tagged_stream.h"
+%include "gnuradio/blocks/stream_to_vector.h"
+%include "gnuradio/blocks/streams_to_stream.h"
+%include "gnuradio/blocks/streams_to_vector.h"
+%include "gnuradio/blocks/tag_debug.h"
+%include "gnuradio/blocks/tagged_file_sink.h"
+%include "gnuradio/blocks/tsb_vector_sink_b.h"
+%include "gnuradio/blocks/tsb_vector_sink_c.h"
+%include "gnuradio/blocks/tsb_vector_sink_f.h"
+%include "gnuradio/blocks/tsb_vector_sink_i.h"
+%include "gnuradio/blocks/tsb_vector_sink_s.h"
+%include "gnuradio/blocks/throttle.h"
+
+GR_SWIG_BLOCK_MAGIC2(blocks, deinterleave);
+GR_SWIG_BLOCK_MAGIC2(blocks, divide_ff);
+GR_SWIG_BLOCK_MAGIC2(blocks, divide_ss);
+GR_SWIG_BLOCK_MAGIC2(blocks, divide_ii);
+GR_SWIG_BLOCK_MAGIC2(blocks, divide_cc);
+GR_SWIG_BLOCK_MAGIC2(blocks, skiphead);
+GR_SWIG_BLOCK_MAGIC2(blocks, stream_mux);
+GR_SWIG_BLOCK_MAGIC2(blocks, stream_to_streams);
+GR_SWIG_BLOCK_MAGIC2(blocks, stream_to_tagged_stream);
+GR_SWIG_BLOCK_MAGIC2(blocks, stream_to_vector);
+GR_SWIG_BLOCK_MAGIC2(blocks, streams_to_stream);
+GR_SWIG_BLOCK_MAGIC2(blocks, streams_to_vector);
+GR_SWIG_BLOCK_MAGIC2(blocks, tag_debug);
+GR_SWIG_BLOCK_MAGIC2(blocks, tagged_file_sink);
+GR_SWIG_BLOCK_MAGIC2(blocks, tsb_vector_sink_b);
+GR_SWIG_BLOCK_MAGIC2(blocks, tsb_vector_sink_c);
+GR_SWIG_BLOCK_MAGIC2(blocks, tsb_vector_sink_f);
+GR_SWIG_BLOCK_MAGIC2(blocks, tsb_vector_sink_i);
+GR_SWIG_BLOCK_MAGIC2(blocks, tsb_vector_sink_s);
+GR_SWIG_BLOCK_MAGIC2(blocks, throttle);
diff --git a/gr-blocks/swig/blocks_swig8.i b/gr-blocks/swig/blocks_swig8.i
new file mode 100644
index 0000000000..2bf5070bb8
--- /dev/null
+++ b/gr-blocks/swig/blocks_swig8.i
@@ -0,0 +1,93 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#define BLOCKS_API
+
+%include "gnuradio.i"
+
+//load generated python docstrings
+%include "blocks_swig8_doc.i"
+
+%{
+#include "gnuradio/blocks/abs_ff.h"
+#include "gnuradio/blocks/abs_ss.h"
+#include "gnuradio/blocks/abs_ii.h"
+#include "gnuradio/blocks/add_ff.h"
+#include "gnuradio/blocks/add_ss.h"
+#include "gnuradio/blocks/add_ii.h"
+#include "gnuradio/blocks/add_cc.h"
+#include "gnuradio/blocks/add_const_bb.h"
+#include "gnuradio/blocks/add_const_ff.h"
+#include "gnuradio/blocks/add_const_ss.h"
+#include "gnuradio/blocks/add_const_ii.h"
+#include "gnuradio/blocks/add_const_cc.h"
+#include "gnuradio/blocks/add_const_vbb.h"
+#include "gnuradio/blocks/add_const_vff.h"
+#include "gnuradio/blocks/add_const_vss.h"
+#include "gnuradio/blocks/add_const_vii.h"
+#include "gnuradio/blocks/add_const_vcc.h"
+#include "gnuradio/blocks/and_bb.h"
+#include "gnuradio/blocks/and_ss.h"
+#include "gnuradio/blocks/and_ii.h"
+%}
+
+%include "gnuradio/blocks/abs_ff.h"
+%include "gnuradio/blocks/abs_ss.h"
+%include "gnuradio/blocks/abs_ii.h"
+%include "gnuradio/blocks/add_ff.h"
+%include "gnuradio/blocks/add_ss.h"
+%include "gnuradio/blocks/add_ii.h"
+%include "gnuradio/blocks/add_cc.h"
+%include "gnuradio/blocks/add_const_bb.h"
+%include "gnuradio/blocks/add_const_ff.h"
+%include "gnuradio/blocks/add_const_ss.h"
+%include "gnuradio/blocks/add_const_ii.h"
+%include "gnuradio/blocks/add_const_cc.h"
+%include "gnuradio/blocks/add_const_vbb.h"
+%include "gnuradio/blocks/add_const_vff.h"
+%include "gnuradio/blocks/add_const_vss.h"
+%include "gnuradio/blocks/add_const_vii.h"
+%include "gnuradio/blocks/add_const_vcc.h"
+%include "gnuradio/blocks/and_bb.h"
+%include "gnuradio/blocks/and_ss.h"
+%include "gnuradio/blocks/and_ii.h"
+
+GR_SWIG_BLOCK_MAGIC2(blocks, abs_ff);
+GR_SWIG_BLOCK_MAGIC2(blocks, abs_ss);
+GR_SWIG_BLOCK_MAGIC2(blocks, abs_ii);
+GR_SWIG_BLOCK_MAGIC2(blocks, add_ff);
+GR_SWIG_BLOCK_MAGIC2(blocks, add_ss);
+GR_SWIG_BLOCK_MAGIC2(blocks, add_ii);
+GR_SWIG_BLOCK_MAGIC2(blocks, add_cc);
+GR_SWIG_BLOCK_MAGIC2(blocks, add_const_bb);
+GR_SWIG_BLOCK_MAGIC2(blocks, add_const_ff);
+GR_SWIG_BLOCK_MAGIC2(blocks, add_const_ss);
+GR_SWIG_BLOCK_MAGIC2(blocks, add_const_ii);
+GR_SWIG_BLOCK_MAGIC2(blocks, add_const_cc);
+GR_SWIG_BLOCK_MAGIC2(blocks, add_const_vbb);
+GR_SWIG_BLOCK_MAGIC2(blocks, add_const_vff);
+GR_SWIG_BLOCK_MAGIC2(blocks, add_const_vss);
+GR_SWIG_BLOCK_MAGIC2(blocks, add_const_vii);
+GR_SWIG_BLOCK_MAGIC2(blocks, add_const_vcc);
+GR_SWIG_BLOCK_MAGIC2(blocks, and_bb);
+GR_SWIG_BLOCK_MAGIC2(blocks, and_ss);
+GR_SWIG_BLOCK_MAGIC2(blocks, and_ii);
diff --git a/gr-blocks/swig/blocks_swig9.i b/gr-blocks/swig/blocks_swig9.i
new file mode 100644
index 0000000000..872abd9d46
--- /dev/null
+++ b/gr-blocks/swig/blocks_swig9.i
@@ -0,0 +1,93 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#define BLOCKS_API
+
+%include "gnuradio.i"
+
+//load generated python docstrings
+%include "blocks_swig9_doc.i"
+
+%{
+#include "gnuradio/blocks/float_to_char.h"
+#include "gnuradio/blocks/float_to_complex.h"
+#include "gnuradio/blocks/magphase_to_complex.h"
+#include "gnuradio/blocks/float_to_int.h"
+#include "gnuradio/blocks/float_to_short.h"
+#include "gnuradio/blocks/float_to_uchar.h"
+#include "gnuradio/blocks/int_to_float.h"
+#include "gnuradio/blocks/integrate_ss.h"
+#include "gnuradio/blocks/integrate_ii.h"
+#include "gnuradio/blocks/integrate_ff.h"
+#include "gnuradio/blocks/integrate_cc.h"
+#include "gnuradio/blocks/interleave.h"
+#include "gnuradio/blocks/interleaved_short_to_complex.h"
+#include "gnuradio/blocks/interleaved_char_to_complex.h"
+#include "gnuradio/blocks/keep_m_in_n.h"
+#include "gnuradio/blocks/keep_one_in_n.h"
+#include "gnuradio/blocks/lfsr_32k_source_s.h"
+#include "gnuradio/blocks/max_ff.h"
+#include "gnuradio/blocks/max_ii.h"
+#include "gnuradio/blocks/max_ss.h"
+%}
+
+%include "gnuradio/blocks/float_to_char.h"
+%include "gnuradio/blocks/float_to_complex.h"
+%include "gnuradio/blocks/magphase_to_complex.h"
+%include "gnuradio/blocks/float_to_int.h"
+%include "gnuradio/blocks/float_to_short.h"
+%include "gnuradio/blocks/float_to_uchar.h"
+%include "gnuradio/blocks/int_to_float.h"
+%include "gnuradio/blocks/integrate_ss.h"
+%include "gnuradio/blocks/integrate_ii.h"
+%include "gnuradio/blocks/integrate_ff.h"
+%include "gnuradio/blocks/integrate_cc.h"
+%include "gnuradio/blocks/interleave.h"
+%include "gnuradio/blocks/interleaved_short_to_complex.h"
+%include "gnuradio/blocks/interleaved_char_to_complex.h"
+%include "gnuradio/blocks/keep_m_in_n.h"
+%include "gnuradio/blocks/keep_one_in_n.h"
+%include "gnuradio/blocks/lfsr_32k_source_s.h"
+%include "gnuradio/blocks/max_ff.h"
+%include "gnuradio/blocks/max_ii.h"
+%include "gnuradio/blocks/max_ss.h"
+
+GR_SWIG_BLOCK_MAGIC2(blocks, float_to_char);
+GR_SWIG_BLOCK_MAGIC2(blocks, float_to_complex);
+GR_SWIG_BLOCK_MAGIC2(blocks, magphase_to_complex);
+GR_SWIG_BLOCK_MAGIC2(blocks, float_to_int);
+GR_SWIG_BLOCK_MAGIC2(blocks, float_to_short);
+GR_SWIG_BLOCK_MAGIC2(blocks, float_to_uchar);
+GR_SWIG_BLOCK_MAGIC2(blocks, int_to_float);
+GR_SWIG_BLOCK_MAGIC2(blocks, integrate_ss);
+GR_SWIG_BLOCK_MAGIC2(blocks, integrate_ii);
+GR_SWIG_BLOCK_MAGIC2(blocks, integrate_ff);
+GR_SWIG_BLOCK_MAGIC2(blocks, integrate_cc);
+GR_SWIG_BLOCK_MAGIC2(blocks, interleave);
+GR_SWIG_BLOCK_MAGIC2(blocks, interleaved_short_to_complex);
+GR_SWIG_BLOCK_MAGIC2(blocks, interleaved_char_to_complex);
+GR_SWIG_BLOCK_MAGIC2(blocks, keep_m_in_n);
+GR_SWIG_BLOCK_MAGIC2(blocks, keep_one_in_n);
+GR_SWIG_BLOCK_MAGIC2(blocks, lfsr_32k_source_s);
+GR_SWIG_BLOCK_MAGIC2(blocks, max_ff);
+GR_SWIG_BLOCK_MAGIC2(blocks, max_ii);
+GR_SWIG_BLOCK_MAGIC2(blocks, max_ss);
diff --git a/gr-digital/grc/variable_header_format_default.xml b/gr-digital/grc/variable_header_format_default.xml
index 55b361f8ca..88727600ed 100644
--- a/gr-digital/grc/variable_header_format_default.xml
+++ b/gr-digital/grc/variable_header_format_default.xml
@@ -10,12 +10,12 @@
<import>from gnuradio import digital</import>
<var_make>
#if int($access_code())==0 #
-self.$(id) = $(id) = digital.header_format_default(digital.packet_utils.default_access_code, $threshold)
+self.$(id) = $(id) = digital.header_format_default(digital.packet_utils.default_access_code, $threshold, $bps)
#else
-self.$(id) = $(id) = digital.header_format_default($access_code, $threshold)
+self.$(id) = $(id) = digital.header_format_default($access_code, $threshold, $bps)
#end if
</var_make>
- <var_value>digital.header_format_default($access_code, $threshold)</var_value>
+ <var_value>digital.header_format_default($access_code, $threshold, $bps)</var_value>
<make></make>
<param>
@@ -32,4 +32,11 @@ self.$(id) = $(id) = digital.header_format_default($access_code, $threshold)
<type>int</type>
</param>
+ <param>
+ <name>Payload Bits per Symbol</name>
+ <key>bps</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+
</block>
diff --git a/gr-digital/include/gnuradio/digital/header_format_counter.h b/gr-digital/include/gnuradio/digital/header_format_counter.h
index 5eb075afb9..752a9ec775 100644
--- a/gr-digital/include/gnuradio/digital/header_format_counter.h
+++ b/gr-digital/include/gnuradio/digital/header_format_counter.h
@@ -112,7 +112,6 @@ namespace gr {
protected:
uint16_t d_counter; //!< keeps track of the number of packets transmitted
- uint16_t d_bps; //!< bits/sec of payload modulation
//! Verify that the header is valid
bool header_ok();
diff --git a/gr-digital/include/gnuradio/digital/header_format_default.h b/gr-digital/include/gnuradio/digital/header_format_default.h
index 4abd7bb2db..bfea3567f8 100644
--- a/gr-digital/include/gnuradio/digital/header_format_default.h
+++ b/gr-digital/include/gnuradio/digital/header_format_default.h
@@ -82,7 +82,8 @@ namespace gr {
: public header_format_base
{
public:
- header_format_default(const std::string &access_code, int threshold);
+ header_format_default(const std::string &access_code, int threshold,
+ int bps);
virtual ~header_format_default();
/*!
@@ -179,13 +180,18 @@ namespace gr {
* receiver. Can be up to 64-bits long.
* \param threshold How many bits can be wrong in the access
* code and still count as correct.
+ * \param bps The number of bits/second used in the payload's
+ * modulator.
*/
- static sptr make(const std::string &access_code, int threshold);
+ static sptr make(const std::string &access_code, int threshold,
+ int bps = 1);
protected:
uint64_t d_access_code; //!< register to hold the access code
size_t d_access_code_len; //!< length in bits of the access code
+ uint16_t d_bps; //!< bits/sec of payload modulation
+
unsigned long long d_data_reg; //!< used to look for access_code
unsigned long long d_mask; /*!< masks access_code bits (top N bits are set where
N is the number of bits in the access code) */
diff --git a/gr-digital/lib/header_format_counter.cc b/gr-digital/lib/header_format_counter.cc
index 6244ec1679..078d7d4be1 100644
--- a/gr-digital/lib/header_format_counter.cc
+++ b/gr-digital/lib/header_format_counter.cc
@@ -44,9 +44,8 @@ namespace gr {
header_format_counter::header_format_counter(const std::string &access_code,
int threshold, int bps)
- : header_format_default(access_code, threshold)
+ : header_format_default(access_code, threshold, bps)
{
- d_bps = bps;
d_counter = 0;
}
diff --git a/gr-digital/lib/header_format_default.cc b/gr-digital/lib/header_format_default.cc
index 1b7a60e17f..621a801729 100644
--- a/gr-digital/lib/header_format_default.cc
+++ b/gr-digital/lib/header_format_default.cc
@@ -34,16 +34,16 @@ namespace gr {
header_format_default::sptr
header_format_default::make(const std::string &access_code,
- int threshold)
+ int threshold, int bps)
{
return header_format_default::sptr
- (new header_format_default(access_code, threshold));
+ (new header_format_default(access_code, threshold, bps));
}
header_format_default::header_format_default(const std::string &access_code,
- int threshold)
+ int threshold, int bps)
: header_format_base(),
- d_data_reg(0), d_mask(0), d_threshold(0),
+ d_bps(bps), d_data_reg(0), d_mask(0), d_threshold(0),
d_pkt_len(0), d_pkt_count(0), d_nbits(0)
{
if(!set_access_code(access_code)) {
@@ -214,7 +214,7 @@ namespace gr {
d_info = pmt::make_dict();
d_info = pmt::dict_add(d_info, pmt::intern("payload symbols"),
- pmt::from_long(8*len));
+ pmt::from_long(8*len / d_bps));
return static_cast<int>(len);
}
diff --git a/gr-digital/python/digital/qa_packet_format.py b/gr-digital/python/digital/qa_packet_format.py
index 6440b80a5e..ae1a79f1f4 100644
--- a/gr-digital/python/digital/qa_packet_format.py
+++ b/gr-digital/python/digital/qa_packet_format.py
@@ -20,7 +20,7 @@
# Boston, MA 02110-1301, USA.
#
-import random, time, struct
+import time, struct
import pmt
from gnuradio import gr, gr_unittest, digital, blocks
from gnuradio.digital import packet_utils
@@ -80,6 +80,51 @@ class test_packet_format_fb(gr_unittest.TestCase):
self.assertEqual(send_str, payload[0:length])
+ def test_packet_parse_default(self):
+ ac = packet_utils.default_access_code
+ length = '0000000000000001'
+
+ hdr_format_1bps = digital.header_format_default(ac, 0)
+ hdr_format_4bps = digital.header_format_default(ac, 0, 4)
+
+ ac_bits = [int(x) & 1 for x in ac]
+ length_bits = [int(x) & 1 for x in length]
+ header_bits = ac_bits + length_bits + length_bits
+
+ src_hdr = blocks.vector_source_b(header_bits)
+
+ parser_1bps = digital.protocol_parser_b(hdr_format_1bps)
+ parser_4bps = digital.protocol_parser_b(hdr_format_4bps)
+
+ snk_hdr_1bps = blocks.message_debug()
+ snk_hdr_4bps = blocks.message_debug()
+
+ self.tb.connect(src_hdr, parser_1bps)
+ self.tb.connect(src_hdr, parser_4bps)
+
+ self.tb.msg_connect(parser_1bps, 'info', snk_hdr_1bps, 'store')
+ self.tb.msg_connect(parser_4bps, 'info', snk_hdr_4bps, 'store')
+
+ self.tb.start()
+ while (snk_hdr_1bps.num_messages() < 1) and (snk_hdr_4bps.num_messages() < 1):
+ time.sleep(0.1)
+ self.tb.stop()
+ self.tb.wait()
+
+ result_1bps = snk_hdr_1bps.get_message(0)
+ result_4bps = snk_hdr_4bps.get_message(0)
+
+ self.assertTrue(pmt.dict_has_key(
+ result_1bps, pmt.intern('payload symbols')))
+ self.assertEqual(pmt.to_long(pmt.dict_ref(
+ result_1bps, pmt.intern('payload symbols'), pmt.PMT_F)), 8)
+
+ self.assertTrue(pmt.dict_has_key(
+ result_4bps, pmt.intern('payload symbols')))
+ self.assertEqual(pmt.to_long(pmt.dict_ref(
+ result_4bps, pmt.intern('payload symbols'), pmt.PMT_F)), 2)
+
+
def test_packet_format_async_counter(self):
bps = 2
ac = packet_utils.default_access_code
diff --git a/gr-dtv/lib/dvbt2/dvbt2_modulator_bc_impl.cc b/gr-dtv/lib/dvbt2/dvbt2_modulator_bc_impl.cc
index b92738603b..05e3382ef9 100644
--- a/gr-dtv/lib/dvbt2/dvbt2_modulator_bc_impl.cc
+++ b/gr-dtv/lib/dvbt2/dvbt2_modulator_bc_impl.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2015 Free Software Foundation, Inc.
+ * Copyright 2015,2017 Free Software Foundation, Inc.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -45,6 +45,10 @@ namespace gr {
{
double normalization;
double rotation_angle;
+ double m_16qam_lookup[4] = {3.0, 1.0, -3.0, -1.0};
+ double m_64qam_lookup[8] = {7.0, 5.0, 1.0, 3.0, -7.0, -5.0, -1.0, -3.0};
+ double m_256qam_lookup[16] = {15.0, 13.0, 9.0, 11.0, 1.0, 3.0, 7.0, 5.0, -15.0, -13.0, -9.0, -11.0, -1.0, -3.0, -7.0, -5.0};
+ int real_index, imag_index;
gr_complex temp;
cyclic_delay = FALSE;
if (framesize == FECFRAME_NORMAL) {
@@ -103,22 +107,11 @@ namespace gr {
break;
case MOD_16QAM:
normalization = std::sqrt(10.0);
- m_16qam[0] = gr_complex( 3.0 / normalization, 3.0 / normalization);
- m_16qam[1] = gr_complex( 3.0 / normalization, 1.0 / normalization);
- m_16qam[2] = gr_complex( 1.0 / normalization, 3.0 / normalization);
- m_16qam[3] = gr_complex( 1.0 / normalization, 1.0 / normalization);
- m_16qam[4] = gr_complex( 3.0 / normalization, -3.0 / normalization);
- m_16qam[5] = gr_complex( 3.0 / normalization, -1.0 / normalization);
- m_16qam[6] = gr_complex( 1.0 / normalization, -3.0 / normalization);
- m_16qam[7] = gr_complex( 1.0 / normalization, -1.0 / normalization);
- m_16qam[8] = gr_complex(-3.0 / normalization, 3.0 / normalization);
- m_16qam[9] = gr_complex(-3.0 / normalization, 1.0 / normalization);
- m_16qam[10] = gr_complex(-1.0 / normalization, 3.0 / normalization);
- m_16qam[11] = gr_complex(-1.0 / normalization, 1.0 / normalization);
- m_16qam[12] = gr_complex(-3.0 / normalization, -3.0 / normalization);
- m_16qam[13] = gr_complex(-3.0 / normalization, -1.0 / normalization);
- m_16qam[14] = gr_complex(-1.0 / normalization, -3.0 / normalization);
- m_16qam[15] = gr_complex(-1.0 / normalization, -1.0 / normalization);
+ for (int i = 0; i < 16; i++) {
+ real_index = ((i & 0x8) >> 2) | ((i & 0x2) >> 1);
+ imag_index = ((i & 0x4) >> 1) | ((i & 0x1) >> 0);
+ m_16qam[i] = gr_complex(m_16qam_lookup[real_index] / normalization, m_16qam_lookup[imag_index] / normalization);
+ }
if (rotation == ROTATION_ON) {
cyclic_delay = TRUE;
rotation_angle = (2.0 * M_PI * 16.8) / 360.0;
@@ -130,70 +123,11 @@ namespace gr {
break;
case MOD_64QAM:
normalization = std::sqrt(42.0);
- m_64qam[0] = gr_complex( 7.0 / normalization, 7.0 / normalization);
- m_64qam[1] = gr_complex( 7.0 / normalization, 5.0 / normalization);
- m_64qam[2] = gr_complex( 5.0 / normalization, 7.0 / normalization);
- m_64qam[3] = gr_complex( 5.0 / normalization, 5.0 / normalization);
- m_64qam[4] = gr_complex( 7.0 / normalization, 1.0 / normalization);
- m_64qam[5] = gr_complex( 7.0 / normalization, 3.0 / normalization);
- m_64qam[6] = gr_complex( 5.0 / normalization, 1.0 / normalization);
- m_64qam[7] = gr_complex( 5.0 / normalization, 3.0 / normalization);
- m_64qam[8] = gr_complex( 1.0 / normalization, 7.0 / normalization);
- m_64qam[9] = gr_complex( 1.0 / normalization, 5.0 / normalization);
- m_64qam[10] = gr_complex( 3.0 / normalization, 7.0 / normalization);
- m_64qam[11] = gr_complex( 3.0 / normalization, 5.0 / normalization);
- m_64qam[12] = gr_complex( 1.0 / normalization, 1.0 / normalization);
- m_64qam[13] = gr_complex( 1.0 / normalization, 3.0 / normalization);
- m_64qam[14] = gr_complex( 3.0 / normalization, 1.0 / normalization);
- m_64qam[15] = gr_complex( 3.0 / normalization, 3.0 / normalization);
- m_64qam[16] = gr_complex( 7.0 / normalization, -7.0 / normalization);
- m_64qam[17] = gr_complex( 7.0 / normalization, -5.0 / normalization);
- m_64qam[18] = gr_complex( 5.0 / normalization, -7.0 / normalization);
- m_64qam[19] = gr_complex( 5.0 / normalization, -5.0 / normalization);
- m_64qam[20] = gr_complex( 7.0 / normalization, -1.0 / normalization);
- m_64qam[21] = gr_complex( 7.0 / normalization, -3.0 / normalization);
- m_64qam[22] = gr_complex( 5.0 / normalization, -1.0 / normalization);
- m_64qam[23] = gr_complex( 5.0 / normalization, -3.0 / normalization);
- m_64qam[24] = gr_complex( 1.0 / normalization, -7.0 / normalization);
- m_64qam[25] = gr_complex( 1.0 / normalization, -5.0 / normalization);
- m_64qam[26] = gr_complex( 3.0 / normalization, -7.0 / normalization);
- m_64qam[27] = gr_complex( 3.0 / normalization, -5.0 / normalization);
- m_64qam[28] = gr_complex( 1.0 / normalization, -1.0 / normalization);
- m_64qam[29] = gr_complex( 1.0 / normalization, -3.0 / normalization);
- m_64qam[30] = gr_complex( 3.0 / normalization, -1.0 / normalization);
- m_64qam[31] = gr_complex( 3.0 / normalization, -3.0 / normalization);
- m_64qam[32] = gr_complex(-7.0 / normalization, 7.0 / normalization);
- m_64qam[33] = gr_complex(-7.0 / normalization, 5.0 / normalization);
- m_64qam[34] = gr_complex(-5.0 / normalization, 7.0 / normalization);
- m_64qam[35] = gr_complex(-5.0 / normalization, 5.0 / normalization);
- m_64qam[36] = gr_complex(-7.0 / normalization, 1.0 / normalization);
- m_64qam[37] = gr_complex(-7.0 / normalization, 3.0 / normalization);
- m_64qam[38] = gr_complex(-5.0 / normalization, 1.0 / normalization);
- m_64qam[39] = gr_complex(-5.0 / normalization, 3.0 / normalization);
- m_64qam[40] = gr_complex(-1.0 / normalization, 7.0 / normalization);
- m_64qam[41] = gr_complex(-1.0 / normalization, 5.0 / normalization);
- m_64qam[42] = gr_complex(-3.0 / normalization, 7.0 / normalization);
- m_64qam[43] = gr_complex(-3.0 / normalization, 5.0 / normalization);
- m_64qam[44] = gr_complex(-1.0 / normalization, 1.0 / normalization);
- m_64qam[45] = gr_complex(-1.0 / normalization, 3.0 / normalization);
- m_64qam[46] = gr_complex(-3.0 / normalization, 1.0 / normalization);
- m_64qam[47] = gr_complex(-3.0 / normalization, 3.0 / normalization);
- m_64qam[48] = gr_complex(-7.0 / normalization, -7.0 / normalization);
- m_64qam[49] = gr_complex(-7.0 / normalization, -5.0 / normalization);
- m_64qam[50] = gr_complex(-5.0 / normalization, -7.0 / normalization);
- m_64qam[51] = gr_complex(-5.0 / normalization, -5.0 / normalization);
- m_64qam[52] = gr_complex(-7.0 / normalization, -1.0 / normalization);
- m_64qam[53] = gr_complex(-7.0 / normalization, -3.0 / normalization);
- m_64qam[54] = gr_complex(-5.0 / normalization, -1.0 / normalization);
- m_64qam[55] = gr_complex(-5.0 / normalization, -3.0 / normalization);
- m_64qam[56] = gr_complex(-1.0 / normalization, -7.0 / normalization);
- m_64qam[57] = gr_complex(-1.0 / normalization, -5.0 / normalization);
- m_64qam[58] = gr_complex(-3.0 / normalization, -7.0 / normalization);
- m_64qam[59] = gr_complex(-3.0 / normalization, -5.0 / normalization);
- m_64qam[60] = gr_complex(-1.0 / normalization, -1.0 / normalization);
- m_64qam[61] = gr_complex(-1.0 / normalization, -3.0 / normalization);
- m_64qam[62] = gr_complex(-3.0 / normalization, -1.0 / normalization);
- m_64qam[63] = gr_complex(-3.0 / normalization, -3.0 / normalization);
+ for (int i = 0; i < 64; i++) {
+ real_index = ((i & 0x20) >> 3) | ((i & 0x8) >> 2) | ((i & 0x2) >> 1);
+ imag_index = ((i & 0x10) >> 2) | ((i & 0x4) >> 1) | ((i & 0x1) >> 0);
+ m_64qam[i] = gr_complex(m_64qam_lookup[real_index] / normalization, m_64qam_lookup[imag_index] / normalization);
+ }
if (rotation == ROTATION_ON) {
cyclic_delay = TRUE;
rotation_angle = (2.0 * M_PI * 8.6) / 360.0;
@@ -205,262 +139,11 @@ namespace gr {
break;
case MOD_256QAM:
normalization = std::sqrt(170.0);
- m_256qam[0] = gr_complex( 15 / normalization, 15 / normalization);
- m_256qam[1] = gr_complex( 15 / normalization, 13 / normalization);
- m_256qam[2] = gr_complex( 13 / normalization, 15 / normalization);
- m_256qam[3] = gr_complex( 13 / normalization, 13 / normalization);
- m_256qam[4] = gr_complex( 15 / normalization, 9 / normalization);
- m_256qam[5] = gr_complex( 15 / normalization, 11 / normalization);
- m_256qam[6] = gr_complex( 13 / normalization, 9 / normalization);
- m_256qam[7] = gr_complex( 13 / normalization, 11 / normalization);
- m_256qam[8] = gr_complex( 9 / normalization, 15 / normalization);
- m_256qam[9] = gr_complex( 9 / normalization, 13 / normalization);
- m_256qam[10] = gr_complex( 11 / normalization, 15 / normalization);
- m_256qam[11] = gr_complex( 11 / normalization, 13 / normalization);
- m_256qam[12] = gr_complex( 9 / normalization, 9 / normalization);
- m_256qam[13] = gr_complex( 9 / normalization, 11 / normalization);
- m_256qam[14] = gr_complex( 11 / normalization, 9 / normalization);
- m_256qam[15] = gr_complex( 11 / normalization, 11 / normalization);
- m_256qam[16] = gr_complex( 15 / normalization, 1 / normalization);
- m_256qam[17] = gr_complex( 15 / normalization, 3 / normalization);
- m_256qam[18] = gr_complex( 13 / normalization, 1 / normalization);
- m_256qam[19] = gr_complex( 13 / normalization, 3 / normalization);
- m_256qam[20] = gr_complex( 15 / normalization, 7 / normalization);
- m_256qam[21] = gr_complex( 15 / normalization, 5 / normalization);
- m_256qam[22] = gr_complex( 13 / normalization, 7 / normalization);
- m_256qam[23] = gr_complex( 13 / normalization, 5 / normalization);
- m_256qam[24] = gr_complex( 9 / normalization, 1 / normalization);
- m_256qam[25] = gr_complex( 9 / normalization, 3 / normalization);
- m_256qam[26] = gr_complex( 11 / normalization, 1 / normalization);
- m_256qam[27] = gr_complex( 11 / normalization, 3 / normalization);
- m_256qam[28] = gr_complex( 9 / normalization, 7 / normalization);
- m_256qam[29] = gr_complex( 9 / normalization, 5 / normalization);
- m_256qam[30] = gr_complex( 11 / normalization, 7 / normalization);
- m_256qam[31] = gr_complex( 11 / normalization, 5 / normalization);
- m_256qam[32] = gr_complex( 1 / normalization, 15 / normalization);
- m_256qam[33] = gr_complex( 1 / normalization, 13 / normalization);
- m_256qam[34] = gr_complex( 3 / normalization, 15 / normalization);
- m_256qam[35] = gr_complex( 3 / normalization, 13 / normalization);
- m_256qam[36] = gr_complex( 1 / normalization, 9 / normalization);
- m_256qam[37] = gr_complex( 1 / normalization, 11 / normalization);
- m_256qam[38] = gr_complex( 3 / normalization, 9 / normalization);
- m_256qam[39] = gr_complex( 3 / normalization, 11 / normalization);
- m_256qam[40] = gr_complex( 7 / normalization, 15 / normalization);
- m_256qam[41] = gr_complex( 7 / normalization, 13 / normalization);
- m_256qam[42] = gr_complex( 5 / normalization, 15 / normalization);
- m_256qam[43] = gr_complex( 5 / normalization, 13 / normalization);
- m_256qam[44] = gr_complex( 7 / normalization, 9 / normalization);
- m_256qam[45] = gr_complex( 7 / normalization, 11 / normalization);
- m_256qam[46] = gr_complex( 5 / normalization, 9 / normalization);
- m_256qam[47] = gr_complex( 5 / normalization, 11 / normalization);
- m_256qam[48] = gr_complex( 1 / normalization, 1 / normalization);
- m_256qam[49] = gr_complex( 1 / normalization, 3 / normalization);
- m_256qam[50] = gr_complex( 3 / normalization, 1 / normalization);
- m_256qam[51] = gr_complex( 3 / normalization, 3 / normalization);
- m_256qam[52] = gr_complex( 1 / normalization, 7 / normalization);
- m_256qam[53] = gr_complex( 1 / normalization, 5 / normalization);
- m_256qam[54] = gr_complex( 3 / normalization, 7 / normalization);
- m_256qam[55] = gr_complex( 3 / normalization, 5 / normalization);
- m_256qam[56] = gr_complex( 7 / normalization, 1 / normalization);
- m_256qam[57] = gr_complex( 7 / normalization, 3 / normalization);
- m_256qam[58] = gr_complex( 5 / normalization, 1 / normalization);
- m_256qam[59] = gr_complex( 5 / normalization, 3 / normalization);
- m_256qam[60] = gr_complex( 7 / normalization, 7 / normalization);
- m_256qam[61] = gr_complex( 7 / normalization, 5 / normalization);
- m_256qam[62] = gr_complex( 5 / normalization, 7 / normalization);
- m_256qam[63] = gr_complex( 5 / normalization, 5 / normalization);
- m_256qam[64] = gr_complex( 15 / normalization, -15 / normalization);
- m_256qam[65] = gr_complex( 15 / normalization, -13 / normalization);
- m_256qam[66] = gr_complex( 13 / normalization, -15 / normalization);
- m_256qam[67] = gr_complex( 13 / normalization, -13 / normalization);
- m_256qam[68] = gr_complex( 15 / normalization, -9 / normalization);
- m_256qam[69] = gr_complex( 15 / normalization, -11 / normalization);
- m_256qam[70] = gr_complex( 13 / normalization, -9 / normalization);
- m_256qam[71] = gr_complex( 13 / normalization, -11 / normalization);
- m_256qam[72] = gr_complex( 9 / normalization, -15 / normalization);
- m_256qam[73] = gr_complex( 9 / normalization, -13 / normalization);
- m_256qam[74] = gr_complex( 11 / normalization, -15 / normalization);
- m_256qam[75] = gr_complex( 11 / normalization, -13 / normalization);
- m_256qam[76] = gr_complex( 9 / normalization, -9 / normalization);
- m_256qam[77] = gr_complex( 9 / normalization, -11 / normalization);
- m_256qam[78] = gr_complex( 11 / normalization, -9 / normalization);
- m_256qam[79] = gr_complex( 11 / normalization, -11 / normalization);
- m_256qam[80] = gr_complex( 15 / normalization, -1 / normalization);
- m_256qam[81] = gr_complex( 15 / normalization, -3 / normalization);
- m_256qam[82] = gr_complex( 13 / normalization, -1 / normalization);
- m_256qam[83] = gr_complex( 13 / normalization, -3 / normalization);
- m_256qam[84] = gr_complex( 15 / normalization, -7 / normalization);
- m_256qam[85] = gr_complex( 15 / normalization, -5 / normalization);
- m_256qam[86] = gr_complex( 13 / normalization, -7 / normalization);
- m_256qam[87] = gr_complex( 13 / normalization, -5 / normalization);
- m_256qam[88] = gr_complex( 9 / normalization, -1 / normalization);
- m_256qam[89] = gr_complex( 9 / normalization, -3 / normalization);
- m_256qam[90] = gr_complex( 11 / normalization, -1 / normalization);
- m_256qam[91] = gr_complex( 11 / normalization, -3 / normalization);
- m_256qam[92] = gr_complex( 9 / normalization, -7 / normalization);
- m_256qam[93] = gr_complex( 9 / normalization, -5 / normalization);
- m_256qam[94] = gr_complex( 11 / normalization, -7 / normalization);
- m_256qam[95] = gr_complex( 11 / normalization, -5 / normalization);
- m_256qam[96] = gr_complex( 1 / normalization, -15 / normalization);
- m_256qam[97] = gr_complex( 1 / normalization, -13 / normalization);
- m_256qam[98] = gr_complex( 3 / normalization, -15 / normalization);
- m_256qam[99] = gr_complex( 3 / normalization, -13 / normalization);
- m_256qam[100] = gr_complex( 1 / normalization, -9 / normalization);
- m_256qam[101] = gr_complex( 1 / normalization, -11 / normalization);
- m_256qam[102] = gr_complex( 3 / normalization, -9 / normalization);
- m_256qam[103] = gr_complex( 3 / normalization, -11 / normalization);
- m_256qam[104] = gr_complex( 7 / normalization, -15 / normalization);
- m_256qam[105] = gr_complex( 7 / normalization, -13 / normalization);
- m_256qam[106] = gr_complex( 5 / normalization, -15 / normalization);
- m_256qam[107] = gr_complex( 5 / normalization, -13 / normalization);
- m_256qam[108] = gr_complex( 7 / normalization, -9 / normalization);
- m_256qam[109] = gr_complex( 7 / normalization, -11 / normalization);
- m_256qam[110] = gr_complex( 5 / normalization, -9 / normalization);
- m_256qam[111] = gr_complex( 5 / normalization, -11 / normalization);
- m_256qam[112] = gr_complex( 1 / normalization, -1 / normalization);
- m_256qam[113] = gr_complex( 1 / normalization, -3 / normalization);
- m_256qam[114] = gr_complex( 3 / normalization, -1 / normalization);
- m_256qam[115] = gr_complex( 3 / normalization, -3 / normalization);
- m_256qam[116] = gr_complex( 1 / normalization, -7 / normalization);
- m_256qam[117] = gr_complex( 1 / normalization, -5 / normalization);
- m_256qam[118] = gr_complex( 3 / normalization, -7 / normalization);
- m_256qam[119] = gr_complex( 3 / normalization, -5 / normalization);
- m_256qam[120] = gr_complex( 7 / normalization, -1 / normalization);
- m_256qam[121] = gr_complex( 7 / normalization, -3 / normalization);
- m_256qam[122] = gr_complex( 5 / normalization, -1 / normalization);
- m_256qam[123] = gr_complex( 5 / normalization, -3 / normalization);
- m_256qam[124] = gr_complex( 7 / normalization, -7 / normalization);
- m_256qam[125] = gr_complex( 7 / normalization, -5 / normalization);
- m_256qam[126] = gr_complex( 5 / normalization, -7 / normalization);
- m_256qam[127] = gr_complex( 5 / normalization, -5 / normalization);
- m_256qam[128] = gr_complex(-15 / normalization, 15 / normalization);
- m_256qam[129] = gr_complex(-15 / normalization, 13 / normalization);
- m_256qam[130] = gr_complex(-13 / normalization, 15 / normalization);
- m_256qam[131] = gr_complex(-13 / normalization, 13 / normalization);
- m_256qam[132] = gr_complex(-15 / normalization, 9 / normalization);
- m_256qam[133] = gr_complex(-15 / normalization, 11 / normalization);
- m_256qam[134] = gr_complex(-13 / normalization, 9 / normalization);
- m_256qam[135] = gr_complex(-13 / normalization, 11 / normalization);
- m_256qam[136] = gr_complex( -9 / normalization, 15 / normalization);
- m_256qam[137] = gr_complex( -9 / normalization, 13 / normalization);
- m_256qam[138] = gr_complex(-11 / normalization, 15 / normalization);
- m_256qam[139] = gr_complex(-11 / normalization, 13 / normalization);
- m_256qam[140] = gr_complex( -9 / normalization, 9 / normalization);
- m_256qam[141] = gr_complex( -9 / normalization, 11 / normalization);
- m_256qam[142] = gr_complex(-11 / normalization, 9 / normalization);
- m_256qam[143] = gr_complex(-11 / normalization, 11 / normalization);
- m_256qam[144] = gr_complex(-15 / normalization, 1 / normalization);
- m_256qam[145] = gr_complex(-15 / normalization, 3 / normalization);
- m_256qam[146] = gr_complex(-13 / normalization, 1 / normalization);
- m_256qam[147] = gr_complex(-13 / normalization, 3 / normalization);
- m_256qam[148] = gr_complex(-15 / normalization, 7 / normalization);
- m_256qam[149] = gr_complex(-15 / normalization, 5 / normalization);
- m_256qam[150] = gr_complex(-13 / normalization, 7 / normalization);
- m_256qam[151] = gr_complex(-13 / normalization, 5 / normalization);
- m_256qam[152] = gr_complex( -9 / normalization, 1 / normalization);
- m_256qam[153] = gr_complex( -9 / normalization, 3 / normalization);
- m_256qam[154] = gr_complex(-11 / normalization, 1 / normalization);
- m_256qam[155] = gr_complex(-11 / normalization, 3 / normalization);
- m_256qam[156] = gr_complex( -9 / normalization, 7 / normalization);
- m_256qam[157] = gr_complex( -9 / normalization, 5 / normalization);
- m_256qam[158] = gr_complex(-11 / normalization, 7 / normalization);
- m_256qam[159] = gr_complex(-11 / normalization, 5 / normalization);
- m_256qam[160] = gr_complex( -1 / normalization, 15 / normalization);
- m_256qam[161] = gr_complex( -1 / normalization, 13 / normalization);
- m_256qam[162] = gr_complex( -3 / normalization, 15 / normalization);
- m_256qam[163] = gr_complex( -3 / normalization, 13 / normalization);
- m_256qam[164] = gr_complex( -1 / normalization, 9 / normalization);
- m_256qam[165] = gr_complex( -1 / normalization, 11 / normalization);
- m_256qam[166] = gr_complex( -3 / normalization, 9 / normalization);
- m_256qam[167] = gr_complex( -3 / normalization, 11 / normalization);
- m_256qam[168] = gr_complex( -7 / normalization, 15 / normalization);
- m_256qam[169] = gr_complex( -7 / normalization, 13 / normalization);
- m_256qam[170] = gr_complex( -5 / normalization, 15 / normalization);
- m_256qam[171] = gr_complex( -5 / normalization, 13 / normalization);
- m_256qam[172] = gr_complex( -7 / normalization, 9 / normalization);
- m_256qam[173] = gr_complex( -7 / normalization, 11 / normalization);
- m_256qam[174] = gr_complex( -5 / normalization, 9 / normalization);
- m_256qam[175] = gr_complex( -5 / normalization, 11 / normalization);
- m_256qam[176] = gr_complex( -1 / normalization, 1 / normalization);
- m_256qam[177] = gr_complex( -1 / normalization, 3 / normalization);
- m_256qam[178] = gr_complex( -3 / normalization, 1 / normalization);
- m_256qam[179] = gr_complex( -3 / normalization, 3 / normalization);
- m_256qam[180] = gr_complex( -1 / normalization, 7 / normalization);
- m_256qam[181] = gr_complex( -1 / normalization, 5 / normalization);
- m_256qam[182] = gr_complex( -3 / normalization, 7 / normalization);
- m_256qam[183] = gr_complex( -3 / normalization, 5 / normalization);
- m_256qam[184] = gr_complex( -7 / normalization, 1 / normalization);
- m_256qam[185] = gr_complex( -7 / normalization, 3 / normalization);
- m_256qam[186] = gr_complex( -5 / normalization, 1 / normalization);
- m_256qam[187] = gr_complex( -5 / normalization, 3 / normalization);
- m_256qam[188] = gr_complex( -7 / normalization, 7 / normalization);
- m_256qam[189] = gr_complex( -7 / normalization, 5 / normalization);
- m_256qam[190] = gr_complex( -5 / normalization, 7 / normalization);
- m_256qam[191] = gr_complex( -5 / normalization, 5 / normalization);
- m_256qam[192] = gr_complex(-15 / normalization, -15 / normalization);
- m_256qam[193] = gr_complex(-15 / normalization, -13 / normalization);
- m_256qam[194] = gr_complex(-13 / normalization, -15 / normalization);
- m_256qam[195] = gr_complex(-13 / normalization, -13 / normalization);
- m_256qam[196] = gr_complex(-15 / normalization, -9 / normalization);
- m_256qam[197] = gr_complex(-15 / normalization, -11 / normalization);
- m_256qam[198] = gr_complex(-13 / normalization, -9 / normalization);
- m_256qam[199] = gr_complex(-13 / normalization, -11 / normalization);
- m_256qam[200] = gr_complex( -9 / normalization, -15 / normalization);
- m_256qam[201] = gr_complex( -9 / normalization, -13 / normalization);
- m_256qam[202] = gr_complex(-11 / normalization, -15 / normalization);
- m_256qam[203] = gr_complex(-11 / normalization, -13 / normalization);
- m_256qam[204] = gr_complex( -9 / normalization, -9 / normalization);
- m_256qam[205] = gr_complex( -9 / normalization, -11 / normalization);
- m_256qam[206] = gr_complex(-11 / normalization, -9 / normalization);
- m_256qam[207] = gr_complex(-11 / normalization, -11 / normalization);
- m_256qam[208] = gr_complex(-15 / normalization, -1 / normalization);
- m_256qam[209] = gr_complex(-15 / normalization, -3 / normalization);
- m_256qam[210] = gr_complex(-13 / normalization, -1 / normalization);
- m_256qam[211] = gr_complex(-13 / normalization, -3 / normalization);
- m_256qam[212] = gr_complex(-15 / normalization, -7 / normalization);
- m_256qam[213] = gr_complex(-15 / normalization, -5 / normalization);
- m_256qam[214] = gr_complex(-13 / normalization, -7 / normalization);
- m_256qam[215] = gr_complex(-13 / normalization, -5 / normalization);
- m_256qam[216] = gr_complex( -9 / normalization, -1 / normalization);
- m_256qam[217] = gr_complex( -9 / normalization, -3 / normalization);
- m_256qam[218] = gr_complex(-11 / normalization, -1 / normalization);
- m_256qam[219] = gr_complex(-11 / normalization, -3 / normalization);
- m_256qam[220] = gr_complex( -9 / normalization, -7 / normalization);
- m_256qam[221] = gr_complex( -9 / normalization, -5 / normalization);
- m_256qam[222] = gr_complex(-11 / normalization, -7 / normalization);
- m_256qam[223] = gr_complex(-11 / normalization, -5 / normalization);
- m_256qam[224] = gr_complex( -1 / normalization, -15 / normalization);
- m_256qam[225] = gr_complex( -1 / normalization, -13 / normalization);
- m_256qam[226] = gr_complex( -3 / normalization, -15 / normalization);
- m_256qam[227] = gr_complex( -3 / normalization, -13 / normalization);
- m_256qam[228] = gr_complex( -1 / normalization, -9 / normalization);
- m_256qam[229] = gr_complex( -1 / normalization, -11 / normalization);
- m_256qam[230] = gr_complex( -3 / normalization, -9 / normalization);
- m_256qam[231] = gr_complex( -3 / normalization, -11 / normalization);
- m_256qam[232] = gr_complex( -7 / normalization, -15 / normalization);
- m_256qam[233] = gr_complex( -7 / normalization, -13 / normalization);
- m_256qam[234] = gr_complex( -5 / normalization, -15 / normalization);
- m_256qam[235] = gr_complex( -5 / normalization, -13 / normalization);
- m_256qam[236] = gr_complex( -7 / normalization, -9 / normalization);
- m_256qam[237] = gr_complex( -7 / normalization, -11 / normalization);
- m_256qam[238] = gr_complex( -5 / normalization, -9 / normalization);
- m_256qam[239] = gr_complex( -5 / normalization, -11 / normalization);
- m_256qam[240] = gr_complex( -1 / normalization, -1 / normalization);
- m_256qam[241] = gr_complex( -1 / normalization, -3 / normalization);
- m_256qam[242] = gr_complex( -3 / normalization, -1 / normalization);
- m_256qam[243] = gr_complex( -3 / normalization, -3 / normalization);
- m_256qam[244] = gr_complex( -1 / normalization, -7 / normalization);
- m_256qam[245] = gr_complex( -1 / normalization, -5 / normalization);
- m_256qam[246] = gr_complex( -3 / normalization, -7 / normalization);
- m_256qam[247] = gr_complex( -3 / normalization, -5 / normalization);
- m_256qam[248] = gr_complex( -7 / normalization, -1 / normalization);
- m_256qam[249] = gr_complex( -7 / normalization, -3 / normalization);
- m_256qam[250] = gr_complex( -5 / normalization, -1 / normalization);
- m_256qam[251] = gr_complex( -5 / normalization, -3 / normalization);
- m_256qam[252] = gr_complex( -7 / normalization, -7 / normalization);
- m_256qam[253] = gr_complex( -7 / normalization, -5 / normalization);
- m_256qam[254] = gr_complex( -5 / normalization, -7 / normalization);
- m_256qam[255] = gr_complex( -5 / normalization, -5 / normalization);
+ for (int i = 0; i < 256; i++) {
+ real_index = ((i & 0x80) >> 4) | ((i & 0x20) >> 3) | ((i & 0x8) >> 2) | ((i & 0x2) >> 1);
+ imag_index = ((i & 0x40) >> 3) | ((i & 0x10) >> 2) | ((i & 0x4) >> 1) | ((i & 0x1) >> 0);
+ m_256qam[i] = gr_complex(m_256qam_lookup[real_index] / normalization, m_256qam_lookup[imag_index] / normalization);
+ }
if (rotation == ROTATION_ON) {
cyclic_delay = TRUE;
rotation_angle = (2.0 * M_PI * 3.576334375) / 360.0;
diff --git a/gr-uhd/apps/uhd_app.py b/gr-uhd/apps/uhd_app.py
index f9b08a6457..f4b6da67c3 100644
--- a/gr-uhd/apps/uhd_app.py
+++ b/gr-uhd/apps/uhd_app.py
@@ -106,43 +106,22 @@ class UHDApp(object):
except:
return "Can't establish USRP info."
- def normalize_antenna_sel(self, args):
+ def normalize_sel(self, num_name, arg_name, num, arg):
"""
- Make sure the --antenna option matches the --channels option.
+ num_name: meaningful name why we need num arguments
+ arg_name: name of current argument
+ num: required number of arguments
+ arg: actual argument
"""
- if args.antenna is None:
- return None
- antennas = [x.strip() for x in args.antenna.split(",")]
- if len(antennas) != 1 and len(antennas) != len(args.channels):
- raise ValueError("Invalid antenna setting for {n} channels: {a}".format(
- n=len(self.channels), a=args.antenna,
- ))
- if len(antennas) == 1:
- antennas = [antennas[0],] * len(args.channels)
- return antennas
- def normalize_subdev_sel(self, spec):
- """
- """
- if spec is None:
+ if arg is None:
return None
- specs = [x.strip() for x in spec.split(",")]
- if len(specs) == 1:
- return spec
- elif len(specs) != self.usrp.get_num_mboards():
- raise ValueError("Invalid subdev setting for {n} mboards: {a}".format(
- n=len(self.usrp.get_num_mboards()), a=spec
+ args = [x.strip() for x in arg.split(",")]
+ if len(args) != num:
+ raise ValueError("Invalid {m} setting for {n} {b}: {a}".format(
+ m=arg_name, n=num, a=arg, b=num_name
))
- return specs
-
- def normalize_lo_source_export_sel(self, args):
- lo_source = [x.strip() for x in args.lo_source.split(",")]
- lo_export = [x.strip() for x in args.lo_export.split(",")]
- if len(lo_source) != len(self.channels):
- raise ValueError("Invalid number of lo-source settings {n} for {c} channels. Must be one argument per channel.".format(n=len(lo_source), c=len(args.channels)))
- if len(lo_export) != len(self.channels):
- raise ValueError("Invalid number of lo-export settings {n} for {c} channels. Must be one argument per channel.".format(n=len(lo_source), c=len(args.channels)))
- return (lo_source, lo_export)
+ return args
def async_callback(self, msg):
"""
@@ -174,27 +153,40 @@ class UHDApp(object):
)
)
# Set the subdevice spec:
- args.spec = self.normalize_subdev_sel(args.spec)
+ args.spec = self.normalize_sel("mboards", "subdev",
+ self.usrp.get_num_mboards(), args.spec)
if args.spec:
for mb_idx in xrange(self.usrp.get_num_mboards()):
- if isinstance(args.spec, list):
- self.usrp.set_subdev_spec(args.spec[mb_idx], mb_idx)
- else:
+ if len(args.spec) == 1:
self.usrp.set_subdev_spec(args.spec, mb_idx)
+ else:
+ self.usrp.set_subdev_spec(args.spec[mb_idx], mb_idx)
# Set the clock and/or time source:
if args.clock_source is not None:
+ args.clock_source = self.normalize_sel("mboards", "clock-source",
+ self.usrp.get_num_mboards(), args.clock_source)
for mb_idx in xrange(self.usrp.get_num_mboards()):
- self.usrp.set_clock_source(args.clock_source, mb_idx)
+ if len(args.time_source) == 1:
+ self.usrp.set_clock_source(args.clock_source[0], mb_idx)
+ else:
+ self.usrp.set_clock_source(args.clock_source[mb_idx], mb_idx)
if args.time_source is not None:
+ args.time_source = self.normalize_sel("mboards", "time-source",
+ self.usrp.get_num_mboards(), args.time_source)
for mb_idx in xrange(self.usrp.get_num_mboards()):
- self.usrp.set_time_source(args.time_source, mb_idx)
+ if len(args.time_source) == 1:
+ self.usrp.set_time_source(args.time_source[0], mb_idx)
+ else:
+ self.usrp.set_time_source(args.time_source[mb_idx], mb_idx)
# Sampling rate:
self.usrp.set_samp_rate(args.samp_rate)
self.samp_rate = self.usrp.get_samp_rate()
self.vprint("Using sampling rate: {rate}".format(rate=self.samp_rate))
# Set the antenna:
- self.antenna = self.normalize_antenna_sel(args)
+ self.antenna = self.normalize_sel("channels", "antenna", len(args.channels), args.antenna)
if self.antenna is not None:
+ if len(self.antenna) == 1:
+ self.antenna = [self.antenna, ] * len(args.channels)
for i, chan in enumerate(self.channels):
if not self.antenna[i] in self.usrp.get_antennas(i):
self.vprint("[ERROR] {} is not a valid antenna name for this USRP device!".format(self.antenna[i]))
@@ -215,7 +207,8 @@ class UHDApp(object):
self.has_lo_sensor = 'lo_locked' in self.usrp.get_sensor_names()
# Set LO export and LO source operation
if (args.lo_export is not None) and (args.lo_source is not None):
- (args.lo_source,args.lo_export) = self.normalize_lo_source_export_sel(args)
+ args.lo_source = self.normalize_sel("channels", "lo-source", len(args.channels), args.lo_source)
+ args.lo_export = self.normalize_sel("channels", "lo-export", len(args.channels), args.lo_export)
for chan,lo_source,lo_export in zip(self.channels,args.lo_source,args.lo_export):
if (lo_source == "None") or (lo_export == "None"):
continue
diff --git a/gr-uhd/apps/uhd_fft b/gr-uhd/apps/uhd_fft
index b65bb7a062..1f0cf1cda5 100755
--- a/gr-uhd/apps/uhd_fft
+++ b/gr-uhd/apps/uhd_fft
@@ -98,6 +98,7 @@ class uhd_fft(gr.top_block, Qt.QWidget, UHDApp):
self.stream_args = args.stream_args
self.update_rate = args.update_rate
self.wire_format = args.otw_format
+ self.lo_offset = args.lo_offset
##################################################
# Variables
@@ -128,7 +129,7 @@ class uhd_fft(gr.top_block, Qt.QWidget, UHDApp):
self.setup_usrp(uhd.usrp_source, args)
self._ant_options = self.usrp.get_antennas(0)
for c in range(len(self.channels)):
- self.usrp.set_bandwidth(self.samp_rate, c)
+ self.usrp.set_bandwidth(self.samp_rate + abs(self.lo_offset), c)
self.usrp_device_info = self.get_usrp_info_string(compact=True, tx_or_rx='rx')
### Now set up the GUI widgets: #####################################
@@ -431,7 +432,7 @@ class uhd_fft(gr.top_block, Qt.QWidget, UHDApp):
self.qtgui_waterfall_sink_x_0.set_frequency_range(self.freq, self.samp_rate)
self.usrp.set_samp_rate(self.samp_rate)
for c in range(len(self.channels)):
- self.usrp.set_bandwidth(self.samp_rate, c)
+ self.usrp.set_bandwidth(self.samp_rate + abs(self.lo_offset), c)
def set_lo_locked_probe(self, lo_locked_probe):
self.lo_locked_probe = lo_locked_probe
diff --git a/gr-uhd/lib/usrp_source_impl.cc b/gr-uhd/lib/usrp_source_impl.cc
index 11b6300406..23b94c684f 100644
--- a/gr-uhd/lib/usrp_source_impl.cc
+++ b/gr-uhd/lib/usrp_source_impl.cc
@@ -79,7 +79,6 @@ namespace gr {
_id = pmt::string_to_symbol(str.str());
_samp_rate = this->get_samp_rate();
- _center_freq = this->get_center_freq(0);
#ifdef GR_UHD_USE_STREAM_API
_samps_per_packet = 1;
#endif
@@ -144,10 +143,8 @@ namespace gr {
usrp_source_impl::set_center_freq(const ::uhd::tune_request_t tune_request,
size_t chan)
{
- const size_t user_chan = chan;
chan = _stream_args.channels[chan];
const ::uhd::tune_result_t res = _dev->set_rx_freq(tune_request, chan);
- _center_freq = this->get_center_freq(user_chan);
_tag_now = true;
return res;
}
@@ -657,7 +654,7 @@ namespace gr {
this->add_item_tag(i, nitems_written(0), RATE_KEY,
pmt::from_double(_samp_rate), _id);
this->add_item_tag(i, nitems_written(0), FREQ_KEY,
- pmt::from_double(_center_freq), _id);
+ pmt::from_double(this->get_center_freq(i)), _id);
}
}
break;
diff --git a/gr-uhd/lib/usrp_source_impl.h b/gr-uhd/lib/usrp_source_impl.h
index ab0f5c62c4..7ee5a138d4 100644
--- a/gr-uhd/lib/usrp_source_impl.h
+++ b/gr-uhd/lib/usrp_source_impl.h
@@ -135,7 +135,6 @@ namespace gr {
//tag shadows
double _samp_rate;
- double _center_freq;
boost::recursive_mutex d_mutex;
};
diff --git a/gr-utils/python/modtool/gr-newmod/cmake/Modules/UseSWIG.cmake b/gr-utils/python/modtool/gr-newmod/cmake/Modules/UseSWIG.cmake
index c0f172870b..b7e3e05dc5 100644
--- a/gr-utils/python/modtool/gr-newmod/cmake/Modules/UseSWIG.cmake
+++ b/gr-utils/python/modtool/gr-newmod/cmake/Modules/UseSWIG.cmake
@@ -224,9 +224,9 @@ print(re.sub('\\W', '_', '${name} ${reldir} ' + unique))"
foreach(swig_gen_file ${${outfiles}})
add_custom_command(
OUTPUT ${swig_gen_file}
- COMMAND ""
+ COMMAND "${CMAKE_COMMAND}" -E touch_nocreate "${swig_gen_file}"
DEPENDS ${_target}
- COMMENT ""
+ COMMENT "dummy command to show ${_target} dependency of ${swig_gen_file}"
)
endforeach()
diff --git a/grc/core/Param.py b/grc/core/Param.py
index 26f9d2f451..afa478b3a2 100644
--- a/grc/core/Param.py
+++ b/grc/core/Param.py
@@ -485,13 +485,20 @@ class Param(Element):
# Can python use this as a variable?
if not _check_id_matcher.match(v):
raise Exception('ID "{0}" must begin with a letter and may contain letters, numbers, and underscores.'.format(v))
- ids = [param.get_value() for param in self.get_all_params(t)]
+ ids = [param.get_value() for param in self.get_all_params(t, 'id')]
- # Id should only appear once, or zero times if block is disabled
- if ids.count(v) > 1:
- raise Exception('ID "{0}" is not unique.'.format(v))
if v in ID_BLACKLIST:
raise Exception('ID "{0}" is blacklisted.'.format(v))
+
+ if self._key == 'id':
+ # Id should only appear once, or zero times if block is disabled
+ if ids.count(v) > 1:
+ raise Exception('ID "{0}" is not unique.'.format(v))
+ else:
+ # Id should exist to be a reference
+ if ids.count(v) < 1:
+ raise Exception('ID "{0}" does not exist.'.format(v))
+
return v
#########################
@@ -655,17 +662,19 @@ class Param(Element):
else:
return v
- def get_all_params(self, type):
+ def get_all_params(self, type, key=None):
"""
- Get all the params from the flowgraph that have the given type.
+ Get all the params from the flowgraph that have the given type and
+ optionally a given key
Args:
type: the specified type
+ key: the key to match against
Returns:
a list of params
"""
- return sum([filter(lambda p: p.get_type() == type, block.get_params()) for block in self.get_parent().get_parent().get_enabled_blocks()], [])
+ return sum([filter(lambda p: ((p.get_type() == type) and ((key is None) or (p.get_key() == key))), block.get_params()) for block in self.get_parent().get_parent().get_enabled_blocks()], [])
def is_enum(self):
return self._type == 'enum'
diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py
index b9f534fdf0..5d48485238 100644
--- a/grc/gui/ActionHandler.py
+++ b/grc/gui/ActionHandler.py
@@ -131,6 +131,7 @@ class ActionHandler:
for action in (
Actions.APPLICATION_QUIT, Actions.FLOW_GRAPH_NEW,
Actions.FLOW_GRAPH_OPEN, Actions.FLOW_GRAPH_SAVE_AS,
+ Actions.FLOW_GRAPH_DUPLICATE, Actions.FLOW_GRAPH_SAVE_A_COPY,
Actions.FLOW_GRAPH_CLOSE, Actions.ABOUT_WINDOW_DISPLAY,
Actions.FLOW_GRAPH_SCREEN_CAPTURE, Actions.HELP_WINDOW_DISPLAY,
Actions.TYPES_WINDOW_DISPLAY, Actions.TOGGLE_BLOCKS_WINDOW,
@@ -561,6 +562,32 @@ class ActionHandler:
Preferences.add_recent_file(file_path)
main.tool_bar.refresh_submenus()
main.menu_bar.refresh_submenus()
+ elif action == Actions.FLOW_GRAPH_SAVE_A_COPY:
+ try:
+ if not page.get_file_path():
+ Actions.FLOW_GRAPH_SAVE_AS()
+ else:
+ dup_file_path = page.get_file_path()
+ dup_file_name = '.'.join(dup_file_path.split('.')[:-1]) + "_copy" # Assuming .grc extension at the end of file_path
+ dup_file_path_temp = dup_file_name+'.grc'
+ count = 1
+ while os.path.exists(dup_file_path_temp):
+ dup_file_path_temp = dup_file_name+'('+str(count)+').grc'
+ count += 1
+ dup_file_path_user = SaveFlowGraphFileDialog(dup_file_path_temp).run()
+ if dup_file_path_user is not None:
+ ParseXML.to_file(flow_graph.export_data(), dup_file_path_user)
+ Messages.send('Saved Copy to: "' + dup_file_path_user + '"\n')
+ except IOError:
+ Messages.send_fail_save("Can not create a copy of the flowgraph\n")
+ elif action == Actions.FLOW_GRAPH_DUPLICATE:
+ flow_graph = main.get_flow_graph()
+ main.new_page()
+ curr_page = main.get_page()
+ new_flow_graph = main.get_flow_graph()
+ new_flow_graph.import_data(flow_graph.export_data())
+ flow_graph_update(new_flow_graph)
+ curr_page.set_saved(False)
elif action == Actions.FLOW_GRAPH_SCREEN_CAPTURE:
file_path, background_transparent = SaveScreenShotDialog(page.get_file_path()).run()
if file_path is not None:
diff --git a/grc/gui/Actions.py b/grc/gui/Actions.py
index 9b2af36b93..6eccab75fb 100644
--- a/grc/gui/Actions.py
+++ b/grc/gui/Actions.py
@@ -203,6 +203,16 @@ FLOW_GRAPH_SAVE_AS = Action(
stock_id=gtk.STOCK_SAVE_AS,
keypresses=(gtk.keysyms.s, gtk.gdk.CONTROL_MASK | gtk.gdk.SHIFT_MASK),
)
+FLOW_GRAPH_SAVE_A_COPY = Action(
+ label='Save A Copy',
+ tooltip='Save the copy of current flowgraph',
+)
+FLOW_GRAPH_DUPLICATE = Action(
+ label='_Duplicate',
+ tooltip='Create a duplicate of current flowgraph',
+ stock_id=gtk.STOCK_COPY,
+ keypresses=(gtk.keysyms.d, gtk.gdk.CONTROL_MASK | gtk.gdk.SHIFT_MASK),
+)
FLOW_GRAPH_CLOSE = Action(
label='_Close',
tooltip='Close the current flow graph',
diff --git a/grc/gui/Bars.py b/grc/gui/Bars.py
index a4819b973c..d9bc2aedb7 100644
--- a/grc/gui/Bars.py
+++ b/grc/gui/Bars.py
@@ -64,11 +64,13 @@ TOOLBAR_LIST = (
MENU_BAR_LIST = (
(gtk.Action('File', '_File', None, None), [
'flow_graph_new',
+ Actions.FLOW_GRAPH_DUPLICATE,
Actions.FLOW_GRAPH_OPEN,
'flow_graph_recent',
None,
Actions.FLOW_GRAPH_SAVE,
Actions.FLOW_GRAPH_SAVE_AS,
+ Actions.FLOW_GRAPH_SAVE_A_COPY,
None,
Actions.FLOW_GRAPH_SCREEN_CAPTURE,
None,