root / host / lib / types / tune.cpp @ ef8d7967
History | View | Annotate | Download (1.63 KB)
| 1 |
//
|
|---|---|
| 2 |
// Copyright 2010-2011 Ettus Research LLC
|
| 3 |
//
|
| 4 |
// This program is free software: you can redistribute it and/or modify
|
| 5 |
// it under the terms of the GNU General Public License as published by
|
| 6 |
// the Free Software Foundation, either version 3 of the License, or
|
| 7 |
// (at your option) any later version.
|
| 8 |
//
|
| 9 |
// This program is distributed in the hope that it will be useful,
|
| 10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 12 |
// GNU General Public License for more details.
|
| 13 |
//
|
| 14 |
// You should have received a copy of the GNU General Public License
|
| 15 |
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 16 |
//
|
| 17 |
|
| 18 |
#include <uhd/types/tune_request.hpp> |
| 19 |
#include <uhd/types/tune_result.hpp> |
| 20 |
#include <boost/format.hpp> |
| 21 |
|
| 22 |
using namespace uhd; |
| 23 |
|
| 24 |
tune_request_t::tune_request_t(double target_freq):
|
| 25 |
target_freq(target_freq), |
| 26 |
inter_freq_policy(POLICY_AUTO), |
| 27 |
dsp_freq_policy(POLICY_AUTO) |
| 28 |
{
|
| 29 |
/* NOP */
|
| 30 |
} |
| 31 |
|
| 32 |
tune_request_t::tune_request_t(double target_freq, double lo_off): |
| 33 |
target_freq(target_freq), |
| 34 |
inter_freq_policy(POLICY_MANUAL), |
| 35 |
inter_freq(target_freq + lo_off), |
| 36 |
dsp_freq_policy(POLICY_AUTO) |
| 37 |
{
|
| 38 |
/* NOP */
|
| 39 |
} |
| 40 |
|
| 41 |
std::string tune_result_t::to_pp_string(void) const{ |
| 42 |
return str(boost::format(
|
| 43 |
"Tune Result:\n"
|
| 44 |
" Target Intermediate Freq: %f (MHz)\n"
|
| 45 |
" Actual Intermediate Freq: %f (MHz)\n"
|
| 46 |
" Target DSP Freq Shift: %f (MHz)\n"
|
| 47 |
" Actual DSP Freq Shift: %f (MHz)\n"
|
| 48 |
) |
| 49 |
% (target_inter_freq/1e6) % (actual_inter_freq/1e6) |
| 50 |
% (target_dsp_freq/1e6) % (actual_dsp_freq/1e6) |
| 51 |
); |
| 52 |
} |