1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-13 19:50:34 +00:00

Clean the factory

Now GetBlock does not require a queue for generating blocks that do not
use it.
This commit is contained in:
Carles Fernandez 2016-05-10 01:32:26 +02:00
parent b1188e9c92
commit df47884cd7
15 changed files with 81 additions and 117 deletions

View File

@ -152,7 +152,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetSignalSource(
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetSignalConditioner(
std::shared_ptr<ConfigurationInterface> configuration, boost::shared_ptr<gr::msg_queue> queue, int ID)
std::shared_ptr<ConfigurationInterface> configuration, int ID)
{
std::string default_implementation = "Pass_Through";
//backwards compatibility for old conf files
@ -169,8 +169,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetSignalConditioner(
role_resampler = "Resampler" + boost::lexical_cast<std::string>(ID);
}
std::string signal_conditioner = configuration->property(
role_conditioner + ".implementation", default_implementation);
std::string signal_conditioner = configuration->property(role_conditioner + ".implementation", default_implementation);
std::string data_type_adapter;
std::string input_filter;
@ -183,12 +182,9 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetSignalConditioner(
}
else
{
data_type_adapter = configuration->property(
role_datatypeadapter + ".implementation", default_implementation);
input_filter = configuration->property(
role_inputfilter + ".implementation", default_implementation);
resampler = configuration->property(
role_resampler + ".implementation", default_implementation);
data_type_adapter = configuration->property(role_datatypeadapter + ".implementation", default_implementation);
input_filter = configuration->property(role_inputfilter + ".implementation", default_implementation);
resampler = configuration->property(role_resampler + ".implementation", default_implementation);
}
LOG(INFO) << "Getting SignalConditioner with DataTypeAdapter implementation: "
@ -200,9 +196,9 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetSignalConditioner(
{
//instantiate the array version
std::unique_ptr<GNSSBlockInterface> conditioner_(new ArraySignalConditioner(configuration.get(),
std::move(GetBlock(configuration, role_datatypeadapter, data_type_adapter, 1, 1, queue)),
std::move(GetBlock(configuration, role_inputfilter, input_filter, 1, 1, queue)),
std::move(GetBlock(configuration, role_resampler, resampler, 1, 1, queue)),
std::move(GetBlock(configuration, role_datatypeadapter, data_type_adapter, 1, 1)),
std::move(GetBlock(configuration, role_inputfilter, input_filter, 1, 1)),
std::move(GetBlock(configuration, role_resampler, resampler, 1, 1)),
role_conditioner, "Signal_Conditioner"));
return conditioner_;
}
@ -210,9 +206,9 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetSignalConditioner(
{
//single-antenna version
std::unique_ptr<GNSSBlockInterface> conditioner_(new SignalConditioner(configuration.get(),
std::move(GetBlock(configuration, role_datatypeadapter, data_type_adapter, 1, 1, queue)),
std::move(GetBlock(configuration, role_inputfilter, input_filter, 1, 1, queue)),
std::move(GetBlock(configuration, role_resampler, resampler, 1, 1, queue)),
std::move(GetBlock(configuration, role_datatypeadapter, data_type_adapter, 1, 1)),
std::move(GetBlock(configuration, role_inputfilter, input_filter, 1, 1)),
std::move(GetBlock(configuration, role_resampler, resampler, 1, 1)),
role_conditioner, "Signal_Conditioner"));
return conditioner_;
}
@ -220,8 +216,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetSignalConditioner(
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetObservables(std::shared_ptr<ConfigurationInterface> configuration,
boost::shared_ptr<gr::msg_queue> queue)
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetObservables(std::shared_ptr<ConfigurationInterface> configuration)
{
std::string default_implementation = "GPS_L1_CA_Observables";
std::string implementation = configuration->property("Observables.implementation", default_implementation);
@ -230,13 +225,12 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetObservables(std::shared
Galileo_channels += configuration->property("Channels_5X.count", 0);
unsigned int GPS_channels = configuration->property("Channels_1C.count", 0);
GPS_channels += configuration->property("Channels_2S.count", 0);
return GetBlock(configuration, "Observables", implementation, Galileo_channels + GPS_channels, Galileo_channels + GPS_channels, queue);
return GetBlock(configuration, "Observables", implementation, Galileo_channels + GPS_channels, Galileo_channels + GPS_channels);
}
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetPVT(std::shared_ptr<ConfigurationInterface> configuration,
boost::shared_ptr<gr::msg_queue> queue)
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetPVT(std::shared_ptr<ConfigurationInterface> configuration)
{
std::string default_implementation = "Pass_Through";
std::string implementation = configuration->property("PVT.implementation", default_implementation);
@ -245,7 +239,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetPVT(std::shared_ptr<Con
Galileo_channels += configuration->property("Channels_5X.count", 0);
unsigned int GPS_channels =configuration->property("Channels_1C.count", 0);
GPS_channels += configuration->property("Channels_2S.count", 0);
return GetBlock(configuration, "PVT", implementation, Galileo_channels + GPS_channels, 1, queue);
return GetBlock(configuration, "PVT", implementation, Galileo_channels + GPS_channels, 1);
}
@ -921,8 +915,6 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
out_streams));
block = std::move(block_);
}
else if (implementation.compare("Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition") == 0)
{
std::unique_ptr<GNSSBlockInterface> block_( new GalileoE1PcpsQuickSyncAmbiguousAcquisition(configuration.get(), role, in_streams,
@ -1053,7 +1045,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
else
{
// Log fatal. This causes execution to stop.
LOG(ERROR) << role<<"."<<implementation << ": Undefined implementation for block";
LOG(ERROR) << role << "." << implementation << ": Undefined implementation for block";
}
return std::move(block);
}
@ -1235,7 +1227,7 @@ std::unique_ptr<TrackingInterface> GNSSBlockFactory::GetTrkBlock(
else
{
// Log fatal. This causes execution to stop.
LOG(ERROR) << role<<"."<<implementation << ": Undefined implementation for block";
LOG(ERROR) << role << "." << implementation << ": Undefined implementation for block";
}
return std::move(block);
}
@ -1283,7 +1275,7 @@ std::unique_ptr<TelemetryDecoderInterface> GNSSBlockFactory::GetTlmBlock(
else
{
// Log fatal. This causes execution to stop.
LOG(ERROR) << role<<"."<<implementation << ": Undefined implementation for block";
LOG(ERROR) << role << "." << implementation << ": Undefined implementation for block";
}
return std::move(block);
}

View File

@ -59,17 +59,11 @@ public:
std::unique_ptr<GNSSBlockInterface> GetSignalSource(std::shared_ptr<ConfigurationInterface> configuration,
boost::shared_ptr<gr::msg_queue> queue, int ID = -1);
std::unique_ptr<GNSSBlockInterface> GetSignalConditioner(std::shared_ptr<ConfigurationInterface> configuration,
boost::shared_ptr<gr::msg_queue> queue, int ID = -1);
std::unique_ptr<GNSSBlockInterface> GetSignalConditioner(std::shared_ptr<ConfigurationInterface> configuration, int ID = -1);
std::unique_ptr<GNSSBlockInterface> GetPVT(std::shared_ptr<ConfigurationInterface> configuration,
boost::shared_ptr<gr::msg_queue> queue);
std::unique_ptr<GNSSBlockInterface> GetPVT(std::shared_ptr<ConfigurationInterface> configuration);
std::unique_ptr<GNSSBlockInterface> GetObservables(std::shared_ptr<ConfigurationInterface> configuration,
boost::shared_ptr<gr::msg_queue> queue);
std::unique_ptr<GNSSBlockInterface> GetOutputFilter(std::shared_ptr<ConfigurationInterface> configuration,
boost::shared_ptr<gr::msg_queue> queue);
std::unique_ptr<GNSSBlockInterface> GetObservables(std::shared_ptr<ConfigurationInterface> configuration);
std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GetChannels(std::shared_ptr<ConfigurationInterface> configuration,
boost::shared_ptr<gr::msg_queue> queue);
@ -80,7 +74,7 @@ public:
std::unique_ptr<GNSSBlockInterface> GetBlock(std::shared_ptr<ConfigurationInterface> configuration,
std::string role, std::string implementation,
unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue);
boost::shared_ptr<gr::msg_queue> queue = nullptr);
private:

View File

@ -485,7 +485,7 @@ void GNSSFlowgraph::init()
std::cout << "RF Channels " << RF_Channels << std::endl;
for (int j = 0; j < RF_Channels; j++)
{
sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, queue_, signal_conditioner_ID));
sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, signal_conditioner_ID));
signal_conditioner_ID++;
}
}
@ -502,19 +502,19 @@ void GNSSFlowgraph::init()
{
for (int j = 0; j < RF_Channels; j++)
{
sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, queue_, signal_conditioner_ID));
sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, signal_conditioner_ID));
signal_conditioner_ID++;
}
}
else
{
//old config file, single signal source and single channel, not specified
sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, queue_, -1));
sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, -1));
}
}
observables_ = block_factory_->GetObservables(configuration_, queue_);
pvt_ = block_factory_->GetPVT(configuration_, queue_);
observables_ = block_factory_->GetObservables(configuration_);
pvt_ = block_factory_->GetPVT(configuration_);
std::shared_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> channels = block_factory_->GetChannels(configuration_, queue_);

