1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-07 07:50:32 +00:00

Add forgotten options to GpsL2MPcpsAcquisition

This commit is contained in:
Luis Esteve 2016-05-13 00:21:27 +02:00
parent 2e6bcdbdd2
commit 2780247cda
2 changed files with 87 additions and 45 deletions

View File

@ -55,7 +55,6 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type", default_item_type); item_type_ = configuration_->property(role + ".item_type", default_item_type);
//float pfa = configuration_->property(role + ".pfa", 0.0);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
if_ = configuration_->property(role + ".if", 0); if_ = configuration_->property(role + ".if", 0);
@ -238,8 +237,7 @@ void GpsL1CaPcpsAcquisition::init()
void GpsL1CaPcpsAcquisition::set_local_code() void GpsL1CaPcpsAcquisition::set_local_code()
{ {
// if (item_type_.compare("gr_complex") == 0)
// {
std::complex<float>* code = new std::complex<float>[code_length_]; std::complex<float>* code = new std::complex<float>[code_length_];
gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0);
@ -261,7 +259,6 @@ void GpsL1CaPcpsAcquisition::set_local_code()
} }
delete[] code; delete[] code;
// }
} }

View File

@ -121,10 +121,14 @@ GpsL2MPcpsAcquisition::~GpsL2MPcpsAcquisition()
void GpsL2MPcpsAcquisition::set_channel(unsigned int channel) void GpsL2MPcpsAcquisition::set_channel(unsigned int channel)
{ {
channel_ = channel; channel_ = channel;
//if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("cshort") == 0)
//{ {
acquisition_cc_->set_channel(channel_); acquisition_sc_->set_channel(channel_);
//} }
else
{
acquisition_cc_->set_channel(channel_);
}
} }
@ -147,20 +151,29 @@ void GpsL2MPcpsAcquisition::set_threshold(float threshold)
DLOG(INFO) << "Channel " << channel_ <<" Threshold = " << threshold_; DLOG(INFO) << "Channel " << channel_ <<" Threshold = " << threshold_;
// if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("cshort") == 0)
// { {
acquisition_cc_->set_threshold(threshold_); acquisition_sc_->set_threshold(threshold_);
// } }
else
{
acquisition_cc_->set_threshold(threshold_);
}
} }
void GpsL2MPcpsAcquisition::set_doppler_max(unsigned int doppler_max) void GpsL2MPcpsAcquisition::set_doppler_max(unsigned int doppler_max)
{ {
doppler_max_ = doppler_max; doppler_max_ = doppler_max;
// if (item_type_.compare("gr_complex") == 0)
// { if (item_type_.compare("cshort") == 0)
acquisition_cc_->set_doppler_max(doppler_max_); {
// } acquisition_sc_->set_doppler_max(doppler_max_);
}
else
{
acquisition_cc_->set_doppler_max(doppler_max_);
}
} }
@ -169,50 +182,74 @@ void GpsL2MPcpsAcquisition::set_doppler_max(unsigned int doppler_max)
void GpsL2MPcpsAcquisition::set_doppler_step(unsigned int doppler_step) void GpsL2MPcpsAcquisition::set_doppler_step(unsigned int doppler_step)
{ {
doppler_step_ = doppler_step; doppler_step_ = doppler_step;
// if (item_type_.compare("gr_complex") == 0)
// {
acquisition_cc_->set_doppler_step(doppler_step_);
// }
if (item_type_.compare("cshort") == 0)
{
acquisition_sc_->set_doppler_step(doppler_step_);
}
else
{
acquisition_cc_->set_doppler_step(doppler_step_);
}
} }
void GpsL2MPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro) void GpsL2MPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{ {
gnss_synchro_ = gnss_synchro; gnss_synchro_ = gnss_synchro;
// if (item_type_.compare("gr_complex") == 0)
// { if (item_type_.compare("cshort") == 0)
acquisition_cc_->set_gnss_synchro(gnss_synchro_); {
// } acquisition_sc_->set_gnss_synchro(gnss_synchro_);
}
else
{
acquisition_cc_->set_gnss_synchro(gnss_synchro_);
}
} }
signed int GpsL2MPcpsAcquisition::mag() signed int GpsL2MPcpsAcquisition::mag()
{ {
// // if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("cshort") == 0)
// { {
return acquisition_cc_->mag(); return acquisition_sc_->mag();
// } }
// else else
// { {
// return 0; return acquisition_cc_->mag();
// } }
} }
void GpsL2MPcpsAcquisition::init() void GpsL2MPcpsAcquisition::init()
{ {
acquisition_cc_->init(); if (item_type_.compare("cshort") == 0)
{
acquisition_sc_->init();
}
else
{
acquisition_cc_->init();
}
set_local_code(); set_local_code();
} }
void GpsL2MPcpsAcquisition::set_local_code() void GpsL2MPcpsAcquisition::set_local_code()
{ {
// if (item_type_.compare("gr_complex") == 0)
// {
gps_l2c_m_code_gen_complex_sampled(code_, gnss_synchro_->PRN, fs_in_); gps_l2c_m_code_gen_complex_sampled(code_, gnss_synchro_->PRN, fs_in_);
acquisition_cc_->set_local_code(code_);
if (item_type_.compare("cshort") == 0)
{
acquisition_sc_->set_local_code(code_);
}
else
{
acquisition_cc_->set_local_code(code_);
}
// //debug // //debug
// std::ofstream d_dump_file; // std::ofstream d_dump_file;
@ -230,18 +267,26 @@ void GpsL2MPcpsAcquisition::set_local_code()
void GpsL2MPcpsAcquisition::reset() void GpsL2MPcpsAcquisition::reset()
{ {
// if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("cshort") == 0)
// { {
acquisition_cc_->set_active(true); acquisition_sc_->set_active(true);
// } }
else
{
acquisition_cc_->set_active(true);
}
} }
void GpsL2MPcpsAcquisition::set_state(int state) void GpsL2MPcpsAcquisition::set_state(int state)
{ {
// if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("cshort") == 0)
// { {
acquisition_cc_->set_state(state); acquisition_sc_->set_state(state);
// } }
else
{
acquisition_cc_->set_state(state);
}
} }