aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/types.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-07-15 22:59:37 -0700
committerJosh Blum <josh@joshknows.com>2010-07-16 16:51:30 -0700
commitb25e610868752ac55b6f8e0c05bc2e0f7b18e223 (patch)
tree50ca897af5ab54b3d104a03fc9ec11058bfea55d /host/lib/types.cpp
parent2ff23daec6e82661499a7cbbdea8d2ef7cc8711b (diff)
downloaduhd-b25e610868752ac55b6f8e0c05bc2e0f7b18e223.tar.gz
uhd-b25e610868752ac55b6f8e0c05bc2e0f7b18e223.tar.bz2
uhd-b25e610868752ac55b6f8e0c05bc2e0f7b18e223.zip
usrp: added functions to derive tuned frequency, tweaked logic, added unit test
Diffstat (limited to 'host/lib/types.cpp')
-rw-r--r--host/lib/types.cpp19
1 files changed, 11 insertions, 8 deletions
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)
+ );
}
/***********************************************************************