View File

@ -103,7 +103,7 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, Instantiate)
{
init();
auto tracking = factory->GetBlock(config, "Tracking", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1, queue);
auto tracking = factory->GetBlock(config, "Tracking", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1);
EXPECT_STREQ("Galileo_E1_DLL_PLL_VEML_Tracking", tracking->implementation().c_str());
}
@ -120,7 +120,7 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun)
top_block = gr::make_top_block("Tracking test");
// Example using smart pointers and the block factory
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(config, "Tracking", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(config, "Tracking", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1);
std::shared_ptr<GalileoE1DllPllVemlTracking> tracking = std::dynamic_pointer_cast<GalileoE1DllPllVemlTracking>(trk_);
ASSERT_NO_THROW( {
@ -171,7 +171,7 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults)
top_block = gr::make_top_block("Tracking test");
// Example using smart pointers and the block factory
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(config, "Tracking", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(config, "Tracking", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1);
std::shared_ptr<TrackingInterface> tracking = std::dynamic_pointer_cast<TrackingInterface>(trk_);
// gnss_synchro.Acq_delay_samples = 1753; // 4 Msps

View File

@ -417,7 +417,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::stop_queue()
TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, Instantiate)
{
config_1();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 1);
}
TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
@ -431,7 +431,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
queue = gr::msg_queue::make(0);
top_block = gr::make_top_block("Acquisition test");
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1Pcps8msAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx> msg_rx = GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue);
@ -569,7 +569,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProb
config_2();
queue = gr::msg_queue::make(0);
top_block = gr::make_top_block("Acquisition test");
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1Pcps8msAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx> msg_rx = GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue);

