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

Fix name of output files

This commit is contained in:
Carles Fernandez 2018-09-06 11:48:40 +02:00
parent ab1c87bdc4
commit 3adba38c34

View File

@ -67,6 +67,7 @@ public:
int configure_receiver(); int configure_receiver();
int run_receiver(); int run_receiver();
void check_results(); void check_results();
std::string config_filename_no_extension;
private: private:
std::string generator_binary; std::string generator_binary;
@ -608,7 +609,10 @@ void StaticPositionSystemTest::check_results()
std::stringstream stm; std::stringstream stm;
std::ofstream position_test_file; std::ofstream position_test_file;
if (!FLAGS_config_file_ptest.empty())
{
stm << "Configuration file: " << FLAGS_config_file_ptest << std::endl;
}
if (FLAGS_config_file_ptest.empty()) if (FLAGS_config_file_ptest.empty())
{ {
stm << "---- ACCURACY ----" << std::endl; stm << "---- ACCURACY ----" << std::endl;
@ -726,6 +730,10 @@ void StaticPositionSystemTest::check_results()
//report //report
std::cout << "----- Position and Velocity 3D ECEF error statistics -----" << std::endl; std::cout << "----- Position and Velocity 3D ECEF error statistics -----" << std::endl;
if (!FLAGS_config_file_ptest.empty())
{
std::cout << "Configuration file: " << FLAGS_config_file_ptest << std::endl;
}
std::streamsize ss = std::cout.precision(); std::streamsize ss = std::cout.precision();
std::cout << std::setprecision(10) << "---- 3D ECEF Position RMSE = " std::cout << std::setprecision(10) << "---- 3D ECEF Position RMSE = "
<< rmse_R_eb_e << ", mean = " << error_mean_R_eb_e << rmse_R_eb_e << ", mean = " << error_mean_R_eb_e
@ -767,7 +775,7 @@ void StaticPositionSystemTest::check_results()
} }
else else
{ {
g1.savetops("ECEF_3d_error_" + FLAGS_config_file_ptest.erase(FLAGS_config_file_ptest.length() - 5)); g1.savetops("ECEF_3d_error_" + config_filename_no_extension);
} }
arma::vec time_vector_from_start_s = receiver_time_s - receiver_time_s(0); arma::vec time_vector_from_start_s = receiver_time_s - receiver_time_s(0);
Gnuplot g3("linespoints"); Gnuplot g3("linespoints");
@ -798,7 +806,7 @@ void StaticPositionSystemTest::check_results()
} }
else else
{ {
g3.savetops("Position_3d_error_" + FLAGS_config_file_ptest.erase(FLAGS_config_file_ptest.length() - 5)); g3.savetops("Position_3d_error_" + config_filename_no_extension);
} }
Gnuplot g4("linespoints"); Gnuplot g4("linespoints");
@ -829,7 +837,7 @@ void StaticPositionSystemTest::check_results()
} }
else else
{ {
g4.savetops("Velocity_3d_error_" + FLAGS_config_file_ptest.erase(FLAGS_config_file_ptest.length() - 5)); g4.savetops("Velocity_3d_error_" + config_filename_no_extension);
} }
} }
} }
@ -907,8 +915,8 @@ void StaticPositionSystemTest::print_results(const std::vector<double>& east,
} }
else else
{ {
g1.savetops("Position_test_2D_" + FLAGS_config_file_ptest.erase(FLAGS_config_file_ptest.length() - 5)); g1.savetops("Position_test_2D_" + config_filename_no_extension);
g1.savetopdf("Position_test_2D_" + FLAGS_config_file_ptest.erase(FLAGS_config_file_ptest.length() - 5), 18); g1.savetopdf("Position_test_2D_" + config_filename_no_extension, 18);
} }
Gnuplot g2("points"); Gnuplot g2("points");
@ -942,8 +950,8 @@ void StaticPositionSystemTest::print_results(const std::vector<double>& east,
} }
else else
{ {
g2.savetops("Position_test_3D_" + FLAGS_config_file_ptest.erase(FLAGS_config_file_ptest.length() - 5)); g2.savetops("Position_test_3D_" + config_filename_no_extension);
g2.savetopdf("Position_test_3D_" + FLAGS_config_file_ptest.erase(FLAGS_config_file_ptest.length() - 5)); g2.savetopdf("Position_test_3D_" + config_filename_no_extension);
} }
} }
catch (const GnuplotException& ge) catch (const GnuplotException& ge)
@ -966,6 +974,11 @@ TEST_F(StaticPositionSystemTest, Position_system_test)
generate_signal(); generate_signal();
} }
} }
else
{
config_filename_no_extension = FLAGS_config_file_ptest.substr(FLAGS_config_file_ptest.find_last_of("/\\") + 1);
config_filename_no_extension = config_filename_no_extension.erase(config_filename_no_extension.length() - 5);
}
// Configure receiver // Configure receiver
configure_receiver(); configure_receiver();