mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-18 16:15:21 +00:00
Changes in the building system
This commit is contained in:
@@ -127,6 +127,8 @@ if(ARCH_64BITS)
|
||||
add_definitions(-DARCH_64BITS=1)
|
||||
endif(ARCH_64BITS)
|
||||
|
||||
add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
file(GLOB SIGNAL_SOURCE_ADAPTER_HEADERS "*.h")
|
||||
add_library(signal_source_adapters ${SIGNAL_SOURCE_ADAPTER_SOURCES} ${SIGNAL_SOURCE_ADAPTER_HEADERS})
|
||||
source_group(Headers FILES ${SIGNAL_SOURCE_ADAPTER_HEADERS})
|
||||
|
||||
@@ -31,9 +31,6 @@
|
||||
*/
|
||||
|
||||
#include "file_signal_source.h"
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
@@ -56,18 +53,9 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
|
||||
boost::shared_ptr<gr::msg_queue> 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 = hmpath + "/.gnss-sdr/data/my_capture.dat";
|
||||
std::string default_filename = "./example_capture.dat";
|
||||
std::string default_item_type = "short";
|
||||
std::string default_dump_filename = hmpath + "/.gnss-sdr/data/my_capture.dat";
|
||||
std::string default_dump_filename = "./my_capture.dat";
|
||||
|
||||
samples_ = configuration->property(role + ".samples", 0);
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0);
|
||||
@@ -113,32 +101,38 @@ 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/conf/gnss-sdr.conf";
|
||||
text_ = "Please modify the configuration taking the example at " + default_conf_file;
|
||||
|
||||
std::cerr
|
||||
<< "The configuration file has not been found."
|
||||
<< std::endl
|
||||
<< "Please create a configuration file based on the examples at the 'conf/' folder "
|
||||
<< std::endl
|
||||
<< "and then generate your own GNSS Software Defined Receiver by doing:"
|
||||
<< std::endl
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf"
|
||||
<< std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
text_ = "Please modify your 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 your configuration file"
|
||||
<< std::endl
|
||||
<< "and point SignalSource.filename to a valid raw data file. Then:"
|
||||
<< std::endl
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf"
|
||||
<< std::endl
|
||||
<< "Examples of configuration files available at:"
|
||||
<< std::endl
|
||||
<< GNSSSDR_INSTALL_DIR "/gnss-sdr/conf/"
|
||||
<< std::endl;
|
||||
|
||||
}
|
||||
|
||||
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
|
||||
<< text_
|
||||
<< std::endl
|
||||
<< "and point SignalSource.filename to a valid file,"
|
||||
<< std::endl
|
||||
<< "and specify your own receiver with the flag"
|
||||
<< std::endl
|
||||
<< "$ 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.";
|
||||
throw(e);
|
||||
|
||||
@@ -31,9 +31,6 @@
|
||||
*/
|
||||
|
||||
#include "nsr_file_signal_source.h"
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#include <cstdlib>
|
||||
#include <exception>
|
||||
#include <fstream>
|
||||
@@ -56,15 +53,6 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration,
|
||||
boost::shared_ptr<gr::msg_queue> 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";
|
||||
@@ -99,24 +87,22 @@ 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
|
||||
<< text_
|
||||
<< "Please modify your configuration file"
|
||||
<< std::endl
|
||||
<< "and point SignalSource.filename to a valid file,"
|
||||
<< std::endl
|
||||
<< "and specify your own receiver and source with the flag"
|
||||
<< "and point SignalSource.filename to a valid raw data file. Then:"
|
||||
<< std::endl
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf"
|
||||
<< std::endl
|
||||
<< "Examples of configuration files available at:"
|
||||
<< std::endl
|
||||
<< GNSSSDR_INSTALL_DIR "/gnss-sdr/conf/"
|
||||
<< std::endl;
|
||||
|
||||
LOG(WARNING) << "file_signal_source: Unable to open the samples file "
|
||||
<< filename_.c_str() << ", exiting the program.";
|
||||
throw(e);
|
||||
|
||||
Reference in New Issue
Block a user