From b25e610868752ac55b6f8e0c05bc2e0f7b18e223 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 15 Jul 2010 22:59:37 -0700 Subject: usrp: added functions to derive tuned frequency, tweaked logic, added unit test --- host/lib/types.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'host/lib/types.cpp') diff --git a/host/lib/types.cpp b/host/lib/types.cpp index e0ce61058..fdc435fef 100644 --- a/host/lib/types.cpp +++ b/host/lib/types.cpp @@ -60,14 +60,17 @@ freq_range_t::freq_range_t(double min, double max): /*********************************************************************** * tune result **********************************************************************/ -tune_result_t::tune_result_t(void): - target_inter_freq(0.0), - actual_inter_freq(0.0), - target_dsp_freq(0.0), - actual_dsp_freq(0.0), - spectrum_inverted(false) -{ - /* NOP */ +std::string tune_result_t::to_pp_string(void) const{ + return str(boost::format( + "Tune Result:\n" + " Target Intermediate Freq: %f (MHz)\n" + " Actual Intermediate Freq: %f (MHz)\n" + " Target DSP Freq Shift: %f (MHz)\n" + " Actual DSP Freq Shift: %f (MHz)\n" + ) + % (target_inter_freq/1e6) % (actual_inter_freq/1e6) + % (target_dsp_freq/1e6) % (actual_dsp_freq/1e6) + ); } /*********************************************************************** -- cgit v1.2.3