1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 12:40:35 +00:00

Adding a parameter to allow the acquisition engine to block the samples flow in stanby mode, very useful in unit testing (disabled by default)

This commit is contained in:
Javier Arribas 2018-06-28 17:39:37 +02:00
parent f6396fe0e6
commit b0eb9f3aac
3 changed files with 12 additions and 4 deletions

View File

@ -682,9 +682,12 @@ int pcps_acquisition::general_work(int noutput_items __attribute__((unused)),
gr::thread::scoped_lock lk(d_setlock); gr::thread::scoped_lock lk(d_setlock);
if (!d_active or d_worker_active) if (!d_active or d_worker_active)
{
if (!acq_parameters.blocking_on_stanby)
{ {
d_sample_counter += d_fft_size * ninput_items[0]; d_sample_counter += d_fft_size * ninput_items[0];
consume_each(ninput_items[0]); consume_each(ninput_items[0]);
}
if (d_step_two) if (d_step_two)
{ {
d_doppler_center_step_two = static_cast<float>(d_gnss_synchro->Acq_doppler_hz); d_doppler_center_step_two = static_cast<float>(d_gnss_synchro->Acq_doppler_hz);
@ -708,8 +711,11 @@ int pcps_acquisition::general_work(int noutput_items __attribute__((unused)),
d_input_power = 0.0; d_input_power = 0.0;
d_test_statistics = 0.0; d_test_statistics = 0.0;
d_state = 1; d_state = 1;
if (!acq_parameters.blocking_on_stanby)
{
d_sample_counter += d_fft_size * ninput_items[0]; // sample counter d_sample_counter += d_fft_size * ninput_items[0]; // sample counter
consume_each(ninput_items[0]); consume_each(ninput_items[0]);
}
break; break;
} }

View File

@ -50,4 +50,5 @@ Acq_Conf::Acq_Conf()
dump_filename = ""; dump_filename = "";
dump_channel = 0; dump_channel = 0;
it_size = sizeof(char); it_size = sizeof(char);
blocking_on_stanby = false;
} }

View File

@ -51,6 +51,7 @@ public:
bool use_CFAR_algorithm_flag; bool use_CFAR_algorithm_flag;
bool dump; bool dump;
bool blocking; bool blocking;
bool blocking_on_stanby; //enable it only for unit testing to avoid sample consume on idle status
bool make_2_steps; bool make_2_steps;
std::string dump_filename; std::string dump_filename;
unsigned int dump_channel; unsigned int dump_channel;