diff --git a/src/algorithms/signal_source/adapters/file_signal_source.cc b/src/algorithms/signal_source/adapters/file_signal_source.cc index d9faf8fab..bb419224a 100644 --- a/src/algorithms/signal_source/adapters/file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/file_signal_source.cc @@ -118,14 +118,12 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration, if (filename_.compare(default_filename) == 0) { default_conf_file = hmpath + "/.gnss-sdr/conf/gnss-sdr.conf"; - text_ = "Please modify the configuration example at " + default_conf_file; + text_ = "Please modify the configuration taking the example at " + default_conf_file; } else { - default_conf_file = "conf/gnss-sdr.conf"; - text_ = "Please modify the configuration at " + - default_conf_file +" (the default configuration file)"; + text_ = "Please modify your configuration file"; //+ } std::cerr @@ -137,12 +135,12 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration, << std::endl << "and point SignalSource.filename to a valid file," << std::endl - << "or specify your own receiver and source with the flag" + << "and specify your own receiver with the flag" << std::endl - <<"gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" + << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" << std::endl; LOG(INFO) << "file_signal_source: Unable to open the samples file " - << filename_.c_str() << ", exiting the program."; + << filename_.c_str() << ", exiting the program."; throw(e); } diff --git a/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc b/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc index 8889968c7..ff5acbe44 100644 --- a/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc @@ -31,6 +31,10 @@ */ #include "nsr_file_signal_source.h" +#include +#include +#include +#include #include #include #include @@ -52,6 +56,15 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration, boost::shared_ptr queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) { + + char* userHomePath; + userHomePath = getenv ("HOME"); + if (userHomePath == NULL) + { + struct passwd *pw = getpwuid(getuid()); + userHomePath = pw->pw_dir; + } + std::string hmpath(userHomePath); std::string default_filename = "../data/my_capture.dat"; std::string default_item_type = "byte"; std::string default_dump_filename = "../data/my_capture_dump.dat"; @@ -86,19 +99,23 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration, } catch (const std::exception &e) { + std::string default_conf_file; + std::string text_; + default_conf_file = hmpath + "/.gnss-sdr/conf/gnss-sdr_GPS_L1_nsr.conf"; + text_ = "Please modify the configuration taking the example at " + default_conf_file; + std::cerr << "The receiver was configured to work with a file signal source " << std::endl << "but the specified file is unreachable by GNSS-SDR." << std::endl - << "Please modify the configuration at " - << "conf/gnss-sdr.conf (the default configuration file)" + << text_ << std::endl << "and point SignalSource.filename to a valid file," << std::endl - << "or specify your own receiver and source with the flag" + << "and specify your own receiver and source with the flag" << std::endl - <<"gnss-sdr --config_file=my_GNSS_SDR_configuration.conf" + << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" << std::endl; LOG(WARNING) << "file_signal_source: Unable to open the samples file " << filename_.c_str() << ", exiting the program.";