mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-10-22 02:57:41 +00:00
Improve const correctness
Remove all buprone conversions from signal_generator module
This commit is contained in:
@@ -48,12 +48,12 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con
|
||||
const std::string &role, unsigned int in_stream, unsigned int out_stream,
|
||||
Concurrent_Queue<pmt::pmt_t> *queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
std::string default_gain_mode("slow_attack");
|
||||
double default_tx_attenuation_db = -10.0;
|
||||
double default_manual_gain_rx1 = 64.0;
|
||||
double default_manual_gain_rx2 = 64.0;
|
||||
uint64_t default_bandwidth = 12500000;
|
||||
std::string default_rf_port_select("A_BALANCED");
|
||||
const std::string default_gain_mode("slow_attack");
|
||||
const double default_tx_attenuation_db = -10.0;
|
||||
const double default_manual_gain_rx1 = 64.0;
|
||||
const double default_manual_gain_rx2 = 64.0;
|
||||
const uint64_t default_bandwidth = 12500000;
|
||||
const std::string default_rf_port_select("A_BALANCED");
|
||||
freq_ = configuration->property(role + ".freq", static_cast<uint64_t>(GPS_L1_FREQ_HZ));
|
||||
sample_rate_ = configuration->property(role + ".sampling_frequency", static_cast<uint64_t>(12500000));
|
||||
bandwidth_ = configuration->property(role + ".bandwidth", default_bandwidth);
|
||||
@@ -91,7 +91,7 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con
|
||||
rf_shutdown_ = configuration->property(role + ".rf_shutdown", FLAGS_rf_shutdown);
|
||||
|
||||
// turn switch to A/D position
|
||||
std::string default_device_name = "/dev/uio1";
|
||||
const std::string default_device_name("/dev/uio1");
|
||||
std::string device_name = configuration->property(role + ".devicename", default_device_name);
|
||||
switch_position = configuration->property(role + ".switch_position", 0);
|
||||
if (switch_position != 0 && switch_position != 2)
|
||||
@@ -111,7 +111,7 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con
|
||||
if (switch_position == 0) // Inject file(s) via DMA
|
||||
{
|
||||
enable_DMA_ = true;
|
||||
std::string empty_string;
|
||||
const std::string empty_string;
|
||||
filename_rx1 = configuration->property(role + ".filename", empty_string);
|
||||
|
||||
// override value with commandline flag, if present
|
||||
@@ -129,12 +129,12 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con
|
||||
filename_rx1 = configuration->property(role + ".filename0", empty_string);
|
||||
filename_rx2 = configuration->property(role + ".filename1", empty_string);
|
||||
}
|
||||
int l1_band = configuration->property("Channels_1C.count", 0) +
|
||||
configuration->property("Channels_1B.count", 0);
|
||||
const int l1_band = configuration->property("Channels_1C.count", 0) +
|
||||
configuration->property("Channels_1B.count", 0);
|
||||
|
||||
int l2_band = configuration->property("Channels_L5.count", 0) +
|
||||
configuration->property("Channels_5X.count", 0) +
|
||||
configuration->property("Channels_2S.count", 0);
|
||||
const int l2_band = configuration->property("Channels_L5.count", 0) +
|
||||
configuration->property("Channels_5X.count", 0) +
|
||||
configuration->property("Channels_2S.count", 0);
|
||||
|
||||
if (l1_band != 0)
|
||||
{
|
||||
@@ -295,9 +295,9 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con
|
||||
enable_dynamic_bit_selection_ = configuration->property(role + ".enable_dynamic_bit_selection", true);
|
||||
if (enable_dynamic_bit_selection_)
|
||||
{
|
||||
std::string dynamic_bit_selection_default_device_name1 = "/dev/uio48";
|
||||
const std::string dynamic_bit_selection_default_device_name1("/dev/uio48");
|
||||
std::string device_name1 = configuration->property(role + ".dyn_bits_sel_devicename", dynamic_bit_selection_default_device_name1);
|
||||
std::string dynamic_bit_selection_default_device_name2 = "/dev/uio49";
|
||||
const std::string dynamic_bit_selection_default_device_name2("/dev/uio49");
|
||||
std::string device_name2 = configuration->property(role + ".dyn_bits_sel_devicename", dynamic_bit_selection_default_device_name2);
|
||||
dynamic_bit_selection_fpga = std::make_shared<Fpga_dynamic_bit_selection>(device_name1, device_name2);
|
||||
thread_dynamic_bit_selection = std::thread([&] { run_dynamic_bit_selection_process(); });
|
||||
@@ -573,7 +573,7 @@ void Ad9361FpgaSignalSource::run_DMA_process(const std::string &FreqBand, const
|
||||
int num_bytes_sent = write(tx_fd, input_samples_dma.data(), nread_elements * 2);
|
||||
if (num_bytes_sent != num_transferred_bytes)
|
||||
{
|
||||
std::cerr << "Error: DMA could not send all the required samples \n";
|
||||
std::cerr << "Error: DMA could not send all the required samples\n";
|
||||
}
|
||||
|
||||
// Throttle the DMA
|
||||
@@ -607,6 +607,7 @@ void Ad9361FpgaSignalSource::run_DMA_process(const std::string &FreqBand, const
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Ad9361FpgaSignalSource::run_dynamic_bit_selection_process(void)
|
||||
{
|
||||
bool dynamic_bit_selection_active = true;
|
||||
@@ -625,6 +626,7 @@ void Ad9361FpgaSignalSource::run_dynamic_bit_selection_process(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Ad9361FpgaSignalSource::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (top_block)
|
||||
|
@@ -35,12 +35,12 @@ FileSignalSource::FileSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_streams, unsigned int out_streams,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
std::string default_filename = "./example_capture.dat";
|
||||
std::string default_item_type = "short";
|
||||
std::string default_dump_filename = "./my_capture.dat";
|
||||
const std::string default_filename("./example_capture.dat");
|
||||
const std::string default_item_type("short");
|
||||
const std::string default_dump_filename("./my_capture.dat");
|
||||
|
||||
const double default_seconds_to_skip = 0.0;
|
||||
|
||||
double default_seconds_to_skip = 0.0;
|
||||
size_t header_size = 0;
|
||||
samples_ = configuration->property(role + ".samples", static_cast<uint64_t>(0));
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", static_cast<int64_t>(0));
|
||||
filename_ = configuration->property(role + ".filename", default_filename);
|
||||
@@ -61,8 +61,8 @@ FileSignalSource::FileSignalSource(const ConfigurationInterface* configuration,
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||
enable_throttle_control_ = configuration->property(role + ".enable_throttle_control", false);
|
||||
|
||||
double seconds_to_skip = configuration->property(role + ".seconds_to_skip", default_seconds_to_skip);
|
||||
header_size = configuration->property(role + ".header_size", 0);
|
||||
const double seconds_to_skip = configuration->property(role + ".seconds_to_skip", default_seconds_to_skip);
|
||||
const size_t header_size = configuration->property(role + ".header_size", 0);
|
||||
int64_t samples_to_skip = 0;
|
||||
|
||||
bool is_complex = false;
|
||||
@@ -131,32 +131,21 @@ FileSignalSource::FileSignalSource(const ConfigurationInterface* configuration,
|
||||
if (filename_ == default_filename)
|
||||
{
|
||||
std::cerr
|
||||
<< "The configuration file has not been found."
|
||||
<< '\n'
|
||||
<< "Please create a configuration file based on the examples at the 'conf/' folder "
|
||||
<< '\n'
|
||||
<< "and then generate your own GNSS Software Defined Receiver by doing:"
|
||||
<< '\n'
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf"
|
||||
<< '\n';
|
||||
<< "The configuration file has not been found.\n"
|
||||
<< "Please create a configuration file based on the examples at the 'conf/' folder\n"
|
||||
<< "and then generate your own GNSS Software Defined Receiver by doing:\n"
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr
|
||||
<< "The receiver was configured to work with a file signal source "
|
||||
<< '\n'
|
||||
<< "but the specified file is unreachable by GNSS-SDR."
|
||||
<< '\n'
|
||||
<< "Please modify your configuration file"
|
||||
<< '\n'
|
||||
<< "and point SignalSource.filename to a valid raw data file. Then:"
|
||||
<< '\n'
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf"
|
||||
<< '\n'
|
||||
<< "Examples of configuration files available at:"
|
||||
<< '\n'
|
||||
<< GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/"
|
||||
<< '\n';
|
||||
<< "The receiver was configured to work with a file signal source\n"
|
||||
<< "but the specified file is unreachable by GNSS-SDR.\n"
|
||||
<< "Please modify your configuration file\n"
|
||||
<< "and point SignalSource.filename to a valid raw data file. Then:\n"
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf\n"
|
||||
<< "Examples of configuration files available at:\n"
|
||||
<< GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/\n";
|
||||
}
|
||||
|
||||
LOG(INFO) << "file_signal_source: Unable to open the samples file "
|
||||
@@ -193,15 +182,14 @@ FileSignalSource::FileSignalSource(const ConfigurationInterface* configuration,
|
||||
|
||||
if (size > 0)
|
||||
{
|
||||
int64_t bytes_to_skip = samples_to_skip * item_size_;
|
||||
int64_t bytes_to_process = static_cast<int64_t>(size) - bytes_to_skip;
|
||||
const int64_t bytes_to_skip = samples_to_skip * item_size_;
|
||||
const int64_t bytes_to_process = static_cast<int64_t>(size) - bytes_to_skip;
|
||||
samples_ = floor(static_cast<double>(bytes_to_process) / static_cast<double>(item_size_) - ceil(0.002 * static_cast<double>(sampling_frequency_))); // process all the samples available in the file excluding at least the last 1 ms
|
||||
}
|
||||
}
|
||||
|
||||
CHECK(samples_ > 0) << "File does not contain enough samples to process.";
|
||||
double signal_duration_s;
|
||||
signal_duration_s = static_cast<double>(samples_) * (1 / static_cast<double>(sampling_frequency_));
|
||||
double signal_duration_s = static_cast<double>(samples_) * (1 / static_cast<double>(sampling_frequency_));
|
||||
|
||||
if (is_complex)
|
||||
{
|
||||
|
@@ -33,10 +33,10 @@ FlexibandSignalSource::FlexibandSignalSource(const ConfigurationInterface* confi
|
||||
unsigned int out_stream,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
std::string default_item_type = "byte";
|
||||
const std::string default_item_type("byte");
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
|
||||
std::string default_firmware_file = "flexiband_I-1b.bit";
|
||||
const std::string default_firmware_file("flexiband_I-1b.bit");
|
||||
firmware_filename_ = configuration->property(role + ".firmware_file", default_firmware_file);
|
||||
|
||||
gain1_ = configuration->property(role + ".gain1", 0); // check gain DAC values for Flexiband frontend!
|
||||
@@ -45,7 +45,7 @@ FlexibandSignalSource::FlexibandSignalSource(const ConfigurationInterface* confi
|
||||
|
||||
AGC_ = configuration->property(role + ".AGC", true); // enabled AGC by default
|
||||
flag_read_file = configuration->property(role + ".flag_read_file", false); // disable read samples from file by default
|
||||
std::string default_signal_file = "flexiband_frame_samples.bin";
|
||||
const std::string default_signal_file("flexiband_frame_samples.bin");
|
||||
signal_file = configuration->property(role + ".signal_file", default_signal_file);
|
||||
|
||||
usb_packet_buffer_size_ = configuration->property(role + ".usb_packet_buffer", 128);
|
||||
|
@@ -39,8 +39,8 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(const ConfigurationInterface *configu
|
||||
{
|
||||
const std::string default_item_type("gr_complex");
|
||||
const std::string default_dump_file("./data/signal_source.dat");
|
||||
std::string default_gain_mode("slow_attack");
|
||||
double default_tx_attenuation_db = -10.0;
|
||||
const std::string default_gain_mode("slow_attack");
|
||||
const double default_tx_attenuation_db = -10.0;
|
||||
uri_ = configuration->property(role + ".device_address", std::string("192.168.2.1"));
|
||||
freq_ = configuration->property(role + ".freq", static_cast<uint64_t>(GPS_L1_FREQ_HZ));
|
||||
sample_rate_ = configuration->property(role + ".sampling_frequency", static_cast<uint64_t>(2600000));
|
||||
|
@@ -30,8 +30,8 @@ Gn3sSignalSource::Gn3sSignalSource(const ConfigurationInterface* configuration,
|
||||
unsigned int out_stream,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
std::string default_item_type = "short";
|
||||
std::string default_dump_file = "./data/gn3s_source.dat";
|
||||
const std::string default_item_type("short");
|
||||
const std::string default_dump_file("./data/gn3s_source.dat");
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
|
||||
|
@@ -29,14 +29,14 @@ LabsatSignalSource::LabsatSignalSource(const ConfigurationInterface* configurati
|
||||
const std::string& role, unsigned int in_stream, unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
const std::string default_item_type("gr_complex");
|
||||
std::string default_dump_file = "./labsat_output.dat";
|
||||
const std::string default_dump_file("./labsat_output.dat");
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
|
||||
|
||||
int channel_selector = configuration->property(role + ".selected_channel", 1);
|
||||
const int channel_selector = configuration->property(role + ".selected_channel", 1);
|
||||
|
||||
std::string default_filename = "./example_capture.LS3";
|
||||
const std::string default_filename("./example_capture.LS3");
|
||||
filename_ = configuration->property(role + ".filename", default_filename);
|
||||
|
||||
if (item_type_ == "gr_complex")
|
||||
|
@@ -34,12 +34,11 @@ MultichannelFileSignalSource::MultichannelFileSignalSource(const ConfigurationIn
|
||||
const std::string& role, unsigned int in_streams, unsigned int out_streams,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
std::string default_filename = "./example_capture.dat";
|
||||
std::string default_item_type = "short";
|
||||
std::string default_dump_filename = "./my_capture.dat";
|
||||
const std::string default_filename("./example_capture.dat");
|
||||
const std::string default_item_type("short");
|
||||
const std::string default_dump_filename("./my_capture.dat");
|
||||
|
||||
double default_seconds_to_skip = 0.0;
|
||||
size_t header_size = 0;
|
||||
const double default_seconds_to_skip = 0.0;
|
||||
samples_ = configuration->property(role + ".samples", static_cast<uint64_t>(0));
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", static_cast<int64_t>(0));
|
||||
n_channels_ = configuration->property(role + ".total_channels", 1);
|
||||
@@ -53,8 +52,8 @@ MultichannelFileSignalSource::MultichannelFileSignalSource(const ConfigurationIn
|
||||
repeat_ = configuration->property(role + ".repeat", false);
|
||||
enable_throttle_control_ = configuration->property(role + ".enable_throttle_control", false);
|
||||
|
||||
double seconds_to_skip = configuration->property(role + ".seconds_to_skip", default_seconds_to_skip);
|
||||
header_size = configuration->property(role + ".header_size", 0);
|
||||
const double seconds_to_skip = configuration->property(role + ".seconds_to_skip", default_seconds_to_skip);
|
||||
size_t header_size = configuration->property(role + ".header_size", 0);
|
||||
int64_t samples_to_skip = 0;
|
||||
|
||||
bool is_complex = false;
|
||||
@@ -126,32 +125,21 @@ MultichannelFileSignalSource::MultichannelFileSignalSource(const ConfigurationIn
|
||||
if (filename_vec_.at(0) == default_filename)
|
||||
{
|
||||
std::cerr
|
||||
<< "The configuration file has not been found."
|
||||
<< '\n'
|
||||
<< "Please create a configuration file based on the examples at the 'conf/' folder "
|
||||
<< '\n'
|
||||
<< "and then generate your own GNSS Software Defined Receiver by doing:"
|
||||
<< '\n'
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf"
|
||||
<< '\n';
|
||||
<< "The configuration file has not been found.\n"
|
||||
<< "Please create a configuration file based on the examples at the 'conf/' folder\n"
|
||||
<< "and then generate your own GNSS Software Defined Receiver by doing:\n"
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr
|
||||
<< "The receiver was configured to work with a file signal source "
|
||||
<< '\n'
|
||||
<< "but the specified file is unreachable by GNSS-SDR."
|
||||
<< '\n'
|
||||
<< "Please modify your configuration file"
|
||||
<< '\n'
|
||||
<< "and point SignalSource.filename to a valid raw data file. Then:"
|
||||
<< '\n'
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf"
|
||||
<< '\n'
|
||||
<< "Examples of configuration files available at:"
|
||||
<< '\n'
|
||||
<< GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/"
|
||||
<< '\n';
|
||||
<< "The receiver was configured to work with a file signal source\n"
|
||||
<< "but the specified file is unreachable by GNSS-SDR.\n"
|
||||
<< "Please modify your configuration file\n"
|
||||
<< "and point SignalSource.filename to a valid raw data file. Then:\n"
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf\n"
|
||||
<< "Examples of configuration files available at:\n"
|
||||
<< GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/\n";
|
||||
}
|
||||
|
||||
LOG(INFO) << "file_signal_source: Unable to open the samples file "
|
||||
@@ -194,8 +182,7 @@ MultichannelFileSignalSource::MultichannelFileSignalSource(const ConfigurationIn
|
||||
}
|
||||
|
||||
CHECK(samples_ > 0) << "File does not contain enough samples to process.";
|
||||
double signal_duration_s;
|
||||
signal_duration_s = static_cast<double>(samples_) * (1 / static_cast<double>(sampling_frequency_));
|
||||
double signal_duration_s = static_cast<double>(samples_) * (1 / static_cast<double>(sampling_frequency_));
|
||||
|
||||
if (is_complex)
|
||||
{
|
||||
|
@@ -35,9 +35,9 @@ NsrFileSignalSource::NsrFileSignalSource(const ConfigurationInterface* configura
|
||||
const std::string& role, unsigned int in_streams, unsigned int out_streams,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
std::string default_filename = "../data/my_capture.dat";
|
||||
std::string default_item_type = "byte";
|
||||
std::string default_dump_filename = "../data/my_capture_dump.dat";
|
||||
const std::string default_filename("../data/my_capture.dat");
|
||||
const std::string default_item_type("byte");
|
||||
const std::string default_dump_filename("../data/my_capture_dump.dat");
|
||||
|
||||
samples_ = configuration->property(role + ".samples", static_cast<uint64_t>(0));
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", static_cast<int64_t>(0));
|
||||
@@ -76,20 +76,13 @@ NsrFileSignalSource::NsrFileSignalSource(const ConfigurationInterface* configura
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr
|
||||
<< "The receiver was configured to work with a file signal source "
|
||||
<< '\n'
|
||||
<< "but the specified file is unreachable by GNSS-SDR."
|
||||
<< '\n'
|
||||
<< "Please modify your configuration file"
|
||||
<< '\n'
|
||||
<< "and point SignalSource.filename to a valid raw data file. Then:"
|
||||
<< '\n'
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf"
|
||||
<< '\n'
|
||||
<< "Examples of configuration files available at:"
|
||||
<< '\n'
|
||||
<< GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/"
|
||||
<< '\n';
|
||||
<< "The receiver was configured to work with a file signal source\n"
|
||||
<< "but the specified file is unreachable by GNSS-SDR.\n"
|
||||
<< "Please modify your configuration file\n"
|
||||
<< "and point SignalSource.filename to a valid raw data file. Then:\n"
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf\n"
|
||||
<< "Examples of configuration files available at:\n"
|
||||
<< GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/\n";
|
||||
|
||||
LOG(WARNING) << "file_signal_source: Unable to open the samples file "
|
||||
<< filename_.c_str() << ", exiting the program.";
|
||||
@@ -132,8 +125,7 @@ NsrFileSignalSource::NsrFileSignalSource(const ConfigurationInterface* configura
|
||||
}
|
||||
|
||||
CHECK(samples_ > 0) << "File does not contain enough samples to process.";
|
||||
double signal_duration_s;
|
||||
signal_duration_s = static_cast<double>(samples_) * (1 / static_cast<double>(sampling_frequency_));
|
||||
const double signal_duration_s = static_cast<double>(samples_) * (1 / static_cast<double>(sampling_frequency_));
|
||||
LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
|
||||
std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]\n";
|
||||
|
||||
|
@@ -34,7 +34,7 @@ OsmosdrSignalSource::OsmosdrSignalSource(const ConfigurationInterface* configura
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
// DUMP PARAMETERS
|
||||
std::string empty;
|
||||
const std::string empty;
|
||||
const std::string default_dump_file("./data/signal_source.dat");
|
||||
const std::string default_item_type("gr_complex");
|
||||
samples_ = configuration->property(role + ".samples", static_cast<int64_t>(0));
|
||||
|
@@ -33,7 +33,7 @@ PlutosdrSignalSource::PlutosdrSignalSource(const ConfigurationInterface* configu
|
||||
{
|
||||
const std::string default_item_type("gr_complex");
|
||||
const std::string default_dump_file("./data/signal_source.dat");
|
||||
std::string default_gain_mode("slow_attack");
|
||||
const std::string default_gain_mode("slow_attack");
|
||||
uri_ = configuration->property(role + ".device_address", std::string("192.168.2.1"));
|
||||
freq_ = configuration->property(role + ".freq", static_cast<uint64_t>(GPS_L1_FREQ_HZ));
|
||||
sample_rate_ = configuration->property(role + ".sampling_frequency", static_cast<uint64_t>(3000000));
|
||||
|
@@ -30,27 +30,23 @@ RawArraySignalSource::RawArraySignalSource(const ConfigurationInterface* configu
|
||||
std::string role, unsigned int in_stream, unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
const std::string default_item_type("gr_complex");
|
||||
std::string default_dump_file = "./data/raw_array_source.dat";
|
||||
const std::string default_dump_file("./data/raw_array_source.dat");
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
|
||||
// dump_ = configuration->property(role + ".dump", false);
|
||||
// dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
|
||||
dump_ = false;
|
||||
|
||||
std::string default_ethernet_dev = "eth0";
|
||||
const std::string default_ethernet_dev("eth0");
|
||||
eth_device_ = configuration->property(role + ".ethernet_dev", default_ethernet_dev);
|
||||
|
||||
int channels_;
|
||||
channels_ = configuration->property(role + ".channels", 8);
|
||||
int channels_ = configuration->property(role + ".channels", 8);
|
||||
|
||||
int snapshots_per_frame_;
|
||||
snapshots_per_frame_ = configuration->property(role + ".snapshots_per_frame", 80);
|
||||
int snapshots_per_frame_ = configuration->property(role + ".snapshots_per_frame", 80);
|
||||
|
||||
int inter_frame_delay_;
|
||||
inter_frame_delay_ = configuration->property(role + ".inter_frame_delay", 10);
|
||||
int inter_frame_delay_ = configuration->property(role + ".inter_frame_delay", 10);
|
||||
|
||||
int sampling_freq_;
|
||||
sampling_freq_ = configuration->property(role + ".sampling_freq", 5000000);
|
||||
int sampling_freq_ = configuration->property(role + ".sampling_freq", 5000000);
|
||||
|
||||
if (item_type_ == "gr_complex")
|
||||
{
|
||||
|
@@ -34,9 +34,9 @@ SpirFileSignalSource::SpirFileSignalSource(const ConfigurationInterface* configu
|
||||
const std::string& role, unsigned int in_streams, unsigned int out_streams,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
std::string default_filename = "../data/my_capture.dat";
|
||||
std::string default_item_type = "int";
|
||||
std::string default_dump_filename = "../data/my_capture_dump.dat";
|
||||
const std::string default_filename("../data/my_capture.dat");
|
||||
const std::string default_item_type("int");
|
||||
const std::string default_dump_filename("../data/my_capture_dump.dat");
|
||||
|
||||
samples_ = configuration->property(role + ".samples", static_cast<uint64_t>(0));
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", static_cast<int64_t>(0));
|
||||
@@ -75,20 +75,13 @@ SpirFileSignalSource::SpirFileSignalSource(const ConfigurationInterface* configu
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr
|
||||
<< "The receiver was configured to work with a file signal source "
|
||||
<< '\n'
|
||||
<< "but the specified file is unreachable by GNSS-SDR."
|
||||
<< '\n'
|
||||
<< "Please modify your configuration file"
|
||||
<< '\n'
|
||||
<< "and point SignalSource.filename to a valid raw data file. Then:"
|
||||
<< '\n'
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf"
|
||||
<< '\n'
|
||||
<< "Examples of configuration files available at:"
|
||||
<< '\n'
|
||||
<< GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/"
|
||||
<< '\n';
|
||||
<< "The receiver was configured to work with a file signal source\n"
|
||||
<< "but the specified file is unreachable by GNSS-SDR.\n"
|
||||
<< "Please modify your configuration file\n"
|
||||
<< "and point SignalSource.filename to a valid raw data file. Then:\n"
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf\n"
|
||||
<< "Examples of configuration files available at:\n"
|
||||
<< GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/\n";
|
||||
|
||||
LOG(WARNING) << "file_signal_source: Unable to open the samples file "
|
||||
<< filename_.c_str() << ", exiting the program.";
|
||||
@@ -131,8 +124,7 @@ SpirFileSignalSource::SpirFileSignalSource(const ConfigurationInterface* configu
|
||||
}
|
||||
|
||||
CHECK(samples_ > 0) << "File does not contain enough samples to process.";
|
||||
double signal_duration_s;
|
||||
signal_duration_s = static_cast<double>(samples_) * (1 / static_cast<double>(sampling_frequency_));
|
||||
double signal_duration_s = static_cast<double>(samples_) * (1 / static_cast<double>(sampling_frequency_));
|
||||
LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
|
||||
std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]\n";
|
||||
|
||||
|
@@ -31,8 +31,8 @@
|
||||
SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role, uint32_t in_streams, uint32_t out_streams, Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
std::string default_filename = "../data/my_capture.dat";
|
||||
std::string default_dump_filename = "../data/my_capture_dump.dat";
|
||||
const std::string default_filename("../data/my_capture.dat");
|
||||
const std::string default_dump_filename("../data/my_capture_dump.dat");
|
||||
item_type_ = "int";
|
||||
|
||||
samples_ = configuration->property(role + ".samples", static_cast<uint64_t>(0));
|
||||
@@ -47,8 +47,8 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(const ConfigurationInte
|
||||
n_channels_ = configuration->property(role + ".total_channels", 1);
|
||||
sel_ch_ = configuration->property(role + ".sel_ch", 1);
|
||||
item_size_ = sizeof(int32_t);
|
||||
int64_t bytes_seek = configuration->property(role + ".bytes_to_skip", static_cast<int64_t>(65536));
|
||||
double sample_size_byte = static_cast<double>(adc_bits_) / 4.0;
|
||||
const int64_t bytes_seek = configuration->property(role + ".bytes_to_skip", static_cast<int64_t>(65536));
|
||||
const double sample_size_byte = static_cast<double>(adc_bits_) / 4.0;
|
||||
|
||||
if (sel_ch_ > n_channels_)
|
||||
{
|
||||
|
@@ -39,9 +39,9 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(
|
||||
in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
{
|
||||
std::string default_filename = "../data/my_capture.dat";
|
||||
std::string default_item_type = "byte";
|
||||
std::string default_dump_filename = "../data/my_capture_dump.dat";
|
||||
const std::string default_filename("../data/my_capture.dat");
|
||||
const std::string default_item_type("byte");
|
||||
const std::string default_dump_filename("../data/my_capture_dump.dat");
|
||||
|
||||
samples_ = configuration->property(role + ".samples", static_cast<uint64_t>(0));
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", static_cast<int64_t>(0));
|
||||
@@ -81,20 +81,13 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr
|
||||
<< "The receiver was configured to work with a file signal source "
|
||||
<< '\n'
|
||||
<< "but the specified file is unreachable by GNSS-SDR."
|
||||
<< '\n'
|
||||
<< "Please modify your configuration file"
|
||||
<< '\n'
|
||||
<< "and point SignalSource.filename to a valid raw data file. Then:"
|
||||
<< '\n'
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf"
|
||||
<< '\n'
|
||||
<< "Examples of configuration files available at:"
|
||||
<< '\n'
|
||||
<< GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/"
|
||||
<< '\n';
|
||||
<< "The receiver was configured to work with a file signal source\n"
|
||||
<< "but the specified file is unreachable by GNSS-SDR.\n"
|
||||
<< "Please modify your configuration file\n"
|
||||
<< "and point SignalSource.filename to a valid raw data file. Then:\n"
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf\n"
|
||||
<< "Examples of configuration files available at:\n"
|
||||
<< GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/\n";
|
||||
|
||||
LOG(WARNING) << "file_signal_source: Unable to open the samples file "
|
||||
<< filename_.c_str() << ", exiting the program.";
|
||||
@@ -137,8 +130,7 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(
|
||||
}
|
||||
|
||||
CHECK(samples_ > 0) << "File does not contain enough samples to process.";
|
||||
double signal_duration_s;
|
||||
signal_duration_s = static_cast<double>(samples_) * (1 / static_cast<double>(sampling_frequency_));
|
||||
const double signal_duration_s = static_cast<double>(samples_) * (1 / static_cast<double>(sampling_frequency_));
|
||||
LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
|
||||
std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]\n";
|
||||
|
||||
|
@@ -41,11 +41,11 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(
|
||||
in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
{
|
||||
std::string default_filename = "../data/my_capture.dat";
|
||||
std::string default_item_type = "byte";
|
||||
std::string default_dump_filename = "../data/my_capture_dump.dat";
|
||||
std::string default_sample_type = "real";
|
||||
double default_seconds_to_skip = 0.0;
|
||||
const std::string default_filename("../data/my_capture.dat");
|
||||
const std::string default_item_type("byte");
|
||||
const std::string default_dump_filename("../data/my_capture_dump.dat");
|
||||
const std::string default_sample_type("real");
|
||||
const double default_seconds_to_skip = 0.0;
|
||||
|
||||
samples_ = configuration->property(role + ".samples", static_cast<uint64_t>(0));
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", static_cast<int64_t>(0));
|
||||
@@ -69,7 +69,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||
enable_throttle_control_ = configuration->property(role + ".enable_throttle_control", false);
|
||||
double seconds_to_skip = configuration->property(role + ".seconds_to_skip", default_seconds_to_skip);
|
||||
const double seconds_to_skip = configuration->property(role + ".seconds_to_skip", default_seconds_to_skip);
|
||||
int64_t bytes_to_skip = 0;
|
||||
|
||||
if (item_type_ == "byte")
|
||||
@@ -145,20 +145,13 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr
|
||||
<< "The receiver was configured to work with a file signal source "
|
||||
<< '\n'
|
||||
<< "but the specified file is unreachable by GNSS-SDR."
|
||||
<< '\n'
|
||||
<< "Please modify your configuration file"
|
||||
<< '\n'
|
||||
<< "and point SignalSource.filename to a valid raw data file. Then:"
|
||||
<< '\n'
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf"
|
||||
<< '\n'
|
||||
<< "Examples of configuration files available at:"
|
||||
<< '\n'
|
||||
<< GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/"
|
||||
<< '\n';
|
||||
<< "The receiver was configured to work with a file signal source\n"
|
||||
<< "but the specified file is unreachable by GNSS-SDR.\n"
|
||||
<< "Please modify your configuration file\n"
|
||||
<< "and point SignalSource.filename to a valid raw data file. Then:\n"
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf\n"
|
||||
<< "Examples of configuration files available at:\n"
|
||||
<< GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/\n";
|
||||
|
||||
LOG(WARNING) << "file_signal_source: Unable to open the samples file "
|
||||
<< filename_.c_str() << ", exiting the program.";
|
||||
@@ -167,7 +160,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(
|
||||
|
||||
DLOG(INFO) << "file_source(" << file_source_->unique_id() << ")";
|
||||
|
||||
size_t output_item_size = (is_complex_ ? sizeof(gr_complex) : sizeof(float));
|
||||
const size_t output_item_size = (is_complex_ ? sizeof(gr_complex) : sizeof(float));
|
||||
|
||||
if (samples_ == 0) // read all file
|
||||
{
|
||||
|
@@ -34,9 +34,9 @@ UhdSignalSource::UhdSignalSource(const ConfigurationInterface* configuration,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
// DUMP PARAMETERS
|
||||
std::string empty;
|
||||
const std::string empty;
|
||||
const std::string default_dump_file("./data/signal_source.dat");
|
||||
std::string default_item_type = "cshort";
|
||||
const std::string default_item_type("cshort");
|
||||
|
||||
// UHD COMMON PARAMETERS
|
||||
uhd::device_addr_t dev_addr;
|
||||
|
Reference in New Issue
Block a user