diff --git a/src/algorithms/libs/gnss_sdr_flags.cc b/src/algorithms/libs/gnss_sdr_flags.cc index f13e69e5a..c5f6594bc 100644 --- a/src/algorithms/libs/gnss_sdr_flags.cc +++ b/src/algorithms/libs/gnss_sdr_flags.cc @@ -33,6 +33,9 @@ DEFINE_string(s, "-", DEFINE_string(signal_source, "-", "If defined, path to the file containing the signal samples (overrides the configuration file)."); +DEFINE_string(timestamp_source, "-", + "If defined, path to the file containing the signal timestamp data (overrides the configuration file)."); + DEFINE_bool(rf_shutdown, true, "If set to false, AD9361 RF channels are not shut down when exiting the program. Useful to leave the AD9361 configured and running."); DEFINE_int32(doppler_max, 0, "If defined, sets the maximum Doppler value in the search grid, in Hz (overrides the configuration file)."); diff --git a/src/algorithms/libs/gnss_sdr_flags.h b/src/algorithms/libs/gnss_sdr_flags.h index de3daec99..e6a185230 100644 --- a/src/algorithms/libs/gnss_sdr_flags.h +++ b/src/algorithms/libs/gnss_sdr_flags.h @@ -35,9 +35,10 @@ DECLARE_string(config_file); //!< Path to the configuration file. DECLARE_string(log_dir); //!< Path to the folder in which logging will be stored. // Declare flags for signal sources -DECLARE_string(s); //!< Path to the file containing the signal samples. -DECLARE_string(signal_source); //!< Path to the file containing the signal samples. -DECLARE_bool(rf_shutdown); //!< Shutdown RF when program exits. +DECLARE_string(s); //!< Path to the file containing the signal samples. +DECLARE_string(signal_source); //!< Path to the file containing the signal samples. +DECLARE_string(timestamp_source); //!< Path to the file containing the signal samples. +DECLARE_bool(rf_shutdown); //!< Shutdown RF when program exits. // Declare flags for acquisition blocks DECLARE_int32(doppler_max); //!< If defined, maximum Doppler value in the search grid, in Hz (overrides the configuration file). diff --git a/src/algorithms/signal_source/adapters/file_timestamp_signal_source.cc b/src/algorithms/signal_source/adapters/file_timestamp_signal_source.cc index 33bc96b10..7189024b7 100644 --- a/src/algorithms/signal_source/adapters/file_timestamp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/file_timestamp_signal_source.cc @@ -14,6 +14,7 @@ * ----------------------------------------------------------------------------- */ #include "file_timestamp_signal_source.h" +#include "gnss_sdr_flags.h" #include "gnss_sdr_string_literals.h" #include "gnss_sdr_timestamp.h" #include @@ -33,6 +34,12 @@ FileTimestampSignalSource::FileTimestampSignalSource(const ConfigurationInterfac { LOG(ERROR) << "This implementation only supports one output stream"; } + + // override value with commandline flag, if present + if (FLAGS_timestamp_source != "-") + { + timestamp_file_ = FLAGS_timestamp_source; + } }