View File

@ -427,7 +427,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::stop_queue()
TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, Instantiate)
{
config_1();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsAmbiguousAcquisition>(acq_);
}
@ -442,7 +442,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
queue = gr::msg_queue::make(0);
config_1();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx> msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue);
@ -472,7 +472,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
config_1();
top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx> msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue);
@ -558,7 +558,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabi
config_2();
top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx> msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue);

View File

@ -204,7 +204,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::stop_queue()
TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, Instantiate)
{
init();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1);
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
EXPECT_STREQ("Galileo_E1_PCPS_Ambiguous_Acquisition", acquisition->implementation().c_str());
}
@ -220,7 +220,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ConnectAndRun)
top_block = gr::make_top_block("Acquisition test");
init();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1);
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
boost::shared_ptr<GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx> msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_make(channel_internal_queue);
@ -252,7 +252,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ValidationOfResults)
top_block = gr::make_top_block("Acquisition test");
init();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1);
std::shared_ptr<GalileoE1PcpsAmbiguousAcquisition> acquisition = std::dynamic_pointer_cast<GalileoE1PcpsAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx> msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_make(channel_internal_queue);

View File

@ -123,7 +123,6 @@ protected:
void init();
gr::msg_queue::sptr queue;
gr::top_block_sptr top_block;
std::shared_ptr<GNSSBlockFactory> factory;
std::shared_ptr<InMemoryConfiguration> config;
@ -156,7 +155,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::init()
TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, Instantiate)
{
init();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1);
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
}
@ -169,9 +168,9 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ConnectAndRun)
long long int begin = 0;
long long int end = 0;
top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0);
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
init();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1);
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
boost::shared_ptr<GpsL2MPcpsAcquisitionTest_msg_rx> msg_rx = GpsL2MPcpsAcquisitionTest_msg_rx_make();
@ -205,8 +204,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
double expected_doppler_hz = -632;
init();
top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1);
std::shared_ptr<GalileoE1PcpsAmbiguousAcquisition> acquisition = std::dynamic_pointer_cast<GalileoE1PcpsAmbiguousAcquisition>(acq_);
boost::shared_ptr<GpsL2MPcpsAcquisitionTest_msg_rx> msg_rx = GpsL2MPcpsAcquisitionTest_msg_rx_make();

