mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-07 10:43:58 +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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user