diff --git a/src/algorithms/PVT/libs/signal_enabled_flags.cc b/src/algorithms/PVT/libs/signal_enabled_flags.cc index d7cd8a324..8d6a58b77 100644 --- a/src/algorithms/PVT/libs/signal_enabled_flags.cc +++ b/src/algorithms/PVT/libs/signal_enabled_flags.cc @@ -40,7 +40,7 @@ uint32_t flags_from_config(const ConfigurationInterface* configuration) for (const auto& pair_aux : signal_flag_to_prop) { auto flag = pair_aux.first; - auto prop = pair_aux.second; + const auto& prop = pair_aux.second; const auto enabled = configuration->property(prop, 0) > 0; if (enabled) diff --git a/src/algorithms/libs/beidou_b3i_signal_replica.cc b/src/algorithms/libs/beidou_b3i_signal_replica.cc index 84787e5ef..108428754 100644 --- a/src/algorithms/libs/beidou_b3i_signal_replica.cc +++ b/src/algorithms/libs/beidou_b3i_signal_replica.cc @@ -108,7 +108,7 @@ void beidou_b3i_code_gen_int(own::span dest, int32_t prn, uint32_t chip_shi std::bitset<13>(std::string("0010001001110"))}; // A simple error check - if ((prn_idx < 0) || (prn_idx > 63)) + if ((prn_idx < 0) || (prn_idx > 62)) { return; } diff --git a/src/algorithms/libs/sensor_data/sensor_data_aggregator.cc b/src/algorithms/libs/sensor_data/sensor_data_aggregator.cc index 20cba420d..8a8c6ea04 100644 --- a/src/algorithms/libs/sensor_data/sensor_data_aggregator.cc +++ b/src/algorithms/libs/sensor_data/sensor_data_aggregator.cc @@ -17,7 +17,7 @@ #include "sensor_data_aggregator.h" #include #include - +#include SensorDataAggregator::SensorDataAggregator(const SensorDataSourceConfiguration& configuration, const std::vector& required_sensors) { @@ -123,7 +123,7 @@ void SensorDataAggregator::append_data(const pmt::pmt_t& data_dict) pmt::pmt_t key = pmt::car(pair); pmt::pmt_t val = pmt::cdr(pair); - std::string key_str = pmt::write_string(key); + std::string key_str = pmt::write_string(std::move(key)); SensorIdentifier::value_type sensor_id = SensorIdentifier::from_string(key_str); if (sensor_id != SensorIdentifier::SAMPLE_STAMP and sensor_id != SensorIdentifier::CHUNK_COUNT) @@ -133,7 +133,7 @@ void SensorDataAggregator::append_data(const pmt::pmt_t& data_dict) case SensorDataType::F32: if (f32_data_.find(sensor_id) != f32_data_.end()) { - f32_data_.at(sensor_id).emplace_back(sample_stamp, pmt::to_float(val)); + f32_data_.at(sensor_id).emplace_back(sample_stamp, pmt::to_float(std::move(val))); } break; diff --git a/src/algorithms/signal_source/adapters/ntlab_file_signal_source.cc b/src/algorithms/signal_source/adapters/ntlab_file_signal_source.cc index 75549d244..5288bb1a2 100644 --- a/src/algorithms/signal_source/adapters/ntlab_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/ntlab_file_signal_source.cc @@ -55,6 +55,7 @@ NTLabFileSignalSource::NTLabFileSignalSource( } } + std::tuple NTLabFileSignalSource::itemTypeToSize() { auto is_complex_t = false; @@ -81,22 +82,26 @@ std::tuple NTLabFileSignalSource::itemTypeToSize() return std::make_tuple(item_size, is_complex_t); } + double NTLabFileSignalSource::packetsPerSample() const { - return 4 / n_channels_; // sampling instants in one byte depend on channel count + return 4.0 / n_channels_; // sampling instants in one byte depend on channel count } + gnss_shared_ptr NTLabFileSignalSource::source() const { return unpack_samples_; } + void NTLabFileSignalSource::create_file_source_hook() { unpack_samples_ = make_unpack_ntlab_2bit_samples(item_size(), n_channels_); DLOG(INFO) << "unpack_byte_2bit_samples(" << unpack_samples_->unique_id() << ")"; } + void NTLabFileSignalSource::pre_connect_hook(gr::top_block_sptr top_block) { top_block->connect(file_source(), 0, unpack_samples_, 0); @@ -109,6 +114,7 @@ void NTLabFileSignalSource::pre_connect_hook(gr::top_block_sptr top_block) } } + void NTLabFileSignalSource::pre_disconnect_hook(gr::top_block_sptr top_block) { top_block->disconnect(file_source(), 0, unpack_samples_, 0); @@ -121,12 +127,14 @@ void NTLabFileSignalSource::pre_disconnect_hook(gr::top_block_sptr top_block) } } + gr::basic_block_sptr NTLabFileSignalSource::get_left_block() { LOG(WARNING) << "Left block of a signal source should not be retrieved"; return gr::block_sptr(); } + gr::basic_block_sptr NTLabFileSignalSource::get_right_block() { return valve();