View File

@ -420,7 +420,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::stop_queue()
TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, Instantiate)
{
config_1();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsCccwsrAmbiguousAcquisition>(acq_);
}
@ -435,7 +435,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ConnectAndRun)
top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsCccwsrAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx> msg_rx = GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(channel_internal_queue);
@ -464,7 +464,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults)
config_1();
top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsCccwsrAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx> msg_rx = GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(channel_internal_queue);
@ -562,7 +562,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabili
config_2();
top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsCccwsrAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx> msg_rx = GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(channel_internal_queue);

View File

@ -548,7 +548,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::stop_queue()
TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, Instantiate)
{
config_1();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsQuickSyncAmbiguousAcquisition>(acq_);
}
@ -565,7 +565,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ConnectAndRun)
config_1();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsQuickSyncAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx> msg_rx = GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(channel_internal_queue);
@ -600,7 +600,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul
top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsQuickSyncAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx> msg_rx = GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(channel_internal_queue);
@ -691,7 +691,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul
top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsQuickSyncAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx> msg_rx = GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(channel_internal_queue);
@ -778,7 +778,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul
top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsQuickSyncAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx> msg_rx = GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(channel_internal_queue);

View File

@ -424,7 +424,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::stop_queue()
TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, Instantiate)
{
config_1();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsTongAmbiguousAcquisition>(acq_);
}
@ -437,7 +437,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0);
config_1();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsTongAmbiguousAcquisition>(acq_);
ASSERT_NO_THROW( {
@ -464,7 +464,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
config_1();
top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsTongAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx> msg_rx = GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue);
@ -552,7 +552,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsPro
config_2();
top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 1);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsTongAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx> msg_rx = GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue);

View File

