diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2015-07-06 16:05:42 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2015-07-06 16:05:42 -0700 |
commit | 9c91a38f0dad9e0bacb96b87f6793c13522d00b2 (patch) | |
tree | 250ec6c5e285678701322773fb814baeed300c03 | |
parent | 8ef1ea6d5e1781379473a1990ca30e3833f49c0c (diff) | |
parent | 1185d401caf8f420b93754398675d012f08ef68f (diff) |
Merge branch 'master' into next
-rw-r--r-- | cmake/Modules/GnuradioConfig.cmake | 1 | ||||
-rw-r--r-- | gnuradio-runtime/include/gnuradio/flowgraph.h | 76 | ||||
-rw-r--r-- | gnuradio-runtime/python/gnuradio/CMakeLists.txt | 1 | ||||
-rw-r--r-- | gnuradio-runtime/python/gnuradio/eng_arg.py | 53 | ||||
-rw-r--r-- | gr-analog/gnuradio-analog.pc.in | 2 | ||||
-rw-r--r-- | gr-analog/include/gnuradio/analog/frequency_modulator_fc.h | 2 | ||||
-rw-r--r-- | gr-analog/lib/frequency_modulator_fc_impl.cc | 4 | ||||
-rw-r--r-- | gr-analog/lib/frequency_modulator_fc_impl.h | 2 | ||||
-rw-r--r-- | gr-noaa/README | 13 | ||||
-rw-r--r-- | grc/gui/BlockTreeWindow.py | 2 | ||||
-rwxr-xr-x | grc/scripts/gnuradio-companion | 8 |
11 files changed, 134 insertions, 30 deletions
diff --git a/cmake/Modules/GnuradioConfig.cmake b/cmake/Modules/GnuradioConfig.cmake index c2630ca26e..83d72c1743 100644 --- a/cmake/Modules/GnuradioConfig.cmake +++ b/cmake/Modules/GnuradioConfig.cmake @@ -132,6 +132,7 @@ GR_MODULE(UHD gnuradio-uhd gnuradio/uhd/api.h gnuradio-uhd) GR_MODULE(VOCODER gnuradio-vocoder gnuradio/vocoder/api.h gnuradio-vocoder) GR_MODULE(WAVELET gnuradio-wavelet gnuradio/wavelet/api.h gnuradio-wavelet) GR_MODULE(WXGUI gnuradio-wxgui gnuradio/wxgui/api.h gnuradio-wxgui) +GR_MODULE(ZEROMQ gnuradio-zeromq gnuradio/zeromq/api.h gnuradio-zeromq) GR_MODULE(PMT gnuradio-runtime pmt/pmt.h gnuradio-pmt) GR_MODULE(VOLK volk volk/volk.h volk) diff --git a/gnuradio-runtime/include/gnuradio/flowgraph.h b/gnuradio-runtime/include/gnuradio/flowgraph.h index 452a20cbc6..280c01fc28 100644 --- a/gnuradio-runtime/include/gnuradio/flowgraph.h +++ b/gnuradio-runtime/include/gnuradio/flowgraph.h @@ -146,49 +146,95 @@ namespace gr { public: friend GR_RUNTIME_API flowgraph_sptr make_flowgraph(); - // Destruct an arbitrary flowgraph + /*! + * \brief Destruct an arbitrary flowgraph + */ virtual ~flowgraph(); - // Connect two endpoints + /*! + * \brief Connect two endpoints + * \details + * Checks the validity of both endpoints, and whether the + * destination is unused so far, then adds the edge to the internal list of + * edges. + */ void connect(const endpoint &src, const endpoint &dst); - // Disconnect two endpoints + /*! + * \brief Disconnect two endpoints + */ void disconnect(const endpoint &src, const endpoint &dst); - // Connect an output port to an input port (convenience) + /*! + * \brief convenience wrapper; used to connect two endpoints + */ void connect(basic_block_sptr src_block, int src_port, basic_block_sptr dst_block, int dst_port); - // Disconnect an input port from an output port (convenience) + /*! + * \brief convenience wrapper; used to disconnect two endpoints + */ void disconnect(basic_block_sptr src_block, int src_port, basic_block_sptr dst_block, int dst_port); - // Connect two msg endpoints + /*! + * \brief Connect two message endpoints + * \details + * Checks the validity of both endpoints, then adds the edge to the + * internal list of edges. + */ void connect(const msg_endpoint &src, const msg_endpoint &dst); - // Disconnect two msg endpoints + /*! + * \brief Disconnect two message endpoints + */ void disconnect(const msg_endpoint &src, const msg_endpoint &dst); - // Validate connectivity, raise exception if invalid + /*! + * \brief Validate flow graph + * \details + * Gathers all used blocks, checks the contiguity of all connected in- and + * outputs, and calls the check_topology method of each block. + */ void validate(); - // Clear existing flowgraph + /*! + * \brief Clear existing flowgraph + */ void clear(); - // Return vector of edges + /*! + * \brief Get vector of edges + */ const edge_vector_t &edges() const { return d_edges; } - // Return vector of msg edges + /*! + * \brief Get vector of message edges + */ const msg_edge_vector_t &msg_edges() const { return d_msg_edges; } - // Return vector of connected blocks + /*! + * \brief calculates all used blocks in a flow graph + * \details + * Iterates over all message edges and stream edges, noting both endpoints in a vector. + * + * \return a unique vector of used blocks + */ basic_block_vector_t calc_used_blocks(); - // Return toplogically sorted vector of blocks. All the sources come first. + /*! + * \brief topologically sort blocks + * \details + * Uses depth-first search to return a sorted vector of blocks + * + * \return toplogically sorted vector of blocks. All the sources come first. + */ basic_block_vector_t topological_sort(basic_block_vector_t &blocks); - // Return vector of vectors of disjointly connected blocks, - // topologically sorted. + /*! + * \brief Calculate vector of disjoint graph partions + * \return vector of disjoint vectors of topologically sorted blocks + */ std::vector<basic_block_vector_t> partition(); protected: diff --git a/gnuradio-runtime/python/gnuradio/CMakeLists.txt b/gnuradio-runtime/python/gnuradio/CMakeLists.txt index bd566edf14..d29e6aa9d2 100644 --- a/gnuradio-runtime/python/gnuradio/CMakeLists.txt +++ b/gnuradio-runtime/python/gnuradio/CMakeLists.txt @@ -31,6 +31,7 @@ GR_PYTHON_INSTALL(FILES __init__.py eng_notation.py eng_option.py + eng_arg.py gr_unittest.py gr_xmlrunner.py DESTINATION ${GR_PYTHON_DIR}/gnuradio diff --git a/gnuradio-runtime/python/gnuradio/eng_arg.py b/gnuradio-runtime/python/gnuradio/eng_arg.py new file mode 100644 index 0000000000..05cd8a1f2a --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/eng_arg.py @@ -0,0 +1,53 @@ +# +# Copyright 2015 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. +# + +''' +Add support for engineering notation to argparse.ArgumentParser +''' + +import argparse +from gnuradio import eng_notation + +def intx(string): + """ + Generic integer type, will interpret string as string literal. + Does the right thing for 0x1F, 0b10101, 010. + """ + try: + return int(string, 0) + except: + raise argparse.ArgumentTypeError( + "Invalid integer value: {}".format(string) + ) + +def eng_float(string): + """ + Takes a string, returns a float. Accepts engineering notation. + Designed for use with argparse.ArgumentParser. + Will raise an ArgumentTypeError if not possible. + """ + try: + return eng_notation.str_to_num(string) + except: + raise argparse.ArgumentTypeError( + "Invalid engineering notation value: {}".format(string) + ) + diff --git a/gr-analog/gnuradio-analog.pc.in b/gr-analog/gnuradio-analog.pc.in index 2461fc3fdd..7bf0a36846 100644 --- a/gr-analog/gnuradio-analog.pc.in +++ b/gr-analog/gnuradio-analog.pc.in @@ -5,7 +5,7 @@ includedir=@includedir@ Name: gnuradio-analog Description: GNU Radio blocks for analog communications -Requires: gnuradio-runtime +Requires: gnuradio-runtime volk Version: @LIBVER@ Libs: -L${libdir} -lgnuradio-analog Cflags: -I${includedir} diff --git a/gr-analog/include/gnuradio/analog/frequency_modulator_fc.h b/gr-analog/include/gnuradio/analog/frequency_modulator_fc.h index c573efe5cc..838831052d 100644 --- a/gr-analog/include/gnuradio/analog/frequency_modulator_fc.h +++ b/gr-analog/include/gnuradio/analog/frequency_modulator_fc.h @@ -47,7 +47,7 @@ namespace gr { * * \param sensitivity radians/sample = amplitude * sensitivity */ - static sptr make(double sensitivity); + static sptr make(float sensitivity); virtual void set_sensitivity(float sens) = 0; virtual float sensitivity() const = 0; diff --git a/gr-analog/lib/frequency_modulator_fc_impl.cc b/gr-analog/lib/frequency_modulator_fc_impl.cc index 5015ff720d..1158167756 100644 --- a/gr-analog/lib/frequency_modulator_fc_impl.cc +++ b/gr-analog/lib/frequency_modulator_fc_impl.cc @@ -34,13 +34,13 @@ namespace gr { namespace analog { frequency_modulator_fc::sptr - frequency_modulator_fc::make(double sensitivity) + frequency_modulator_fc::make(float sensitivity) { return gnuradio::get_initial_sptr (new frequency_modulator_fc_impl(sensitivity)); } - frequency_modulator_fc_impl::frequency_modulator_fc_impl(double sensitivity) + frequency_modulator_fc_impl::frequency_modulator_fc_impl(float sensitivity) : sync_block("frequency_modulator_fc", io_signature::make(1, 1, sizeof(float)), io_signature::make(1, 1, sizeof(gr_complex))), diff --git a/gr-analog/lib/frequency_modulator_fc_impl.h b/gr-analog/lib/frequency_modulator_fc_impl.h index d2c57b3e4c..9f5310ce97 100644 --- a/gr-analog/lib/frequency_modulator_fc_impl.h +++ b/gr-analog/lib/frequency_modulator_fc_impl.h @@ -35,7 +35,7 @@ namespace gr { float d_phase; public: - frequency_modulator_fc_impl(double sensitivity); + frequency_modulator_fc_impl(float sensitivity); ~frequency_modulator_fc_impl(); void set_sensitivity(float sens) { d_sensitivity = sens; } diff --git a/gr-noaa/README b/gr-noaa/README index f00d2d28de..88364cafda 100644 --- a/gr-noaa/README +++ b/gr-noaa/README @@ -15,15 +15,12 @@ HRPT minor frames into a file. The file stores a series of 11090 word, 16-bits per word corresponding to the HRPT minor frame format (only the lower 10-bits per word are significant.) -The script file by default uses USRP side A, 1698 MHz, at decimation 16. The -gnuradio configuration file ~/.gnuradio/config.conf, section 'usrp_rx_hrpt.cfg', -will allow changing this, as well as implementing persistent storage of GUI -entered parameters from invocation to invocation. - -The present HRPT demodulator is only tested at decimation 16. The only other -valid decimation rates are 24 and 32, which may work but with more bit -errors. No other decimation rates will work. +The script file by default uses USRP side A, 1698 MHz, at a sampling rate of +4MHz. The gnuradio configuration file ~/.gnuradio/config.conf, section +'usrp_rx_hrpt.cfg', will allow changing this, as well as implementing +persistent storage of GUI entered parameters from invocation to invocation. +The present HRPT demodulator is only tested at 4MS/s. file_rx_hrpt.py --------------- diff --git a/grc/gui/BlockTreeWindow.py b/grc/gui/BlockTreeWindow.py index 76eebdb959..631272b03c 100644 --- a/grc/gui/BlockTreeWindow.py +++ b/grc/gui/BlockTreeWindow.py @@ -170,7 +170,7 @@ class BlockTreeWindow(gtk.VBox): def _expand_category(self): treestore, iter = self.treeview.get_selection().get_selected() if iter and treestore.iter_has_child(iter): - path = self.treestore.get_path(iter) + path = treestore.get_path(iter) self.treeview.expand_to_path(path) ############################################################ diff --git a/grc/scripts/gnuradio-companion b/grc/scripts/gnuradio-companion index b8b960a91e..77345bed1a 100755 --- a/grc/scripts/gnuradio-companion +++ b/grc/scripts/gnuradio-companion @@ -21,11 +21,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA import os import sys import optparse +import warnings import pygtk pygtk.require('2.0') -import gtk +warnings.filterwarnings("error") +try: + import gtk +except: + sys.exit("Failed to import gtk. If you are running over ssh, did you enable X forwarding and start ssh with -X?") +warnings.filterwarnings("always") GR_IMPORT_ERROR_MESSAGE = """\ Cannot import gnuradio. |