1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-06-06 08:34:10 +00:00

Merge branch 'MathieuFavreau-refactor/cleanup-gnss-block-factory' into next

This commit is contained in:
Carles Fernandez 2025-05-10 17:34:27 +02:00
commit 928e6a1297
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
4 changed files with 543 additions and 1279 deletions

File diff suppressed because it is too large Load Diff

View File

@ -57,7 +57,7 @@ public:
std::unique_ptr<GNSSBlockInterface> GetSignalConditioner(const ConfigurationInterface* configuration, int ID = -1);
std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GetChannels(const ConfigurationInterface* configuration,
std::vector<std::unique_ptr<GNSSBlockInterface>> GetChannels(const ConfigurationInterface* configuration,
Concurrent_Queue<pmt::pmt_t>* queue);
std::unique_ptr<GNSSBlockInterface> GetObservables(const ConfigurationInterface* configuration);

View File

@ -212,10 +212,10 @@ void GNSSFlowgraph::init()
auto channels = block_factory->GetChannels(configuration_.get(), queue_.get());
channels_count_ = static_cast<int>(channels->size());
channels_count_ = static_cast<int>(channels.size());
for (int i = 0; i < channels_count_; i++)
{
std::shared_ptr<GNSSBlockInterface> chan_ = std::move(channels->at(i));
std::shared_ptr<GNSSBlockInterface> chan_ = std::move(channels.at(i));
channels_.push_back(std::dynamic_pointer_cast<ChannelInterface>(chan_));
}

View File

@ -394,9 +394,9 @@ TEST(GNSSBlockFactoryTest, InstantiateChannels)
configuration->set_property("TelemetryDecoder_1C.implementation", "GPS_L1_CA_Telemetry_Decoder");
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> channels = factory->GetChannels(configuration.get(), queue.get());
EXPECT_EQ(static_cast<unsigned int>(2), channels->size());
channels->erase(channels->begin(), channels->end());
std::vector<std::unique_ptr<GNSSBlockInterface>> channels = factory->GetChannels(configuration.get(), queue.get());
EXPECT_EQ(static_cast<unsigned int>(2), channels.size());
channels.erase(channels.begin(), channels.end());
}