@ -111,7 +111,7 @@ TEST_F(GalileoE5aTrackingTest, ValidationOfResults)
top_block = gr::make_top_block("Tracking test");
// Example using smart pointers and the block factory
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(config, "Tracking", "Galileo_E5a_DLL_PLL_Tracking", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(config, "Tracking", "Galileo_E5a_DLL_PLL_Tracking", 1, 1);
std::shared_ptr<TrackingInterface> tracking = std::dynamic_pointer_cast<TrackingInterface>(trk_);
//REAL

View File

@ -80,9 +80,8 @@ TEST(GNSS_Block_Factory_Test, InstantiateSignalConditioner)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("SignalConditioner.implementation", "Signal_Conditioner");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::unique_ptr<GNSSBlockFactory> factory;
std::unique_ptr<GNSSBlockInterface> signal_conditioner = factory->GetSignalConditioner(configuration, queue);
std::unique_ptr<GNSSBlockInterface> signal_conditioner = factory->GetSignalConditioner(configuration);
EXPECT_STREQ("SignalConditioner", signal_conditioner->role().c_str());
EXPECT_STREQ("Signal_Conditioner", signal_conditioner->implementation().c_str());
}
@ -115,7 +114,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateFIRFilter)
configuration->set_property("InputFilter.grid_density", "16");
std::unique_ptr<GNSSBlockFactory> factory;
std::unique_ptr<GNSSBlockInterface> input_filter = factory->GetBlock(configuration, "InputFilter", "Fir_Filter", 1,1, queue);
std::unique_ptr<GNSSBlockInterface> input_filter = factory->GetBlock(configuration, "InputFilter", "Fir_Filter", 1, 1);
EXPECT_STREQ("InputFilter", input_filter->role().c_str());
EXPECT_STREQ("Fir_Filter", input_filter->implementation().c_str());
@ -150,7 +149,7 @@ TEST(GNSS_Block_Factory_Test, InstantiateFreqXlatingFIRFilter)
configuration->set_property("InputFilter.sampling_frequency","4000000");
configuration->set_property("InputFilter.IF","34000");
std::unique_ptr<GNSSBlockFactory> factory;
std::unique_ptr<GNSSBlockInterface> input_filter = factory->GetBlock(configuration, "InputFilter", "Freq_Xlating_Fir_Filter", 1,1, queue);
std::unique_ptr<GNSSBlockInterface> input_filter = factory->GetBlock(configuration, "InputFilter", "Freq_Xlating_Fir_Filter", 1, 1);
EXPECT_STREQ("InputFilter", input_filter->role().c_str());
EXPECT_STREQ("Freq_Xlating_Fir_Filter", input_filter->implementation().c_str());
@ -160,9 +159,8 @@ TEST(GNSS_Block_Factory_Test, InstantiateDirectResampler)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("Resampler.implementation", "Direct_Resampler");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::unique_ptr<GNSSBlockFactory> factory;
std::unique_ptr<GNSSBlockInterface> resampler = factory->GetBlock(configuration, "Resampler", "Direct_Resampler", 1,1, queue);
std::unique_ptr<GNSSBlockInterface> resampler = factory->GetBlock(configuration, "Resampler", "Direct_Resampler", 1, 1);
EXPECT_STREQ("Resampler", resampler->role().c_str());
EXPECT_STREQ("Direct_Resampler", resampler->implementation().c_str());
}
@ -171,9 +169,8 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaPcpsAcquisition)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_Acquisition");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::unique_ptr<GNSSBlockFactory> factory;
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(configuration, "Acquisition", "GPS_L1_CA_PCPS_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(configuration, "Acquisition", "GPS_L1_CA_PCPS_Acquisition", 1, 1);
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
EXPECT_STREQ("Acquisition", acquisition->role().c_str());
EXPECT_STREQ("GPS_L1_CA_PCPS_Acquisition", acquisition->implementation().c_str());
@ -184,9 +181,8 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaPcpsQuickSyncAcquisition)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_QuickSync_Acquisition");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(configuration, "Acquisition", "GPS_L1_CA_PCPS_QuickSync_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(configuration, "Acquisition", "GPS_L1_CA_PCPS_QuickSync_Acquisition", 1, 1);
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
EXPECT_STREQ("Acquisition", acquisition->role().c_str());
EXPECT_STREQ("GPS_L1_CA_PCPS_QuickSync_Acquisition", acquisition->implementation().c_str());
@ -196,9 +192,8 @@ TEST(GNSS_Block_Factory_Test, InstantiateGalileoE1PcpsQuickSyncAmbiguousAcquisit
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("Acquisition.implementation", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(configuration, "Acquisition", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(configuration, "Acquisition", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 1);
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
EXPECT_STREQ("Acquisition", acquisition->role().c_str());
EXPECT_STREQ("Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", acquisition->implementation().c_str());
@ -209,9 +204,8 @@ TEST(GNSS_Block_Factory_Test, InstantiateGalileoE1PcpsAmbiguousAcquisition)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("Acquisition.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::unique_ptr<GNSSBlockFactory> factory;
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(configuration, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(configuration, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1);
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
EXPECT_STREQ("Acquisition", acquisition->role().c_str());
EXPECT_STREQ("Galileo_E1_PCPS_Ambiguous_Acquisition", acquisition->implementation().c_str());
@ -222,9 +216,8 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaDllPllCAidTracking)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("Tracking.implementation", "GPS_L1_CA_DLL_PLL_C_Aid_Tracking");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::unique_ptr<GNSSBlockFactory> factory;
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(configuration, "Tracking", "GPS_L1_CA_DLL_PLL_C_Aid_Tracking", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(configuration, "Tracking", "GPS_L1_CA_DLL_PLL_C_Aid_Tracking", 1, 1);
std::shared_ptr<TrackingInterface> tracking = std::dynamic_pointer_cast<TrackingInterface>(trk_);
EXPECT_STREQ("Tracking", tracking->role().c_str());
EXPECT_STREQ("GPS_L1_CA_DLL_PLL_C_Aid_Tracking", tracking->implementation().c_str());
@ -235,9 +228,8 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaDllPllTracking)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("Tracking.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::unique_ptr<GNSSBlockFactory> factory;
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(configuration, "Tracking", "GPS_L1_CA_DLL_PLL_Tracking", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(configuration, "Tracking", "GPS_L1_CA_DLL_PLL_Tracking", 1, 1);
std::shared_ptr<TrackingInterface> tracking = std::dynamic_pointer_cast<TrackingInterface>(trk_);
EXPECT_STREQ("Tracking", tracking->role().c_str());
EXPECT_STREQ("GPS_L1_CA_DLL_PLL_Tracking", tracking->implementation().c_str());
@ -248,9 +240,8 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaTcpConnectorTracking)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("Tracking.implementation", "GPS_L1_CA_TCP_CONNECTOR_Tracking");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::unique_ptr<GNSSBlockFactory> factory;
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(configuration, "Tracking", "GPS_L1_CA_TCP_CONNECTOR_Tracking", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(configuration, "Tracking", "GPS_L1_CA_TCP_CONNECTOR_Tracking", 1, 1);
std::shared_ptr<TrackingInterface> tracking = std::dynamic_pointer_cast<TrackingInterface>(trk_);
EXPECT_STREQ("Tracking", tracking->role().c_str());
EXPECT_STREQ("GPS_L1_CA_TCP_CONNECTOR_Tracking", tracking->implementation().c_str());
@ -261,9 +252,8 @@ TEST(GNSS_Block_Factory_Test, InstantiateGalileoE1DllPllVemlTracking)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("Tracking.implementation", "Galileo_E1_DLL_PLL_VEML_Tracking");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::unique_ptr<GNSSBlockFactory> factory;
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(configuration, "Tracking", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(configuration, "Tracking", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1);
std::shared_ptr<TrackingInterface> tracking = std::dynamic_pointer_cast<TrackingInterface>(trk_);
EXPECT_STREQ("Tracking", tracking->role().c_str());
EXPECT_STREQ("Galileo_E1_DLL_PLL_VEML_Tracking", tracking->implementation().c_str());
@ -274,9 +264,8 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaTelemetryDecoder)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("TelemetryDecoder.implementation", "GPS_L1_CA_Telemetry_Decoder");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::unique_ptr<GNSSBlockFactory> factory;
std::shared_ptr<GNSSBlockInterface> telemetry_decoder = factory->GetBlock(configuration, "TelemetryDecoder", "GPS_L1_CA_Telemetry_Decoder", 1, 1, queue);
std::shared_ptr<GNSSBlockInterface> telemetry_decoder = factory->GetBlock(configuration, "TelemetryDecoder", "GPS_L1_CA_Telemetry_Decoder", 1, 1);
EXPECT_STREQ("TelemetryDecoder", telemetry_decoder->role().c_str());
EXPECT_STREQ("GPS_L1_CA_Telemetry_Decoder", telemetry_decoder->implementation().c_str());
}
@ -305,9 +294,8 @@ TEST(GNSS_Block_Factory_Test, InstantiateObservables)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("Observables.implementation", "Pass_Through");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::unique_ptr<GNSSBlockFactory> factory;
auto observables = factory->GetObservables(configuration, queue);
auto observables = factory->GetObservables(configuration);
EXPECT_STREQ("Observables", observables->role().c_str());
EXPECT_STREQ("Pass_Through", observables->implementation().c_str());
}
@ -317,9 +305,8 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaObservables)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("Observables.implementation", "GPS_L1_CA_Observables");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::unique_ptr<GNSSBlockFactory> factory;
std::unique_ptr<GNSSBlockInterface> observables = factory->GetObservables(configuration, queue);
std::unique_ptr<GNSSBlockInterface> observables = factory->GetObservables(configuration);
EXPECT_STREQ("Observables", observables->role().c_str());
EXPECT_STREQ("GPS_L1_CA_Observables", observables->implementation().c_str());
}
@ -331,9 +318,8 @@ TEST(GNSS_Block_Factory_Test, InstantiatePvt)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("PVT.implementation", "Pass_Through");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::unique_ptr<GNSSBlockFactory> factory;
auto pvt_ = factory->GetPVT(configuration, queue);
auto pvt_ = factory->GetPVT(configuration);
EXPECT_STREQ("PVT", pvt_->role().c_str());
EXPECT_STREQ("Pass_Through", pvt_->implementation().c_str());
}
@ -343,9 +329,8 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaPvt)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("PVT.implementation", "GPS_L1_CA_PVT");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::unique_ptr<GNSSBlockFactory> factory;
std::shared_ptr<GNSSBlockInterface> pvt_ = factory->GetPVT(configuration, queue);
std::shared_ptr<GNSSBlockInterface> pvt_ = factory->GetPVT(configuration);
std::shared_ptr<PvtInterface> pvt = std::dynamic_pointer_cast<PvtInterface>(pvt_);
EXPECT_STREQ("PVT", pvt->role().c_str());
EXPECT_STREQ("GPS_L1_CA_PVT", pvt->implementation().c_str());
@ -356,9 +341,8 @@ TEST(GNSS_Block_Factory_Test, InstantiateWrongPvt)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("PVT.implementation", "Pepito");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::unique_ptr<GNSSBlockFactory> factory;
std::shared_ptr<GNSSBlockInterface> pvt_ = factory->GetPVT(configuration, queue);
std::shared_ptr<GNSSBlockInterface> pvt_ = factory->GetPVT(configuration);
std::shared_ptr<PvtInterface> pvt = std::dynamic_pointer_cast<PvtInterface>(pvt_);
EXPECT_EQ(nullptr, pvt);
}

View File

@ -123,7 +123,6 @@ protected:
void init();
gr::msg_queue::sptr queue;
gr::top_block_sptr top_block;
std::shared_ptr<GNSSBlockFactory> factory;
std::shared_ptr<InMemoryConfiguration> config;
@ -139,7 +138,6 @@ void GpsL1CaPcpsAcquisitionTest::init()
std::string signal = "1C";
signal.copy(gnss_synchro.Signal, 2, 0);
gnss_synchro.PRN = 1;
queue = gr::msg_queue::make(0);
config->set_property("GNSS-SDR.internal_fs_hz", "4000000");
config->set_property("Acquisition.item_type", "gr_complex");
config->set_property("Acquisition.if", "0");
@ -168,6 +166,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ConnectAndRun)
struct timeval tv;
long long int begin = 0;
long long int end = 0;
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
top_block = gr::make_top_block("Acquisition test");
init();
@ -180,7 +179,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ConnectAndRun)
boost::shared_ptr<gr::block> valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue);
top_block->connect(source, 0, valve, 0);
top_block->connect(valve, 0, acquisition->get_left_block(), 0);
top_block->msg_connect(acquisition->get_right_block(),pmt::mp("events"), msg_rx,pmt::mp("events"));
top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events"));
}) << "Failure connecting the blocks of acquisition test." << std::endl;
@ -240,7 +239,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
const char * file_name = file.c_str();
gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false);
top_block->connect(file_source, 0, acquisition->get_left_block(), 0);
top_block->msg_connect(acquisition->get_right_block(),pmt::mp("events"), msg_rx,pmt::mp("events"));
top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events"));
}) << "Failure connecting the blocks of acquisition test." << std::endl;

View File

@ -206,7 +206,7 @@ bool front_end_capture(std::shared_ptr<ConfigurationInterface> configuration)
std::shared_ptr<GNSSBlockInterface> conditioner;
try
{
conditioner = block_factory.GetSignalConditioner(configuration,queue);
conditioner = block_factory.GetSignalConditioner(configuration);
}
catch(const boost::exception_ptr & e)
{
@ -352,8 +352,6 @@ int main(int argc, char** argv)
// 4. Setup GNU Radio flowgraph (file_source -> Acquisition_10m)
gr::top_block_sptr top_block;
boost::shared_ptr<gr::msg_queue> queue;
queue = gr::msg_queue::make(0);
top_block = gr::make_top_block("Acquisition test");
// Satellite signal definition
@ -380,7 +378,6 @@ int main(int argc, char** argv)
boost::shared_ptr<FrontEndCal_msg_rx> msg_rx = FrontEndCal_msg_rx_make();
//gr_basic_block_sptr head = gr_make_head(sizeof(gr_complex), nsamples);
//gr_head_sptr head_sptr = boost::dynamic_pointer_cast<gr_head>(head);
//head_sptr->set_length(nsamples);
@ -390,7 +387,7 @@ int main(int argc, char** argv)
{
acquisition->connect(top_block);
top_block->connect(source, 0, acquisition->get_left_block(), 0);
top_block->msg_connect(acquisition->get_right_block(),pmt::mp("events"), msg_rx,pmt::mp("events"));
top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx,pmt::mp("events"));
}
catch(const std::exception & e)
{