1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-04 23:40:04 +00:00

gnss-sdr now accepts a --config_file flag for specifying the configuration file:

./gnss-sdr --config_file="my_receiver.conf" 

and another --signal_source flag that, if specified, overrides the file in the configuration:

./gnss-sdr --signal_source=/path/to/file.dat

Requires gflags 1.6 or later.

git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@100 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
Carles Fernandez 2011-12-26 05:04:27 +00:00
parent 87aa9baf17
commit 27b5074152
4 changed files with 20 additions and 9 deletions

View File

@ -40,7 +40,7 @@
#include <iostream>
#include <fstream>
#include <iomanip>
#include <gflags/gflags.h>
#include <glog/log_severity.h>
#include <glog/logging.h>
@ -48,6 +48,10 @@
using google::LogMessage;
DEFINE_string(signal_source, "-",
"If defined, path to the file containing the signal samples (overrides the configuration file)");
FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_streams, unsigned int out_streams,
gr_msg_queue_sptr queue) :
@ -63,6 +67,9 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
sampling_frequency_ = configuration->property(role
+ ".sampling_frequency", 0);
filename_ = configuration->property(role + ".filename", default_filename);
// override value with commandline flag, if present
if (FLAGS_signal_source.compare("-") != 0) filename_= FLAGS_signal_source;
item_type_ = configuration->property(role + ".item_type",
default_item_type);
repeat_ = configuration->property(role + ".repeat", false);

View File

@ -48,8 +48,7 @@
using google::LogMessage;
DEFINE_string(config_file, "../conf/gnss-sdr.conf",
"Path to the file containing the configuration parameters")
;
"Path to the file containing the configuration parameters");
ControlThread::ControlThread()
{

View File

@ -63,6 +63,7 @@
using google::LogMessage;
GNSSBlockFactory::GNSSBlockFactory()
{
}
@ -76,6 +77,7 @@ GNSSBlockInterface* GNSSBlockFactory::GetSignalSource(
{
std::string default_implementation = "File_Signal_Source";
std::string implementation = configuration->property(
"SignalSource.implementation", default_implementation);

View File

@ -64,17 +64,20 @@ int main(int argc, char** argv)
+
"See COPYING file to see a copy of the General Public License\n \n");
std::cout<<"Initializing GNSS-SDR... Please wait"<<"\r\n";
google::SetUsageMessage(intro_help);
google::InitGoogleLogging(argv[0]);
google::ParseCommandLineFlags(&argc, &argv, true);
google::SetUsageMessage(intro_help);
google::SetVersionString("0.1");
google::ParseCommandLineFlags(&argc, &argv, true);
google::InitGoogleLogging(argv[0]);
std::cout<<"Initializing GNSS-SDR... Please wait"<<std::endl;
ControlThread *control_thread = new ControlThread();
control_thread->run();
delete control_thread;
std::cout<<"GNSS-SDR program ended"<<"\r\n";
//google::ShutDownCommandLineFlags();
google::ShutDownCommandLineFlags();
std::cout<<"GNSS-SDR program ended"<<std::endl;
}