mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-02-04 21:29:18 +00:00
some cleaning
This commit is contained in:
parent
59a158c576
commit
d76b6060f5
@ -90,17 +90,17 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
|
|||||||
|
|
||||||
code_= new gr_complex[vector_length_];
|
code_= new gr_complex[vector_length_];
|
||||||
|
|
||||||
// if (item_type_.compare("gr_complex") == 0 || (item_type_.compare("cshort") == 0))
|
// if (item_type_.compare("gr_complex") == 0 )
|
||||||
// {
|
// {
|
||||||
item_size_ = sizeof(gr_complex);
|
item_size_ = sizeof(gr_complex);
|
||||||
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
|
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
|
||||||
shift_resolution_, if_, fs_in_, code_length_, code_length_,
|
shift_resolution_, if_, fs_in_, code_length_, code_length_,
|
||||||
bit_transition_flag_, queue_, dump_, dump_filename_);
|
bit_transition_flag_, queue_, dump_, dump_filename_);
|
||||||
|
|
||||||
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
||||||
|
|
||||||
DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
|
DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
|
||||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (item_type_.compare("cshort") == 0)
|
if (item_type_.compare("cshort") == 0)
|
||||||
@ -132,10 +132,10 @@ GpsL1CaPcpsAcquisition::~GpsL1CaPcpsAcquisition()
|
|||||||
void GpsL1CaPcpsAcquisition::set_channel(unsigned int channel)
|
void GpsL1CaPcpsAcquisition::set_channel(unsigned int channel)
|
||||||
{
|
{
|
||||||
channel_ = channel;
|
channel_ = channel;
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
//if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
//{
|
||||||
acquisition_cc_->set_channel(channel_);
|
acquisition_cc_->set_channel(channel_);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -170,8 +170,8 @@ void GpsL1CaPcpsAcquisition::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("gr_complex") == 0)
|
||||||
// {
|
// {
|
||||||
acquisition_cc_->set_doppler_max(doppler_max_);
|
acquisition_cc_->set_doppler_max(doppler_max_);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -180,8 +180,8 @@ void GpsL1CaPcpsAcquisition::set_doppler_step(unsigned int doppler_step)
|
|||||||
doppler_step_ = doppler_step;
|
doppler_step_ = doppler_step;
|
||||||
// if (item_type_.compare("gr_complex") == 0)
|
// if (item_type_.compare("gr_complex") == 0)
|
||||||
// {
|
// {
|
||||||
acquisition_cc_->set_doppler_step(doppler_step_);
|
acquisition_cc_->set_doppler_step(doppler_step_);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,19 +191,19 @@ void GpsL1CaPcpsAcquisition::set_channel_queue(
|
|||||||
{
|
{
|
||||||
channel_internal_queue_ = channel_internal_queue;
|
channel_internal_queue_ = channel_internal_queue;
|
||||||
// if (item_type_.compare("gr_complex") == 0)
|
// if (item_type_.compare("gr_complex") == 0)
|
||||||
// {
|
// {
|
||||||
acquisition_cc_->set_channel_queue(channel_internal_queue_);
|
acquisition_cc_->set_channel_queue(channel_internal_queue_);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GpsL1CaPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
|
void GpsL1CaPcpsAcquisition::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("gr_complex") == 0)
|
||||||
// {
|
// {
|
||||||
acquisition_cc_->set_gnss_synchro(gnss_synchro_);
|
acquisition_cc_->set_gnss_synchro(gnss_synchro_);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -229,22 +229,22 @@ void GpsL1CaPcpsAcquisition::init()
|
|||||||
|
|
||||||
void GpsL1CaPcpsAcquisition::set_local_code()
|
void GpsL1CaPcpsAcquisition::set_local_code()
|
||||||
{
|
{
|
||||||
// if (item_type_.compare("gr_complex") == 0)
|
// 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);
|
||||||
|
|
||||||
for (unsigned int i = 0; i < sampled_ms_; i++)
|
for (unsigned int i = 0; i < sampled_ms_; i++)
|
||||||
{
|
{
|
||||||
memcpy(&(code_[i*code_length_]), code,
|
memcpy(&(code_[i*code_length_]), code,
|
||||||
sizeof(gr_complex)*code_length_);
|
sizeof(gr_complex)*code_length_);
|
||||||
}
|
}
|
||||||
|
|
||||||
acquisition_cc_->set_local_code(code_);
|
acquisition_cc_->set_local_code(code_);
|
||||||
|
|
||||||
delete[] code;
|
delete[] code;
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -252,16 +252,16 @@ void GpsL1CaPcpsAcquisition::reset()
|
|||||||
{
|
{
|
||||||
// if (item_type_.compare("gr_complex") == 0)
|
// if (item_type_.compare("gr_complex") == 0)
|
||||||
// {
|
// {
|
||||||
acquisition_cc_->set_active(true);
|
acquisition_cc_->set_active(true);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
void GpsL1CaPcpsAcquisition::set_state(int state)
|
void GpsL1CaPcpsAcquisition::set_state(int state)
|
||||||
{
|
{
|
||||||
// if (item_type_.compare("gr_complex") == 0)
|
// if (item_type_.compare("gr_complex") == 0)
|
||||||
// {
|
// {
|
||||||
acquisition_cc_->set_state(state);
|
acquisition_cc_->set_state(state);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -322,6 +322,8 @@ void GpsL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
|
|||||||
}
|
}
|
||||||
else if (item_type_.compare("cshort") == 0)
|
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_, 0, float_to_complex_, 0);
|
||||||
top_block->disconnect(cshort_to_float_x2_, 1, float_to_complex_, 1);
|
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(float_to_complex_, 0, stream_to_vector_, 0);
|
||||||
@ -329,6 +331,8 @@ void GpsL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
|
|||||||
}
|
}
|
||||||
else if (item_type_.compare("cbyte") == 0)
|
else if (item_type_.compare("cbyte") == 0)
|
||||||
{
|
{
|
||||||
|
// Since a byte-based acq implementation is not available,
|
||||||
|
// we just convert cshorts to gr_complex
|
||||||
top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
|
top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
|
||||||
top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
|
top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
|
||||||
top_block->disconnect(float_to_complex_, 0, stream_to_vector_, 0);
|
top_block->disconnect(float_to_complex_, 0, stream_to_vector_, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user