1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-13 21:57:14 +00:00

Changing building system: 'cmake && make && sudo make install'

This commit is contained in:
Carles Fernandez
2014-11-04 21:28:01 +01:00
parent 3f4afcb756
commit 74cb7ff362
4 changed files with 56 additions and 10 deletions

View File

@@ -31,6 +31,10 @@
*/
#include "file_signal_source.h"
#include <unistd.h>
#include <sys/types.h>
#include <pwd.h>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <iomanip>
@@ -52,9 +56,18 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
boost::shared_ptr<gr::msg_queue> queue) :
role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue)
{
std::string default_filename = "../data/my_capture.dat";
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 = hmpath + "/.gnss-sdr/data/my_capture.dat";
std::string default_item_type = "short";
std::string default_dump_filename = "../data/my_capture_dump.dat";
std::string default_dump_filename = hmpath + "/.gnss-sdr/data/my_capture.dat";
samples_ = configuration->property(role + ".samples", 0);
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0);
@@ -100,19 +113,33 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
}
catch (const std::exception &e)
{
std::string default_conf_file;
std::string text_;
if (filename_.compare(default_filename) == 0)
{
default_conf_file = hmpath + "/.gnss-sdr/" + GNSS_SDR_VERSION + "/conf/gnss-sdr.conf";
text_ = "Please modify the configuration 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)";
}
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"
<< 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(INFO) << "file_signal_source: Unable to open the samples file "
<< filename_.c_str() << ", exiting the program.";