1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 20:50:33 +00:00

Apply coding style

This commit is contained in:
Carles Fernandez 2018-01-17 08:42:50 +01:00
parent 6af8527518
commit 27baa7e45d
3 changed files with 457 additions and 437 deletions

View File

@ -108,16 +108,6 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
very_early_late_space_narrow_chips, very_early_late_space_narrow_chips,
extend_correlation_symbols, extend_correlation_symbols,
track_pilot); track_pilot);
// tracking_ = galileo_e1_dll_pll_veml_make_tracking_cc(
// f_if,
// fs_in,
// vector_length,
// dump,
// dump_filename,
// pll_bw_hz,
// dll_bw_hz,
// early_late_space_chips,
// very_early_late_space_chips);
} }
else else
{ {
@ -130,14 +120,17 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")"; DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
} }
GalileoE1DllPllVemlTracking::~GalileoE1DllPllVemlTracking() GalileoE1DllPllVemlTracking::~GalileoE1DllPllVemlTracking()
{} {}
void GalileoE1DllPllVemlTracking::start_tracking() void GalileoE1DllPllVemlTracking::start_tracking()
{ {
tracking_->start_tracking(); tracking_->start_tracking();
} }
/* /*
* Set tracking channel unique ID * Set tracking channel unique ID
*/ */
@ -153,23 +146,27 @@ void GalileoE1DllPllVemlTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
tracking_->set_gnss_synchro(p_gnss_synchro); tracking_->set_gnss_synchro(p_gnss_synchro);
} }
void GalileoE1DllPllVemlTracking::connect(gr::top_block_sptr top_block) void GalileoE1DllPllVemlTracking::connect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to connect, now the tracking uses gr_sync_decimator //nothing to connect, now the tracking uses gr_sync_decimator
} }
void GalileoE1DllPllVemlTracking::disconnect(gr::top_block_sptr top_block) void GalileoE1DllPllVemlTracking::disconnect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
//nothing to disconnect, now the tracking uses gr_sync_decimator //nothing to disconnect, now the tracking uses gr_sync_decimator
} }
gr::basic_block_sptr GalileoE1DllPllVemlTracking::get_left_block() gr::basic_block_sptr GalileoE1DllPllVemlTracking::get_left_block()
{ {
return tracking_; return tracking_;
} }
gr::basic_block_sptr GalileoE1DllPllVemlTracking::get_right_block() gr::basic_block_sptr GalileoE1DllPllVemlTracking::get_right_block()
{ {
return tracking_; return tracking_;

View File

@ -198,7 +198,9 @@ galileo_e1_dll_pll_veml_tracking_cc::galileo_e1_dll_pll_veml_tracking_cc(
if (d_extend_correlation_symbols > 1) if (d_extend_correlation_symbols > 1)
{ {
d_enable_extended_integration = true; d_enable_extended_integration = true;
}else{ }
else
{
d_enable_extended_integration = false; d_enable_extended_integration = false;
} }
//Extra correlator for the data component //Extra correlator for the data component
@ -208,7 +210,9 @@ galileo_e1_dll_pll_veml_tracking_cc::galileo_e1_dll_pll_veml_tracking_cc(
d_Prompt_Data = static_cast<gr_complex*>(volk_gnsssdr_malloc(sizeof(gr_complex), volk_gnsssdr_get_alignment())); d_Prompt_Data = static_cast<gr_complex*>(volk_gnsssdr_malloc(sizeof(gr_complex), volk_gnsssdr_get_alignment()));
d_Prompt_Data[0] = gr_complex(0,0); d_Prompt_Data[0] = gr_complex(0,0);
d_data_code = static_cast<float*>(volk_gnsssdr_malloc((2 * Galileo_E1_B_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment())); d_data_code = static_cast<float*>(volk_gnsssdr_malloc((2 * Galileo_E1_B_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment()));
}else{ }
else
{
// Disable extended integration if data component tracking is selected // Disable extended integration if data component tracking is selected
d_enable_extended_integration = false; d_enable_extended_integration = false;
} }
@ -301,7 +305,6 @@ void galileo_e1_dll_pll_veml_tracking_cc::start_tracking()
d_carrier_loop_filter.initialize(); // initialize the carrier filter d_carrier_loop_filter.initialize(); // initialize the carrier filter
d_code_loop_filter.initialize(); // initialize the code filter d_code_loop_filter.initialize(); // initialize the code filter
if (d_track_pilot) if (d_track_pilot)
{ {
char pilot_signal[3] = "1C"; char pilot_signal[3] = "1C";
@ -321,7 +324,9 @@ void galileo_e1_dll_pll_veml_tracking_cc::start_tracking()
correlator_data_cpu.set_local_code_and_taps(static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS), correlator_data_cpu.set_local_code_and_taps(static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS),
d_data_code, d_data_code,
d_local_code_shift_chips); d_local_code_shift_chips);
}else{ }
else
{
galileo_e1_code_gen_float_sampled(d_tracking_code, galileo_e1_code_gen_float_sampled(d_tracking_code,
d_acquisition_gnss_synchro->Signal, d_acquisition_gnss_synchro->Signal,
false, false,
@ -357,8 +362,6 @@ void galileo_e1_dll_pll_veml_tracking_cc::start_tracking()
LOG(INFO) << "PULL-IN Doppler [Hz]=" << d_carrier_doppler_hz LOG(INFO) << "PULL-IN Doppler [Hz]=" << d_carrier_doppler_hz
<< " Code Phase correction [samples]=" << delay_correction_samples << " Code Phase correction [samples]=" << delay_correction_samples
<< " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples; << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples;
} }
@ -408,6 +411,7 @@ galileo_e1_dll_pll_veml_tracking_cc::~galileo_e1_dll_pll_veml_tracking_cc()
} }
} }
bool galileo_e1_dll_pll_veml_tracking_cc::acquire_secondary() bool galileo_e1_dll_pll_veml_tracking_cc::acquire_secondary()
{ {
//******* preamble correlation ******** //******* preamble correlation ********
@ -441,12 +445,14 @@ bool galileo_e1_dll_pll_veml_tracking_cc::acquire_secondary()
if (abs(corr_value) == Galileo_E1_C_SECONDARY_CODE_LENGTH) if (abs(corr_value) == Galileo_E1_C_SECONDARY_CODE_LENGTH)
{ {
return true; return true;
}else }
else
{ {
return false; return false;
} }
} }
bool galileo_e1_dll_pll_veml_tracking_cc::cn0_and_tracking_lock_status() bool galileo_e1_dll_pll_veml_tracking_cc::cn0_and_tracking_lock_status()
{ {
// ####### CN0 ESTIMATION AND LOCK DETECTORS ###### // ####### CN0 ESTIMATION AND LOCK DETECTORS ######
@ -480,11 +486,15 @@ bool galileo_e1_dll_pll_veml_tracking_cc::cn0_and_tracking_lock_status()
this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock
d_carrier_lock_fail_counter = 0; d_carrier_lock_fail_counter = 0;
return false; return false;
}else{ }
else
{
return true; return true;
} }
} }
} }
// correlation requires: // correlation requires:
// - updated remnant carrier phase in radians (rem_carr_phase_rad) // - updated remnant carrier phase in radians (rem_carr_phase_rad)
// - updated remnant code phase in samples (d_rem_code_phase_samples) // - updated remnant code phase in samples (d_rem_code_phase_samples)
@ -515,6 +525,7 @@ void galileo_e1_dll_pll_veml_tracking_cc::do_correlation_step(const gr_complex*
} }
} }
void galileo_e1_dll_pll_veml_tracking_cc::run_dll_pll(bool disable_costas_loop) void galileo_e1_dll_pll_veml_tracking_cc::run_dll_pll(bool disable_costas_loop)
{ {
// ################## PLL ########################################################## // ################## PLL ##########################################################
@ -523,7 +534,9 @@ void galileo_e1_dll_pll_veml_tracking_cc::run_dll_pll(bool disable_costas_loop)
{ {
// Secondary code acquired. No symbols transition should be present in the signal // Secondary code acquired. No symbols transition should be present in the signal
d_carr_error_hz = pll_four_quadrant_atan(d_P_accu) / GALILEO_TWO_PI; d_carr_error_hz = pll_four_quadrant_atan(d_P_accu) / GALILEO_TWO_PI;
}else{ }
else
{
// Costas loop discriminator, insensitive to 180 deg phase transitions // Costas loop discriminator, insensitive to 180 deg phase transitions
d_carr_error_hz = pll_cloop_two_quadrant_atan(d_P_accu) / GALILEO_TWO_PI; d_carr_error_hz = pll_cloop_two_quadrant_atan(d_P_accu) / GALILEO_TWO_PI;
} }
@ -540,9 +553,9 @@ void galileo_e1_dll_pll_veml_tracking_cc::run_dll_pll(bool disable_costas_loop)
d_code_error_chips = dll_nc_vemlp_normalized(d_VE_accu, d_E_accu, d_L_accu, d_VL_accu); // [chips/Ti] d_code_error_chips = dll_nc_vemlp_normalized(d_VE_accu, d_E_accu, d_L_accu, d_VL_accu); // [chips/Ti]
// Code discriminator filter // Code discriminator filter
d_code_error_filt_chips = d_code_loop_filter.get_code_nco(d_code_error_chips); // [chips/second] d_code_error_filt_chips = d_code_loop_filter.get_code_nco(d_code_error_chips); // [chips/second]
} }
void galileo_e1_dll_pll_veml_tracking_cc::clear_tracking_vars() void galileo_e1_dll_pll_veml_tracking_cc::clear_tracking_vars()
{ {
*d_Very_Early = gr_complex(0,0); *d_Very_Early = gr_complex(0,0);
@ -557,6 +570,7 @@ void galileo_e1_dll_pll_veml_tracking_cc::clear_tracking_vars()
d_current_symbol = 0; d_current_symbol = 0;
} }
void galileo_e1_dll_pll_veml_tracking_cc::log_data() void galileo_e1_dll_pll_veml_tracking_cc::log_data()
{ {
if(d_dump) if(d_dump)
@ -628,10 +642,11 @@ void galileo_e1_dll_pll_veml_tracking_cc::log_data()
} }
} }
} }
int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
{ {
// Block input data and block output stream pointers // Block input data and block output stream pointers
const gr_complex* in = reinterpret_cast<const gr_complex *>(input_items[0]); const gr_complex* in = reinterpret_cast<const gr_complex *>(input_items[0]);
Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]); Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
@ -687,8 +702,9 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
{ {
clear_tracking_vars(); clear_tracking_vars();
d_state = 0; // loss-of-lock detected d_state = 0; // loss-of-lock detected
}else{ }
else
{
// perform DLL/PLL tracking loop computations // perform DLL/PLL tracking loop computations
run_dll_pll(false); run_dll_pll(false);
@ -700,7 +716,6 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
d_rem_carr_phase_rad = std::fmod(d_rem_carr_phase_rad, GALILEO_TWO_PI); d_rem_carr_phase_rad = std::fmod(d_rem_carr_phase_rad, GALILEO_TWO_PI);
// ################## DLL COMMANDS ################################################# // ################## DLL COMMANDS #################################################
// Code error from DLL // Code error from DLL
double code_error_filt_secs; double code_error_filt_secs;
code_error_filt_secs = (Galileo_E1_CODE_PERIOD * d_code_error_filt_chips) / Galileo_E1_CODE_CHIP_RATE_HZ; // [seconds] code_error_filt_secs = (Galileo_E1_CODE_PERIOD * d_code_error_filt_chips) / Galileo_E1_CODE_CHIP_RATE_HZ; // [seconds]
@ -719,7 +734,9 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
{ {
current_synchro_data.Prompt_I = static_cast<double>((*d_Prompt_Data).real()); current_synchro_data.Prompt_I = static_cast<double>((*d_Prompt_Data).real());
current_synchro_data.Prompt_Q = static_cast<double>((*d_Prompt_Data).imag()); current_synchro_data.Prompt_Q = static_cast<double>((*d_Prompt_Data).imag());
}else{ }
else
{
current_synchro_data.Prompt_I = static_cast<double>((*d_Prompt).real()); current_synchro_data.Prompt_I = static_cast<double>((*d_Prompt).real());
current_synchro_data.Prompt_Q = static_cast<double>((*d_Prompt).imag()); current_synchro_data.Prompt_Q = static_cast<double>((*d_Prompt).imag());
} }
@ -764,7 +781,6 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
d_local_code_shift_chips[3] = d_early_late_spc_narrow_chips; d_local_code_shift_chips[3] = d_early_late_spc_narrow_chips;
d_local_code_shift_chips[4] = d_very_early_late_spc_narrow_chips; d_local_code_shift_chips[4] = d_very_early_late_spc_narrow_chips;
LOG(INFO) << "Enabled " << d_extend_correlation_symbols << " [symbols] extended correlator for CH " LOG(INFO) << "Enabled " << d_extend_correlation_symbols << " [symbols] extended correlator for CH "
<< d_channel << d_channel
<< " : Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN); << " : Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN);
@ -806,7 +822,9 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
d_P_accu += *d_Prompt; d_P_accu += *d_Prompt;
d_L_accu += *d_Late; d_L_accu += *d_Late;
d_VL_accu += *d_Very_Late; d_VL_accu += *d_Very_Late;
}else{ }
else
{
d_VE_accu -= *d_Very_Early; d_VE_accu -= *d_Very_Early;
d_E_accu -= *d_Early; d_E_accu -= *d_Early;
d_P_accu -= *d_Prompt; d_P_accu -= *d_Prompt;
@ -873,7 +891,9 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
d_P_accu += *d_Prompt; d_P_accu += *d_Prompt;
d_L_accu += *d_Late; d_L_accu += *d_Late;
d_VL_accu += *d_Very_Late; d_VL_accu += *d_Very_Late;
}else{ }
else
{
d_VE_accu -= *d_Very_Early; d_VE_accu -= *d_Very_Early;
d_E_accu -= *d_Early; d_E_accu -= *d_Early;
d_P_accu -= *d_Prompt; d_P_accu -= *d_Prompt;
@ -889,7 +909,9 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
{ {
clear_tracking_vars(); clear_tracking_vars();
d_state = 0; // loss-of-lock detected d_state = 0; // loss-of-lock detected
}else{ }
else
{
run_dll_pll(true); // Costas loop disabled, use four quadrant atan run_dll_pll(true); // Costas loop disabled, use four quadrant atan
// ################## PLL ########################################################## // ################## PLL ##########################################################
@ -900,7 +922,6 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
d_rem_carr_phase_rad = std::fmod(d_rem_carr_phase_rad, GALILEO_TWO_PI); d_rem_carr_phase_rad = std::fmod(d_rem_carr_phase_rad, GALILEO_TWO_PI);
// ################## DLL ########################################################## // ################## DLL ##########################################################
// Code phase accumulator // Code phase accumulator
double code_error_filt_secs; double code_error_filt_secs;
code_error_filt_secs = (Galileo_E1_CODE_PERIOD * d_code_error_filt_chips) / Galileo_E1_CODE_CHIP_RATE_HZ; //[seconds] code_error_filt_secs = (Galileo_E1_CODE_PERIOD * d_code_error_filt_chips) / Galileo_E1_CODE_CHIP_RATE_HZ; //[seconds]
@ -912,7 +933,7 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
double T_prn_seconds = T_chip_seconds * Galileo_E1_B_CODE_LENGTH_CHIPS; double T_prn_seconds = T_chip_seconds * Galileo_E1_B_CODE_LENGTH_CHIPS;
double T_prn_samples = T_prn_seconds * static_cast<double>(d_fs_in); double T_prn_samples = T_prn_seconds * static_cast<double>(d_fs_in);
double K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast<double>(d_fs_in); double K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast<double>(d_fs_in);
d_current_prn_length_samples = round(K_blk_samples); //round to a discrete samples d_current_prn_length_samples = round(K_blk_samples); // round to a discrete number of samples
// ########### Output the tracking results to Telemetry block ########## // ########### Output the tracking results to Telemetry block ##########
current_synchro_data.Prompt_I = static_cast<double>((*d_Prompt_Data).real()); current_synchro_data.Prompt_I = static_cast<double>((*d_Prompt_Data).real());
@ -954,7 +975,9 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
if (current_synchro_data.Flag_valid_symbol_output) if (current_synchro_data.Flag_valid_symbol_output)
{ {
return 1; return 1;
}else{ }
else
{
return 0; return 0;
} }
} }
@ -1209,8 +1232,6 @@ void galileo_e1_dll_pll_veml_tracking_cc::set_channel(unsigned int channel)
} }
void galileo_e1_dll_pll_veml_tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) void galileo_e1_dll_pll_veml_tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{ {
d_acquisition_gnss_synchro = p_gnss_synchro; d_acquisition_gnss_synchro = p_gnss_synchro;

View File

@ -732,7 +732,9 @@ int gps_l5i_dll_pll_tracking_cc::general_work (int noutput_items __attribute__((
if (d_enable_tracking) if (d_enable_tracking)
{ {
return 1; return 1;
}else{ }
else
{
return 0; return 0;
} }
} }