mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 07:13:03 +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 <iostream> | ||||||
| #include <fstream> | #include <fstream> | ||||||
| #include <iomanip> | #include <iomanip> | ||||||
|  | #include <gflags/gflags.h> | ||||||
| #include <glog/log_severity.h> | #include <glog/log_severity.h> | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
|  |  | ||||||
| @@ -48,6 +48,10 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | 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, | FileSignalSource::FileSignalSource(ConfigurationInterface* configuration, | ||||||
|         std::string role, unsigned int in_streams, unsigned int out_streams, |         std::string role, unsigned int in_streams, unsigned int out_streams, | ||||||
|         gr_msg_queue_sptr queue) : |         gr_msg_queue_sptr queue) : | ||||||
| @@ -63,6 +67,9 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration, | |||||||
|     sampling_frequency_ = configuration->property(role |     sampling_frequency_ = configuration->property(role | ||||||
|             + ".sampling_frequency", 0); |             + ".sampling_frequency", 0); | ||||||
|     filename_ = configuration->property(role + ".filename", default_filename); |     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", |     item_type_ = configuration->property(role + ".item_type", | ||||||
|             default_item_type); |             default_item_type); | ||||||
|     repeat_ = configuration->property(role + ".repeat", false); |     repeat_ = configuration->property(role + ".repeat", false); | ||||||
|   | |||||||
| @@ -48,8 +48,7 @@ | |||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
| DEFINE_string(config_file, "../conf/gnss-sdr.conf", | 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() | ControlThread::ControlThread() | ||||||
| { | { | ||||||
|   | |||||||
| @@ -63,6 +63,7 @@ | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
|  |  | ||||||
| GNSSBlockFactory::GNSSBlockFactory() | GNSSBlockFactory::GNSSBlockFactory() | ||||||
| { | { | ||||||
| } | } | ||||||
| @@ -76,6 +77,7 @@ GNSSBlockInterface* GNSSBlockFactory::GetSignalSource( | |||||||
| { | { | ||||||
|  |  | ||||||
|     std::string default_implementation = "File_Signal_Source"; |     std::string default_implementation = "File_Signal_Source"; | ||||||
|  |  | ||||||
|     std::string implementation = configuration->property( |     std::string implementation = configuration->property( | ||||||
|             "SignalSource.implementation", default_implementation); |             "SignalSource.implementation", default_implementation); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -64,17 +64,20 @@ int main(int argc, char** argv) | |||||||
|             + |             + | ||||||
|             "See COPYING file to see a copy of the General Public License\n \n"); |             "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(); |     ControlThread *control_thread = new ControlThread(); | ||||||
|  |  | ||||||
|     control_thread->run(); |     control_thread->run(); | ||||||
|  |  | ||||||
|     delete control_thread; |     delete control_thread; | ||||||
|     std::cout<<"GNSS-SDR program ended"<<"\r\n"; |  | ||||||
|     //google::ShutDownCommandLineFlags(); |     google::ShutDownCommandLineFlags(); | ||||||
|  |     std::cout<<"GNSS-SDR program ended"<<std::endl; | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez