diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index 35ab43156..c1ca0f57f 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -222,8 +222,18 @@ std::unique_ptr GNSSBlockFactory::GetObservables(std::shared std::string default_implementation = "GPS_L1_CA_Observables"; std::string implementation = configuration->property("Observables.implementation", default_implementation); LOG(INFO) << "Getting Observables with implementation " << implementation; - unsigned int Galileo_channels = configuration->property("Channels_Galileo.count", 0); - unsigned int GPS_channels = configuration->property("Channels_GPS.count", 0); + unsigned int Galileo_channels = configuration->property("Channels_Galileo.count", 0); // DEPRECATED + if(Galileo_channels == 0) + { + Galileo_channels = configuration->property("Channels_1B.count", 0); + } + Galileo_channels += configuration->property("Channels_5I.count", 0); + unsigned int GPS_channels = configuration->property("Channels_GPS.count", 0); // DEPRECATED + if(GPS_channels == 0) + { + 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); } @@ -235,8 +245,18 @@ std::unique_ptr GNSSBlockFactory::GetPVT(std::shared_ptrproperty("PVT.implementation", default_implementation); LOG(INFO) << "Getting PVT with implementation " << implementation; - unsigned int Galileo_channels = configuration->property("Channels_Galileo.count", 0); - unsigned int GPS_channels = configuration->property("Channels_GPS.count", 0); + unsigned int Galileo_channels = configuration->property("Channels_Galileo.count", 0); // DEPRECATED + if(Galileo_channels == 0) + { + Galileo_channels = configuration->property("Channels_1B.count", 0); + } + Galileo_channels += configuration->property("Channels_5I.count", 0); + unsigned int GPS_channels = configuration->property("Channels_GPS.count", 0); // DEPRECATED + if(GPS_channels == 0) + { + 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); } @@ -263,9 +283,9 @@ std::unique_ptr GNSSBlockFactory::GetChannel_GPS( std::unique_ptr pass_through_ = GetBlock(configuration, "Channel", "Pass_Through", 1, 1, queue); std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_GPS", acq, 1, 1, queue); - std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_GPS" +boost::lexical_cast(channel), trk, 1, 1, queue); + std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_GPS" + boost::lexical_cast(channel), trk, 1, 1, queue); - std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_GPS"+boost::lexical_cast(channel) , tlm, 1, 1, queue); + std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_GPS" + boost::lexical_cast(channel), tlm, 1, 1, queue); std::unique_ptr channel_(new Channel(configuration.get(), channel, pass_through_.release(), acq_.release(), @@ -276,6 +296,55 @@ std::unique_ptr GNSSBlockFactory::GetChannel_GPS( return channel_; } +//********* GPS L1 C/A CHANNEL ***************** +std::unique_ptr GNSSBlockFactory::GetChannel_1C( + std::shared_ptr configuration, + std::string acq, std::string trk, std::string tlm, int channel, + boost::shared_ptr queue) +{ + + LOG(INFO) << "Instantiating Channel " << channel << " with Acquisition Implementation: " + << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; + + std::unique_ptr pass_through_ = GetBlock(configuration, "Channel", "Pass_Through", 1, 1, queue); + std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_1C", acq, 1, 1, queue); + std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_1C", trk, 1, 1, queue); + + std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_1C", tlm, 1, 1, queue); + + std::unique_ptr channel_(new Channel(configuration.get(), channel, pass_through_.release(), + acq_.release(), + trk_.release(), + tlm_.release(), + "Channel", "1C", queue)); + + return channel_; +} + +//********* GPS L2C (M) CHANNEL ***************** +std::unique_ptr GNSSBlockFactory::GetChannel_2S( + std::shared_ptr configuration, + std::string acq, std::string trk, std::string tlm, int channel, + boost::shared_ptr queue) +{ + + LOG(INFO) << "Instantiating Channel " << channel << " with Acquisition Implementation: " + << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; + + std::unique_ptr pass_through_ = GetBlock(configuration, "Channel", "Pass_Through", 1, 1, queue); + std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_2S", acq, 1, 1, queue); + std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_2S", trk, 1, 1, queue); + + std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_2S", tlm, 1, 1, queue); + + std::unique_ptr channel_(new Channel(configuration.get(), channel, pass_through_.release(), + acq_.release(), + trk_.release(), + tlm_.release(), + "Channel", "2S", queue)); + + return channel_; +} //********* GALILEO CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_Galileo( @@ -303,6 +372,59 @@ std::unique_ptr GNSSBlockFactory::GetChannel_Galileo( return channel_; } +//********* GALILEO E1 B CHANNEL ***************** +std::unique_ptr GNSSBlockFactory::GetChannel_1B( + std::shared_ptr configuration, + std::string acq, std::string trk, std::string tlm, int channel, + boost::shared_ptr queue) +{ + std::stringstream stream; + stream << channel; + std::string id = stream.str(); + LOG(INFO) << "Instantiating Channel " << id << " with Acquisition Implementation: " + << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; + + std::unique_ptr pass_through_ = GetBlock(configuration, "Channel", "Pass_Through", 1, 1, queue); + std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_1B", acq, 1, 1, queue); + std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_1B", trk, 1, 1, queue); + std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_1B", tlm, 1, 1, queue); + + std::unique_ptr channel_(new Channel(configuration.get(), channel, pass_through_.release(), + acq_.release(), + trk_.release(), + tlm_.release(), + "Channel", "1B", queue)); + + return channel_; +} + +//********* GALILEO E5a CHANNEL ***************** +std::unique_ptr GNSSBlockFactory::GetChannel_5I( + std::shared_ptr configuration, + std::string acq, std::string trk, std::string tlm, int channel, + boost::shared_ptr queue) +{ + std::stringstream stream; + stream << channel; + std::string id = stream.str(); + LOG(INFO) << "Instantiating Channel " << id << " with Acquisition Implementation: " + << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; + + std::unique_ptr pass_through_ = GetBlock(configuration, "Channel", "Pass_Through", 1, 1, queue); + std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_5I", acq, 1, 1, queue); + std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_5I", trk, 1, 1, queue); + std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_5I", tlm, 1, 1, queue); + + std::unique_ptr channel_(new Channel(configuration.get(), channel, pass_through_.release(), + acq_.release(), + trk_.release(), + tlm_.release(), + "Channel", "5I", queue)); + + return channel_; +} + + std::unique_ptr>> GNSSBlockFactory::GetChannels( std::shared_ptr configuration, boost::shared_ptr queue) { diff --git a/src/core/receiver/gnss_block_factory.h b/src/core/receiver/gnss_block_factory.h index f4b4afcd9..00d7e93d5 100644 --- a/src/core/receiver/gnss_block_factory.h +++ b/src/core/receiver/gnss_block_factory.h @@ -93,6 +93,10 @@ public: std::string acq, std::string trk, std::string tlm, int channel, boost::shared_ptr queue); + std::unique_ptr GetChannel_5I(std::shared_ptr configuration, + std::string acq, std::string trk, std::string tlm, int channel, + boost::shared_ptr queue); + std::unique_ptr>> GetChannels(std::shared_ptr configuration, boost::shared_ptr queue);