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

Ensure that a terminal is not open when the flag --noshow_plots is passed to the tests

This commit is contained in:
Carles Fernandez 2018-07-06 11:14:38 +02:00
parent 4154533812
commit 2f3376dc38
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
7 changed files with 136 additions and 16 deletions

View File

@ -600,6 +600,14 @@ void ObsSystemTest::compute_pseudorange_error(
Gnuplot::set_GNUPlotPath(gnuplot_path);
Gnuplot g1("linespoints");
if (FLAGS_show_plots)
{
g1.showonscreen(); // window output
}
else
{
g1.disablescreen();
}
g1.set_title(signal_name + " Pseudorange error");
g1.set_grid();
g1.set_xlabel("PRN");
@ -620,7 +628,6 @@ void ObsSystemTest::compute_pseudorange_error(
}
g1.savetops("Pseudorange_error_" + signal_name);
g1.savetopdf("Pseudorange_error_" + signal_name, 18);
if (FLAGS_show_plots) g1.showonscreen(); // window output
}
catch (const GnuplotException& ge)
{
@ -691,6 +698,14 @@ void ObsSystemTest::compute_carrierphase_error(
Gnuplot::set_GNUPlotPath(gnuplot_path);
Gnuplot g1("linespoints");
if (FLAGS_show_plots)
{
g1.showonscreen(); // window output
}
else
{
g1.disablescreen();
}
g1.set_title(signal_name + " Carrier phase error");
g1.set_grid();
g1.set_xlabel("PRN");
@ -711,7 +726,6 @@ void ObsSystemTest::compute_carrierphase_error(
}
g1.savetops("Carrier_phase_error_" + signal_name);
g1.savetopdf("Carrier_phase_error_" + signal_name, 18);
if (FLAGS_show_plots) g1.showonscreen(); // window output
}
catch (const GnuplotException& ge)
{
@ -782,6 +796,14 @@ void ObsSystemTest::compute_doppler_error(
Gnuplot::set_GNUPlotPath(gnuplot_path);
Gnuplot g1("linespoints");
if (FLAGS_show_plots)
{
g1.showonscreen(); // window output
}
else
{
g1.disablescreen();
}
g1.set_title(signal_name + " Doppler error");
g1.set_grid();
g1.set_xlabel("PRN");
@ -802,7 +824,6 @@ void ObsSystemTest::compute_doppler_error(
}
g1.savetops("Doppler_error_" + signal_name);
g1.savetopdf("Doppler_error_" + signal_name, 18);
if (FLAGS_show_plots) g1.showonscreen(); // window output
}
catch (const GnuplotException& ge)
{

View File

@ -619,6 +619,14 @@ void StaticPositionSystemTest::print_results(const std::vector<double>& east,
Gnuplot::set_GNUPlotPath(gnuplot_path);
Gnuplot g1("points");
if (FLAGS_show_plots)
{
g1.showonscreen(); // window output
}
else
{
g1.disablescreen();
}
g1.set_title("2D precision");
g1.set_xlabel("East [m]");
g1.set_ylabel("North [m]");
@ -635,9 +643,16 @@ void StaticPositionSystemTest::print_results(const std::vector<double>& east,
g1.savetops("Position_test_2D");
g1.savetopdf("Position_test_2D", 18);
if (FLAGS_show_plots) g1.showonscreen(); // window output
Gnuplot g2("points");
if (FLAGS_show_plots)
{
g2.showonscreen(); // window output
}
else
{
g2.disablescreen();
}
g2.set_title("3D precision");
g2.set_xlabel("East [m]");
g2.set_ylabel("North [m]");
@ -656,7 +671,6 @@ void StaticPositionSystemTest::print_results(const std::vector<double>& east,
g2.savetops("Position_test_3D");
g2.savetopdf("Position_test_3D");
if (FLAGS_show_plots) g2.showonscreen(); // window output
}
catch (const GnuplotException& ge)
{

View File

@ -116,6 +116,14 @@ TEST(FFTLengthTest, MeasureExecutionTime)
Gnuplot::set_GNUPlotPath(gnuplot_path);
Gnuplot g1("linespoints");
if (FLAGS_show_plots)
{
g1.showonscreen(); // window output
}
else
{
g1.disablescreen();
}
g1.set_title("FFT execution times for different lengths");
g1.set_grid();
g1.set_xlabel("FFT length");
@ -124,9 +132,16 @@ TEST(FFTLengthTest, MeasureExecutionTime)
g1.set_style("points").plot_xy(powers_of_two, execution_times_powers_of_two, "Power of 2");
g1.savetops("FFT_execution_times_extended");
g1.savetopdf("FFT_execution_times_extended", 18);
if (FLAGS_show_plots) g1.showonscreen(); // window output
Gnuplot g2("linespoints");
if (FLAGS_show_plots)
{
g2.showonscreen(); // window output
}
else
{
g2.disablescreen();
}
g2.set_title("FFT execution times for different lengths (up to 2^{14}=16384)");
g2.set_grid();
g2.set_xlabel("FFT length");

View File

@ -201,6 +201,14 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid()
Gnuplot::set_GNUPlotPath(gnuplot_path);
Gnuplot g1("lines");
if (FLAGS_show_plots)
{
g1.showonscreen(); // window output
}
else
{
g1.disablescreen();
}
g1.set_title("Galileo E1b/c signal acquisition for satellite PRN #" + std::to_string(gnss_synchro.PRN));
g1.set_xlabel("Doppler [Hz]");
g1.set_ylabel("Sample");
@ -209,7 +217,6 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid()
g1.savetops("Galileo_E1_acq_grid");
g1.savetopdf("Galileo_E1_acq_grid");
if (FLAGS_show_plots) g1.showonscreen();
}
catch (const GnuplotException& ge)
{

View File

@ -202,6 +202,14 @@ void GpsL1CaPcpsAcquisitionTest::plot_grid()
Gnuplot::set_GNUPlotPath(gnuplot_path);
Gnuplot g1("lines");
if (FLAGS_show_plots)
{
g1.showonscreen(); // window output
}
else
{
g1.disablescreen();
}
g1.set_title("GPS L1 C/A signal acquisition for satellite PRN #" + std::to_string(gnss_synchro.PRN));
g1.set_xlabel("Doppler [Hz]");
g1.set_ylabel("Sample");
@ -210,7 +218,6 @@ void GpsL1CaPcpsAcquisitionTest::plot_grid()
g1.savetops("GPS_L1_acq_grid");
g1.savetopdf("GPS_L1_acq_grid");
if (FLAGS_show_plots) g1.showonscreen();
}
catch (const GnuplotException &ge)
{

View File

@ -205,6 +205,14 @@ void GpsL2MPcpsAcquisitionTest::plot_grid()
Gnuplot::set_GNUPlotPath(gnuplot_path);
Gnuplot g1("impulses");
if (FLAGS_show_plots)
{
g1.showonscreen(); // window output
}
else
{
g1.disablescreen();
}
g1.set_title("GPS L2CM signal acquisition for satellite PRN #" + std::to_string(gnss_synchro.PRN));
g1.set_xlabel("Doppler [Hz]");
g1.set_ylabel("Sample");
@ -213,7 +221,6 @@ void GpsL2MPcpsAcquisitionTest::plot_grid()
g1.savetops("GPS_L2CM_acq_grid");
g1.savetopdf("GPS_L2CM_acq_grid");
if (FLAGS_show_plots) g1.showonscreen();
}
catch (const GnuplotException &ge)
{

View File

@ -795,7 +795,14 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
for (unsigned int current_cn0_idx = 0; current_cn0_idx < generator_CN0_values.size(); current_cn0_idx++)
{
Gnuplot g1("linespoints");
if (FLAGS_show_plots) g1.showonscreen(); // window output
if (FLAGS_show_plots)
{
g1.showonscreen(); // window output
}
else
{
g1.disablescreen();
}
g1.set_title(std::to_string(generator_CN0_values.at(current_cn0_idx)) + " dB-Hz, " + "PLL/DLL BW: " + std::to_string(PLL_wide_bw_values.at(config_idx)) + "," + std::to_string(DLL_wide_bw_values.at(config_idx)) + " Hz" + "GPS L1 C/A (PRN #" + std::to_string(FLAGS_test_satellite_PRN) + ")");
g1.set_grid();
g1.set_xlabel("Time [s]");
@ -809,7 +816,14 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
g1.savetopdf("Correlators_outputs" + std::to_string(generator_CN0_values.at(current_cn0_idx)), 18);
}
Gnuplot g2("points");
if (FLAGS_show_plots) g2.showonscreen(); // window output
if (FLAGS_show_plots)
{
g2.showonscreen(); // window output
}
else
{
g2.disablescreen();
}
g2.set_multiplot(ceil(static_cast<float>(generator_CN0_values.size()) / 2.0),
ceil(static_cast<float>(generator_CN0_values.size()) / 2));
for (unsigned int current_cn0_idx = 0; current_cn0_idx < generator_CN0_values.size(); current_cn0_idx++)
@ -840,7 +854,14 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
g3.set_legend();
g3.savetops("CN0_output");
g3.savetopdf("CN0_output", 18);
if (FLAGS_show_plots) g3.showonscreen(); // window output
if (FLAGS_show_plots)
{
g3.showonscreen(); // window output
}
else
{
g3.disablescreen();
}
}
//PLOT ERROR FIGURES (only if it is used the signal generator)
@ -849,7 +870,14 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
if (FLAGS_plot_detail_level >= 1)
{
Gnuplot g5("points");
if (FLAGS_show_plots) g5.showonscreen(); // window output
if (FLAGS_show_plots)
{
g5.showonscreen(); // window output
}
else
{
g5.disablescreen();
}
g5.set_title("Code delay error, PLL/DLL BW: " + std::to_string(PLL_wide_bw_values.at(config_idx)) + "," + std::to_string(DLL_wide_bw_values.at(config_idx)) + " Hz (PRN #" + std::to_string(FLAGS_test_satellite_PRN) + ")");
g5.set_grid();
g5.set_xlabel("Time [s]");
@ -874,7 +902,14 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
Gnuplot g6("points");
if (FLAGS_show_plots) g6.showonscreen(); // window output
if (FLAGS_show_plots)
{
g6.showonscreen(); // window output
}
else
{
g6.disablescreen();
}
g6.set_title("Accumulated carrier phase error, PLL/DLL BW: " + std::to_string(PLL_wide_bw_values.at(config_idx)) + "," + std::to_string(DLL_wide_bw_values.at(config_idx)) + " Hz (PRN #" + std::to_string(FLAGS_test_satellite_PRN) + ")");
g6.set_grid();
g6.set_xlabel("Time [s]");
@ -898,7 +933,14 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
g6.savetopdf("Carrier_phase_error_output", 18);
Gnuplot g4("points");
if (FLAGS_show_plots) g4.showonscreen(); // window output
if (FLAGS_show_plots)
{
g4.showonscreen(); // window output
}
else
{
g4.disablescreen();
}
g4.set_multiplot(ceil(static_cast<float>(generator_CN0_values.size()) / 2.0),
ceil(static_cast<float>(generator_CN0_values.size()) / 2));
for (unsigned int current_cn0_idx = 0; current_cn0_idx < generator_CN0_values_sweep_copy.at(config_idx).size(); current_cn0_idx++)
@ -942,7 +984,14 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
//plot metrics
Gnuplot g7("linespoints");
if (FLAGS_show_plots) g7.showonscreen(); // window output
if (FLAGS_show_plots)
{
g7.showonscreen(); // window output
}
else
{
g7.disablescreen();
}
g7.set_title("Doppler error metrics (PRN #" + std::to_string(FLAGS_test_satellite_PRN) + ")");
g7.set_grid();
g7.set_xlabel("CN0 [dB-Hz]");