aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/utils
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2020-03-05 12:08:56 -0800
committerAaron Rossetto <aaron.rossetto@ni.com>2020-04-02 11:55:17 -0500
commita1f96194696494b756d691ff54e384a1ce478fc2 (patch)
tree1a1d480b5e35a239c5599ebcda1984e29bd0dd55 /host/lib/utils
parent3fe5ccf700a0c6f27dca9511386460194dcc593c (diff)
downloaduhd-a1f96194696494b756d691ff54e384a1ce478fc2.tar.gz
uhd-a1f96194696494b756d691ff54e384a1ce478fc2.tar.bz2
uhd-a1f96194696494b756d691ff54e384a1ce478fc2.zip
uhd: cal: Use usrp::cal::database instead of CSV files
Now that we have cal::iq_cal and cal::database, there's no need to manually wrangle CSV files for calibration data. This commit replaces all CSV operations with cal::database calls and uses cal::iq_cal as a container. CSV files can still be read, but are considered deprecated.
Diffstat (limited to 'host/lib/utils')
-rw-r--r--host/lib/utils/paths.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp
index ccf52f257..3ecd5fe38 100644
--- a/host/lib/utils/paths.cpp
+++ b/host/lib/utils/paths.cpp
@@ -8,6 +8,7 @@
#include <uhd/config.hpp>
#include <uhd/exception.hpp>
#include <uhd/utils/paths.hpp>
+#include <uhd/utils/log.hpp>
#include <uhdlib/utils/paths.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/version.hpp>
@@ -189,6 +190,31 @@ std::string uhd::get_app_path(void)
return uhd::get_tmp_path();
}
+// Only used for deprecated CSV file loader. Delete this once CSV support is
+// removed.
+std::string uhd::get_appdata_path(void)
+{
+ const std::string uhdcalib_path = get_env_var("UHD_CONFIG_DIR");
+ if (not uhdcalib_path.empty()) {
+ UHD_LOG_WARNING("UHD",
+ "The environment variable UHD_CONFIG_DIR is deprecated. Refer to "
+ "https://files.ettus.com/manual/page_calibration.html for how to store "
+ "calibration data.");
+ return uhdcalib_path;
+ }
+
+ const std::string appdata_path = get_env_var("APPDATA");
+ if (not appdata_path.empty())
+ return appdata_path;
+
+ const std::string home_path = get_env_var("HOME");
+ if (not home_path.empty())
+ return home_path;
+
+ return uhd::get_tmp_path();
+}
+
+
#if BOOST_VERSION >= 106100
std::string uhd::get_pkg_path(void)
{