mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-30 23:03:05 +00:00 
			
		
		
		
	Make it backward compatible with gflags 2.0, shipped by Debian Jessie
This commit is contained in:
		| @@ -30,6 +30,15 @@ | ||||
|  | ||||
|  | ||||
| #include <gnss_sdr_flags.h> | ||||
| #include <iostream> | ||||
|  | ||||
| static bool ValidateDopplerMax(const char* flagname, gflags::int32 value) | ||||
| { | ||||
|     if (value >= 0.0 && value < 1000000.0)   // value is ok | ||||
|         return true; | ||||
|     std::cout << "Invalid value for " << flagname << ": " << value << std::endl; | ||||
|     return false; | ||||
| } | ||||
|  | ||||
|  | ||||
| DEFINE_string(c, "-", "Path to the configuration file (if set, overrides --config_file)"); | ||||
| @@ -40,13 +49,14 @@ DEFINE_string(s, "-", | ||||
| DEFINE_string(signal_source, "-", | ||||
|         "If defined, path to the file containing the signal samples (overrides the configuration file)"); | ||||
|  | ||||
| DEFINE_uint32(doppler_max, 0, "If defined, maximum Doppler value in the search grid, in Hz (overrides the configuration file)"); | ||||
| DEFINE_int32(doppler_max, 0, "If defined, maximum Doppler value in the search grid, in Hz (overrides the configuration file)"); | ||||
| DEFINE_validator(doppler_max, &ValidateDopplerMax); | ||||
|  | ||||
| DEFINE_uint32(cn0_samples, 20, "Number of correlator outputs used for CN0 estimation"); | ||||
| DEFINE_int32(cn0_samples, 20, "Number of correlator outputs used for CN0 estimation"); | ||||
|  | ||||
| DEFINE_uint32(cn0_min, 25, "Minimum valid CN0 (in dB-Hz)"); | ||||
| DEFINE_int32(cn0_min, 25, "Minimum valid CN0 (in dB-Hz)"); | ||||
|  | ||||
| DEFINE_uint32(max_lock_fail, 50, "Number number of lock failures before dropping satellite"); | ||||
| DEFINE_int32(max_lock_fail, 50, "Number number of lock failures before dropping satellite"); | ||||
|  | ||||
| DEFINE_double(carrier_lock_th, 0.85, "Carrier lock threshold (in rad)"); | ||||
|  | ||||
|   | ||||
| @@ -34,7 +34,6 @@ | ||||
|  | ||||
| #include <gflags/gflags.h> | ||||
|  | ||||
|  | ||||
| DECLARE_string(c);                  //<! Path to the configuration file | ||||
| DECLARE_string(config_file);        //<! Path to the configuration file | ||||
|  | ||||
| @@ -45,12 +44,12 @@ DECLARE_string(s);                  //<! Path to the file containing the signal | ||||
| DECLARE_string(signal_source);      //<! Path to the file containing the signal samples | ||||
|  | ||||
| // Declare flags for acquisition blocks | ||||
| DECLARE_uint32(doppler_max);        //<!If defined, maximum Doppler value in the search grid, in Hz (overrides the configuration file) | ||||
| DECLARE_int32(doppler_max);        //<!If defined, maximum Doppler value in the search grid, in Hz (overrides the configuration file) | ||||
|  | ||||
| // Declare flags for tracking blocks | ||||
| DECLARE_uint32(cn0_samples);        //<! Number of correlator outputs used for CN0 estimation | ||||
| DECLARE_uint32(cn0_min);            //<! Minimum valid CN0 (in dB-Hz) | ||||
| DECLARE_uint32(max_lock_fail);      //<! Number number of lock failures before dropping satellite | ||||
| DECLARE_int32(cn0_samples);        //<! Number of correlator outputs used for CN0 estimation | ||||
| DECLARE_int32(cn0_min);            //<! Minimum valid CN0 (in dB-Hz) | ||||
| DECLARE_int32(max_lock_fail);      //<! Number number of lock failures before dropping satellite | ||||
| DECLARE_double(carrier_lock_th);    //<! Carrier lock threshold (in rad) | ||||
| DECLARE_double(dll_bw_hz);          //<! Bandwidth of the DLL low pass filter, in Hz (overrides the configuration file) | ||||
| DECLARE_double(pll_bw_hz);          //<! Bandwidth of the PLL low pass filter, in Hz (overrides the configuration file) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez