diff options
Diffstat (limited to 'gr-uhd')
-rw-r--r-- | gr-uhd/lib/Makefile.am | 4 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_mimo_sink.cc | 6 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_mimo_source.cc | 6 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_simple_sink.cc | 6 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_simple_source.cc | 6 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_single_usrp_sink.cc | 3 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_single_usrp_source.cc | 3 | ||||
-rw-r--r-- | gr-uhd/lib/utils.cc | 56 | ||||
-rw-r--r-- | gr-uhd/lib/utils.h | 40 |
9 files changed, 13 insertions, 117 deletions
diff --git a/gr-uhd/lib/Makefile.am b/gr-uhd/lib/Makefile.am index 1260201a5..69a41e788 100644 --- a/gr-uhd/lib/Makefile.am +++ b/gr-uhd/lib/Makefile.am @@ -29,7 +29,6 @@ AM_CPPFLAGS = \ lib_LTLIBRARIES = libgnuradio-uhd.la libgnuradio_uhd_la_SOURCES = \ - utils.cc \ uhd_mimo_source.cc \ uhd_mimo_sink.cc \ uhd_simple_source.cc \ @@ -51,5 +50,4 @@ grinclude_HEADERS = \ uhd_single_usrp_source.h \ uhd_single_usrp_sink.h -noinst_HEADERS = \ - utils.h +noinst_HEADERS = diff --git a/gr-uhd/lib/uhd_mimo_sink.cc b/gr-uhd/lib/uhd_mimo_sink.cc index 0a2ce1b0a..03d310b1e 100644 --- a/gr-uhd/lib/uhd_mimo_sink.cc +++ b/gr-uhd/lib/uhd_mimo_sink.cc @@ -23,7 +23,7 @@ #include <uhd_mimo_sink.h> #include <gr_io_signature.h> #include <stdexcept> -#include "utils.h" +//#include "utils.h" /*********************************************************************** * UHD Sink @@ -59,7 +59,7 @@ public: void set_samp_rate_all(double rate){ _dev->set_tx_rate_all(rate); - do_samp_rate_error_message(rate, get_samp_rate_all(), "TX"); + //do_samp_rate_error_message(rate, get_samp_rate_all(), "TX"); } double get_samp_rate_all(void){ @@ -68,7 +68,7 @@ public: uhd::tune_result_t set_center_freq(size_t chan, double freq){ uhd::tune_result_t tr = _dev->set_tx_freq(chan, freq); - do_tune_freq_error_message(freq, _dev->get_tx_freq(chan), "TX"); + //do_tune_freq_error_message(freq, _dev->get_tx_freq(chan), "TX"); return tr; } diff --git a/gr-uhd/lib/uhd_mimo_source.cc b/gr-uhd/lib/uhd_mimo_source.cc index 62157142d..abd70ba36 100644 --- a/gr-uhd/lib/uhd_mimo_source.cc +++ b/gr-uhd/lib/uhd_mimo_source.cc @@ -23,7 +23,7 @@ #include <uhd_mimo_source.h> #include <gr_io_signature.h> #include <stdexcept> -#include "utils.h" +//#include "utils.h" /*********************************************************************** * UHD Source @@ -59,7 +59,7 @@ public: void set_samp_rate_all(double rate){ _dev->set_rx_rate_all(rate); - do_samp_rate_error_message(rate, get_samp_rate_all(), "RX"); + //do_samp_rate_error_message(rate, get_samp_rate_all(), "RX"); } double get_samp_rate_all(void){ @@ -68,7 +68,7 @@ public: uhd::tune_result_t set_center_freq(size_t chan, double freq){ uhd::tune_result_t tr = _dev->set_rx_freq(chan, freq); - do_tune_freq_error_message(freq, _dev->get_rx_freq(chan), "RX"); + //do_tune_freq_error_message(freq, _dev->get_rx_freq(chan), "RX"); return tr; } diff --git a/gr-uhd/lib/uhd_simple_sink.cc b/gr-uhd/lib/uhd_simple_sink.cc index 7b31218db..d7b04465d 100644 --- a/gr-uhd/lib/uhd_simple_sink.cc +++ b/gr-uhd/lib/uhd_simple_sink.cc @@ -23,7 +23,7 @@ #include <uhd_simple_sink.h> #include <gr_io_signature.h> #include <stdexcept> -#include "utils.h" +//#include "utils.h" /*********************************************************************** * UHD Sink @@ -56,7 +56,7 @@ public: void set_samp_rate(double rate){ _dev->set_tx_rate(rate); - do_samp_rate_error_message(rate, get_samp_rate(), "TX"); + //do_samp_rate_error_message(rate, get_samp_rate(), "TX"); } double get_samp_rate(void){ @@ -65,7 +65,7 @@ public: uhd::tune_result_t set_center_freq(double freq){ uhd::tune_result_t tr = _dev->set_tx_freq(freq); - do_tune_freq_error_message(freq, _dev->get_tx_freq(), "TX"); + //do_tune_freq_error_message(freq, _dev->get_tx_freq(), "TX"); return tr; } diff --git a/gr-uhd/lib/uhd_simple_source.cc b/gr-uhd/lib/uhd_simple_source.cc index c1e11e85d..d74c8414d 100644 --- a/gr-uhd/lib/uhd_simple_source.cc +++ b/gr-uhd/lib/uhd_simple_source.cc @@ -25,7 +25,7 @@ #include <stdexcept> #include <iostream> #include <boost/format.hpp> -#include "utils.h" +//#include "utils.h" /*********************************************************************** * UHD Source @@ -59,7 +59,7 @@ public: void set_samp_rate(double rate){ _dev->set_rx_rate(rate); - do_samp_rate_error_message(rate, get_samp_rate(), "RX"); + //do_samp_rate_error_message(rate, get_samp_rate(), "RX"); } double get_samp_rate(void){ @@ -68,7 +68,7 @@ public: uhd::tune_result_t set_center_freq(double freq){ uhd::tune_result_t tr = _dev->set_rx_freq(freq); - do_tune_freq_error_message(freq, _dev->get_rx_freq(), "RX"); + //do_tune_freq_error_message(freq, _dev->get_rx_freq(), "RX"); return tr; } diff --git a/gr-uhd/lib/uhd_single_usrp_sink.cc b/gr-uhd/lib/uhd_single_usrp_sink.cc index 96f86c8db..cd7d7a618 100644 --- a/gr-uhd/lib/uhd_single_usrp_sink.cc +++ b/gr-uhd/lib/uhd_single_usrp_sink.cc @@ -22,7 +22,6 @@ #include <uhd_single_usrp_sink.h> #include <gr_io_signature.h> #include <stdexcept> -#include "utils.h" /*********************************************************************** * UHD Single USPR Sink @@ -56,7 +55,6 @@ public: void set_samp_rate(double rate){ _dev->set_tx_rate(rate); - do_samp_rate_error_message(rate, get_samp_rate(), "TX"); } double get_samp_rate(void){ @@ -65,7 +63,6 @@ public: uhd::tune_result_t set_center_freq(double freq, size_t chan){ uhd::tune_result_t tr = _dev->set_tx_freq(freq, chan); - do_tune_freq_error_message(freq, _dev->get_tx_freq(chan), "TX"); return tr; } diff --git a/gr-uhd/lib/uhd_single_usrp_source.cc b/gr-uhd/lib/uhd_single_usrp_source.cc index b5e39b5a4..fc2c453eb 100644 --- a/gr-uhd/lib/uhd_single_usrp_source.cc +++ b/gr-uhd/lib/uhd_single_usrp_source.cc @@ -24,7 +24,6 @@ #include <stdexcept> #include <iostream> #include <boost/format.hpp> -#include "utils.h" /*********************************************************************** * UHD Single USPR Source @@ -54,7 +53,6 @@ public: void set_samp_rate(double rate){ _dev->set_rx_rate(rate); - do_samp_rate_error_message(rate, get_samp_rate(), "RX"); } double get_samp_rate(void){ @@ -63,7 +61,6 @@ public: uhd::tune_result_t set_center_freq(double freq, size_t chan){ uhd::tune_result_t tr = _dev->set_rx_freq(freq, chan); - do_tune_freq_error_message(freq, _dev->get_rx_freq(chan), "RX"); return tr; } diff --git a/gr-uhd/lib/utils.cc b/gr-uhd/lib/utils.cc deleted file mode 100644 index da8352965..000000000 --- a/gr-uhd/lib/utils.cc +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2010 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. - */ - -#include "utils.h" //local include -#include <uhd/utils/warning.hpp> -#include <boost/format.hpp> -#include <cmath> - -void do_samp_rate_error_message( - double target_rate, - double actual_rate, - const std::string &xx -){ - static const double max_allowed_error = 1.0; //Sps - if (std::abs(target_rate - actual_rate) > max_allowed_error){ - uhd::print_warning(str(boost::format( - "The hardware does not support the requested %s sample rate:\n" - "Target sample rate: %f MSps\n" - "Actual sample rate: %f MSps\n" - ) % xx % (target_rate/1e6) % (actual_rate/1e6))); - } -} - -void do_tune_freq_error_message( - double target_freq, - double actual_freq, - const std::string &xx -){ - static const double max_allowed_error = 1.0; //Hz - if (std::abs(target_freq - actual_freq) > max_allowed_error){ - uhd::print_warning(str(boost::format( - "The hardware does not support the requested %s frequency:\n" - "Target frequency: %f MHz\n" - "Actual frequency: %f MHz\n" - ) % xx % (target_freq/1e6) % (actual_freq/1e6))); - } -} diff --git a/gr-uhd/lib/utils.h b/gr-uhd/lib/utils.h deleted file mode 100644 index 4a05476bd..000000000 --- a/gr-uhd/lib/utils.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2010 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. - */ - -#ifndef INCLUDED_NOINST_UTILS_H -#define INCLUDED_NOINST_UTILS_H - -#include <string> - -void do_samp_rate_error_message( - double target_rate, - double actual_rate, - const std::string &xx -); - -void do_tune_freq_error_message( - double target_freq, - double actual_freq, - const std::string &xx -); - -#endif /* INCLUDED_NOINST_UTILS_H */ |