1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 12:10:34 +00:00

code cleaning

This commit is contained in:
Carles Fernandez 2016-01-20 22:59:22 +01:00
parent 1f3554384d
commit d095b581ae

View File

@ -103,11 +103,11 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
//now is supported natively by the acquisition (_sc variant)
// if (item_type_.compare("cshort") == 0)
// {
// cshort_to_float_x2_ = make_cshort_to_float_x2();
// float_to_complex_ = gr::blocks::float_to_complex::make();
// }
// if (item_type_.compare("cshort") == 0)
// {
// cshort_to_float_x2_ = make_cshort_to_float_x2();
// float_to_complex_ = gr::blocks::float_to_complex::make();
// }
if (item_type_.compare("cbyte") == 0)
{
@ -135,7 +135,9 @@ void GpsL1CaPcpsAcquisition::set_channel(unsigned int channel)
if (item_type_.compare("cshort") == 0)
{
acquisition_sc_->set_channel(channel_);
}else{
}
else
{
acquisition_cc_->set_channel(channel_);
}
@ -162,7 +164,9 @@ void GpsL1CaPcpsAcquisition::set_threshold(float threshold)
if (item_type_.compare("cshort") == 0)
{
acquisition_sc_->set_threshold(threshold_);
}else{
}
else
{
acquisition_cc_->set_threshold(threshold_);
}
}
@ -175,7 +179,9 @@ void GpsL1CaPcpsAcquisition::set_doppler_max(unsigned int doppler_max)
if (item_type_.compare("cshort") == 0)
{
acquisition_sc_->set_doppler_max(doppler_max_);
}else{
}
else
{
acquisition_cc_->set_doppler_max(doppler_max_);
}
}
@ -188,7 +194,9 @@ void GpsL1CaPcpsAcquisition::set_doppler_step(unsigned int doppler_step)
if (item_type_.compare("cshort") == 0)
{
acquisition_sc_->set_doppler_step(doppler_step_);
}else{
}
else
{
acquisition_cc_->set_doppler_step(doppler_step_);
}
@ -203,7 +211,9 @@ void GpsL1CaPcpsAcquisition::set_channel_queue(
if (item_type_.compare("cshort") == 0)
{
acquisition_sc_->set_channel_queue(channel_internal_queue_);
}else{
}
else
{
acquisition_cc_->set_channel_queue(channel_internal_queue_);
}
}
@ -216,7 +226,9 @@ void GpsL1CaPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
if (item_type_.compare("cshort") == 0)
{
acquisition_sc_->set_gnss_synchro(gnss_synchro_);
}else{
}
else
{
acquisition_cc_->set_gnss_synchro(gnss_synchro_);
}
}
@ -227,7 +239,9 @@ signed int GpsL1CaPcpsAcquisition::mag()
if (item_type_.compare("cshort") == 0)
{
return acquisition_sc_->mag();
}else{
}
else
{
return acquisition_cc_->mag();
}
}
@ -238,7 +252,9 @@ void GpsL1CaPcpsAcquisition::init()
if (item_type_.compare("cshort") == 0)
{
acquisition_sc_->init();
}else{
}
else
{
acquisition_cc_->init();
}
@ -264,7 +280,9 @@ void GpsL1CaPcpsAcquisition::set_local_code()
if (item_type_.compare("cshort") == 0)
{
acquisition_sc_->set_local_code(code_);
}else{
}
else
{
acquisition_cc_->set_local_code(code_);
}
@ -275,21 +293,25 @@ void GpsL1CaPcpsAcquisition::set_local_code()
void GpsL1CaPcpsAcquisition::reset()
{
if (item_type_.compare("cshort") == 0)
{
acquisition_sc_->set_active(true);
}else{
}
else
{
acquisition_cc_->set_active(true);
}
}
void GpsL1CaPcpsAcquisition::set_state(int state)
{
if (item_type_.compare("cshort") == 0)
{
acquisition_sc_->set_state(state);
}else{
}
else
{
acquisition_cc_->set_state(state);
}
}
@ -324,12 +346,7 @@ void GpsL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block)
}
else if (item_type_.compare("cshort") == 0)
{
//top_block->connect(cshort_to_float_x2_, 0, float_to_complex_, 0);
//top_block->connect(cshort_to_float_x2_, 1, float_to_complex_, 1);
//top_block->connect(float_to_complex_, 0, stream_to_vector_, 0);
//top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0);
top_block->connect(stream_to_vector_, 0, acquisition_sc_, 0);
}
else if (item_type_.compare("cbyte") == 0)
{
@ -353,12 +370,6 @@ void GpsL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
}
else if (item_type_.compare("cshort") == 0)
{
// Since a short-based acq implementation is not available,
// we just convert cshorts to gr_complex
//top_block->disconnect(cshort_to_float_x2_, 0, float_to_complex_, 0);
//top_block->disconnect(cshort_to_float_x2_, 1, float_to_complex_, 1);
//top_block->disconnect(float_to_complex_, 0, stream_to_vector_, 0);
//top_block->disconnect(stream_to_vector_, 0, acquisition_cc_, 0);
top_block->disconnect(stream_to_vector_, 0, acquisition_sc_, 0);
}
else if (item_type_.compare("cbyte") == 0)
@ -385,7 +396,6 @@ gr::basic_block_sptr GpsL1CaPcpsAcquisition::get_left_block()
}
else if (item_type_.compare("cshort") == 0)
{
//return cshort_to_float_x2_;
return stream_to_vector_;
}
else if (item_type_.compare("cbyte") == 0)
@ -405,7 +415,9 @@ gr::basic_block_sptr GpsL1CaPcpsAcquisition::get_right_block()
if (item_type_.compare("cshort") == 0)
{
return acquisition_sc_;
}else{
}
else
{
return acquisition_cc_;
}
}