From 09bcd1981cda51de306e1cbd84dddfd93c80f199 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 7 Jul 2020 18:53:50 +0200 Subject: [PATCH] Replace std::endl by \n character. There is no need to always flush the stream. --- src/algorithms/PVT/adapters/rtklib_pvt.cc | 32 +- .../PVT/gnuradio_blocks/rtklib_pvt_gs.cc | 38 +- src/algorithms/PVT/libs/geojson_printer.cc | 32 +- src/algorithms/PVT/libs/gpx_printer.cc | 34 +- src/algorithms/PVT/libs/hybrid_ls_pvt.cc | 6 +- src/algorithms/PVT/libs/kml_printer.cc | 192 ++-- src/algorithms/PVT/libs/nmea_printer.cc | 6 +- src/algorithms/PVT/libs/rinex_printer.cc | 976 +++++++++--------- src/algorithms/PVT/libs/rtcm.cc | 6 +- src/algorithms/PVT/libs/rtcm.h | 22 +- src/algorithms/PVT/libs/rtcm_printer.cc | 10 +- src/algorithms/PVT/libs/rtklib_solver.cc | 6 +- ...ileo_e5a_noncoherent_iq_acquisition_caf.cc | 4 +- ...o_e5a_noncoherent_iq_acquisition_caf_cc.cc | 4 +- .../gnuradio_blocks/pcps_acquisition.cc | 8 +- .../pcps_acquisition_fine_doppler_cc.cc | 6 +- .../pcps_assisted_acquisition_cc.cc | 6 +- .../pcps_opencl_acquisition_cc.cc | 14 +- .../acquisition/libs/fpga_acquisition.cc | 12 +- src/algorithms/channel/adapters/channel.cc | 4 +- .../adapters/freq_xlating_fir_filter.cc | 2 +- .../adapters/pulse_blanking_filter.cc | 2 +- src/algorithms/libs/geofunctions.cc | 2 +- src/algorithms/libs/gnss_sdr_flags.cc | 52 +- src/algorithms/libs/opencl/cl.hpp | 2 +- .../apps/volk_gnsssdr-config-info.cc | 10 +- .../apps/volk_gnsssdr_option_helpers.cc | 16 +- .../volk_gnsssdr/apps/volk_gnsssdr_profile.cc | 58 +- .../volk_gnsssdr/lib/qa_utils.cc | 28 +- .../volk_gnsssdr/lib/testqa.cc | 32 +- .../gnuradio_blocks/hybrid_observables_gs.cc | 18 +- .../adapters/direct_resampler_conditioner.cc | 2 +- .../adapters/mmse_resampler_conditioner.cc | 4 +- .../gnuradio_blocks/signal_generator_c.cc | 2 +- .../adapters/ad9361_fpga_signal_source.cc | 98 +- .../adapters/custom_udp_signal_source.cc | 6 +- .../adapters/file_signal_source.cc | 28 +- .../adapters/fmcomms2_signal_source.cc | 90 +- .../multichannel_file_signal_source.cc | 28 +- .../adapters/nsr_file_signal_source.cc | 20 +- .../adapters/osmosdr_signal_source.cc | 22 +- .../adapters/plutosdr_signal_source.cc | 46 +- .../adapters/rtl_tcp_signal_source.cc | 10 +- .../adapters/spir_file_signal_source.cc | 20 +- .../spir_gss6450_file_signal_source.cc | 20 +- .../two_bit_cpx_file_signal_source.cc | 20 +- .../two_bit_packed_file_signal_source.cc | 20 +- .../adapters/uhd_signal_source.cc | 16 +- .../gr_complex_ip_packet_source.cc | 12 +- .../gnuradio_blocks/labsat23_source.cc | 92 +- .../rtl_tcp_signal_source_c.cc | 32 +- .../signal_source/libs/ad9361_manager.cc | 120 +-- .../signal_source/libs/fpga_switch.cc | 8 +- .../beidou_b1i_telemetry_decoder_gs.cc | 10 +- .../beidou_b3i_telemetry_decoder_gs.cc | 10 +- .../galileo_telemetry_decoder_gs.cc | 16 +- .../glonass_l1_ca_telemetry_decoder_gs.cc | 6 +- .../glonass_l2_ca_telemetry_decoder_gs.cc | 6 +- .../gps_l1_ca_telemetry_decoder_gs.cc | 2 +- .../gps_l2c_telemetry_decoder_gs.cc | 6 +- .../gps_l5_telemetry_decoder_gs.cc | 6 +- .../sbas_l1_telemetry_decoder_gs.cc | 4 +- .../telemetry_decoder/libs/viterbi_decoder.cc | 10 +- .../adapters/beidou_b1i_dll_pll_tracking.cc | 8 +- .../adapters/beidou_b3i_dll_pll_tracking.cc | 4 +- .../galileo_e1_dll_pll_veml_tracking.cc | 6 +- .../galileo_e1_dll_pll_veml_tracking_fpga.cc | 6 +- .../adapters/galileo_e5a_dll_pll_tracking.cc | 6 +- .../galileo_e5a_dll_pll_tracking_fpga.cc | 6 +- .../adapters/gps_l1_ca_dll_pll_tracking.cc | 8 +- .../gps_l1_ca_dll_pll_tracking_fpga.cc | 8 +- .../adapters/gps_l2_m_dll_pll_tracking.cc | 4 +- .../gps_l2_m_dll_pll_tracking_fpga.cc | 4 +- .../adapters/gps_l5_dll_pll_tracking.cc | 6 +- .../adapters/gps_l5_dll_pll_tracking_fpga.cc | 6 +- .../gnuradio_blocks/dll_pll_veml_tracking.cc | 44 +- .../dll_pll_veml_tracking_fpga.cc | 44 +- .../galileo_e1_tcp_connector_tracking_cc.cc | 4 +- ...glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc | 18 +- ...glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc | 18 +- .../glonass_l1_ca_dll_pll_tracking_cc.cc | 10 +- ...glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc | 18 +- ...glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc | 18 +- .../glonass_l2_ca_dll_pll_tracking_cc.cc | 10 +- .../gps_l1_ca_dll_pll_tracking_gpu_cc.cc | 6 +- .../gps_l1_ca_kf_tracking_cc.cc | 12 +- .../gps_l1_ca_tcp_connector_tracking_cc.cc | 6 +- .../tracking/libs/fpga_multicorrelator.cc | 16 +- .../tracking/libs/tcp_communication.cc | 12 +- src/core/libs/channel_status_msg_receiver.cc | 12 +- src/core/libs/gnss_sdr_fpga_sample_counter.cc | 22 +- src/core/libs/gnss_sdr_sample_counter.cc | 8 +- src/core/libs/gnss_sdr_supl_client.cc | 2 +- src/core/libs/gnss_sdr_time_counter.cc | 8 +- src/core/receiver/control_thread.cc | 120 +-- src/core/receiver/gnss_block_factory.cc | 20 +- src/core/receiver/gnss_flowgraph.cc | 24 +- src/core/receiver/tcp_cmd_interface.cc | 22 +- .../beidou_dnav_navigation_message.cc | 6 +- .../glonass_gnav_navigation_message.cc | 2 +- .../gps_cnav_navigation_message.cc | 2 +- .../gps_navigation_message.cc | 4 +- src/main/main.cc | 44 +- src/tests/common-files/gnuplot_i.h | 18 +- .../libs/rtklib_solver_dump_reader.cc | 2 +- .../libs/spirent_motion_csv_dump_reader.cc | 2 +- src/tests/system-tests/position_test.cc | 86 +- src/tests/system-tests/ttff.cc | 58 +- src/tests/test_main.cc | 2 +- .../arithmetic/code_generation_test.cc | 6 +- .../arithmetic/complex_carrier_test.cc | 6 +- .../unit-tests/arithmetic/conjugate_test.cc | 10 +- .../unit-tests/arithmetic/fft_length_test.cc | 10 +- .../unit-tests/arithmetic/fft_speed_test.cc | 4 +- .../arithmetic/magnitude_squared_test.cc | 10 +- .../unit-tests/arithmetic/multiply_test.cc | 14 +- .../arithmetic/preamble_correlator_test.cc | 6 +- .../acquisition/acq_performance_test.cc | 48 +- .../beidou_b1i_pcps_acquisition_test.cc | 16 +- .../beidou_b3i_pcps_acquisition_test.cc | 16 +- ...8ms_ambiguous_acquisition_gsoc2013_test.cc | 14 +- ...cps_ambiguous_acquisition_gsoc2013_test.cc | 14 +- ...e1_pcps_ambiguous_acquisition_gsoc_test.cc | 4 +- ...ileo_e1_pcps_ambiguous_acquisition_test.cc | 20 +- ...e1_pcps_ambiguous_acquisition_test_fpga.cc | 20 +- ...wsr_ambiguous_acquisition_gsoc2013_test.cc | 16 +- ...ync_ambiguous_acquisition_gsoc2014_test.cc | 20 +- ...ong_ambiguous_acquisition_gsoc2013_test.cc | 20 +- ...cps_acquisition_gsoc2014_gensource_test.cc | 12 +- ...ss_l1_ca_pcps_acquisition_gsoc2017_test.cc | 18 +- .../glonass_l1_ca_pcps_acquisition_test.cc | 6 +- .../glonass_l2_ca_pcps_acquisition_test.cc | 14 +- ...ps_l1_ca_pcps_acquisition_gsoc2013_test.cc | 14 +- .../gps_l1_ca_pcps_acquisition_test.cc | 16 +- .../gps_l1_ca_pcps_acquisition_test_fpga.cc | 20 +- ...a_pcps_opencl_acquisition_gsoc2013_test.cc | 20 +- ...cps_quicksync_acquisition_gsoc2014_test.cc | 20 +- ..._ca_pcps_tong_acquisition_gsoc2013_test.cc | 16 +- .../gps_l2_m_pcps_acquisition_test.cc | 20 +- .../adapter/adapter_test.cc | 12 +- .../filter/fir_filter_test.cc | 10 +- .../filter/notch_filter_lite_test.cc | 4 +- .../filter/notch_filter_test.cc | 4 +- .../filter/pulse_blanking_filter_test.cc | 4 +- .../libs/acquisition_dump_reader.cc | 16 +- .../libs/observables_dump_reader.cc | 2 +- .../libs/tlm_dump_reader.cc | 4 +- .../libs/tracking_dump_reader.cc | 2 +- .../libs/tracking_true_obs_reader.cc | 2 +- .../libs/true_observables_reader.cc | 4 +- .../observables/hybrid_observables_test.cc | 66 +- .../hybrid_observables_test_fpga.cc | 84 +- .../pvt/rtklib_solver_test.cc | 58 +- .../direct_resampler_conditioner_cc_test.cc | 2 +- .../resampler/mmse_resampler_test.cc | 4 +- .../galileo_fnav_inav_decoder_test.cc | 4 +- .../gps_l1_ca_telemetry_decoder_test.cc | 16 +- .../cpu_multicorrelator_real_codes_test.cc | 8 +- .../tracking/cpu_multicorrelator_test.cc | 8 +- .../galileo_e1_dll_pll_veml_tracking_test.cc | 4 +- .../tracking/galileo_e5a_tracking_test.cc | 2 +- ...onass_l1_ca_dll_pll_c_aid_tracking_test.cc | 2 +- .../glonass_l1_ca_dll_pll_tracking_test.cc | 2 +- .../gps_l1_ca_dll_pll_tracking_test.cc | 42 +- .../gps_l1_ca_dll_pll_tracking_test_fpga.cc | 28 +- .../tracking/gps_l1_ca_kf_tracking_test.cc | 30 +- .../gps_l2_m_dll_pll_tracking_test.cc | 2 +- .../tracking/gpu_multicorrelator_test.cc | 4 +- .../tracking/tracking_pull-in_test.cc | 38 +- .../tracking/tracking_pull-in_test_fpga.cc | 56 +- src/utils/front-end-cal/front_end_cal.cc | 32 +- src/utils/front-end-cal/main.cc | 108 +- src/utils/rinex-tools/obsdiff.cc | 74 +- src/utils/rinex2assist/main.cc | 50 +- 174 files changed, 2219 insertions(+), 2223 deletions(-) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 79d35746f..97c3b0c92 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -418,10 +418,10 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration, if (positioning_mode == -1) { // warn user and set the default - std::cout << "WARNING: Bad specification of positioning mode." << std::endl; - std::cout << "positioning_mode possible values: Single / Static / Kinematic / PPP_Static / PPP_Kinematic" << std::endl; - std::cout << "positioning_mode specified value: " << positioning_mode_str << std::endl; - std::cout << "Setting positioning_mode to Single" << std::endl; + std::cout << "WARNING: Bad specification of positioning mode.\n"; + std::cout << "positioning_mode possible values: Single / Static / Kinematic / PPP_Static / PPP_Kinematic\n"; + std::cout << "positioning_mode specified value: " << positioning_mode_str << '\n'; + std::cout << "Setting positioning_mode to Single\n"; positioning_mode = PMODE_SINGLE; } @@ -497,10 +497,10 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration, if (iono_model == -1) { // warn user and set the default - std::cout << "WARNING: Bad specification of ionospheric model." << std::endl; - std::cout << "iono_model possible values: OFF / Broadcast / SBAS / Iono-Free-LC / Estimate_STEC / IONEX" << std::endl; - std::cout << "iono_model specified value: " << iono_model_str << std::endl; - std::cout << "Setting iono_model to OFF" << std::endl; + std::cout << "WARNING: Bad specification of ionospheric model.\n"; + std::cout << "iono_model possible values: OFF / Broadcast / SBAS / Iono-Free-LC / Estimate_STEC / IONEX\n"; + std::cout << "iono_model specified value: " << iono_model_str << '\n'; + std::cout << "Setting iono_model to OFF\n"; iono_model = IONOOPT_OFF; /* 0: ionosphere option: correction off */ } @@ -530,10 +530,10 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration, if (trop_model == -1) { // warn user and set the default - std::cout << "WARNING: Bad specification of tropospheric model." << std::endl; - std::cout << "trop_model possible values: OFF / Saastamoinen / SBAS / Estimate_ZTD / Estimate_ZTD_Grad" << std::endl; - std::cout << "trop_model specified value: " << trop_model_str << std::endl; - std::cout << "Setting trop_model to OFF" << std::endl; + std::cout << "WARNING: Bad specification of tropospheric model.\n"; + std::cout << "trop_model possible values: OFF / Saastamoinen / SBAS / Estimate_ZTD / Estimate_ZTD_Grad\n"; + std::cout << "trop_model specified value: " << trop_model_str << '\n'; + std::cout << "Setting trop_model to OFF\n"; trop_model = TROPOPT_OFF; } @@ -608,10 +608,10 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration, if (integer_ambiguity_resolution_gps == -1) { // warn user and set the default - std::cout << "WARNING: Bad specification of GPS ambiguity resolution method." << std::endl; - std::cout << "AR_GPS possible values: OFF / Continuous / Instantaneous / Fix-and-Hold / PPP-AR" << std::endl; - std::cout << "AR_GPS specified value: " << integer_ambiguity_resolution_gps_str << std::endl; - std::cout << "Setting AR_GPS to OFF" << std::endl; + std::cout << "WARNING: Bad specification of GPS ambiguity resolution method.\n"; + std::cout << "AR_GPS possible values: OFF / Continuous / Instantaneous / Fix-and-Hold / PPP-AR\n"; + std::cout << "AR_GPS specified value: " << integer_ambiguity_resolution_gps_str << '\n'; + std::cout << "Setting AR_GPS to OFF\n"; integer_ambiguity_resolution_gps = ARMODE_OFF; } diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index e7fffe6b0..67acba92e 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -179,7 +179,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, // create directory if (!gnss_sdr_create_directory(dump_path)) { - std::cerr << "GNSS-SDR cannot create dump file for the PVT block. Wrong permissions?" << std::endl; + std::cerr << "GNSS-SDR cannot create dump file for the PVT block. Wrong permissions?\n"; d_dump = false; } } @@ -382,7 +382,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, { if (!fs::create_directory(new_folder, ec)) { - std::cout << "Could not create the " << new_folder << " folder." << std::endl; + std::cout << "Could not create the " << new_folder << " folder.\n"; d_xml_base_path = full_path.string(); } } @@ -395,7 +395,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, } if (d_xml_base_path != ".") { - std::cout << "XML files will be stored at " << d_xml_base_path << std::endl; + std::cout << "XML files will be stored at " << d_xml_base_path << '\n'; } d_xml_base_path = d_xml_base_path + fs::path::preferred_separator; @@ -426,8 +426,8 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, int msgflg = IPC_CREAT | 0666; if ((d_sysv_msqid = msgget(d_sysv_msg_key, msgflg)) == -1) { - std::cout << "GNSS-SDR cannot create System V message queues." << std::endl; - LOG(WARNING) << "The System V message queue is not available. Error: " << errno << " - " << strerror(errno) << std::endl; + std::cout << "GNSS-SDR cannot create System V message queues.\n"; + LOG(WARNING) << "The System V message queue is not available. Error: " << errno << " - " << strerror(errno); } // Display time in local time zone @@ -1749,7 +1749,7 @@ bool rtklib_pvt_gs::load_gnss_synchro_map_xml(const std::string& file_name) boost::archive::xml_iarchive xml(ifs); d_gnss_observables_map.clear(); xml >> boost::serialization::make_nvp("GNSS-SDR_gnss_synchro_map", d_gnss_observables_map); - // std::cout << "Loaded gnss_synchro map data with " << gnss_synchro_map.size() << " pseudoranges" << std::endl; + // std::cout << "Loaded gnss_synchro map data with " << gnss_synchro_map.size() << " pseudoranges\n"; } catch (const std::exception& e) { @@ -2088,12 +2088,12 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } catch (const boost::exception& ex) { - std::cout << "RTCM boost exception: " << boost::diagnostic_information(ex) << std::endl; + std::cout << "RTCM boost exception: " << boost::diagnostic_information(ex) << '\n'; LOG(ERROR) << "RTCM boost exception: " << boost::diagnostic_information(ex); } catch (const std::exception& ex) { - std::cout << "RTCM std exception: " << ex.what() << std::endl; + std::cout << "RTCM std exception: " << ex.what() << '\n'; LOG(ERROR) << "RTCM std exception: " << ex.what(); } } @@ -2145,14 +2145,14 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item d_rx_time = static_cast(current_RX_time_ms) / 1000.0; // std::cout << " obs time t0: " << d_gnss_observables_map_t0.cbegin()->second.RX_time // << " t1: " << d_gnss_observables_map_t1.cbegin()->second.RX_time - // << " interp time: " << d_rx_time << std::endl; + // << " interp time: " << d_rx_time << '\n'; d_gnss_observables_map = interpolate_observables(d_gnss_observables_map_t0, d_gnss_observables_map_t1, d_rx_time); flag_compute_pvt_output = true; // d_rx_time = current_RX_time; // std::cout.precision(17); - // std::cout << "current_RX_time: " << current_RX_time << " map time: " << d_gnss_observables_map.begin()->second.RX_time << std::endl; + // std::cout << "current_RX_time: " << current_RX_time << " map time: " << d_gnss_observables_map.begin()->second.RX_time << '\n'; } } } @@ -2164,7 +2164,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { flag_compute_pvt_output = true; // std::cout.precision(17); - // std::cout << "current_RX_time: " << current_RX_time << " map time: " << d_gnss_observables_map.begin()->second.RX_time << std::endl; + // std::cout << "current_RX_time: " << current_RX_time << " map time: " << d_gnss_observables_map.begin()->second.RX_time << '\n'; } flag_pvt_valid = true; } @@ -2199,7 +2199,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item DLOG(INFO) << "Rx clock offset at interpolated RX time: " << Rx_clock_offset_s * 1000.0 << "[s]" << " at RX time: " << static_cast(d_rx_time * 1000.0) << " [ms]"; // Optional debug code: export observables snapshot for rtklib unit testing - // std::cout << "step 1: save gnss_synchro map" << std::endl; + // std::cout << "step 1: save gnss_synchro map\n"; // save_gnss_synchro_map_xml("./gnss_synchro_map.xml"); // getchar(); // stop the execution // end debug @@ -2271,7 +2271,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item std::cout << "First position fix at " << d_user_pvt_solver->get_position_UTC_time() << " UTC"; } std::cout << " is Lat = " << d_user_pvt_solver->get_latitude() << " [deg], Long = " << d_user_pvt_solver->get_longitude() - << " [deg], Height= " << d_user_pvt_solver->get_height() << " [m]" << std::endl; + << " [deg], Height= " << d_user_pvt_solver->get_height() << " [m]\n"; d_ttff_msgbuf ttff; ttff.mtype = 1; d_end = std::chrono::system_clock::now(); @@ -4211,12 +4211,12 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } catch (const boost::exception& ex) { - std::cout << "RTCM boost exception: " << boost::diagnostic_information(ex) << std::endl; + std::cout << "RTCM boost exception: " << boost::diagnostic_information(ex) << '\n'; LOG(ERROR) << "RTCM boost exception: " << boost::diagnostic_information(ex); } catch (const std::exception& ex) { - std::cout << "RTCM std exception: " << ex.what() << std::endl; + std::cout << "RTCM std exception: " << ex.what() << '\n'; LOG(ERROR) << "RTCM std exception: " << ex.what(); } } @@ -4248,7 +4248,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item << std::fixed << std::setprecision(9) << " observations is Lat = " << d_user_pvt_solver->get_latitude() << " [deg], Long = " << d_user_pvt_solver->get_longitude() << std::fixed << std::setprecision(3) - << " [deg], Height = " << d_user_pvt_solver->get_height() << " [m]" << TEXT_RESET << std::endl; + << " [deg], Height = " << d_user_pvt_solver->get_height() << " [m]" << TEXT_RESET << '\n'; std::cout << std::setprecision(ss); DLOG(INFO) << "RX clock offset: " << d_user_pvt_solver->get_time_offset_s() << "[s]"; @@ -4257,7 +4257,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item << TEXT_BOLD_GREEN << "Velocity: " << std::fixed << std::setprecision(3) << "East: " << d_user_pvt_solver->get_rx_vel()[0] << " [m/s], North: " << d_user_pvt_solver->get_rx_vel()[1] - << " [m/s], Up = " << d_user_pvt_solver->get_rx_vel()[2] << " [m/s]" << TEXT_RESET << std::endl; + << " [m/s], Up = " << d_user_pvt_solver->get_rx_vel()[2] << " [m/s]" << TEXT_RESET << '\n'; std::cout << std::setprecision(ss); DLOG(INFO) << "RX clock drift: " << d_user_pvt_solver->get_clock_drift_ppm() << " [ppm]"; @@ -4266,7 +4266,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item // gtime_t rtklib_utc_time = gpst2time(adjgpsweek(d_user_pvt_solver->gps_ephemeris_map.cbegin()->second.i_GPS_week), d_rx_time); // p_time = boost::posix_time::from_time_t(rtklib_utc_time.time); // p_time += boost::posix_time::microseconds(round(rtklib_utc_time.sec * 1e6)); - // std::cout << TEXT_MAGENTA << "Observable RX time (GPST) " << boost::posix_time::to_simple_string(p_time) << TEXT_RESET << std::endl; + // std::cout << TEXT_MAGENTA << "Observable RX time (GPST) " << boost::posix_time::to_simple_string(p_time) << TEXT_RESET << '\n'; DLOG(INFO) << "Position at " << boost::posix_time::to_simple_string(d_user_pvt_solver->get_position_UTC_time()) << " UTC using " << d_user_pvt_solver->get_num_valid_observations() << " observations is Lat = " << d_user_pvt_solver->get_latitude() << " [deg], Long = " << d_user_pvt_solver->get_longitude() @@ -4275,7 +4275,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item /* std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_user_pvt_solver->get_position_UTC_time()) << " UTC using "<< d_user_pvt_solver->get_num_valid_observations() <<" observations is HDOP = " << d_user_pvt_solver->get_hdop() << " VDOP = " << d_user_pvt_solver->get_vdop() - << " GDOP = " << d_user_pvt_solver->get_gdop() << std::endl; */ + << " GDOP = " << d_user_pvt_solver->get_gdop() << '\n'; */ } // PVT MONITOR diff --git a/src/algorithms/PVT/libs/geojson_printer.cc b/src/algorithms/PVT/libs/geojson_printer.cc index 06e046976..95b2becca 100644 --- a/src/algorithms/PVT/libs/geojson_printer.cc +++ b/src/algorithms/PVT/libs/geojson_printer.cc @@ -65,7 +65,7 @@ GeoJSON_Printer::GeoJSON_Printer(const std::string& base_path) { if (!fs::create_directory(new_folder, ec)) { - std::cout << "Could not create the " << new_folder << " folder." << std::endl; + std::cout << "Could not create the " << new_folder << " folder.\n"; geojson_base_path = full_path.string(); } } @@ -78,7 +78,7 @@ GeoJSON_Printer::GeoJSON_Printer(const std::string& base_path) } if (geojson_base_path != ".") { - std::cout << "GeoJSON files will be stored at " << geojson_base_path << std::endl; + std::cout << "GeoJSON files will be stored at " << geojson_base_path << '\n'; } geojson_base_path = geojson_base_path + fs::path::preferred_separator; @@ -160,19 +160,19 @@ bool GeoJSON_Printer::set_headers(const std::string& filename, bool time_tag_nam geojson_file << std::setprecision(14); // Writing the header - geojson_file << "{" << std::endl; - geojson_file << R"( "type": "Feature",)" << std::endl; - geojson_file << " \"properties\": {" << std::endl; - geojson_file << R"( "name": "Locations generated by GNSS-SDR" )" << std::endl; - geojson_file << " }," << std::endl; - geojson_file << " \"geometry\": {" << std::endl; - geojson_file << R"( "type": "MultiPoint",)" << std::endl; - geojson_file << " \"coordinates\": [" << std::endl; + geojson_file << "{\n"; + geojson_file << R"( "type": "Feature",)" << '\n'; + geojson_file << " \"properties\": {\n"; + geojson_file << R"( "name": "Locations generated by GNSS-SDR" )" << '\n'; + geojson_file << " },\n"; + geojson_file << " \"geometry\": {\n"; + geojson_file << R"( "type": "MultiPoint",)" << '\n'; + geojson_file << " \"coordinates\": [\n"; return true; } - std::cout << "File " << filename_ << " cannot be saved. Wrong permissions?" << std::endl; + std::cout << "File " << filename_ << " cannot be saved. Wrong permissions?\n"; return false; } @@ -205,7 +205,7 @@ bool GeoJSON_Printer::print_position(const Pvt_Solution* position, bool print_av } else { - geojson_file << "," << std::endl; + geojson_file << ",\n"; geojson_file << " [" << longitude << ", " << latitude << ", " << height << "]"; } return true; @@ -218,10 +218,10 @@ bool GeoJSON_Printer::close_file() { if (geojson_file.is_open()) { - geojson_file << std::endl; - geojson_file << " ]" << std::endl; - geojson_file << " }" << std::endl; - geojson_file << "}" << std::endl; + geojson_file << '\n'; + geojson_file << " ]\n"; + geojson_file << " }\n"; + geojson_file << "}\n"; geojson_file.close(); // if nothing is written, erase the file diff --git a/src/algorithms/PVT/libs/gpx_printer.cc b/src/algorithms/PVT/libs/gpx_printer.cc index 8ddee75ca..19e1895d2 100644 --- a/src/algorithms/PVT/libs/gpx_printer.cc +++ b/src/algorithms/PVT/libs/gpx_printer.cc @@ -67,7 +67,7 @@ Gpx_Printer::Gpx_Printer(const std::string& base_path) { if (!fs::create_directory(new_folder, ec)) { - std::cout << "Could not create the " << new_folder << " folder." << std::endl; + std::cout << "Could not create the " << new_folder << " folder.\n"; gpx_base_path = full_path.string(); } } @@ -80,7 +80,7 @@ Gpx_Printer::Gpx_Printer(const std::string& base_path) } if (gpx_base_path != ".") { - std::cout << "GPX files will be stored at " << gpx_base_path << std::endl; + std::cout << "GPX files will be stored at " << gpx_base_path << '\n'; } gpx_base_path = gpx_base_path + fs::path::preferred_separator; @@ -144,20 +144,20 @@ bool Gpx_Printer::set_headers(const std::string& filename, bool time_tag_name) // Set iostream numeric format and precision gpx_file.setf(gpx_file.std::ofstream::fixed, gpx_file.std::ofstream::floatfield); gpx_file << std::setprecision(14); - gpx_file << R"()" << std::endl - << R"(" << std::endl - << indent << "" << std::endl - << indent << indent << "Position fixes computed by GNSS-SDR v" << GNSS_SDR_VERSION << "" << std::endl - << indent << indent << "GNSS-SDR position log generated at " << pt << " (local time)" << std::endl - << indent << indent << "" << std::endl; + gpx_file << R"()" << '\n' + << R"(" << '\n' + << indent << "" << '\n' + << indent << indent << "Position fixes computed by GNSS-SDR v" << GNSS_SDR_VERSION << "" << '\n' + << indent << indent << "GNSS-SDR position log generated at " << pt << " (local time)" << '\n' + << indent << indent << "\n"; return true; } - std::cout << "File " << gpx_filename << " cannot be saved. Wrong permissions?" << std::endl; + std::cout << "File " << gpx_filename << " cannot be saved. Wrong permissions?\n"; return false; } @@ -205,7 +205,7 @@ bool Gpx_Printer::print_position(const Pvt_Solution* position, bool print_averag << "" << "" << speed_over_ground << "" << "" << course_over_ground << "" - << "" << std::endl; + << "\n"; return true; } return false; @@ -216,8 +216,8 @@ bool Gpx_Printer::close_file() { if (gpx_file.is_open()) { - gpx_file << indent << indent << "" << std::endl - << indent << "" << std::endl + gpx_file << indent << indent << "" << '\n' + << indent << "" << '\n' << ""; gpx_file.close(); return true; diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc index d0d6bb286..cdab47472 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc @@ -236,7 +236,7 @@ bool Hybrid_Ls_Pvt::get_PVT(std::map gnss_observables_map, do // 3- compute the current ECEF position for this SV using corrected TX time TX_time_corrected_s = Tx_time - SV_clock_bias_s; - // std::cout<<"TX time["<second.i_satellite_PRN<<"]="<second.i_satellite_PRN<<"]="<second.satellitePosition(TX_time_corrected_s); // store satellite positions in a matrix @@ -296,14 +296,14 @@ bool Hybrid_Ls_Pvt::get_PVT(std::map gnss_observables_map, do // execute Bancroft's algorithm to estimate initial receiver position and time DLOG(INFO) << " Executing Bancroft algorithm..."; rx_position_and_time = bancroftPos(satpos.t(), obs); - this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration + this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration this->set_time_offset_s(rx_position_and_time(3) / SPEED_OF_LIGHT_M_S); // save time for the next iteration [meters]->[seconds] } // Execute WLS using previous position as the initialization point rx_position_and_time = leastSquarePos(satpos, obs, W); - this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration + this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration this->set_time_offset_s(this->get_time_offset_s() + rx_position_and_time(3) / SPEED_OF_LIGHT_M_S); // accumulate the rx time error for the next iteration [meters]->[seconds] DLOG(INFO) << "Hybrid Position at TOW=" << hybrid_current_time << " in ECEF (X,Y,Z,t[meters]) = " << rx_position_and_time; diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc index 71ddfaa0d..e610436a4 100644 --- a/src/algorithms/PVT/libs/kml_printer.cc +++ b/src/algorithms/PVT/libs/kml_printer.cc @@ -69,7 +69,7 @@ Kml_Printer::Kml_Printer(const std::string& base_path) { if (!fs::create_directory(new_folder, ec)) { - std::cout << "Could not create the " << new_folder << " folder." << std::endl; + std::cout << "Could not create the " << new_folder << " folder.\n"; kml_base_path = full_path.string(); } } @@ -82,7 +82,7 @@ Kml_Printer::Kml_Printer(const std::string& base_path) } if (kml_base_path != ".") { - std::cout << "KML files will be stored at " << kml_base_path << std::endl; + std::cout << "KML files will be stored at " << kml_base_path << '\n'; } kml_base_path = kml_base_path + fs::path::preferred_separator; @@ -92,7 +92,7 @@ Kml_Printer::Kml_Printer(const std::string& base_path) int fd = mkstemp(tmp_filename_); if (fd == -1) { - std::cerr << "Error in KML printer: failed to create temporary file" << std::endl; + std::cerr << "Error in KML printer: failed to create temporary file\n"; } else { @@ -169,64 +169,64 @@ bool Kml_Printer::set_headers(const std::string& filename, bool time_tag_name) tmp_file.setf(tmp_file.std::ofstream::fixed, tmp_file.std::ofstream::floatfield); tmp_file << std::setprecision(14); - kml_file << R"()" << std::endl - << R"()" << std::endl - << indent << "" << std::endl - << indent << indent << "GNSS Track" << std::endl - << indent << indent << "" << std::endl - << indent << indent << indent << indent << "GNSS-SDR Receiver position log file created at " << pt << "" << std::endl - << indent << indent << indent << indent << "https://gnss-sdr.org/" << std::endl - << indent << indent << indent << "" << std::endl - << indent << indent << "]]>" << std::endl - << indent << indent << "" << std::endl - << indent << indent << "" << std::endl - << indent << indent << "" << std::endl - << indent << indent << "" << std::endl - << indent << indent << "" << std::endl - << indent << indent << indent << "" << std::endl - << indent << indent << indent << indent << "normal" << std::endl - << indent << indent << indent << indent << "#track_n" << std::endl - << indent << indent << indent << "" << std::endl - << indent << indent << indent << "" << std::endl - << indent << indent << indent << indent << "highlight" << std::endl - << indent << indent << indent << indent << "#track_h" << std::endl - << indent << indent << indent << "" << std::endl - << indent << indent << "" << std::endl - << indent << indent << "" << std::endl - << indent << indent << "" << std::endl - << indent << indent << indent << "Points" << std::endl; + kml_file << R"()" << '\n' + << R"()" << '\n' + << indent << "" << '\n' + << indent << indent << "GNSS Track" << '\n' + << indent << indent << "" << '\n' + << indent << indent << indent << indent << "GNSS-SDR Receiver position log file created at " << pt << "" << '\n' + << indent << indent << indent << indent << "https://gnss-sdr.org/" << '\n' + << indent << indent << indent << "" << '\n' + << indent << indent << "]]>" << '\n' + << indent << indent << "" << '\n' + << indent << indent << "" << '\n' + << indent << indent << "" << '\n' + << indent << indent << "" << '\n' + << indent << indent << "" << '\n' + << indent << indent << indent << "" << '\n' + << indent << indent << indent << indent << "normal" << '\n' + << indent << indent << indent << indent << "#track_n" << '\n' + << indent << indent << indent << "" << '\n' + << indent << indent << indent << "" << '\n' + << indent << indent << indent << indent << "highlight" << '\n' + << indent << indent << indent << indent << "#track_h" << '\n' + << indent << indent << indent << "" << '\n' + << indent << indent << "" << '\n' + << indent << indent << "" << '\n' + << indent << indent << "" << '\n' + << indent << indent << indent << "Points\n"; return true; } - std::cout << "File " << kml_filename << " cannot be saved. Wrong permissions?" << std::endl; + std::cout << "File " << kml_filename << " cannot be saved. Wrong permissions?\n"; return false; } @@ -269,34 +269,34 @@ bool Kml_Printer::print_position(const Pvt_Solution* position, bool print_averag if (kml_file.is_open() && tmp_file.is_open()) { point_id++; - kml_file << indent << indent << indent << "" << std::endl - << indent << indent << indent << indent << "" << point_id << "" << std::endl - << indent << indent << indent << indent << "" << std::endl - << indent << indent << indent << indent << "" << std::endl - << indent << indent << indent << indent << indent << indent << "Time:" << utc_time << "" << std::endl - << indent << indent << indent << indent << indent << indent << "Longitude:" << longitude << "deg" << std::endl - << indent << indent << indent << indent << indent << indent << "Latitude:" << latitude << "deg" << std::endl - << indent << indent << indent << indent << indent << indent << "Altitude:" << height << "m" << std::endl - << indent << indent << indent << indent << indent << indent << "Speed:" << speed_over_ground << "m/s" << std::endl - << indent << indent << indent << indent << indent << indent << "Course:" << course_over_ground << "deg" << std::endl - << indent << indent << indent << indent << indent << indent << "HDOP:" << hdop << "" << std::endl - << indent << indent << indent << indent << indent << indent << "VDOP:" << vdop << "" << std::endl - << indent << indent << indent << indent << indent << indent << "PDOP:" << pdop << "" << std::endl - << indent << indent << indent << indent << indent << "" << std::endl - << indent << indent << indent << indent << "]]>" << std::endl - << indent << indent << indent << indent << "" << std::endl - << indent << indent << indent << indent << indent << "" << utc_time << "" << std::endl - << indent << indent << indent << indent << "" << std::endl - << indent << indent << indent << indent << "#track" << std::endl - << indent << indent << indent << indent << "" << std::endl - << indent << indent << indent << indent << indent << "absolute" << std::endl - << indent << indent << indent << indent << indent << "" << longitude << "," << latitude << "," << height << "" << std::endl - << indent << indent << indent << indent << "" << std::endl - << indent << indent << indent << "" << std::endl; + kml_file << indent << indent << indent << "" << '\n' + << indent << indent << indent << indent << "" << point_id << "" << '\n' + << indent << indent << indent << indent << "" << '\n' + << indent << indent << indent << indent << "" << '\n' + << indent << indent << indent << indent << indent << indent << "Time:" << utc_time << "" << '\n' + << indent << indent << indent << indent << indent << indent << "Longitude:" << longitude << "deg" << '\n' + << indent << indent << indent << indent << indent << indent << "Latitude:" << latitude << "deg" << '\n' + << indent << indent << indent << indent << indent << indent << "Altitude:" << height << "m" << '\n' + << indent << indent << indent << indent << indent << indent << "Speed:" << speed_over_ground << "m/s" << '\n' + << indent << indent << indent << indent << indent << indent << "Course:" << course_over_ground << "deg" << '\n' + << indent << indent << indent << indent << indent << indent << "HDOP:" << hdop << "" << '\n' + << indent << indent << indent << indent << indent << indent << "VDOP:" << vdop << "" << '\n' + << indent << indent << indent << indent << indent << indent << "PDOP:" << pdop << "" << '\n' + << indent << indent << indent << indent << indent << "" << '\n' + << indent << indent << indent << indent << "]]>" << '\n' + << indent << indent << indent << indent << "" << '\n' + << indent << indent << indent << indent << indent << "" << utc_time << "" << '\n' + << indent << indent << indent << indent << "" << '\n' + << indent << indent << indent << indent << "#track" << '\n' + << indent << indent << indent << indent << "" << '\n' + << indent << indent << indent << indent << indent << "absolute" << '\n' + << indent << indent << indent << indent << indent << "" << longitude << "," << latitude << "," << height << "" << '\n' + << indent << indent << indent << indent << "" << '\n' + << indent << indent << indent << "\n"; tmp_file << indent << indent << indent << indent << indent - << longitude << "," << latitude << "," << height << std::endl; + << longitude << "," << latitude << "," << height << '\n'; return true; } @@ -311,23 +311,23 @@ bool Kml_Printer::close_file() tmp_file.close(); kml_file << indent << indent << "" - << indent << indent << "" << std::endl - << indent << indent << indent << "Path" << std::endl - << indent << indent << indent << "#yellowLineGreenPoly" << std::endl - << indent << indent << indent << "" << std::endl - << indent << indent << indent << indent << "0" << std::endl - << indent << indent << indent << indent << "1" << std::endl - << indent << indent << indent << indent << "absolute" << std::endl - << indent << indent << indent << indent << "" << std::endl; + << indent << indent << "" << '\n' + << indent << indent << indent << "Path" << '\n' + << indent << indent << indent << "#yellowLineGreenPoly" << '\n' + << indent << indent << indent << "" << '\n' + << indent << indent << indent << indent << "0" << '\n' + << indent << indent << indent << indent << "1" << '\n' + << indent << indent << indent << indent << "absolute" << '\n' + << indent << indent << indent << indent << "\n"; // Copy the contents of tmp_file into kml_file std::ifstream src(tmp_file_str, std::ios::binary); kml_file << src.rdbuf(); - kml_file << indent << indent << indent << indent << "" << std::endl - << indent << indent << indent << "" << std::endl - << indent << indent << "" << std::endl - << indent << "" << std::endl + kml_file << indent << indent << indent << indent << "" << '\n' + << indent << indent << indent << "" << '\n' + << indent << indent << "" << '\n' + << indent << "" << '\n' << ""; kml_file.close(); diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index e3ae93341..fc5ec8933 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -73,7 +73,7 @@ Nmea_Printer::Nmea_Printer(const std::string& filename, bool flag_nmea_output_fi { if (!fs::create_directory(new_folder, ec)) { - std::cout << "Could not create the " << new_folder << " folder." << std::endl; + std::cout << "Could not create the " << new_folder << " folder.\n"; nmea_base_path = full_path.string(); } } @@ -87,7 +87,7 @@ Nmea_Printer::Nmea_Printer(const std::string& filename, bool flag_nmea_output_fi if ((nmea_base_path != ".") and (d_flag_nmea_output_file == true)) { - std::cout << "NMEA files will be stored at " << nmea_base_path << std::endl; + std::cout << "NMEA files will be stored at " << nmea_base_path << '\n'; } nmea_base_path = nmea_base_path + fs::path::preferred_separator; @@ -101,7 +101,7 @@ Nmea_Printer::Nmea_Printer(const std::string& filename, bool flag_nmea_output_fi } else { - std::cout << "File " << nmea_filename << " cannot be saved. Wrong permissions?" << std::endl; + std::cout << "File " << nmea_filename << " cannot be saved. Wrong permissions?\n"; } } diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index a2f822772..30806d685 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -92,7 +92,7 @@ Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path, { if (!fs::create_directory(new_folder, ec)) { - std::cout << "Could not create the " << new_folder << " folder." << std::endl; + std::cout << "Could not create the " << new_folder << " folder.\n"; base_rinex_path = full_path.string(); } } @@ -105,7 +105,7 @@ Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path, } if (base_rinex_path != ".") { - std::cout << "RINEX files will be stored at " << base_rinex_path << std::endl; + std::cout << "RINEX files will be stored at " << base_rinex_path << '\n'; } navfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_GPS_NAV", base_name); @@ -129,7 +129,7 @@ Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path, !Rinex_Printer::sbsFile.is_open() or !Rinex_Printer::navGalFile.is_open() or !Rinex_Printer::navMixFile.is_open() or !Rinex_Printer::navGloFile.is_open()) { - std::cout << "RINEX files cannot be saved. Wrong permissions?" << std::endl; + std::cout << "RINEX files cannot be saved. Wrong permissions?\n"; } // RINEX v3.02 codes @@ -329,9 +329,9 @@ void Rinex_Printer::lengthCheck(const std::string& line) if (line.length() != 80) { LOG(ERROR) << "Bad defined RINEX line: " - << line.length() << " characters (must be 80)" << std::endl - << line << std::endl - << "----|---1|0---|---2|0---|---3|0---|---4|0---|---5|0---|---6|0---|---7|0---|---8|" << std::endl; + << line.length() << " characters (must be 80)" << '\n' + << line << '\n' + << "----|---1|0---|---2|0---|---3|0---|---4|0---|---5|0---|---6|0---|---7|0---|---8|\n"; } } @@ -535,7 +535,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += std::string(10, ' '); line += std::string("RINEX VERSION / TYPE"); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 2 line.clear(); @@ -543,14 +543,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += std::string("PGM / RUN BY / DATE"); line += std::string(1, ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("GLONASS NAVIGATION MESSAGE FILE GENERATED BY GNSS-SDR", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); @@ -559,14 +559,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += Rinex_Printer::leftJustify(gnss_sdr_version, 43); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("See https://gnss-sdr.org", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction if (version == 3) @@ -581,7 +581,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction 2 line.clear(); @@ -594,7 +594,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; } if (version == 2) { @@ -614,7 +614,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += std::string(20, ' '); line += Rinex_Printer::leftJustify("CORR TO SYSTEM TIME", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; } // -------- End of Header @@ -622,7 +622,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += std::string(60, ' '); line += Rinex_Printer::leftJustify("END OF HEADER", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; } @@ -645,7 +645,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(12, ' '); line += std::string("RINEX VERSION / TYPE"); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 2 line.clear(); @@ -653,14 +653,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string("PGM / RUN BY / DATE"); line += std::string(1, ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("GNSS NAVIGATION MESSAGE FILE GENERATED BY GNSS-SDR", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); @@ -669,14 +669,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += Rinex_Printer::leftJustify(gnss_sdr_version, 43); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("See https://gnss-sdr.org", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 1 line.clear(); @@ -689,7 +689,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction 1 line.clear(); @@ -702,7 +702,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction 2 line.clear(); @@ -715,7 +715,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction 3 line.clear(); @@ -763,7 +763,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 6 leap seconds // For leap second information, see https://endruntechnologies.com/support/leap-seconds @@ -775,14 +775,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- End of Header line.clear(); line += std::string(60, ' '); line += Rinex_Printer::leftJustify("END OF HEADER", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; } @@ -805,7 +805,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string(12, ' '); line += std::string("RINEX VERSION / TYPE"); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 2 line.clear(); @@ -813,14 +813,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string("PGM / RUN BY / DATE"); line += std::string(1, ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("GNSS NAVIGATION MESSAGE FILE GENERATED BY GNSS-SDR", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); @@ -829,14 +829,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += Rinex_Printer::leftJustify(gnss_sdr_version, 43); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("See https://gnss-sdr.org", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 1 line.clear(); @@ -849,7 +849,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction 1 line.clear(); @@ -862,7 +862,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction 2 line.clear(); @@ -875,7 +875,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction 3 line.clear(); @@ -887,7 +887,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 6 leap seconds // For leap second information, see https://endruntechnologies.com/support/leap-seconds @@ -899,14 +899,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- End of Header line.clear(); line += std::string(60, ' '); line += Rinex_Printer::leftJustify("END OF HEADER", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; } @@ -931,7 +931,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += std::string(12, ' '); line += std::string("RINEX VERSION / TYPE"); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 2 line.clear(); @@ -939,14 +939,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += std::string("PGM / RUN BY / DATE"); line += std::string(1, ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("GNSS NAVIGATION MESSAGE FILE GENERATED BY GNSS-SDR", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); @@ -955,14 +955,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += Rinex_Printer::leftJustify(gnss_sdr_version, 43); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("See https://gnss-sdr.org", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 1 line.clear(); @@ -976,7 +976,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction line.clear(); @@ -988,7 +988,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction 1 line.clear(); @@ -1001,7 +1001,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 6 leap seconds // For leap second information, see https://endruntechnologies.com/support/leap-seconds @@ -1013,14 +1013,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- End of Header line.clear(); line += std::string(60, ' '); line += Rinex_Printer::leftJustify("END OF HEADER", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; } @@ -1038,7 +1038,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono line += std::string(10, ' '); line += std::string("RINEX VERSION / TYPE"); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 2 line.clear(); @@ -1046,14 +1046,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono line += std::string("PGM / RUN BY / DATE"); line += std::string(1, ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("GALILEO NAVIGATION MESSAGE FILE GENERATED BY GNSS-SDR", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); @@ -1062,14 +1062,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono line += Rinex_Printer::leftJustify(gnss_sdr_version, 43); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("See https://gnss-sdr.org", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 1 line.clear(); @@ -1083,7 +1083,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction line.clear(); @@ -1095,7 +1095,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction 2 line.clear(); @@ -1107,7 +1107,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 6 leap seconds // For leap second information, see https://endruntechnologies.com/support/leap-seconds @@ -1119,14 +1119,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- End of Header line.clear(); line += std::string(60, ' '); line += Rinex_Printer::leftJustify("END OF HEADER", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; } @@ -1144,7 +1144,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string(14, ' '); line += std::string("RINEX VERSION / TYPE"); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 2 line.clear(); @@ -1152,14 +1152,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string("PGM / RUN BY / DATE"); line += std::string(1, ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 3 line.clear(); line += Rinex_Printer::leftJustify("GPS NAVIGATION MESSAGE FILE GENERATED BY GNSS-SDR", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); @@ -1168,14 +1168,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += Rinex_Printer::leftJustify(gnss_sdr_version, 43); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("See https://gnss-sdr.org", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 1 line.clear(); @@ -1188,7 +1188,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 2 line.clear(); @@ -1201,7 +1201,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 5 system time correction line.clear(); @@ -1223,7 +1223,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 6 leap seconds // For leap second information, see https://endruntechnologies.com/support/leap-seconds @@ -1235,14 +1235,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- End of Header line.clear(); line += std::string(60, ' '); line += Rinex_Printer::leftJustify("END OF HEADER", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; } @@ -1260,7 +1260,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string(12, ' '); line += std::string("RINEX VERSION / TYPE"); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 2 line.clear(); @@ -1268,14 +1268,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string("PGM / RUN BY / DATE"); line += std::string(1, ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("GNSS NAVIGATION MESSAGE FILE GENERATED BY GNSS-SDR", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); @@ -1284,14 +1284,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += Rinex_Printer::leftJustify(gnss_sdr_version, 43); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("See https://gnss-sdr.org", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 1 line.clear(); @@ -1305,7 +1305,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 2 line.clear(); @@ -1318,7 +1318,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 3 line.clear(); @@ -1331,7 +1331,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction line.clear(); @@ -1343,7 +1343,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction 2 line.clear(); @@ -1355,7 +1355,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 6 leap seconds // For leap second information, see https://endruntechnologies.com/support/leap-seconds @@ -1367,14 +1367,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- End of Header line.clear(); line += std::string(60, ' '); line += Rinex_Printer::leftJustify("END OF HEADER", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; } @@ -1405,7 +1405,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co line += std::string("RINEX VERSION / TYPE"); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 2 line.clear(); @@ -1413,14 +1413,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co line += std::string("PGM / RUN BY / DATE"); line += std::string(1, ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 3 line.clear(); line += Rinex_Printer::leftJustify("GPS NAVIGATION MESSAGE FILE GENERATED BY GNSS-SDR", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); @@ -1429,14 +1429,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co line += Rinex_Printer::leftJustify(gnss_sdr_version, 43); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("See https://gnss-sdr.org", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 1 line.clear(); @@ -1462,7 +1462,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); } Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 2 line.clear(); @@ -1489,7 +1489,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); } Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 5 system time correction line.clear(); @@ -1595,7 +1595,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); } Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 6 leap seconds // For leap second information, see https://endruntechnologies.com/support/leap-seconds @@ -1614,14 +1614,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co } line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- End of Header line.clear(); line += std::string(60, ' '); line += Rinex_Printer::leftJustify("END OF HEADER", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; } @@ -1639,7 +1639,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(12, ' '); line += std::string("RINEX VERSION / TYPE"); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 2 line.clear(); @@ -1647,14 +1647,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string("PGM / RUN BY / DATE"); line += std::string(1, ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("GNSS NAVIGATION MESSAGE FILE GENERATED BY GNSS-SDR", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); @@ -1663,14 +1663,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += Rinex_Printer::leftJustify(gnss_sdr_version, 43); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("See https://gnss-sdr.org", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 1 line.clear(); @@ -1684,7 +1684,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 2 line.clear(); @@ -1697,7 +1697,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction line.clear(); @@ -1709,7 +1709,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction 2 line.clear(); @@ -1721,7 +1721,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction 3 line.clear(); @@ -1768,7 +1768,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 6 leap seconds // For leap second information, see https://endruntechnologies.com/support/leap-seconds @@ -1780,14 +1780,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- End of Header line.clear(); line += std::string(60, ' '); line += Rinex_Printer::leftJustify("END OF HEADER", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; } @@ -1812,7 +1812,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Beidou_Dnav_Iono& line += std::string("RINEX VERSION / TYPE"); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 2 line.clear(); @@ -1820,14 +1820,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Beidou_Dnav_Iono& line += std::string("PGM / RUN BY / DATE"); line += std::string(1, ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 3 line.clear(); line += Rinex_Printer::leftJustify("BDS NAVIGATION MESSAGE FILE GENERATED BY GNSS-SDR", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); @@ -1836,14 +1836,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Beidou_Dnav_Iono& line += Rinex_Printer::leftJustify(gnss_sdr_version, 43); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("See https://gnss-sdr.org", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 1, only version 3 supported line.clear(); @@ -1856,7 +1856,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Beidou_Dnav_Iono& line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 2 line.clear(); @@ -1869,7 +1869,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Beidou_Dnav_Iono& line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 5 system time correction line.clear(); @@ -1879,7 +1879,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Beidou_Dnav_Iono& line += std::string(22, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 6 leap seconds // For leap second information, see https://endruntechnologies.com/support/leap-seconds @@ -1891,14 +1891,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Beidou_Dnav_Iono& line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- End of Header line.clear(); line += std::string(60, ' '); line += Rinex_Printer::leftJustify("END OF HEADER", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; } @@ -1916,7 +1916,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(12, ' '); line += std::string("RINEX VERSION / TYPE"); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 2 line.clear(); @@ -1924,14 +1924,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string("PGM / RUN BY / DATE"); line += std::string(1, ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("GNSS NAVIGATION MESSAGE FILE GENERATED BY GNSS-SDR", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); @@ -1940,14 +1940,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += Rinex_Printer::leftJustify(gnss_sdr_version, 43); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("See https://gnss-sdr.org", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 1, only version 3 supported line.clear(); @@ -1960,7 +1960,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 2 line.clear(); @@ -1973,7 +1973,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 2 line.clear(); @@ -1986,7 +1986,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 5 system time correction line.clear(); @@ -1997,7 +1997,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction 3 line.clear(); @@ -2030,7 +2030,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 6 leap seconds // For leap second information, see https://endruntechnologies.com/support/leap-seconds @@ -2042,14 +2042,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- End of Header line.clear(); line += std::string(60, ' '); line += Rinex_Printer::leftJustify("END OF HEADER", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; } @@ -2069,7 +2069,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string(12, ' '); line += std::string("RINEX VERSION / TYPE"); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 2 line.clear(); @@ -2077,14 +2077,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string("PGM / RUN BY / DATE"); line += std::string(1, ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("GNSS NAVIGATION MESSAGE FILE GENERATED BY GNSS-SDR", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); @@ -2093,14 +2093,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += Rinex_Printer::leftJustify(gnss_sdr_version, 43); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("See https://gnss-sdr.org", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 1, only version 3 supported line.clear(); @@ -2113,7 +2113,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 2 line.clear(); @@ -2126,7 +2126,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 1 line.clear(); @@ -2139,7 +2139,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 5 system time correction line.clear(); @@ -2149,7 +2149,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string(22, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction 3 line.clear(); @@ -2161,7 +2161,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 6 leap seconds // For leap second information, see https://endruntechnologies.com/support/leap-seconds @@ -2173,14 +2173,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- End of Header line.clear(); line += std::string(60, ' '); line += Rinex_Printer::leftJustify("END OF HEADER", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; } void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_Model& glo_gnav_utc_model, const Beidou_Dnav_Iono& bds_dnav_iono, const Beidou_Dnav_Utc_Model& bds_dnav_utc_model) @@ -2197,7 +2197,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += std::string(12, ' '); line += std::string("RINEX VERSION / TYPE"); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 2 line.clear(); @@ -2205,14 +2205,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += std::string("PGM / RUN BY / DATE"); line += std::string(1, ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("GNSS NAVIGATION MESSAGE FILE GENERATED BY GNSS-SDR", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); @@ -2221,14 +2221,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += Rinex_Printer::leftJustify(gnss_sdr_version, 43); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("See https://gnss-sdr.org", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 1, only version 3 supported line.clear(); @@ -2241,7 +2241,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 2 line.clear(); @@ -2254,7 +2254,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 5 system time correction line.clear(); @@ -2264,7 +2264,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += std::string(22, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction 1 line.clear(); @@ -2277,7 +2277,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 6 leap seconds // For leap second information, see https://endruntechnologies.com/support/leap-seconds @@ -2289,14 +2289,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- End of Header line.clear(); line += std::string(60, ' '); line += Rinex_Printer::leftJustify("END OF HEADER", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; } @@ -2314,7 +2314,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += std::string(12, ' '); line += std::string("RINEX VERSION / TYPE"); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 2 line.clear(); @@ -2322,14 +2322,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += std::string("PGM / RUN BY / DATE"); line += std::string(1, ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("GNSS NAVIGATION MESSAGE FILE GENERATED BY GNSS-SDR", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); @@ -2338,14 +2338,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += Rinex_Printer::leftJustify(gnss_sdr_version, 43); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); line += Rinex_Printer::leftJustify("See https://gnss-sdr.org", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 1 line.clear(); @@ -2359,7 +2359,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 1, only version 3 supported line.clear(); @@ -2372,7 +2372,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line ionospheric info 2 line.clear(); @@ -2385,7 +2385,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += std::string(7, ' '); line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction line.clear(); @@ -2397,7 +2397,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line system time correction 1 // -------- Line 5 system time correction @@ -2408,7 +2408,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += std::string(22, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 6 leap seconds // For leap second information, see https://endruntechnologies.com/support/leap-seconds @@ -2420,14 +2420,14 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- End of Header line.clear(); line += std::string(60, ' '); line += Rinex_Printer::leftJustify("END OF HEADER", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; } @@ -2445,7 +2445,7 @@ void Rinex_Printer::rinex_sbs_header(std::fstream& out) line += std::string("RINEX VERSION / TYPE"); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 2 line.clear(); @@ -2510,21 +2510,21 @@ void Rinex_Printer::rinex_sbs_header(std::fstream& out) line += Rinex_Printer::leftJustify(time_str, 20); line += Rinex_Printer::leftJustify("PGM / RUN BY / DATE", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line 3 line.clear(); line += std::string(60, ' '); line += Rinex_Printer::leftJustify("REC INDEX/TYPE/VERS", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT 1 line.clear(); line += Rinex_Printer::leftJustify("BROADCAST DATA FILE FOR GEO SV, GENERATED BY GNSS-SDR", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT line.clear(); @@ -2533,21 +2533,21 @@ void Rinex_Printer::rinex_sbs_header(std::fstream& out) line += Rinex_Printer::leftJustify(gnss_sdr_version, 43); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- Line COMMENT 2 line.clear(); line += Rinex_Printer::leftJustify("See https://gnss-sdr.org", 60); line += Rinex_Printer::leftJustify("COMMENT", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- End of Header line.clear(); line += std::string(60, ' '); line += Rinex_Printer::leftJustify("END OF HEADER", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; } @@ -2617,12 +2617,12 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Glonass_Gnav_Utc_ out.seekp(0); for (int32_t i = 0; i < static_cast(data.size()) - 1; i++) { - out << data[i] << std::endl; + out << data[i] << '\n'; } out.close(); out.open(navGlofilename, std::ios::out | std::ios::app); out.seekp(pos); - std::cout << "The RINEX Navigation file header has been updated with UTC info." << std::endl; + std::cout << "The RINEX Navigation file header has been updated with UTC info.\n"; } @@ -2712,12 +2712,12 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal out.seekp(0); for (int32_t i = 0; i < static_cast(data.size()) - 1; i++) { - out << data[i] << std::endl; + out << data[i] << '\n'; } out.close(); out.open(navGalfilename, std::ios::out | std::ios::app); out.seekp(pos); - std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info." << std::endl; + std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info.\n"; } @@ -2891,12 +2891,12 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& ut out.seekp(0); for (int32_t i = 0; i < static_cast(data.size()) - 1; i++) { - out << data[i] << std::endl; + out << data[i] << '\n'; } out.close(); out.open(navfilename, std::ios::out | std::ios::app); out.seekp(pos); - std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info." << std::endl; + std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info.\n"; } @@ -2986,12 +2986,12 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Mode out.seekp(0); for (int32_t i = 0; i < static_cast(data.size()) - 1; i++) { - out << data[i] << std::endl; + out << data[i] << '\n'; } out.close(); out.open(navfilename, std::ios::out | std::ios::app); out.seekp(pos); - std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info." << std::endl; + std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info.\n"; } @@ -3115,12 +3115,12 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Mode out.seekp(0); for (int32_t i = 0; i < static_cast(data.size()) - 1; i++) { - out << data[i] << std::endl; + out << data[i] << '\n'; } out.close(); out.open(navfilename, std::ios::out | std::ios::app); out.seekp(pos); - std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info." << std::endl; + std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info.\n"; } @@ -3259,12 +3259,12 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion out.seekp(0); for (int32_t i = 0; i < static_cast(data.size()) - 1; i++) { - out << data[i] << std::endl; + out << data[i] << '\n'; } out.close(); out.open(navMixfilename, std::ios::out | std::ios::app); out.seekp(pos); - std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info." << std::endl; + std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info.\n"; } @@ -3381,12 +3381,12 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion out.seekp(0); for (int32_t i = 0; i < static_cast(data.size()) - 1; i++) { - out << data[i] << std::endl; + out << data[i] << '\n'; } out.close(); out.open(navMixfilename, std::ios::out | std::ios::app); out.seekp(pos); - std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info." << std::endl; + std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info.\n"; } @@ -3489,12 +3489,12 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gp out.seekp(0); for (int32_t i = 0; i < static_cast(data.size()) - 1; i++) { - out << data[i] << std::endl; + out << data[i] << '\n'; } out.close(); out.open(navMixfilename, std::ios::out | std::ios::app); out.seekp(pos); - std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info." << std::endl; + std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info.\n"; } @@ -3591,12 +3591,12 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal out.seekp(0); for (int32_t i = 0; i < static_cast(data.size()) - 1; i++) { - out << data[i] << std::endl; + out << data[i] << '\n'; } out.close(); out.open(navMixfilename, std::ios::out | std::ios::app); out.seekp(pos); - std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info." << std::endl; + std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info.\n"; } @@ -3684,12 +3684,12 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Beidou_Dnav_Utc_M out.seekp(0); for (int32_t i = 0; i < static_cast(data.size()) - 1; i++) { - out << data[i] << std::endl; + out << data[i] << '\n'; } out.close(); out.open(navfilename, std::ios::out | std::ios::app); out.seekp(pos); - std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info." << std::endl; + std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info.\n"; } @@ -3810,7 +3810,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_A_f2, 18, 2); } Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 1 line.clear(); @@ -3843,7 +3843,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_A_f2, 18, 2); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 1 line.clear(); @@ -4145,7 +4145,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_M_0, 18, 2); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 2 line.clear(); @@ -4160,7 +4160,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_DELTA_A); line += Rinex_Printer::doub2for(sqrt_A, 18, 2); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 3 line.clear(); @@ -4173,7 +4173,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_Cis, 18, 2); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 4 line.clear(); @@ -4188,7 +4188,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_DELTA_OMEGA_DOT; line += Rinex_Printer::doub2for(OMEGA_DOT_aux, 18, 2); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 5 line.clear(); @@ -4209,7 +4209,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.af2_4, 18, 2); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 1 line.clear(); @@ -4301,7 +4301,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.M0_1, 18, 2); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 2 line.clear(); @@ -4314,7 +4314,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.A_1, 18, 2); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 3 line.clear(); @@ -4327,7 +4327,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.C_is_4, 18, 2); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 4 line.clear(); @@ -4340,7 +4340,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.OMEGA_dot_3, 18, 2); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 5 line.clear(); @@ -4360,7 +4360,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.BGD_E1E5b_5, 18, 2); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 7 line.clear(); @@ -4446,7 +4446,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_t_k + p_utc_time.date().day_of_week() * 86400, 18, 2); } Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 1 line.clear(); @@ -4596,7 +4596,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_A_f2, 18, 2); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 1 line.clear(); @@ -4750,7 +4750,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_M_0, 18, 2); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 2 line.clear(); @@ -4763,7 +4763,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_sqrt_A, 18, 2); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 3 line.clear(); @@ -4776,7 +4776,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_Cis, 18, 2); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 4 line.clear(); @@ -4789,7 +4789,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_OMEGA_DOT, 18, 2); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 5 line.clear(); @@ -4803,7 +4803,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_TGD2, 18, 2); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- BROADCAST ORBIT - 7 line.clear(); @@ -4830,7 +4830,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map(data.size()) - 1; i++) { - out << data[i] << std::endl; + out << data[i] << '\n'; } out.close(); out.open(obsfilename, std::ios::out | std::ios::in | std::ios::app); @@ -8555,7 +8555,7 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_CNAV_Utc_Mode out.seekp(0); for (int32_t i = 0; i < static_cast(data.size()) - 1; i++) { - out << data[i] << std::endl; + out << data[i] << '\n'; } out.close(); out.open(obsfilename, std::ios::out | std::ios::in | std::ios::app); @@ -8614,7 +8614,7 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Galileo_Utc_Model out.seekp(0); for (int32_t i = 0; i < static_cast(data.size()) - 1; i++) { - out << data[i] << std::endl; + out << data[i] << '\n'; } out.close(); out.open(obsfilename, std::ios::out | std::ios::in | std::ios::app); @@ -8673,7 +8673,7 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Beidou_Dnav_Utc_M out.seekp(0); for (int32_t i = 0; i < static_cast(data.size()) - 1; i++) { - out << data[i] << std::endl; + out << data[i] << '\n'; } out.close(); out.open(obsfilename, std::ios::out | std::ios::in | std::ios::app); @@ -8767,7 +8767,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri // line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; for (observables_iter = observables.cbegin(); observables_iter != observables.cend(); @@ -8822,7 +8822,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri { lineObs += std::string(80 - lineObs.size(), ' '); } - out << lineObs << std::endl; + out << lineObs << '\n'; } } @@ -8868,7 +8868,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; for (observables_iter = observables.cbegin(); observables_iter != observables.cend(); @@ -8932,7 +8932,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri { lineObs += std::string(80 - lineObs.size(), ' '); } - out << lineObs << std::endl; + out << lineObs << '\n'; } } } @@ -9127,7 +9127,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep } line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- OBSERVATION record std::string s; @@ -9206,7 +9206,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { lineObs += std::string(80 - lineObs.size(), ' '); } - out << lineObs << std::endl; + out << lineObs << '\n'; } std::pair::iterator, std::multimap::iterator> ret; @@ -9278,7 +9278,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { lineObs += std::string(80 - lineObs.size(), ' '); } - out << lineObs << std::endl; + out << lineObs << '\n'; } } @@ -9390,7 +9390,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; // -------- OBSERVATION record std::string s; @@ -9466,7 +9466,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g { lineObs += std::string(80 - lineObs.size(), ' '); } - out << lineObs << std::endl; + out << lineObs << '\n'; } std::pair::iterator, std::multimap::iterator> ret; @@ -9536,7 +9536,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g { lineObs += std::string(80 - lineObs.size(), ' '); } - out << lineObs << std::endl; + out << lineObs << '\n'; } } @@ -9650,7 +9650,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; std::string s; std::string lineObs; @@ -9722,7 +9722,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga { lineObs += std::string(80 - lineObs.size(), ' '); } - out << lineObs << std::endl; + out << lineObs << '\n'; } std::pair::iterator, std::multimap::iterator> ret; @@ -9789,7 +9789,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga { lineObs += std::string(80 - lineObs.size(), ' '); } - out << lineObs << std::endl; + out << lineObs << '\n'; } } @@ -9875,7 +9875,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c // line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; for (observables_iter = observables.cbegin(); observables_iter != observables.cend(); @@ -9930,7 +9930,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c { lineObs += std::string(80 - lineObs.size(), ' '); } - out << lineObs << std::endl; + out << lineObs << '\n'; } } @@ -9977,7 +9977,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; for (observables_iter = observables.cbegin(); observables_iter != observables.cend(); @@ -10041,7 +10041,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c { lineObs += std::string(80 - lineObs.size(), ' '); } - out << lineObs << std::endl; + out << lineObs << '\n'; } } } @@ -10104,7 +10104,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; for (observables_iter = observables.cbegin(); observables_iter != observables.cend(); @@ -10169,7 +10169,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e { lineObs += std::string(80 - lineObs.size(), ' '); } - out << lineObs << std::endl; + out << lineObs << '\n'; } } @@ -10327,7 +10327,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c // line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; std::string lineObs; std::pair::iterator, std::multimap::iterator> ret; @@ -10405,7 +10405,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c { lineObs += std::string(80 - lineObs.size(), ' '); } - out << lineObs << std::endl; + out << lineObs << '\n'; } } @@ -10584,7 +10584,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep // line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; std::string lineObs; std::pair::iterator, std::multimap::iterator> ret; @@ -10651,7 +10651,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep { lineObs += std::string(80 - lineObs.size(), ' '); } - out << lineObs << std::endl; + out << lineObs << '\n'; } } @@ -10784,7 +10784,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; std::string s; std::string lineObs; @@ -10856,7 +10856,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { lineObs += std::string(80 - lineObs.size(), ' '); } - out << lineObs << std::endl; + out << lineObs << '\n'; } std::pair::iterator, std::multimap::iterator> ret; @@ -10923,7 +10923,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { lineObs += std::string(80 - lineObs.size(), ' '); } - out << lineObs << std::endl; + out << lineObs << '\n'; } } @@ -11089,7 +11089,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; std::string s; std::string lineObs; @@ -11154,7 +11154,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e lineObs += Rinex_Printer::rightJustify(asString(iter->second.CN0_dB_hz, 3), 14); } - out << lineObs << std::endl; + out << lineObs << '\n'; } for (it = available_gal_prns.begin(); @@ -11217,7 +11217,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e } // if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); - out << lineObs << std::endl; + out << lineObs << '\n'; } } @@ -11404,7 +11404,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; std::string s; std::string lineObs; @@ -11480,7 +11480,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep lineObs += Rinex_Printer::rightJustify(asString(iter->second.CN0_dB_hz, 3), 14); } - out << lineObs << std::endl; + out << lineObs << '\n'; } for (it = available_gal_prns.begin(); @@ -11543,7 +11543,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep } // if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); - out << lineObs << std::endl; + out << lineObs << '\n'; } } @@ -11664,7 +11664,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Beidou_Dnav_Ephemeris // line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); - out << line << std::endl; + out << line << '\n'; std::string lineObs; std::pair::iterator, std::multimap::iterator> ret; @@ -11719,7 +11719,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Beidou_Dnav_Ephemeris { lineObs += std::string(80 - lineObs.size(), ' '); } - out << lineObs << std::endl; + out << lineObs << '\n'; } } @@ -11755,10 +11755,10 @@ void Rinex_Printer::to_date_time(int32_t gps_week, int32_t gps_tow, int& year, i else { year = y; - // std::cout << "year: year=" << year << " secs_in_year_y="<< secs_in_year_y << " remaining_secs="<< remaining_secs << std::endl; + // std::cout << "year: year=" << year << " secs_in_year_y="<< secs_in_year_y << " remaining_secs="<< remaining_secs << '\n'; break; } - // std::cout << "year: y=" << y << " secs_in_year_y="<< secs_in_year_y << " remaining_secs="<< remaining_secs << std::endl; + // std::cout << "year: y=" << y << " secs_in_year_y="<< secs_in_year_y << " remaining_secs="<< remaining_secs << '\n'; } // find month @@ -11777,10 +11777,10 @@ void Rinex_Printer::to_date_time(int32_t gps_week, int32_t gps_tow, int& year, i else { month = m; - // std::cout << "month: month=" << month << " secs_in_month_m="<< secs_in_month_m << " remaining_secs="<< remaining_secs << std::endl; + // std::cout << "month: month=" << month << " secs_in_month_m="<< secs_in_month_m << " remaining_secs="<< remaining_secs << '\n'; break; } - // std::cout << "month: m=" << m << " secs_in_month_m="<< secs_in_month_m << " remaining_secs="<< remaining_secs << std::endl; + // std::cout << "month: m=" << m << " secs_in_month_m="<< secs_in_month_m << " remaining_secs="<< remaining_secs << '\n'; } day = remaining_secs / secs_per_day + 1; @@ -11842,7 +11842,7 @@ void Rinex_Printer::to_date_time(int32_t gps_week, int32_t gps_tow, int& year, i // line1 << "SBA"; // line1 << std::string(35, ' '); // lengthCheck(line1.str()); -// out << line1.str() << std::endl; +// out << line1.str() << '\n'; // // // DATA RECORD - 1 // std::stringstream line2; @@ -11860,7 +11860,7 @@ void Rinex_Printer::to_date_time(int32_t gps_week, int32_t gps_tow, int& year, i // } // line2 << std::string(19, ' '); // lengthCheck(line2.str()); -// out << line2.str() << std::endl; +// out << line2.str() << '\n'; // // // DATA RECORD - 2 // std::stringstream line3; @@ -11873,7 +11873,7 @@ void Rinex_Printer::to_date_time(int32_t gps_week, int32_t gps_tow, int& year, i // } // line3 << std::string(31, ' '); // lengthCheck(line3.str()); -// out << line3.str() << std::endl; +// out << line3.str() << '\n'; // } diff --git a/src/algorithms/PVT/libs/rtcm.cc b/src/algorithms/PVT/libs/rtcm.cc index 9d6c397e3..28b3a5b5c 100644 --- a/src/algorithms/PVT/libs/rtcm.cc +++ b/src/algorithms/PVT/libs/rtcm.cc @@ -75,7 +75,7 @@ Rtcm::~Rtcm() // ***************************************************************************************************** void Rtcm::run_server() { - std::cout << "Starting a TCP/IP server of RTCM messages on port " << RTCM_port << std::endl; + std::cout << "Starting a TCP/IP server of RTCM messages on port " << RTCM_port << '\n'; try { tq = std::thread([&] { std::make_shared(io_context, rtcm_message_queue, RTCM_port)->do_read_queue(); }); @@ -97,7 +97,7 @@ void Rtcm::stop_service() void Rtcm::stop_server() { - std::cout << "Stopping TCP/IP server on port " << RTCM_port << std::endl; + std::cout << "Stopping TCP/IP server on port " << RTCM_port << '\n'; Rtcm::stop_service(); servers.front().close_server(); rtcm_message_queue->push("Goodbye"); // this terminates tq @@ -3439,7 +3439,7 @@ uint32_t Rtcm::lock_time(const Gps_Ephemeris& eph, double obs_time, const Gnss_S boost::posix_time::time_duration lock_duration = current_time - Rtcm::gps_L1_last_lock_time[65 - gnss_synchro.PRN]; lock_time_in_seconds = static_cast(lock_duration.total_seconds()); // Debug: - // std::cout << "lock time PRN " << gnss_synchro.PRN << ": " << lock_time_in_seconds << " current time: " << current_time << std::endl; + // std::cout << "lock time PRN " << gnss_synchro.PRN << ": " << lock_time_in_seconds << " current time: " << current_time << '\n'; return lock_time_in_seconds; } diff --git a/src/algorithms/PVT/libs/rtcm.h b/src/algorithms/PVT/libs/rtcm.h index d5acace77..9a3aa06f1 100644 --- a/src/algorithms/PVT/libs/rtcm.h +++ b/src/algorithms/PVT/libs/rtcm.h @@ -688,7 +688,7 @@ private: } else { - std::cout << "Closing connection with RTCM client" << std::endl; + std::cout << "Closing connection with RTCM client\n"; room_.leave(shared_from_this()); } }); @@ -705,12 +705,12 @@ private: room_.deliver(read_msg_); // std::cout << "Delivered message (session): "; // std::cout.write(read_msg_.body(), read_msg_.body_length()); - // std::cout << std::endl; + // std::cout << '\n'; do_read_message_header(); } else { - std::cout << "Closing connection with RTCM client" << std::endl; + std::cout << "Closing connection with RTCM client\n"; room_.leave(shared_from_this()); } }); @@ -732,7 +732,7 @@ private: } else { - std::cout << "Closing connection with RTCM client" << std::endl; + std::cout << "Closing connection with RTCM client\n"; room_.leave(shared_from_this()); } }); @@ -786,7 +786,7 @@ private: } else { - std::cout << "Server is down." << std::endl; + std::cout << "Server is down.\n"; } }); } @@ -802,7 +802,7 @@ private: } else { - std::cout << "Error in client" << std::endl; + std::cout << "Error in client\n"; socket_.close(); } }); @@ -900,25 +900,25 @@ private: { if (first_client) { - std::cout << "The TCP/IP server of RTCM messages is up and running. Accepting connections ..." << std::endl; + std::cout << "The TCP/IP server of RTCM messages is up and running. Accepting connections ...\n"; first_client = false; } else { - std::cout << "Starting RTCM TCP/IP server session..." << std::endl; + std::cout << "Starting RTCM TCP/IP server session...\n"; boost::system::error_code ec2; boost::asio::ip::tcp::endpoint endpoint = socket_.remote_endpoint(ec2); if (ec2) { // Error creating remote_endpoint - std::cout << "Error getting remote IP address, closing session." << std::endl; + std::cout << "Error getting remote IP address, closing session.\n"; LOG(INFO) << "Error getting remote IP address"; start_session = false; } else { std::string remote_addr = endpoint.address().to_string(); - std::cout << "Serving client from " << remote_addr << std::endl; + std::cout << "Serving client from " << remote_addr << '\n'; LOG(INFO) << "Serving client from " << remote_addr; } } @@ -929,7 +929,7 @@ private: } else { - std::cout << "Error when invoking a RTCM session. " << ec << std::endl; + std::cout << "Error when invoking a RTCM session. " << ec << '\n'; } start_session = true; do_accept(); diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index bb1babfc1..ebfc3f5f3 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -79,7 +79,7 @@ Rtcm_Printer::Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump { if (!fs::create_directory(new_folder, ec)) { - std::cout << "Could not create the " << new_folder << " folder." << std::endl; + std::cout << "Could not create the " << new_folder << " folder.\n"; rtcm_base_path = full_path.string(); } } @@ -92,7 +92,7 @@ Rtcm_Printer::Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump } if (rtcm_base_path != ".") { - std::cout << "RTCM binary file will be stored at " << rtcm_base_path << std::endl; + std::cout << "RTCM binary file will be stored at " << rtcm_base_path << '\n'; } rtcm_base_path = rtcm_base_path + fs::path::preferred_separator; @@ -150,7 +150,7 @@ Rtcm_Printer::Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump } else { - std::cout << "File " << rtcm_filename << "cannot be saved. Wrong permissions?" << std::endl; + std::cout << "File " << rtcm_filename << "cannot be saved. Wrong permissions?\n"; } } @@ -430,7 +430,7 @@ bool Rtcm_Printer::Print_Message(const std::string& message) { try { - rtcm_file_descriptor << message << std::endl; + rtcm_file_descriptor << message << '\n'; } catch (const std::exception& ex) { @@ -445,7 +445,7 @@ bool Rtcm_Printer::Print_Message(const std::string& message) if (write(rtcm_dev_descriptor, message.c_str(), message.length()) == -1) { DLOG(INFO) << "RTCM printer cannot write on serial device " << rtcm_devname.c_str(); - std::cout << "RTCM printer cannot write on serial device " << rtcm_devname.c_str() << std::endl; + std::cout << "RTCM printer cannot write on serial device " << rtcm_devname.c_str() << '\n'; return false; } } diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index f5ff921c7..1624a260d 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -155,14 +155,14 @@ bool Rtklib_Solver::save_matfile() } catch (const std::ifstream::failure &e) { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + std::cerr << "Problem opening dump file:" << e.what() << '\n'; return false; } // count number of epochs and rewind int64_t num_epoch = 0LL; if (dump_file.is_open()) { - std::cout << "Generating .mat file for " << dump_filename << std::endl; + std::cout << "Generating .mat file for " << dump_filename << '\n'; size = dump_file.tellg(); num_epoch = static_cast(size) / static_cast(epoch_size_bytes); dump_file.seekg(0, std::ios::beg); @@ -241,7 +241,7 @@ bool Rtklib_Solver::save_matfile() } catch (const std::ifstream::failure &e) { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + std::cerr << "Problem reading dump file:" << e.what() << '\n'; return false; } diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc index 268b70a7b..728556a08 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc @@ -72,13 +72,13 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( { sampled_ms_ = 3; DLOG(INFO) << "Coherent integration time should be 3 ms or less. Changing to 3ms "; - std::cout << "Too high coherent integration time. Changing to 3ms" << std::endl; + std::cout << "Too high coherent integration time. Changing to 3ms\n"; } if (Zero_padding > 0) { sampled_ms_ = 2; DLOG(INFO) << "Zero padding activated. Changing to 1ms code + 1ms zero padding "; - std::cout << "Zero padding activated. Changing to 1ms code + 1ms zero padding" << std::endl; + std::cout << "Zero padding activated. Changing to 1ms code + 1ms zero padding\n"; } max_dwells_ = configuration_->property(role + ".max_dwells", 1); diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc index 459525ba1..a11fbb8c6 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc @@ -597,7 +597,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items d_dump_file.close(); } } - // std::cout << "d_mag " << d_mag << ".d_sample_counter " << d_sample_counter << ". acq delay " << d_gnss_synchro->Acq_delay_samples<< " indext "<< indext << std::endl; + // std::cout << "d_mag " << d_mag << ".d_sample_counter " << d_sample_counter << ". acq delay " << d_gnss_synchro->Acq_delay_samples<< " indext "<< indext << '\n'; // 6 OPTIONAL: CAF filter to avoid Doppler ambiguity in bit transition. if (d_CAF_window_hz > 0) { @@ -607,7 +607,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items float weighting_factor; weighting_factor = 0.5 / static_cast(CAF_bins_half); // weighting_factor = 0; - // std::cout << "weighting_factor " << weighting_factor << std::endl; + // std::cout << "weighting_factor " << weighting_factor << '\n'; // Initialize first iterations for (int doppler_index = 0; doppler_index < CAF_bins_half; doppler_index++) { diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index 8f76ff93a..d6af93550 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -182,7 +182,7 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu // create directory if (!gnss_sdr_create_directory(dump_path)) { - std::cerr << "GNSS-SDR cannot create dump file for the Acquisition block. Wrong permissions?" << std::endl; + std::cerr << "GNSS-SDR cannot create dump file for the Acquisition block. Wrong permissions?\n"; d_dump = false; } } @@ -240,13 +240,13 @@ bool pcps_acquisition::is_fdma() if (strcmp(d_gnss_synchro->Signal, "1G") == 0) { d_doppler_bias = static_cast(DFRQ1_GLO * GLONASS_PRN.at(d_gnss_synchro->PRN)); - DLOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_doppler_bias << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl; + DLOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_doppler_bias << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << '\n'; return true; } if (strcmp(d_gnss_synchro->Signal, "2G") == 0) { d_doppler_bias += static_cast(DFRQ2_GLO * GLONASS_PRN.at(d_gnss_synchro->PRN)); - DLOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_doppler_bias << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl; + DLOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_doppler_bias << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << '\n'; return true; } return false; @@ -426,7 +426,7 @@ void pcps_acquisition::dump_results(int32_t effective_fft_size) mat_t* matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); if (matfp == nullptr) { - std::cout << "Unable to create or open Acquisition dump file" << std::endl; + std::cout << "Unable to create or open Acquisition dump file\n"; // d_acq_parameters.dump = false; } else diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc index 178d4defa..fee1616b8 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc @@ -117,7 +117,7 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Con // create directory if (!gnss_sdr_create_directory(dump_path)) { - std::cerr << "GNSS-SDR cannot create dump file for the Acquisition block. Wrong permissions?" << std::endl; + std::cerr << "GNSS-SDR cannot create dump file for the Acquisition block. Wrong permissions?\n"; d_dump = false; } } @@ -434,7 +434,7 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler() if (std::abs(fftFreqBins[tmp_index_freq] - d_gnss_synchro->Acq_doppler_hz) < 1000) { d_gnss_synchro->Acq_doppler_hz = static_cast(fftFreqBins[tmp_index_freq]); - // std::cout << "FFT maximum present at " << fftFreqBins[tmp_index_freq] << " [Hz]" << std::endl; + // std::cout << "FFT maximum present at " << fftFreqBins[tmp_index_freq] << " [Hz]\n"; } else { @@ -642,7 +642,7 @@ void pcps_acquisition_fine_doppler_cc::dump_results(int effective_fft_size) mat_t *matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); if (matfp == nullptr) { - std::cout << "Unable to create or open Acquisition dump file" << std::endl; + std::cout << "Unable to create or open Acquisition dump file\n"; d_dump = false; } else diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc index db74506a3..3aa08c65b 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc @@ -177,12 +177,12 @@ void pcps_assisted_acquisition_cc::get_assistance() } this->d_disable_assist = false; std::cout << "Acq assist ENABLED for GPS SV " << this->d_gnss_synchro->PRN << " (Doppler max,Doppler min)=(" - << d_doppler_max << "," << d_doppler_min << ")" << std::endl; + << d_doppler_max << "," << d_doppler_min << ")\n"; } else { this->d_disable_assist = true; - std::cout << "Acq assist DISABLED for GPS SV " << this->d_gnss_synchro->PRN << std::endl; + std::cout << "Acq assist DISABLED for GPS SV " << this->d_gnss_synchro->PRN << '\n'; } } @@ -394,7 +394,7 @@ int pcps_assisted_acquisition_cc::general_work(int noutput_items, if (d_disable_assist == false) { d_disable_assist = true; - std::cout << "Acq assist DISABLED for GPS SV " << this->d_gnss_synchro->PRN << std::endl; + std::cout << "Acq assist DISABLED for GPS SV " << this->d_gnss_synchro->PRN << '\n'; d_state = 4; } else diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc index 9dac57c9a..743b81d82 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc @@ -169,13 +169,13 @@ int pcps_opencl_acquisition_cc::init_opencl_environment(const std::string &kerne if (all_platforms.empty()) { - std::cout << "No OpenCL platforms found. Check OpenCL installation!" << std::endl; + std::cout << "No OpenCL platforms found. Check OpenCL installation!\n"; return 1; } d_cl_platform = all_platforms[0]; // get default platform std::cout << "Using platform: " << d_cl_platform.getInfo() - << std::endl; + << '\n'; // get default GPU device of the default platform std::vector gpu_devices; @@ -183,7 +183,7 @@ int pcps_opencl_acquisition_cc::init_opencl_environment(const std::string &kerne if (gpu_devices.empty()) { - std::cout << "No GPU devices found. Check OpenCL installation!" << std::endl; + std::cout << "No GPU devices found. Check OpenCL installation!\n"; return 2; } @@ -191,7 +191,7 @@ int pcps_opencl_acquisition_cc::init_opencl_environment(const std::string &kerne std::vector device; device.push_back(d_cl_device); - std::cout << "Using device: " << d_cl_device.getInfo() << std::endl; + std::cout << "Using device: " << d_cl_device.getInfo() << '\n'; cl::Context context(device); d_cl_context = context; @@ -211,7 +211,7 @@ int pcps_opencl_acquisition_cc::init_opencl_environment(const std::string &kerne { std::cout << " Error building: " << program.getBuildInfo(device[0]) - << std::endl; + << '\n'; return 3; } d_cl_program = program; @@ -242,7 +242,7 @@ int pcps_opencl_acquisition_cc::init_opencl_environment(const std::string &kerne delete d_cl_buffer_magnitude; delete d_cl_buffer_fft_codes; - std::cout << "Error creating OpenCL FFT plan." << std::endl; + std::cout << "Error creating OpenCL FFT plan.\n"; return 4; } @@ -598,7 +598,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl() // gettimeofday(&tv, NULL); // end = tv.tv_sec *1e6 + tv.tv_usec; - // std::cout << "Acq time = " << (end-begin) << " us" << std::endl; + // std::cout << "Acq time = " << (end-begin) << " us\n"; if (!d_bit_transition_flag) { diff --git a/src/algorithms/acquisition/libs/fpga_acquisition.cc b/src/algorithms/acquisition/libs/fpga_acquisition.cc index bd9fa40ac..2c95de39a 100644 --- a/src/algorithms/acquisition/libs/fpga_acquisition.cc +++ b/src/algorithms/acquisition/libs/fpga_acquisition.cc @@ -105,7 +105,7 @@ void Fpga_Acquisition::open_device() if ((d_fd = open(d_device_name.c_str(), O_RDWR | O_SYNC)) == -1) { LOG(WARNING) << "Cannot open deviceio" << d_device_name; - std::cout << "Acq: cannot open deviceio" << d_device_name << std::endl; + std::cout << "Acq: cannot open deviceio" << d_device_name << '\n'; } d_map_base = reinterpret_cast(mmap(nullptr, PAGE_SIZE_DEFAULT, PROT_READ | PROT_WRITE, MAP_SHARED, d_fd, 0)); @@ -113,7 +113,7 @@ void Fpga_Acquisition::open_device() if (d_map_base == reinterpret_cast(-1)) { LOG(WARNING) << "Cannot map the FPGA acquisition module into user memory"; - std::cout << "Acq: cannot map deviceio" << d_device_name << std::endl; + std::cout << "Acq: cannot map deviceio" << d_device_name << '\n'; } } @@ -148,7 +148,7 @@ void Fpga_Acquisition::run_acquisition() ssize_t nbytes = TEMP_FAILURE_RETRY(write(d_fd, reinterpret_cast(&reenable), sizeof(int32_t))); if (nbytes != sizeof(int32_t)) { - std::cerr << "Error enabling run in the FPGA." << std::endl; + std::cerr << "Error enabling run in the FPGA.\n"; } // launch the acquisition process @@ -160,8 +160,8 @@ void Fpga_Acquisition::run_acquisition() nb = read(d_fd, &irq_count, sizeof(irq_count)); if (nb != sizeof(irq_count)) { - std::cout << "acquisition module Read failed to retrieve 4 bytes!" << std::endl; - std::cout << "acquisition module Interrupt number " << irq_count << std::endl; + std::cout << "acquisition module Read failed to retrieve 4 bytes!\n"; + std::cout << "acquisition module Interrupt number " << irq_count << '\n'; } } @@ -245,7 +245,7 @@ void Fpga_Acquisition::close_device() auto *aux = const_cast(d_map_base); if (munmap(static_cast(aux), PAGE_SIZE_DEFAULT) == -1) { - std::cout << "Failed to unmap memory uio" << std::endl; + std::cout << "Failed to unmap memory uio\n"; } close(d_fd); } diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index 150da6685..0429de568 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -59,8 +59,8 @@ Channel::Channel(const ConfigurationInterface* configuration, uint32_t channel, int64_t deprecation_warning = configuration->property("GNSS-SDR.internal_fs_hz", 0); if (deprecation_warning != 0) { - std::cout << "WARNING: The global parameter name GNSS-SDR.internal_fs_hz has been DEPRECATED." << std::endl; - std::cout << "WARNING: Please replace it by GNSS-SDR.internal_fs_sps in your configuration file." << std::endl; + std::cout << "WARNING: The global parameter name GNSS-SDR.internal_fs_hz has been DEPRECATED.\n"; + std::cout << "WARNING: Please replace it by GNSS-SDR.internal_fs_sps in your configuration file.\n"; } } diff --git a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc index aa7dc09ea..8e5d34cf1 100644 --- a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc +++ b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc @@ -170,7 +170,7 @@ FreqXlatingFirFilter::FreqXlatingFirFilter(const ConfigurationInterface* configu if (dump_) { DLOG(INFO) << "Dumping output into file " << dump_filename_; - std::cout << "Dumping output into file " << dump_filename_ << std::endl; + std::cout << "Dumping output into file " << dump_filename_ << '\n'; file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str()); } if (in_streams_ > 1) diff --git a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc index 0ac990167..482531f04 100644 --- a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc +++ b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc @@ -80,7 +80,7 @@ PulseBlankingFilter::PulseBlankingFilter(const ConfigurationInterface* configura if (dump_) { DLOG(INFO) << "Dumping output into file " << dump_filename_; - std::cout << "Dumping output into file " << dump_filename_ << std::endl; + std::cout << "Dumping output into file " << dump_filename_ << '\n'; file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str()); } if (in_streams_ > 1) diff --git a/src/algorithms/libs/geofunctions.cc b/src/algorithms/libs/geofunctions.cc index b1f8234d6..1a8fdd105 100644 --- a/src/algorithms/libs/geofunctions.cc +++ b/src/algorithms/libs/geofunctions.cc @@ -547,7 +547,7 @@ void cart2utm(const arma::vec &r_eb_e, int zone, arma::vec &r_enu) iterations = iterations + 1; if (iterations > 100) { - std::cout << "Failed to approximate U with desired precision. U-oldU:" << U - oldU << std::endl; + std::cout << "Failed to approximate U with desired precision. U - oldU: " << U - oldU << '\n'; break; } } diff --git a/src/algorithms/libs/gnss_sdr_flags.cc b/src/algorithms/libs/gnss_sdr_flags.cc index f9535d1ff..dd8c8dbfa 100644 --- a/src/algorithms/libs/gnss_sdr_flags.cc +++ b/src/algorithms/libs/gnss_sdr_flags.cc @@ -82,8 +82,8 @@ static bool ValidateC(const char* flagname, const std::string& value) { // value is ok return true; } - std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist." << std::endl; - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist.\n"; + std::cout << "GNSS-SDR program ended.\n"; return false; } @@ -93,8 +93,8 @@ static bool ValidateConfigFile(const char* flagname, const std::string& value) { // value is ok return true; } - std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist." << std::endl; - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist.\n"; + std::cout << "GNSS-SDR program ended.\n"; return false; } @@ -104,8 +104,8 @@ static bool ValidateS(const char* flagname, const std::string& value) { // value is ok return true; } - std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist." << std::endl; - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist.\n"; + std::cout << "GNSS-SDR program ended.\n"; return false; } @@ -115,8 +115,8 @@ static bool ValidateSignalSource(const char* flagname, const std::string& value) { // value is ok return true; } - std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist." << std::endl; - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist.\n"; + std::cout << "GNSS-SDR program ended.\n"; return false; } @@ -127,8 +127,8 @@ static bool ValidateDopplerMax(const char* flagname, int32_t value) { // value is ok return true; } - std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " Hz." << std::endl; - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " Hz.\n"; + std::cout << "GNSS-SDR program ended.\n"; return false; } @@ -139,8 +139,8 @@ static bool ValidateDopplerStep(const char* flagname, int32_t value) { // value is ok return true; } - std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " Hz." << std::endl; - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " Hz.\n"; + std::cout << "GNSS-SDR program ended.\n"; return false; } @@ -151,8 +151,8 @@ static bool ValidateCn0Samples(const char* flagname, int32_t value) { // value is ok return true; } - std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " samples." << std::endl; - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " samples.\n"; + std::cout << "GNSS-SDR program ended.\n"; return false; } @@ -163,8 +163,8 @@ static bool ValidateCn0Min(const char* flagname, int32_t value) { // value is ok return true; } - std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " dB-Hz." << std::endl; - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " dB-Hz.\n"; + std::cout << "GNSS-SDR program ended.\n"; return false; } @@ -175,8 +175,8 @@ static bool ValidateMaxLockFail(const char* flagname, int32_t value) { // value is ok return true; } - std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " fails." << std::endl; - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " fails.\n"; + std::cout << "GNSS-SDR program ended.\n"; return false; } @@ -187,8 +187,8 @@ static bool ValidateCarrierLockTh(const char* flagname, double value) { // value is ok return true; } - std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " rad." << std::endl; - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " rad.\n"; + std::cout << "GNSS-SDR program ended.\n"; return false; } @@ -199,8 +199,8 @@ static bool ValidateDllBw(const char* flagname, double value) { // value is ok return true; } - std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " Hz." << std::endl; - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " Hz.\n"; + std::cout << "GNSS-SDR program ended.\n"; return false; } @@ -211,8 +211,8 @@ static bool ValidatePllBw(const char* flagname, double value) { // value is ok return true; } - std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " Hz." << std::endl; - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " Hz.\n"; + std::cout << "GNSS-SDR program ended.\n"; return false; } @@ -223,8 +223,8 @@ static bool ValidateCarrierSmoothingFactor(const char* flagname, int32_t value) { // value is ok return true; } - std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 1 <= " << flagname << "." << std::endl; - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 1 <= " << flagname << ".\n"; + std::cout << "GNSS-SDR program ended.\n"; return false; } diff --git a/src/algorithms/libs/opencl/cl.hpp b/src/algorithms/libs/opencl/cl.hpp index 0874c8562..12cc7ded7 100644 --- a/src/algorithms/libs/opencl/cl.hpp +++ b/src/algorithms/libs/opencl/cl.hpp @@ -116,7 +116,7 @@ * << "(" * << err.err() * << ")" - * << std::endl; + * << '\n'; * } * * return EXIT_SUCCESS; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr-config-info.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr-config-info.cc index 67c287713..4176d0819 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr-config-info.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr-config-info.cc @@ -14,12 +14,12 @@ #include "volk_gnsssdr/volk_gnsssdr.h" // for volk_gnsssdr_get_alignment, volk_gnsssdr_get_machine #include "volk_gnsssdr_option_helpers.h" // for option_list, option_t #include // for volk_gnsssdr_available_machines, volk_gnsssdr_c_compiler ... -#include // for operator<<, endl, cout, ostream +#include // for operator<<, cout, ostream #include // for string void print_alignment() { - std::cout << "Alignment in bytes: " << volk_gnsssdr_get_alignment() << std::endl; + std::cout << "Alignment in bytes: " << volk_gnsssdr_get_alignment() << '\n'; } @@ -29,11 +29,11 @@ void print_malloc() // structure from there and give an explanation for the implementations std::cout << "Used malloc implementation: "; #if HAVE_POSIX_MEMALIGN - std::cout << "posix_memalign" << std::endl; + std::cout << "posix_memalign\n"; #elif defined(_MSC_VER) - std::cout << "_aligned_malloc" << std::endl; + std::cout << "_aligned_malloc\n"; #else - std::cout << "C11 aligned_alloc." << std::endl; + std::cout << "C11 aligned_alloc.\n"; #endif } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.cc index 0564618b3..d1d303d98 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.cc @@ -12,7 +12,7 @@ #include // IWYU pragma: keep #include // IWYU pragma: keep #include // for exception -#include // for operator<<, endl, basic_ostream, cout, ostream +#include // for operator<<, basic_ostream, cout, ostream #include // for pair @@ -93,7 +93,7 @@ void option_list::parse(int argc, char **argv) } catch (std::exception &exc) { - std::cout << "An int option can only receive a number" << std::endl; + std::cout << "An int option can only receive a number\n"; throw std::exception(); }; break; @@ -105,7 +105,7 @@ void option_list::parse(int argc, char **argv) } catch (std::exception &exc) { - std::cout << "A float option can only receive a number" << std::endl; + std::cout << "A float option can only receive a number\n"; throw std::exception(); }; break; @@ -117,7 +117,7 @@ void option_list::parse(int argc, char **argv) } catch (std::exception &exc) { - std::cout << "A bool option can only receive 0 or 1" << std::endl; + std::cout << "A bool option can only receive 0 or 1\n"; throw std::exception(); }; break; @@ -132,7 +132,7 @@ void option_list::parse(int argc, char **argv) }; break; case STRING: - std::cout << this_option->printval << std::endl; + std::cout << this_option->printval << '\n'; break; default: this_option->callback(); @@ -150,8 +150,8 @@ void option_list::parse(int argc, char **argv) void option_list::help() { - std::cout << program_name << std::endl; - std::cout << " -h [ --help ] \t\tDisplay this help message" << std::endl; + std::cout << program_name << '\n'; + std::cout << " -h [ --help ] \t\tDisplay this help message\n"; for (std::vector::iterator this_option = internal_list.begin(); this_option != internal_list.end(); this_option++) @@ -184,6 +184,6 @@ void option_list::help() break; } help_line += this_option->msg; - std::cout << help_line << std::endl; + std::cout << help_line << '\n'; } } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc index 770a00aee..6361e883f 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc @@ -154,7 +154,7 @@ int main(int argc, char *argv[]) } catch (std::string &error) { - std::cerr << "Caught Exception in 'run_volk_gnsssdr_tests': " << error << std::endl; + std::cerr << "Caught Exception in 'run_volk_gnsssdr_tests': " << error << '\n'; } } } @@ -176,7 +176,7 @@ int main(int argc, char *argv[]) } else { - std::cout << "Warning: this was a dry-run. Config not generated" << std::endl; + std::cout << "Warning: this was a dry-run. Config not generated\n"; } return 0; @@ -261,22 +261,22 @@ void write_results(const std::vector *results, bool { try { - std::cout << "Creating " << config_path.parent_path() << " ..." << std::endl; + std::cout << "Creating " << config_path.parent_path() << " ...\n"; try { fs::create_directories(config_path.parent_path()); } catch (const fs::filesystem_error &e) { - std::cerr << "ERROR: Could not create folder " << config_path.parent_path() << std::endl; - std::cerr << "Reason: " << e.what() << std::endl; + std::cerr << "ERROR: Could not create folder " << config_path.parent_path() << '\n'; + std::cerr << "Reason: " << e.what() << '\n'; return; } } catch (...) { // Catch exception when using std::experimental - std::cerr << "ERROR: Could not create folder" << std::endl; + std::cerr << "ERROR: Could not create folder\n"; return; } } @@ -284,20 +284,20 @@ void write_results(const std::vector *results, bool std::ofstream config; if (update_result) { - std::cout << "Updating " << path << " ..." << std::endl; + std::cout << "Updating " << path << " ...\n"; config.open(path.c_str(), std::ofstream::app); if (!config.is_open()) { // either we don't have write access or we don't have the dir yet - std::cout << "Error opening file " << path << std::endl; + std::cout << "Error opening file " << path << '\n'; } } else { - std::cout << "Writing " << path << " ..." << std::endl; + std::cout << "Writing " << path << " ...\n"; config.open(path.c_str()); if (!config.is_open()) { // either we don't have write access or we don't have the dir yet - std::cout << "Error opening file " << path << std::endl; + std::cout << "Error opening file " << path << '\n'; } config << "\ @@ -311,29 +311,29 @@ void write_results(const std::vector *results, bool { config << profile_results->config_name << " " << profile_results->best_arch_a << " " - << profile_results->best_arch_u << std::endl; + << profile_results->best_arch_u << '\n'; } config.close(); } void write_json(std::ofstream &json_file, std::vector results) { - json_file << "{" << std::endl; - json_file << " \"volk_gnsssdr_tests\": [" << std::endl; + json_file << "{\n"; + json_file << " \"volk_gnsssdr_tests\": [\n"; size_t len = results.size(); size_t i = 0; std::vector::iterator result; for (result = results.begin(); result != results.end(); ++result) { - json_file << " {" << std::endl; - json_file << " \"name\": \"" << result->name << "\"," << std::endl; - json_file << " \"vlen\": " << (int)(result->vlen) << "," << std::endl; - json_file << " \"iter\": " << result->iter << "," << std::endl; + json_file << " {\n"; + json_file << " \"name\": \"" << result->name << "\",\n"; + json_file << " \"vlen\": " << (int)(result->vlen) << ",\n"; + json_file << " \"iter\": " << result->iter << ",\n"; json_file << " \"best_arch_a\": \"" << result->best_arch_a - << "\"," << std::endl; + << "\",\n"; json_file << " \"best_arch_u\": \"" << result->best_arch_u - << "\"," << std::endl; - json_file << " \"results\": {" << std::endl; + << "\",\n"; + json_file << " \"results\": {\n"; size_t results_len = result->results.size(); size_t ri = 0; @@ -341,27 +341,27 @@ void write_json(std::ofstream &json_file, std::vectorresults.begin(); kernel_time_pair != result->results.end(); ++kernel_time_pair) { volk_gnsssdr_test_time_t time = kernel_time_pair->second; - json_file << " \"" << time.name << "\": {" << std::endl; - json_file << " \"name\": \"" << time.name << "\"," << std::endl; - json_file << " \"time\": " << time.time << "," << std::endl; - json_file << " \"units\": \"" << time.units << "\"" << std::endl; + json_file << " \"" << time.name << "\": {\n"; + json_file << " \"name\": \"" << time.name << "\",\n"; + json_file << " \"time\": " << time.time << ",\n"; + json_file << " \"units\": \"" << time.units << "\"\n"; json_file << " }"; if (ri + 1 != results_len) { json_file << ","; } - json_file << std::endl; + json_file << '\n'; ri++; } - json_file << " }" << std::endl; + json_file << " }\n"; json_file << " }"; if (i + 1 != len) { json_file << ","; } - json_file << std::endl; + json_file << '\n'; i++; } - json_file << " ]" << std::endl; - json_file << "}" << std::endl; + json_file << " ]\n"; + json_file << "}\n"; } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc index b0404f29b..053d7c8e7 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc @@ -383,7 +383,7 @@ bool fcompare(t *in1, t *in2, unsigned int vlen, float tol) if (print_max_errs-- > 0) { std::cout << "offset " << i << " in1: " << t(((t *)(in1))[i]) << " in2: " << t(((t *)(in2))[i]); - std::cout << " tolerance was: " << tol << std::endl; + std::cout << " tolerance was: " << tol << '\n'; } } } @@ -394,7 +394,7 @@ bool fcompare(t *in1, t *in2, unsigned int vlen, float tol) if (print_max_errs-- > 0) { std::cout << "offset " << i << " in1: " << t(((t *)(in1))[i]) << " in2: " << t(((t *)(in2))[i]); - std::cout << " tolerance was: " << tol << std::endl; + std::cout << " tolerance was: " << tol << '\n'; } } } @@ -423,7 +423,7 @@ bool ccompare(t *in1, t *in2, unsigned int vlen, float tol) if (print_max_errs-- > 0) { std::cout << "offset " << i / 2 << " in1: " << in1[i] << " + " << in1[i + 1] << "j in2: " << in2[i] << " + " << in2[i + 1] << "j"; - std::cout << " tolerance was: " << tol << std::endl; + std::cout << " tolerance was: " << tol << '\n'; } } } @@ -434,7 +434,7 @@ bool ccompare(t *in1, t *in2, unsigned int vlen, float tol) if (print_max_errs-- > 0) { std::cout << "offset " << i / 2 << " in1: " << in1[i] << " + " << in1[i + 1] << "j in2: " << in2[i] << " + " << in2[i + 1] << "j"; - std::cout << " tolerance was: " << tol << std::endl; + std::cout << " tolerance was: " << tol << '\n'; } } } @@ -455,7 +455,7 @@ bool icompare(t *in1, t *in2, unsigned int vlen, unsigned int tol) if (print_max_errs-- > 0) { std::cout << "offset " << i << " in1: " << static_cast(t(((t *)(in1))[i])) << " in2: " << static_cast(t(((t *)(in2))[i])); - std::cout << " tolerance was: " << tol << std::endl; + std::cout << " tolerance was: " << tol << '\n'; } } } @@ -514,7 +514,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, results->back().name = name; results->back().vlen = vlen; results->back().iter = iter; - std::cout << "RUN_VOLK_GNSSSDR_TESTS: " << name << "(" << vlen << "," << iter << ")" << std::endl; + std::cout << "RUN_VOLK_GNSSSDR_TESTS: " << name << "(" << vlen << "," << iter << ")\n"; // vlen_twiddle will increase vlen for malloc and data generation // but kernels will still be called with the user provided vlen. @@ -530,7 +530,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, if ((!benchmark_mode) && (arch_list.size() < 2)) { - std::cout << "no architectures to test" << std::endl; + std::cout << "no architectures to test\n"; return false; } @@ -545,13 +545,13 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, } catch (std::exception &error) { - std::cerr << "Error: unable to get function signature from kernel name" << std::endl; - std::cerr << " - " << name << std::endl; + std::cerr << "Error: unable to get function signature from kernel name\n"; + std::cerr << " - " << name << '\n'; return false; } catch (std::string s) { - std::cerr << "Error: " << s << std::endl; + std::cerr << "Error: " << s << '\n'; return false; } @@ -740,7 +740,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, end = std::chrono::system_clock::now(); std::chrono::duration elapsed_seconds = end - start; double arch_time = 1000.0 * elapsed_seconds.count(); - std::cout << arch_list[i] << " completed in " << arch_time << " ms" << std::endl; + std::cout << arch_list[i] << " completed in " << arch_time << " ms\n"; volk_gnsssdr_test_time_t result; result.name = arch_list[i]; result.time = arch_time; @@ -881,7 +881,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, volk_gnsssdr_test_time_t *result = &results->back().results[arch_list[i]]; result->pass = false; fail_global = true; - std::cout << name << ": fail on arch " << arch_list[i] << std::endl; + std::cout << name << ": fail on arch " << arch_list[i] << '\n'; } } } @@ -906,8 +906,8 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, } } - std::cout << "Best aligned arch: " << best_arch_a << std::endl; - std::cout << "Best unaligned arch: " << best_arch_u << std::endl; + std::cout << "Best aligned arch: " << best_arch_a << '\n'; + std::cout << "Best unaligned arch: " << best_arch_u << '\n'; if (puppet_master_name == "NULL") { diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc index f340da6a4..3083dc405 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc @@ -13,7 +13,7 @@ #include "qa_utils.h" // for volk_gnsssdr_test_case_t, volk_gnsssdr_test_results_t #include "volk_gnsssdr/volk_gnsssdr_complex.h" // for lv_32fc_t #include // IWYU pragma: keep -#include // for operator<<, basic_ostream, endl, char... +#include // for operator<<, basic_ostream, char... #include // for map, map<>::iterator, _Rb_tree_iterator #include // for stringstream #include // for string, operator<< @@ -43,7 +43,7 @@ int main(int argc, char* argv[]) ss << argv[1]; if (ss.fail()) { - std::cerr << "Test name not correctly set." << std::endl; + std::cerr << "Test name not correctly set.\n"; return 0; } for (unsigned int ii = 0; ii < test_cases.size(); ++ii) @@ -64,7 +64,7 @@ int main(int argc, char* argv[]) } } } - std::cerr << "Did not run a test for kernel: " << std::string(argv[1]) << " !" << std::endl; + std::cerr << "Did not run a test for kernel: " << std::string(argv[1]) << " !\n"; return 0; } else @@ -83,13 +83,13 @@ int main(int argc, char* argv[]) catch (...) { // TODO: what exceptions might we need to catch and how do we handle them? - std::cerr << "Exception found on kernel: " << test_case.name() << std::endl; + std::cerr << "Exception found on kernel: " << test_case.name() << '\n'; qa_result = false; } if (qa_result) { - std::cerr << "Failure on " << test_case.name() << std::endl; + std::cerr << "Failure on " << test_case.name() << '\n'; qa_failures.push_back(test_case.name()); } } @@ -99,13 +99,13 @@ int main(int argc, char* argv[]) // Summarize QA results std::cerr << "Kernel QA finished: " << qa_failures.size() << " failures out of " - << test_cases.size() << " tests." << std::endl; + << test_cases.size() << " tests.\n"; if (qa_failures.size() > 0) { - std::cerr << "The following kernels failed QA:" << std::endl; + std::cerr << "The following kernels failed QA:\n"; for (unsigned int ii = 0; ii < qa_failures.size(); ++ii) { - std::cerr << " " << qa_failures[ii] << std::endl; + std::cerr << " " << qa_failures[ii] << '\n'; } qa_ret_val = 1; } @@ -123,17 +123,17 @@ void print_qa_xml(std::vector results, unsigned int std::ofstream qa_file; qa_file.open(".unittest/kernels.xml"); - qa_file << "" << std::endl; + qa_file << "\n"; qa_file << "" << std::endl; + << "failures=\"" << nfails << "\" id=\"1\">\n"; // Results are in a vector by kernel. Each element has a result // map containing time and arch name with test result for (unsigned int ii = 0; ii < results.size(); ++ii) { volk_gnsssdr_test_results_t result = results[ii]; - qa_file << " " << std::endl; + qa_file << " \n"; std::map::iterator kernel_time_pair; for (kernel_time_pair = result.results.begin(); kernel_time_pair != result.results.end(); ++kernel_time_pair) @@ -141,16 +141,16 @@ void print_qa_xml(std::vector results, unsigned int volk_gnsssdr_test_time_t test_time = kernel_time_pair->second; qa_file << " " << std::endl; + << "time=\"" << test_time.time << "\">\n"; if (!test_time.pass) qa_file << " " - << "" << std::endl; - qa_file << " " << std::endl; + << "\n"; + qa_file << " \n"; } - qa_file << " " << std::endl; + qa_file << " \n"; } - qa_file << "" << std::endl; + qa_file << "\n"; qa_file.close(); } diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc index f013627c9..0a906dc81 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc @@ -122,7 +122,7 @@ hybrid_observables_gs::hybrid_observables_gs(const Obs_Conf &conf_) : gr::block( // create directory if (!gnss_sdr_create_directory(dump_path)) { - std::cerr << "GNSS-SDR cannot create dump file for the Observables block. Wrong permissions?" << std::endl; + std::cerr << "GNSS-SDR cannot create dump file for the Observables block. Wrong permissions?\n"; d_dump = false; } d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); @@ -230,7 +230,7 @@ int32_t hybrid_observables_gs::save_matfile() const int32_t number_of_double_vars = 7; int32_t epoch_size_bytes = sizeof(double) * number_of_double_vars * d_nchannels_out; std::ifstream dump_file; - std::cout << "Generating .mat file for " << dump_filename << std::endl; + std::cout << "Generating .mat file for " << dump_filename << '\n'; dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); try { @@ -238,7 +238,7 @@ int32_t hybrid_observables_gs::save_matfile() const } catch (const std::ifstream::failure &e) { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + std::cerr << "Problem opening dump file:" << e.what() << '\n'; return 1; } // count number of epochs and rewind @@ -284,7 +284,7 @@ int32_t hybrid_observables_gs::save_matfile() const } catch (const std::ifstream::failure &e) { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + std::cerr << "Problem reading dump file:" << e.what() << '\n'; return 1; } @@ -400,14 +400,14 @@ bool hybrid_observables_gs::interp_trk_obs(Gnss_Synchro &interpolated_obs, uint3 if (rx_clock > d_gnss_synchro_history->get(ch, nearest_element).Tracking_sample_counter) { // std::cout << "S1= " << d_gnss_synchro_history->get(ch, nearest_element).Tracking_sample_counter - // << " Si=" << rx_clock << " S2=" << d_gnss_synchro_history->get(ch, neighbor_element).Tracking_sample_counter << std::endl; + // << " Si=" << rx_clock << " S2=" << d_gnss_synchro_history->get(ch, neighbor_element).Tracking_sample_counter << '\n'; t1_idx = nearest_element; t2_idx = neighbor_element; } else { // std::cout << "inv S1= " << d_gnss_synchro_history->get(ch, neighbor_element).Tracking_sample_counter - // << " Si=" << rx_clock << " S2=" << d_gnss_synchro_history->get(ch, nearest_element).Tracking_sample_counter << std::endl; + // << " Si=" << rx_clock << " S2=" << d_gnss_synchro_history->get(ch, nearest_element).Tracking_sample_counter << '\n'; t1_idx = neighbor_element; t2_idx = nearest_element; } @@ -515,7 +515,7 @@ void hybrid_observables_gs::update_TOW(const std::vector &data) void hybrid_observables_gs::compute_pranges(std::vector &data) const { // std::cout.precision(17); - // std::cout << " d_T_rx_TOW_ms: " << static_cast(d_T_rx_TOW_ms) << std::endl; + // std::cout << " d_T_rx_TOW_ms: " << static_cast(d_T_rx_TOW_ms) << '\n'; std::vector::iterator it; auto current_T_rx_TOW_ms = static_cast(d_T_rx_TOW_ms); double current_T_rx_TOW_s = current_T_rx_TOW_ms / 1000.0; @@ -532,8 +532,8 @@ void hybrid_observables_gs::compute_pranges(std::vector &data) con it->Pseudorange_m = traveltime_ms * SPEED_OF_LIGHT_M_MS; it->Flag_valid_pseudorange = true; // debug code - // std::cout << "[" << it->Channel_ID << "] interp_TOW_ms: " << it->interp_TOW_ms << std::endl; - // std::cout << "[" << it->Channel_ID << "] Diff d_T_rx_TOW_ms - interp_TOW_ms: " << static_cast(d_T_rx_TOW_ms) - it->interp_TOW_ms << std::endl; + // std::cout << "[" << it->Channel_ID << "] interp_TOW_ms: " << it->interp_TOW_ms << '\n'; + // std::cout << "[" << it->Channel_ID << "] Diff d_T_rx_TOW_ms - interp_TOW_ms: " << static_cast(d_T_rx_TOW_ms) - it->interp_TOW_ms << '\n'; } else { diff --git a/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc b/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc index 0ba2e5ab7..cb850ada0 100644 --- a/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc +++ b/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc @@ -47,7 +47,7 @@ DirectResamplerConditioner::DirectResamplerConditioner( { std::string aux_warn = "CONFIGURATION WARNING: Parameters GNSS-SDR.internal_fs_sps and " + role_ + ".sample_freq_out are not set to the same value!"; LOG(WARNING) << aux_warn; - std::cout << aux_warn << std::endl; + std::cout << aux_warn << '\n'; } item_type_ = configuration->property(role + ".item_type", default_item_type); dump_ = configuration->property(role + ".dump", false); diff --git a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc index 4a302320b..5d29cb9c7 100644 --- a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc +++ b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc @@ -42,7 +42,7 @@ MmseResamplerConditioner::MmseResamplerConditioner( { std::string aux_warn = "CONFIGURATION WARNING: Parameters GNSS-SDR.internal_fs_sps and " + role_ + ".sample_freq_out are not set to the same value!"; LOG(WARNING) << aux_warn; - std::cout << aux_warn << std::endl; + std::cout << aux_warn << '\n'; } item_type_ = configuration->property(role + ".item_type", default_item_type); dump_ = configuration->property(role + ".dump", false); @@ -59,7 +59,7 @@ MmseResamplerConditioner::MmseResamplerConditioner( sample_freq_out_ / 2.1, sample_freq_out_ / 5, gr::filter::firdes::win_type::WIN_HAMMING); - std::cout << "Enabled fractional resampler low pass filter with " << taps.size() << " taps" << std::endl; + std::cout << "Enabled fractional resampler low pass filter with " << taps.size() << " taps\n"; fir_filter_ccf_ = gr::filter::fir_filter_ccf::make(1, taps); #ifdef GR_GREATER_38 diff --git a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc index 703403bcb..251e89c2f 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc +++ b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc @@ -315,7 +315,7 @@ int signal_generator_c::general_work(int noutput_items __attribute__((unused)), else if (system_[sat] == "R") { phase_step_rad = -static_cast(TWO_PI) * (freq + (DFRQ1_GLO * GLONASS_PRN.at(PRN_[sat])) + doppler_Hz_[sat]) / static_cast(fs_in_); - // std::cout << "sat " << PRN_[sat] << " SG - Freq = " << (freq + (DFRQ1_GLO * GLONASS_PRN.at(PRN_[sat]))) << " Doppler = " << doppler_Hz_[sat] << std::endl; + // std::cout << "sat " << PRN_[sat] << " SG - Freq = " << (freq + (DFRQ1_GLO * GLONASS_PRN.at(PRN_[sat]))) << " Doppler = " << doppler_Hz_[sat] << '\n'; _phase[0] = -start_phase_rad_[sat]; volk_gnsssdr_s32f_sincos_32fc(complex_phase_.data(), -phase_step_rad, _phase.data(), vector_length_); diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc index ce470b2c6..f21812ed9 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc @@ -33,7 +33,7 @@ #include // for exceptions #include // for open, O_WRONLY #include // for std::ifstream -#include // for cout, endl +#include // for cout #include // for string manipulation #include // for std::chrono #include // for write @@ -93,8 +93,8 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con switch_position = configuration->property(role + ".switch_position", 0); if (switch_position != 0 && switch_position != 2) { - std::cout << "SignalSource.switch_position configuration parameter must be either 0: read from file(s) via DMA, or 2: read from AD9361" << std::endl; - std::cout << "SignalSource.switch_position configuration parameter set to its default value switch_position=0 - read from file(s)" << std::endl; + std::cout << "SignalSource.switch_position configuration parameter must be either 0: read from file(s) via DMA, or 2: read from AD9361\n"; + std::cout << "SignalSource.switch_position configuration parameter set to its default value switch_position=0 - read from file(s)\n"; switch_position = 0; } @@ -103,7 +103,7 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con item_size_ = sizeof(gr_complex); - std::cout << "Sample rate: " << sample_rate_ << " Sps" << std::endl; + std::cout << "Sample rate: " << sample_rate_ << " Sps\n"; if (switch_position == 0) // Inject file(s) via DMA { @@ -153,30 +153,30 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con // some basic checks if ((rf_port_select_ != "A_BALANCED") and (rf_port_select_ != "B_BALANCED") and (rf_port_select_ != "A_N") and (rf_port_select_ != "B_N") and (rf_port_select_ != "B_P") and (rf_port_select_ != "C_N") and (rf_port_select_ != "C_P") and (rf_port_select_ != "TX_MONITOR1") and (rf_port_select_ != "TX_MONITOR2") and (rf_port_select_ != "TX_MONITOR1_2")) { - std::cout << "Configuration parameter rf_port_select should take one of these values:" << std::endl; - std::cout << " A_BALANCED, B_BALANCED, A_N, B_N, B_P, C_N, C_P, TX_MONITOR1, TX_MONITOR2, TX_MONITOR1_2" << std::endl; - std::cout << "Error: provided value rf_port_select=" << rf_port_select_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value rf_port_select=" << default_rf_port_select << std::endl; + std::cout << "Configuration parameter rf_port_select should take one of these values:\n"; + std::cout << " A_BALANCED, B_BALANCED, A_N, B_N, B_P, C_N, C_P, TX_MONITOR1, TX_MONITOR2, TX_MONITOR1_2\n"; + std::cout << "Error: provided value rf_port_select=" << rf_port_select_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value rf_port_select=" << default_rf_port_select << '\n'; rf_port_select_ = default_rf_port_select; LOG(WARNING) << "Invalid configuration value for rf_port_select parameter. Set to rf_port_select=" << default_rf_port_select; } if ((gain_mode_rx1_ != "manual") and (gain_mode_rx1_ != "slow_attack") and (gain_mode_rx1_ != "fast_attack") and (gain_mode_rx1_ != "hybrid")) { - std::cout << "Configuration parameter gain_mode_rx1 should take one of these values:" << std::endl; - std::cout << " manual, slow_attack, fast_attack, hybrid" << std::endl; - std::cout << "Error: provided value gain_mode_rx1=" << gain_mode_rx1_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value gain_mode_rx1=" << default_gain_mode << std::endl; + std::cout << "Configuration parameter gain_mode_rx1 should take one of these values:\n"; + std::cout << " manual, slow_attack, fast_attack, hybrid\n"; + std::cout << "Error: provided value gain_mode_rx1=" << gain_mode_rx1_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value gain_mode_rx1=" << default_gain_mode << '\n'; gain_mode_rx1_ = default_gain_mode; LOG(WARNING) << "Invalid configuration value for gain_mode_rx1 parameter. Set to gain_mode_rx1=" << default_gain_mode; } if ((gain_mode_rx2_ != "manual") and (gain_mode_rx2_ != "slow_attack") and (gain_mode_rx2_ != "fast_attack") and (gain_mode_rx2_ != "hybrid")) { - std::cout << "Configuration parameter gain_mode_rx2 should take one of these values:" << std::endl; - std::cout << " manual, slow_attack, fast_attack, hybrid" << std::endl; - std::cout << "Error: provided value gain_mode_rx2=" << gain_mode_rx2_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value gain_mode_rx2=" << default_gain_mode << std::endl; + std::cout << "Configuration parameter gain_mode_rx2 should take one of these values:\n"; + std::cout << " manual, slow_attack, fast_attack, hybrid\n"; + std::cout << "Error: provided value gain_mode_rx2=" << gain_mode_rx2_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value gain_mode_rx2=" << default_gain_mode << '\n'; gain_mode_rx2_ = default_gain_mode; LOG(WARNING) << "Invalid configuration value for gain_mode_rx2 parameter. Set to gain_mode_rx2=" << default_gain_mode; } @@ -185,9 +185,9 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con { if (rf_gain_rx1_ > 73.0 or rf_gain_rx1_ < -1.0) { - std::cout << "Configuration parameter rf_gain_rx1 should take values between -1.0 and 73 dB" << std::endl; - std::cout << "Error: provided value rf_gain_rx1=" << rf_gain_rx1_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value rf_gain_rx1=" << default_manual_gain_rx1 << std::endl; + std::cout << "Configuration parameter rf_gain_rx1 should take values between -1.0 and 73 dB\n"; + std::cout << "Error: provided value rf_gain_rx1=" << rf_gain_rx1_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value rf_gain_rx1=" << default_manual_gain_rx1 << '\n'; rf_gain_rx1_ = default_manual_gain_rx1; LOG(WARNING) << "Invalid configuration value for rf_gain_rx1 parameter. Set to rf_gain_rx1=" << default_manual_gain_rx1; } @@ -197,9 +197,9 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con { if (rf_gain_rx2_ > 73.0 or rf_gain_rx2_ < -1.0) { - std::cout << "Configuration parameter rf_gain_rx2 should take values between -1.0 and 73 dB" << std::endl; - std::cout << "Error: provided value rf_gain_rx2=" << rf_gain_rx2_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value rf_gain_rx2=" << default_manual_gain_rx2 << std::endl; + std::cout << "Configuration parameter rf_gain_rx2 should take values between -1.0 and 73 dB\n"; + std::cout << "Error: provided value rf_gain_rx2=" << rf_gain_rx2_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value rf_gain_rx2=" << default_manual_gain_rx2 << '\n'; rf_gain_rx2_ = default_manual_gain_rx2; LOG(WARNING) << "Invalid configuration value for rf_gain_rx2 parameter. Set to rf_gain_rx2=" << default_manual_gain_rx2; } @@ -207,27 +207,27 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con if ((filter_source_ != "Off") and (filter_source_ != "Auto") and (filter_source_ != "File") and (filter_source_ != "Design")) { - std::cout << "Configuration parameter filter_source should take one of these values:" << std::endl; - std::cout << " Off: Disable filter" << std::endl; - std::cout << " Auto: Use auto-generated filters" << std::endl; - std::cout << " File: User-provided filter in filter_filename parameter" << std::endl; - std::cout << " Design: Create filter from Fpass, Fstop, sampling_frequency and bandwidth parameters" << std::endl; - std::cout << "Error: provided value filter_source=" << filter_source_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value filter_source=Off" << std::endl; + std::cout << "Configuration parameter filter_source should take one of these values:\n"; + std::cout << " Off: Disable filter\n"; + std::cout << " Auto: Use auto-generated filters\n"; + std::cout << " File: User-provided filter in filter_filename parameter\n"; + std::cout << " Design: Create filter from Fpass, Fstop, sampling_frequency and bandwidth parameters\n"; + std::cout << "Error: provided value filter_source=" << filter_source_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value filter_source=Off\n"; filter_source_ = std::string("Off"); LOG(WARNING) << "Invalid configuration value for filter_source parameter. Set to filter_source=Off"; } if (bandwidth_ < 200000 or bandwidth_ > 56000000) { - std::cout << "Configuration parameter bandwidth should take values between 200000 and 56000000 Hz" << std::endl; - std::cout << "Error: provided value bandwidth=" << bandwidth_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value bandwidth=" << default_bandwidth << std::endl; + std::cout << "Configuration parameter bandwidth should take values between 200000 and 56000000 Hz\n"; + std::cout << "Error: provided value bandwidth=" << bandwidth_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value bandwidth=" << default_bandwidth << '\n'; bandwidth_ = default_bandwidth; LOG(WARNING) << "Invalid configuration value for bandwidth parameter. Set to bandwidth=" << default_bandwidth; } - std::cout << "LO frequency : " << freq_ << " Hz" << std::endl; + std::cout << "LO frequency : " << freq_ << " Hz\n"; try { config_ad9361_rx_local(bandwidth_, @@ -250,24 +250,24 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con } catch (const std::runtime_error &e) { - std::cout << "Exception cached when configuring the RX chain: " << e.what() << std::endl; + std::cout << "Exception cached when configuring the RX chain: " << e.what() << '\n'; } // LOCAL OSCILLATOR DDS GENERATOR FOR DUAL FREQUENCY OPERATION if (enable_dds_lo_ == true) { if (tx_bandwidth_ < static_cast(std::floor(static_cast(freq_dds_tx_hz_) * 1.1)) or (tx_bandwidth_ < 200000) or (tx_bandwidth_ > 1000000)) { - std::cout << "Configuration parameter tx_bandwidth value should be between " << std::max(static_cast(freq_dds_tx_hz_) * 1.1, 200000.0) << " and 1000000 Hz" << std::endl; - std::cout << "Error: provided value tx_bandwidth=" << tx_bandwidth_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value tx_bandwidth=500000" << std::endl; + std::cout << "Configuration parameter tx_bandwidth value should be between " << std::max(static_cast(freq_dds_tx_hz_) * 1.1, 200000.0) << " and 1000000 Hz\n"; + std::cout << "Error: provided value tx_bandwidth=" << tx_bandwidth_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value tx_bandwidth=500000\n"; tx_bandwidth_ = 500000; LOG(WARNING) << "Invalid configuration value for tx_bandwidth parameter. Set to tx_bandwidth=500000"; } if (tx_attenuation_db_ > 0.0 or tx_attenuation_db_ < -89.75) { - std::cout << "Configuration parameter tx_attenuation_db should take values between 0.0 and -89.95 in 0.25 dB steps" << std::endl; - std::cout << "Error: provided value tx_attenuation_db=" << tx_attenuation_db_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value tx_attenuation_db=" << default_tx_attenuation_db << std::endl; + std::cout << "Configuration parameter tx_attenuation_db should take values between 0.0 and -89.95 in 0.25 dB steps\n"; + std::cout << "Error: provided value tx_attenuation_db=" << tx_attenuation_db_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value tx_attenuation_db=" << default_tx_attenuation_db << '\n'; tx_attenuation_db_ = default_tx_attenuation_db; LOG(WARNING) << "Invalid configuration value for tx_attenuation_db parameter. Set to tx_attenuation_db=" << default_tx_attenuation_db; } @@ -283,7 +283,7 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con } catch (const std::runtime_error &e) { - std::cout << "Exception cached when configuring the TX carrier: " << e.what() << std::endl; + std::cout << "Exception cached when configuring the TX carrier: " << e.what() << '\n'; } } } @@ -352,7 +352,7 @@ void Ad9361FpgaSignalSource::run_DMA_process(const std::string &FreqBand, const } catch (const std::ifstream::failure &e) { - std::cerr << "Exception opening file " << Filename1 << std::endl; + std::cerr << "Exception opening file " << Filename1 << '\n'; return; } @@ -383,7 +383,7 @@ void Ad9361FpgaSignalSource::run_DMA_process(const std::string &FreqBand, const tx_fd = open("/dev/loop_tx", O_WRONLY); if (tx_fd < 0) { - std::cout << "Cannot open loop device" << std::endl; + std::cout << "Cannot open loop device\n"; return; } @@ -404,7 +404,7 @@ void Ad9361FpgaSignalSource::run_DMA_process(const std::string &FreqBand, const } catch (const std::ifstream::failure &e) { - std::cerr << "Exception reading file " << Filename1 << std::endl; + std::cerr << "Exception reading file " << Filename1 << '\n'; } if (infile1) { @@ -436,7 +436,7 @@ void Ad9361FpgaSignalSource::run_DMA_process(const std::string &FreqBand, const } catch (const std::ifstream::failure &e) { - std::cerr << "Exception reading file " << Filename1 << std::endl; + std::cerr << "Exception reading file " << Filename1 << '\n'; } if (infile1) { @@ -468,7 +468,7 @@ void Ad9361FpgaSignalSource::run_DMA_process(const std::string &FreqBand, const } catch (const std::ifstream::failure &e) { - std::cerr << "Exception reading file " << Filename1 << std::endl; + std::cerr << "Exception reading file " << Filename1 << '\n'; } if (infile1) { @@ -484,7 +484,7 @@ void Ad9361FpgaSignalSource::run_DMA_process(const std::string &FreqBand, const } catch (const std::ifstream::failure &e) { - std::cerr << "Exception reading file " << Filename1 << std::endl; + std::cerr << "Exception reading file " << Filename1 << '\n'; } if (infile2) { @@ -542,7 +542,7 @@ void Ad9361FpgaSignalSource::run_DMA_process(const std::string &FreqBand, const int num_bytes_sent = write(tx_fd, input_samples_dma.data(), nread_elements * 2); if (num_bytes_sent != num_transferred_bytes) { - std::cerr << "Error: DMA could not send all the required samples " << std::endl; + std::cerr << "Error: DMA could not send all the required samples \n"; } // Throttle the DMA @@ -572,7 +572,7 @@ void Ad9361FpgaSignalSource::run_DMA_process(const std::string &FreqBand, const } catch (const std::ifstream::failure &e) { - std::cerr << "Exception closing files " << Filename1 << " and " << Filename2 << std::endl; + std::cerr << "Exception closing files " << Filename1 << " and " << Filename2 << '\n'; } } diff --git a/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc b/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc index 6a735862d..42ddd1c3a 100644 --- a/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc @@ -75,7 +75,7 @@ CustomUDPSignalSource::CustomUDPSignalSource(const ConfigurationInterface* confi } else { - std::cout << "Configuration error: RF_channelsconnect(udp_gnss_rx_source_, n, null_sinks_.at(n), 0); } - DLOG(INFO) << "connected udp_source to null_sinks to enable the use of spare channels" << std::endl; + DLOG(INFO) << "connected udp_source to null_sinks to enable the use of spare channels\n"; if (dump_) { @@ -133,7 +133,7 @@ void CustomUDPSignalSource::disconnect(gr::top_block_sptr top_block) DLOG(INFO) << "disconnected source to file sink"; } } - DLOG(INFO) << "disconnected udp_source" << std::endl; + DLOG(INFO) << "disconnected udp_source\n"; } diff --git a/src/algorithms/signal_source/adapters/file_signal_source.cc b/src/algorithms/signal_source/adapters/file_signal_source.cc index 38bce391b..68b4b3971 100644 --- a/src/algorithms/signal_source/adapters/file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/file_signal_source.cc @@ -132,31 +132,31 @@ FileSignalSource::FileSignalSource(const ConfigurationInterface* configuration, { std::cerr << "The configuration file has not been found." - << std::endl + << '\n' << "Please create a configuration file based on the examples at the 'conf/' folder " - << std::endl + << '\n' << "and then generate your own GNSS Software Defined Receiver by doing:" - << std::endl + << '\n' << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" - << std::endl; + << '\n'; } else { std::cerr << "The receiver was configured to work with a file signal source " - << std::endl + << '\n' << "but the specified file is unreachable by GNSS-SDR." - << std::endl + << '\n' << "Please modify your configuration file" - << std::endl + << '\n' << "and point SignalSource.filename to a valid raw data file. Then:" - << std::endl + << '\n' << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" - << std::endl + << '\n' << "Examples of configuration files available at:" - << std::endl + << '\n' << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" - << std::endl; + << '\n'; } LOG(INFO) << "file_signal_source: Unable to open the samples file " @@ -183,12 +183,12 @@ FileSignalSource::FileSignalSource(const ConfigurationInterface* configuration, } else { - std::cout << "file_signal_source: Unable to open the samples file " << filename_.c_str() << std::endl; + std::cout << "file_signal_source: Unable to open the samples file " << filename_.c_str() << '\n'; LOG(ERROR) << "file_signal_source: Unable to open the samples file " << filename_.c_str(); } std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(16); - std::cout << "Processing file " << filename_ << ", which contains " << static_cast(size) << " [bytes]" << std::endl; + std::cout << "Processing file " << filename_ << ", which contains " << static_cast(size) << " [bytes]\n"; std::cout.precision(ss); if (size > 0) @@ -209,7 +209,7 @@ FileSignalSource::FileSignalSource(const ConfigurationInterface* configuration, } DLOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; - std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; + std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]\n"; valve_ = gnss_sdr_make_valve(item_size_, samples_, queue); DLOG(INFO) << "valve(" << valve_->unique_id() << ")"; diff --git a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc index 7445ea614..c2ffb9e06 100644 --- a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc +++ b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc @@ -92,45 +92,45 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(const ConfigurationInterface *configu // some basic checks if ((rf_port_select_ != "A_BALANCED") and (rf_port_select_ != "B_BALANCED") and (rf_port_select_ != "A_N") and (rf_port_select_ != "B_N") and (rf_port_select_ != "B_P") and (rf_port_select_ != "C_N") and (rf_port_select_ != "C_P") and (rf_port_select_ != "TX_MONITOR1") and (rf_port_select_ != "TX_MONITOR2") and (rf_port_select_ != "TX_MONITOR1_2")) { - std::cout << "Configuration parameter rf_port_select should take one of these values:" << std::endl; - std::cout << " A_BALANCED, B_BALANCED, A_N, B_N, B_P, C_N, C_P, TX_MONITOR1, TX_MONITOR2, TX_MONITOR1_2" << std::endl; - std::cout << "Error: provided value rf_port_select=" << rf_port_select_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value rf_port_select=A_BALANCED" << std::endl; + std::cout << "Configuration parameter rf_port_select should take one of these values:\n"; + std::cout << " A_BALANCED, B_BALANCED, A_N, B_N, B_P, C_N, C_P, TX_MONITOR1, TX_MONITOR2, TX_MONITOR1_2\n"; + std::cout << "Error: provided value rf_port_select=" << rf_port_select_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value rf_port_select=A_BALANCED\n"; rf_port_select_ = std::string("A_BALANCED"); LOG(WARNING) << "Invalid configuration value for rf_port_select parameter. Set to rf_port_select=A_BALANCED"; } if ((gain_mode_rx1_ != "manual") and (gain_mode_rx1_ != "slow_attack") and (gain_mode_rx1_ != "fast_attack") and (gain_mode_rx1_ != "hybrid")) { - std::cout << "Configuration parameter gain_mode_rx1 should take one of these values:" << std::endl; - std::cout << " manual, slow_attack, fast_attack, hybrid" << std::endl; - std::cout << "Error: provided value gain_mode_rx1=" << gain_mode_rx1_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value gain_mode_rx1=" << default_gain_mode << std::endl; + std::cout << "Configuration parameter gain_mode_rx1 should take one of these values:\n"; + std::cout << " manual, slow_attack, fast_attack, hybrid\n"; + std::cout << "Error: provided value gain_mode_rx1=" << gain_mode_rx1_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value gain_mode_rx1=" << default_gain_mode << '\n'; gain_mode_rx1_ = default_gain_mode; LOG(WARNING) << "Invalid configuration value for gain_mode_rx1 parameter. Set to gain_mode_rx1=" << default_gain_mode; } if ((gain_mode_rx2_ != "manual") and (gain_mode_rx2_ != "slow_attack") and (gain_mode_rx2_ != "fast_attack") and (gain_mode_rx2_ != "hybrid")) { - std::cout << "Configuration parameter gain_mode_rx2 should take one of these values:" << std::endl; - std::cout << " manual, slow_attack, fast_attack, hybrid" << std::endl; - std::cout << "Error: provided value gain_mode_rx2=" << gain_mode_rx2_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value gain_mode_rx2=" << default_gain_mode << std::endl; + std::cout << "Configuration parameter gain_mode_rx2 should take one of these values:\n"; + std::cout << " manual, slow_attack, fast_attack, hybrid\n"; + std::cout << "Error: provided value gain_mode_rx2=" << gain_mode_rx2_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value gain_mode_rx2=" << default_gain_mode << '\n'; gain_mode_rx2_ = default_gain_mode; LOG(WARNING) << "Invalid configuration value for gain_mode_rx1 parameter. Set to gain_mode_rx2=" << default_gain_mode; } if ((filter_source_ != "Off") and (filter_source_ != "Auto") and (filter_source_ != "File") and (filter_source_ != "Design")) { - std::cout << "Configuration parameter filter_source should take one of these values:" << std::endl; - std::cout << " Off: Disable filter" << std::endl; - std::cout << " Auto: Use auto-generated filters" << std::endl; - std::cout << " File: User-provided filter in filter_filename parameter" << std::endl; + std::cout << "Configuration parameter filter_source should take one of these values:\n"; + std::cout << " Off: Disable filter\n"; + std::cout << " Auto: Use auto-generated filters\n"; + std::cout << " File: User-provided filter in filter_filename parameter\n"; #if LIBAD9361_VERSION_GREATER_THAN_01 - std::cout << " Design: Create filter from Fpass, Fstop, sampling_frequency and bandwidth parameters" << std::endl; + std::cout << " Design: Create filter from Fpass, Fstop, sampling_frequency and bandwidth parameters\n"; #endif - std::cout << "Error: provided value filter_source=" << filter_source_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value filter_source=Off" << std::endl; + std::cout << "Error: provided value filter_source=" << filter_source_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value filter_source=Off\n"; filter_source_ = std::string("Off"); LOG(WARNING) << "Invalid configuration value for filter_source parameter. Set to filter_source=Off"; } @@ -139,9 +139,9 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(const ConfigurationInterface *configu { if (rf_gain_rx1_ > 73.0 or rf_gain_rx1_ < -1.0) { - std::cout << "Configuration parameter rf_gain_rx1 should take values between -1.0 and 73 dB" << std::endl; - std::cout << "Error: provided value rf_gain_rx1=" << rf_gain_rx1_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value rf_gain_rx1=64.0" << std::endl; + std::cout << "Configuration parameter rf_gain_rx1 should take values between -1.0 and 73 dB\n"; + std::cout << "Error: provided value rf_gain_rx1=" << rf_gain_rx1_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value rf_gain_rx1=64.0\n"; rf_gain_rx1_ = 64.0; LOG(WARNING) << "Invalid configuration value for rf_gain_rx1 parameter. Set to rf_gain_rx1=64.0"; } @@ -151,9 +151,9 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(const ConfigurationInterface *configu { if (rf_gain_rx2_ > 73.0 or rf_gain_rx2_ < -1.0) { - std::cout << "Configuration parameter rf_gain_rx2 should take values between -1.0 and 73 dB" << std::endl; - std::cout << "Error: provided value rf_gain_rx2=" << rf_gain_rx2_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value rf_gain_rx2=64.0" << std::endl; + std::cout << "Configuration parameter rf_gain_rx2 should take values between -1.0 and 73 dB\n"; + std::cout << "Error: provided value rf_gain_rx2=" << rf_gain_rx2_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value rf_gain_rx2=64.0\n"; rf_gain_rx2_ = 64.0; LOG(WARNING) << "Invalid configuration value for rf_gain_rx2 parameter. Set to rf_gain_rx2=64.0"; } @@ -161,16 +161,16 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(const ConfigurationInterface *configu if (bandwidth_ < 200000 or bandwidth_ > 56000000) { - std::cout << "Configuration parameter bandwidth should take values between 200000 and 56000000 Hz" << std::endl; - std::cout << "Error: provided value bandwidth=" << bandwidth_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value bandwidth=2000000" << std::endl; + std::cout << "Configuration parameter bandwidth should take values between 200000 and 56000000 Hz\n"; + std::cout << "Error: provided value bandwidth=" << bandwidth_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value bandwidth=2000000\n"; bandwidth_ = 2000000; LOG(WARNING) << "Invalid configuration value for bandwidth parameter. Set to bandwidth=2000000"; } - std::cout << "device address: " << uri_ << std::endl; - std::cout << "LO frequency : " << freq_ << " Hz" << std::endl; - std::cout << "sample rate: " << sample_rate_ << " Hz" << std::endl; + std::cout << "device address: " << uri_ << '\n'; + std::cout << "LO frequency : " << freq_ << " Hz\n"; + std::cout << "sample rate: " << sample_rate_ << " Hz\n"; if (item_type_ == "gr_complex") { @@ -208,17 +208,17 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(const ConfigurationInterface *configu { if (tx_bandwidth_ < static_cast(std::floor(static_cast(freq_dds_tx_hz_) * 1.1)) or (tx_bandwidth_ < 200000) or (tx_bandwidth_ > 1000000)) { - std::cout << "Configuration parameter tx_bandwidth value should be between " << std::max(static_cast(freq_dds_tx_hz_) * 1.1, 200000.0) << " and 1000000 Hz" << std::endl; - std::cout << "Error: provided value tx_bandwidth=" << tx_bandwidth_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value tx_bandwidth=500000" << std::endl; + std::cout << "Configuration parameter tx_bandwidth value should be between " << std::max(static_cast(freq_dds_tx_hz_) * 1.1, 200000.0) << " and 1000000 Hz\n"; + std::cout << "Error: provided value tx_bandwidth=" << tx_bandwidth_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value tx_bandwidth=500000\n"; tx_bandwidth_ = 500000; LOG(WARNING) << "Invalid configuration value for tx_bandwidth parameter. Set to tx_bandwidth=500000"; } if (tx_attenuation_db_ > 0.0 or tx_attenuation_db_ < -89.75) { - std::cout << "Configuration parameter tx_attenuation_db should take values between 0.0 and -89.95 in 0.25 dB steps" << std::endl; - std::cout << "Error: provided value tx_attenuation_db=" << tx_attenuation_db_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value tx_attenuation_db=" << default_tx_attenuation_db << std::endl; + std::cout << "Configuration parameter tx_attenuation_db should take values between 0.0 and -89.95 in 0.25 dB steps\n"; + std::cout << "Error: provided value tx_attenuation_db=" << tx_attenuation_db_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value tx_attenuation_db=" << default_tx_attenuation_db << '\n'; tx_attenuation_db_ = default_tx_attenuation_db; LOG(WARNING) << "Invalid configuration value for tx_attenuation_db parameter. Set to tx_attenuation_db=" << default_tx_attenuation_db; } @@ -236,7 +236,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(const ConfigurationInterface *configu } catch (const std::runtime_error &e) { - std::cout << "Exception cached when configuring the TX carrier: " << e.what() << std::endl; + std::cout << "Exception cached when configuring the TX carrier: " << e.what() << '\n'; } } } @@ -275,17 +275,17 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(const ConfigurationInterface *configu { if (tx_bandwidth_ < static_cast(std::floor(static_cast(freq_dds_tx_hz_) * 1.1)) or (tx_bandwidth_ < 200000) or (tx_bandwidth_ > 1000000)) { - std::cout << "Configuration parameter tx_bandwidth value should be between " << std::max(static_cast(freq_dds_tx_hz_) * 1.1, 200000.0) << " and 1000000 Hz" << std::endl; - std::cout << "Error: provided value tx_bandwidth=" << tx_bandwidth_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value tx_bandwidth=500000" << std::endl; + std::cout << "Configuration parameter tx_bandwidth value should be between " << std::max(static_cast(freq_dds_tx_hz_) * 1.1, 200000.0) << " and 1000000 Hz\n"; + std::cout << "Error: provided value tx_bandwidth=" << tx_bandwidth_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value tx_bandwidth=500000\n"; tx_bandwidth_ = 500000; LOG(WARNING) << "Invalid configuration value for tx_bandwidth parameter. Set to tx_bandwidth=500000"; } if (tx_attenuation_db_ > 0.0 or tx_attenuation_db_ < -89.75) { - std::cout << "Configuration parameter tx_attenuation_db should take values between 0.0 and -89.95 in 0.25 dB steps" << std::endl; - std::cout << "Error: provided value tx_attenuation_db=" << tx_attenuation_db_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value tx_attenuation_db=" << default_tx_attenuation_db << std::endl; + std::cout << "Configuration parameter tx_attenuation_db should take values between 0.0 and -89.95 in 0.25 dB steps\n"; + std::cout << "Error: provided value tx_attenuation_db=" << tx_attenuation_db_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value tx_attenuation_db=" << default_tx_attenuation_db << '\n'; tx_attenuation_db_ = default_tx_attenuation_db; LOG(WARNING) << "Invalid configuration value for tx_attenuation_db parameter. Set to tx_attenuation_db=" << default_tx_attenuation_db; } @@ -303,7 +303,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(const ConfigurationInterface *configu } catch (const std::runtime_error &e) { - std::cout << "Exception cached when configuring the TX carrier: " << e.what() << std::endl; + std::cout << "Exception cached when configuring the TX carrier: " << e.what() << '\n'; } } } diff --git a/src/algorithms/signal_source/adapters/multichannel_file_signal_source.cc b/src/algorithms/signal_source/adapters/multichannel_file_signal_source.cc index e484886f9..f8507a673 100644 --- a/src/algorithms/signal_source/adapters/multichannel_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/multichannel_file_signal_source.cc @@ -127,31 +127,31 @@ MultichannelFileSignalSource::MultichannelFileSignalSource(const ConfigurationIn { std::cerr << "The configuration file has not been found." - << std::endl + << '\n' << "Please create a configuration file based on the examples at the 'conf/' folder " - << std::endl + << '\n' << "and then generate your own GNSS Software Defined Receiver by doing:" - << std::endl + << '\n' << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" - << std::endl; + << '\n'; } else { std::cerr << "The receiver was configured to work with a file signal source " - << std::endl + << '\n' << "but the specified file is unreachable by GNSS-SDR." - << std::endl + << '\n' << "Please modify your configuration file" - << std::endl + << '\n' << "and point SignalSource.filename to a valid raw data file. Then:" - << std::endl + << '\n' << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" - << std::endl + << '\n' << "Examples of configuration files available at:" - << std::endl + << '\n' << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" - << std::endl; + << '\n'; } LOG(INFO) << "file_signal_source: Unable to open the samples file " @@ -177,12 +177,12 @@ MultichannelFileSignalSource::MultichannelFileSignalSource(const ConfigurationIn } else { - std::cout << "file_signal_source: Unable to open the samples file " << filename_vec_.at(0).c_str() << std::endl; + std::cout << "file_signal_source: Unable to open the samples file " << filename_vec_.at(0).c_str() << '\n'; LOG(ERROR) << "file_signal_source: Unable to open the samples file " << filename_vec_.at(0).c_str(); } std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(16); - std::cout << "Processing file " << filename_vec_.at(0) << ", which contains " << static_cast(size) << " [bytes]" << std::endl; + std::cout << "Processing file " << filename_vec_.at(0) << ", which contains " << static_cast(size) << " [bytes]\n"; std::cout.precision(ss); if (size > 0) @@ -203,7 +203,7 @@ MultichannelFileSignalSource::MultichannelFileSignalSource(const ConfigurationIn } DLOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; - std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; + std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]\n"; valve_ = gnss_sdr_make_valve(item_size_, samples_, queue); DLOG(INFO) << "valve(" << valve_->unique_id() << ")"; diff --git a/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc b/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc index 30278e4a6..0a6bc34c2 100644 --- a/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc @@ -77,19 +77,19 @@ NsrFileSignalSource::NsrFileSignalSource(const ConfigurationInterface* configura { std::cerr << "The receiver was configured to work with a file signal source " - << std::endl + << '\n' << "but the specified file is unreachable by GNSS-SDR." - << std::endl + << '\n' << "Please modify your configuration file" - << std::endl + << '\n' << "and point SignalSource.filename to a valid raw data file. Then:" - << std::endl + << '\n' << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" - << std::endl + << '\n' << "Examples of configuration files available at:" - << std::endl + << '\n' << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" - << std::endl; + << '\n'; LOG(WARNING) << "file_signal_source: Unable to open the samples file " << filename_.c_str() << ", exiting the program."; @@ -115,12 +115,12 @@ NsrFileSignalSource::NsrFileSignalSource(const ConfigurationInterface* configura } else { - std::cout << "file_signal_source: Unable to open the samples file " << filename_.c_str() << std::endl; + std::cout << "file_signal_source: Unable to open the samples file " << filename_.c_str() << '\n'; LOG(ERROR) << "file_signal_source: Unable to open the samples file " << filename_.c_str(); } std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(16); - std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]" << std::endl; + std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]\n"; std::cout.precision(ss); if (size > 0) @@ -135,7 +135,7 @@ NsrFileSignalSource::NsrFileSignalSource(const ConfigurationInterface* configura double signal_duration_s; signal_duration_s = static_cast(samples_) * (1 / static_cast(sampling_frequency_)); LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; - std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; + std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]\n"; valve_ = gnss_sdr_make_valve(sizeof(float), samples_, queue); DLOG(INFO) << "valve(" << valve_->unique_id() << ")"; diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc index e26467ec5..fcaca5abe 100644 --- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc +++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc @@ -67,29 +67,29 @@ OsmosdrSignalSource::OsmosdrSignalSource(const ConfigurationInterface* configura if (!antenna_.empty()) { osmosdr_source_->set_antenna(antenna_, 0); - std::cout << boost::format("Set RX Antenna : %s") % (osmosdr_source_->get_antenna(0)) << std::endl; + std::cout << boost::format("Set RX Antenna : %s") % (osmosdr_source_->get_antenna(0)) << '\n'; LOG(INFO) << boost::format("Set RX Antenna : %s") % (osmosdr_source_->get_antenna(0)); } // 2 set sampling rate osmosdr_source_->set_sample_rate(sample_rate_); - std::cout << boost::format("Actual RX Rate: %f [SPS]...") % (osmosdr_source_->get_sample_rate()) << std::endl; + std::cout << boost::format("Actual RX Rate: %f [SPS]...") % (osmosdr_source_->get_sample_rate()) << '\n'; LOG(INFO) << boost::format("Actual RX Rate: %f [SPS]...") % (osmosdr_source_->get_sample_rate()); // 3. set rx frequency osmosdr_source_->set_center_freq(freq_); - std::cout << boost::format("Actual RX Freq: %f [Hz]...") % (osmosdr_source_->get_center_freq()) << std::endl; + std::cout << boost::format("Actual RX Freq: %f [Hz]...") % (osmosdr_source_->get_center_freq()) << '\n'; LOG(INFO) << boost::format("Actual RX Freq: %f [Hz]...") % (osmosdr_source_->get_center_freq()); // TODO: Assign the remnant IF from the PLL tune error - std::cout << boost::format("PLL Frequency tune error %f [Hz]...") % (osmosdr_source_->get_center_freq() - freq_) << std::endl; + std::cout << boost::format("PLL Frequency tune error %f [Hz]...") % (osmosdr_source_->get_center_freq() - freq_) << '\n'; LOG(INFO) << boost::format("PLL Frequency tune error %f [Hz]...") % (osmosdr_source_->get_center_freq() - freq_); // 4. set rx gain if (this->AGC_enabled_ == true) { osmosdr_source_->set_gain_mode(true); - std::cout << "AGC enabled" << std::endl; + std::cout << "AGC enabled\n"; LOG(INFO) << "AGC enabled"; } else @@ -100,19 +100,19 @@ OsmosdrSignalSource::OsmosdrSignalSource(const ConfigurationInterface* configura osmosdr_source_->set_bb_gain(if_gain_, 0); if (!osmosdr_args_.empty() && (osmosdr_args_.find("bladerf") != std::string::npos)) { - std::cout << boost::format("Actual LNA Gain: %f dB...") % osmosdr_source_->get_gain("LNA", 0) << std::endl; - std::cout << boost::format("Actual VGA1 Gain: %f dB...") % osmosdr_source_->get_gain("VGA1", 0) << std::endl; - std::cout << boost::format("Actual VGA2 Gain: %f dB...") % osmosdr_source_->get_gain("VGA2", 0) << std::endl; + std::cout << boost::format("Actual LNA Gain: %f dB...") % osmosdr_source_->get_gain("LNA", 0) << '\n'; + std::cout << boost::format("Actual VGA1 Gain: %f dB...") % osmosdr_source_->get_gain("VGA1", 0) << '\n'; + std::cout << boost::format("Actual VGA2 Gain: %f dB...") % osmosdr_source_->get_gain("VGA2", 0) << '\n'; } else { - std::cout << boost::format("Actual RX Gain: %f dB...") % osmosdr_source_->get_gain() << std::endl; + std::cout << boost::format("Actual RX Gain: %f dB...") % osmosdr_source_->get_gain() << '\n'; LOG(INFO) << boost::format("Actual RX Gain: %f dB...") % osmosdr_source_->get_gain(); } } // Get actual bandwidth - std::cout << boost::format("Actual Bandwidth: %f [Hz]...") % osmosdr_source_->get_bandwidth(0) << std::endl; + std::cout << boost::format("Actual Bandwidth: %f [Hz]...") % osmosdr_source_->get_bandwidth(0) << '\n'; } else { @@ -150,7 +150,7 @@ void OsmosdrSignalSource::driver_instance() { if (!osmosdr_args_.empty()) { - std::cout << "OsmoSdr arguments: " << osmosdr_args_ << std::endl; + std::cout << "OsmoSdr arguments: " << osmosdr_args_ << '\n'; LOG(INFO) << "OsmoSdr arguments: " << osmosdr_args_; } osmosdr_source_ = osmosdr::source::make(osmosdr_args_); diff --git a/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc b/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc index 468e33c04..2bfe668ce 100644 --- a/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc +++ b/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc @@ -64,17 +64,17 @@ PlutosdrSignalSource::PlutosdrSignalSource(const ConfigurationInterface* configu if (item_type_ != "gr_complex") { - std::cout << "Configuration error: item_type must be gr_complex" << std::endl; + std::cout << "Configuration error: item_type must be gr_complex\n"; LOG(FATAL) << "Configuration error: item_type must be gr_complex!"; } // basic check if ((gain_mode_ != "manual") and (gain_mode_ != "slow_attack") and (gain_mode_ != "fast_attack") and (gain_mode_ != "hybrid")) { - std::cout << "Configuration parameter gain_mode should take one of these values:" << std::endl; - std::cout << " manual, slow_attack, fast_attack, hybrid" << std::endl; - std::cout << "Error: provided value gain_mode=" << gain_mode_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value gain_mode=" << default_gain_mode << std::endl; + std::cout << "Configuration parameter gain_mode should take one of these values:\n"; + std::cout << " manual, slow_attack, fast_attack, hybrid\n"; + std::cout << "Error: provided value gain_mode=" << gain_mode_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value gain_mode=" << default_gain_mode << '\n'; gain_mode_ = default_gain_mode; LOG(WARNING) << "Invalid configuration value for gain_mode parameter. Set to gain_mode=" << default_gain_mode; } @@ -83,9 +83,9 @@ PlutosdrSignalSource::PlutosdrSignalSource(const ConfigurationInterface* configu { if (rf_gain_ > 73.0 or rf_gain_ < -1.0) { - std::cout << "Configuration parameter rf_gain should take values between -1.0 and 73 dB" << std::endl; - std::cout << "Error: provided value rf_gain=" << rf_gain_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value rf_gain=64.0" << std::endl; + std::cout << "Configuration parameter rf_gain should take values between -1.0 and 73 dB\n"; + std::cout << "Error: provided value rf_gain=" << rf_gain_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value rf_gain=64.0\n"; rf_gain_ = 64.0; LOG(WARNING) << "Invalid configuration value for rf_gain parameter. Set to rf_gain=64.0"; } @@ -93,35 +93,35 @@ PlutosdrSignalSource::PlutosdrSignalSource(const ConfigurationInterface* configu if ((filter_source_ != "Off") and (filter_source_ != "Auto") and (filter_source_ != "File") and (filter_source_ != "Design")) { - std::cout << "Configuration parameter filter_source should take one of these values:" << std::endl; - std::cout << " Off: Disable filter" << std::endl; - std::cout << " Auto: Use auto-generated filters" << std::endl; - std::cout << " File: User-provided filter in filter_filename parameter" << std::endl; + std::cout << "Configuration parameter filter_source should take one of these values:\n"; + std::cout << " Off: Disable filter\n"; + std::cout << " Auto: Use auto-generated filters\n"; + std::cout << " File: User-provided filter in filter_filename parameter\n"; #if LIBAD9361_VERSION_GREATER_THAN_01 - std::cout << " Design: Create filter from Fpass, Fstop, sampling_frequency and bandwidth parameters" << std::endl; + std::cout << " Design: Create filter from Fpass, Fstop, sampling_frequency and bandwidth parameters\n"; #endif - std::cout << "Error: provided value filter_source=" << filter_source_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value filter_source=Off" << std::endl; + std::cout << "Error: provided value filter_source=" << filter_source_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value filter_source=Off\n"; filter_source_ = std::string("Off"); LOG(WARNING) << "Invalid configuration value for filter_source parameter. Set to filter_source=Off"; } if (bandwidth_ < 200000 or bandwidth_ > 56000000) { - std::cout << "Configuration parameter bandwidth should take values between 200000 and 56000000 Hz" << std::endl; - std::cout << "Error: provided value bandwidth=" << bandwidth_ << " is not among valid values" << std::endl; - std::cout << " This parameter has been set to its default value bandwidth=2000000" << std::endl; + std::cout << "Configuration parameter bandwidth should take values between 200000 and 56000000 Hz\n"; + std::cout << "Error: provided value bandwidth=" << bandwidth_ << " is not among valid values\n"; + std::cout << " This parameter has been set to its default value bandwidth=2000000\n"; bandwidth_ = 2000000; LOG(WARNING) << "Invalid configuration value for bandwidth parameter. Set to bandwidth=2000000"; } item_size_ = sizeof(gr_complex); - std::cout << "device address: " << uri_ << std::endl; - std::cout << "frequency : " << freq_ << " Hz" << std::endl; - std::cout << "sample rate: " << sample_rate_ << " Hz" << std::endl; - std::cout << "gain mode: " << gain_mode_ << std::endl; - std::cout << "item type: " << item_type_ << std::endl; + std::cout << "device address: " << uri_ << '\n'; + std::cout << "frequency : " << freq_ << " Hz\n"; + std::cout << "sample rate: " << sample_rate_ << " Hz\n"; + std::cout << "gain mode: " << gain_mode_ << '\n'; + std::cout << "item type: " << item_type_ << '\n'; #if GNURADIO_API_IIO plutosdr_source_ = gr::iio::pluto_source::make(uri_, freq_, sample_rate_, diff --git a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc index a50030543..7411e2f23 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc @@ -82,21 +82,21 @@ RtlTcpSignalSource::RtlTcpSignalSource(const ConfigurationInterface* configurati if (this->AGC_enabled_ == true) { - std::cout << "AGC enabled" << std::endl; + std::cout << "AGC enabled\n"; LOG(INFO) << "AGC enabled"; signal_source_->set_agc_mode(true); } else { - std::cout << "AGC disabled" << std::endl; + std::cout << "AGC disabled\n"; LOG(INFO) << "AGC disabled"; signal_source_->set_agc_mode(false); - std::cout << "Setting gain to " << gain_ << std::endl; + std::cout << "Setting gain to " << gain_ << '\n'; LOG(INFO) << "Setting gain to " << gain_; signal_source_->set_gain(gain_); - std::cout << "Setting IF gain to " << if_gain_ << std::endl; + std::cout << "Setting IF gain to " << if_gain_ << '\n'; LOG(INFO) << "Setting IF gain to " << if_gain_; signal_source_->set_if_gain(if_gain_); } @@ -135,7 +135,7 @@ void RtlTcpSignalSource::MakeBlock() { try { - std::cout << "Connecting to " << address_ << ":" << port_ << std::endl; + std::cout << "Connecting to " << address_ << ":" << port_ << '\n'; LOG(INFO) << "Connecting to " << address_ << ":" << port_; signal_source_ = rtl_tcp_make_signal_source_c(address_, port_, flip_iq_); } diff --git a/src/algorithms/signal_source/adapters/spir_file_signal_source.cc b/src/algorithms/signal_source/adapters/spir_file_signal_source.cc index 8663e30d8..1d25959fe 100644 --- a/src/algorithms/signal_source/adapters/spir_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/spir_file_signal_source.cc @@ -76,19 +76,19 @@ SpirFileSignalSource::SpirFileSignalSource(const ConfigurationInterface* configu { std::cerr << "The receiver was configured to work with a file signal source " - << std::endl + << '\n' << "but the specified file is unreachable by GNSS-SDR." - << std::endl + << '\n' << "Please modify your configuration file" - << std::endl + << '\n' << "and point SignalSource.filename to a valid raw data file. Then:" - << std::endl + << '\n' << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" - << std::endl + << '\n' << "Examples of configuration files available at:" - << std::endl + << '\n' << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" - << std::endl; + << '\n'; LOG(WARNING) << "file_signal_source: Unable to open the samples file " << filename_.c_str() << ", exiting the program."; @@ -114,12 +114,12 @@ SpirFileSignalSource::SpirFileSignalSource(const ConfigurationInterface* configu } else { - std::cout << "file_signal_source: Unable to open the samples file " << filename_.c_str() << std::endl; + std::cout << "file_signal_source: Unable to open the samples file " << filename_.c_str() << '\n'; LOG(ERROR) << "file_signal_source: Unable to open the samples file " << filename_.c_str(); } std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(16); - std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]" << std::endl; + std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]\n"; std::cout.precision(ss); if (size > 0) @@ -134,7 +134,7 @@ SpirFileSignalSource::SpirFileSignalSource(const ConfigurationInterface* configu double signal_duration_s; signal_duration_s = static_cast(samples_) * (1 / static_cast(sampling_frequency_)); LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; - std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; + std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]\n"; valve_ = gnss_sdr_make_valve(sizeof(float), samples_, queue); DLOG(INFO) << "valve(" << valve_->unique_id() << ")"; diff --git a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc index cc140509f..29fd1e73e 100644 --- a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc @@ -78,19 +78,19 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(const ConfigurationInte { std::cerr << "The receiver was configured to work with a file signal source " - << std::endl + << '\n' << "but the specified file is unreachable by GNSS-SDR." - << std::endl + << '\n' << "Please modify your configuration file" - << std::endl + << '\n' << "and point SignalSource.filename to a valid raw data file. Then:" - << std::endl + << '\n' << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" - << std::endl + << '\n' << "Examples of configuration files available at:" - << std::endl + << '\n' << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" - << std::endl; + << '\n'; LOG(WARNING) << "file_signal_source: Unable to open the samples file " << filename_.c_str() << ", exiting the program."; @@ -115,12 +115,12 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(const ConfigurationInte } else { - std::cout << "file_signal_source: Unable to open the samples file " << filename_.c_str() << std::endl; + std::cout << "file_signal_source: Unable to open the samples file " << filename_.c_str() << '\n'; LOG(ERROR) << "file_signal_source: Unable to open the samples file " << filename_.c_str(); } std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(16); - std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]" << std::endl; + std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]\n"; std::cout.precision(ss); if (size > 0) @@ -133,7 +133,7 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(const ConfigurationInte CHECK(samples_ > 0) << "File does not contain enough samples to process."; double signal_duration_s = static_cast(samples_) / sampling_frequency_; LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; - std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; + std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]\n"; for (uint32_t i = 0; i < (n_channels_); i++) { diff --git a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc index 087baeb65..a7ed7fcdb 100644 --- a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc @@ -82,19 +82,19 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource( { std::cerr << "The receiver was configured to work with a file signal source " - << std::endl + << '\n' << "but the specified file is unreachable by GNSS-SDR." - << std::endl + << '\n' << "Please modify your configuration file" - << std::endl + << '\n' << "and point SignalSource.filename to a valid raw data file. Then:" - << std::endl + << '\n' << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" - << std::endl + << '\n' << "Examples of configuration files available at:" - << std::endl + << '\n' << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" - << std::endl; + << '\n'; LOG(WARNING) << "file_signal_source: Unable to open the samples file " << filename_.c_str() << ", exiting the program."; @@ -120,12 +120,12 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource( } else { - std::cout << "file_signal_source: Unable to open the samples file " << filename_.c_str() << std::endl; + std::cout << "file_signal_source: Unable to open the samples file " << filename_.c_str() << '\n'; LOG(ERROR) << "file_signal_source: Unable to open the samples file " << filename_.c_str(); } std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(16); - std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]" << std::endl; + std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]\n"; std::cout.precision(ss); if (size > 0) @@ -140,7 +140,7 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource( double signal_duration_s; signal_duration_s = static_cast(samples_) * (1 / static_cast(sampling_frequency_)); LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; - std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; + std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]\n"; valve_ = gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue); DLOG(INFO) << "valve(" << valve_->unique_id() << ")"; diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc index f143b94c0..58405f24f 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc @@ -146,19 +146,19 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource( { std::cerr << "The receiver was configured to work with a file signal source " - << std::endl + << '\n' << "but the specified file is unreachable by GNSS-SDR." - << std::endl + << '\n' << "Please modify your configuration file" - << std::endl + << '\n' << "and point SignalSource.filename to a valid raw data file. Then:" - << std::endl + << '\n' << "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf" - << std::endl + << '\n' << "Examples of configuration files available at:" - << std::endl + << '\n' << GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/" - << std::endl; + << '\n'; LOG(WARNING) << "file_signal_source: Unable to open the samples file " << filename_.c_str() << ", exiting the program."; @@ -191,12 +191,12 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource( } else { - std::cout << "file_signal_source: Unable to open the samples file " << filename_.c_str() << std::endl; + std::cout << "file_signal_source: Unable to open the samples file " << filename_.c_str() << '\n'; LOG(ERROR) << "file_signal_source: Unable to open the samples file " << filename_.c_str(); } std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(16); - std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]" << std::endl; + std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]\n"; std::cout.precision(ss); } @@ -204,7 +204,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource( double signal_duration_s; signal_duration_s = static_cast(samples_) * (1 / static_cast(sampling_frequency_)); LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; - std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; + std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]\n"; valve_ = gnss_sdr_make_valve(output_item_size, samples_, queue); DLOG(INFO) << "valve(" << valve_->unique_id() << ")"; diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.cc b/src/algorithms/signal_source/adapters/uhd_signal_source.cc index 758b4c71d..f0bf2257a 100644 --- a/src/algorithms/signal_source/adapters/uhd_signal_source.cc +++ b/src/algorithms/signal_source/adapters/uhd_signal_source.cc @@ -149,30 +149,30 @@ UhdSignalSource::UhdSignalSource(const ConfigurationInterface* configuration, // 2.2 set the sample rate for the usrp device uhd_source_->set_samp_rate(sample_rate_); // the actual sample rate may differ from the rate set - std::cout << boost::format("Sampling Rate for the USRP device: %f [sps]...") % (uhd_source_->get_samp_rate()) << std::endl; + std::cout << boost::format("Sampling Rate for the USRP device: %f [sps]...") % (uhd_source_->get_samp_rate()) << '\n'; LOG(INFO) << boost::format("Sampling Rate for the USRP device: %f [sps]...") % (uhd_source_->get_samp_rate()); std::vector sensor_names; for (int i = 0; i < RF_channels_; i++) { - std::cout << "UHD RF CHANNEL #" << i << " SETTINGS" << std::endl; + std::cout << "UHD RF CHANNEL #" << i << " SETTINGS\n"; // 3. Tune the usrp device to the desired center frequency uhd_source_->set_center_freq(freq_.at(i), i); - std::cout << boost::format("Actual USRP center freq.: %f [Hz]...") % (uhd_source_->get_center_freq(i)) << std::endl; + std::cout << boost::format("Actual USRP center freq.: %f [Hz]...") % (uhd_source_->get_center_freq(i)) << '\n'; LOG(INFO) << boost::format("Actual USRP center freq. set to: %f [Hz]...") % (uhd_source_->get_center_freq(i)); // TODO: Assign the remnant IF from the PLL tune error - std::cout << boost::format("PLL Frequency tune error %f [Hz]...") % (uhd_source_->get_center_freq(i) - freq_.at(i)) << std::endl; + std::cout << boost::format("PLL Frequency tune error %f [Hz]...") % (uhd_source_->get_center_freq(i) - freq_.at(i)) << '\n'; LOG(INFO) << boost::format("PLL Frequency tune error %f [Hz]...") % (uhd_source_->get_center_freq(i) - freq_.at(i)); // 4. set the gain for the daughterboard uhd_source_->set_gain(gain_.at(i), i); - std::cout << boost::format("Actual daughterboard gain set to: %f dB...") % uhd_source_->get_gain(i) << std::endl; + std::cout << boost::format("Actual daughterboard gain set to: %f dB...") % uhd_source_->get_gain(i) << '\n'; LOG(INFO) << boost::format("Actual daughterboard gain set to: %f dB...") % uhd_source_->get_gain(i); // 5. Set the bandpass filter on the RF frontend - std::cout << boost::format("Setting RF bandpass filter bandwidth to: %f [Hz]...") % IF_bandwidth_hz_.at(i) << std::endl; + std::cout << boost::format("Setting RF bandpass filter bandwidth to: %f [Hz]...") % IF_bandwidth_hz_.at(i) << '\n'; uhd_source_->set_bandwidth(IF_bandwidth_hz_.at(i), i); // set the antenna (optional) @@ -189,11 +189,11 @@ UhdSignalSource::UhdSignalSource(const ConfigurationInterface* configuration, std::cout << boost::format("Check for front-end %s ...") % lo_locked.to_pp_string() << " is "; if (lo_locked.to_bool() == true) { - std::cout << "Locked" << std::endl; + std::cout << "Locked\n"; } else { - std::cout << "UNLOCKED!" << std::endl; + std::cout << "UNLOCKED!\n"; } // UHD_ASSERT_THROW(lo_locked.to_bool()); } diff --git a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc index 5d68f362d..8a7689311 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc @@ -123,7 +123,7 @@ Gr_Complex_Ip_Packet_Source::Gr_Complex_Ip_Packet_Source(std::string src_device, std::cout << "Unknown wire sample type\n"; exit(0); } - std::cout << "d_wire_sample_type:" << d_wire_sample_type << std::endl; + std::cout << "d_wire_sample_type:" << d_wire_sample_type << '\n'; d_src_device = std::move(src_device); d_udp_port = udp_port; d_udp_payload_size = udp_packet_size; @@ -186,15 +186,15 @@ bool Gr_Complex_Ip_Packet_Source::open() descr = pcap_open_live(d_src_device.c_str(), 1500, 1, 1000, errbuf.data()); if (descr == nullptr) { - std::cout << "Error opening Ethernet device " << d_src_device << std::endl; - std::cout << "Fatal Error in pcap_open_live(): " << std::string(errbuf.data()) << std::endl; + std::cout << "Error opening Ethernet device " << d_src_device << '\n'; + std::cout << "Fatal Error in pcap_open_live(): " << std::string(errbuf.data()) << '\n'; return false; } // bind UDP port to avoid automatic reply with ICMP port unreachable packets from kernel d_sock_raw = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (d_sock_raw == -1) { - std::cout << "Error opening UDP socket" << std::endl; + std::cout << "Error opening UDP socket\n"; return false; } @@ -208,7 +208,7 @@ bool Gr_Complex_Ip_Packet_Source::open() // bind socket to port if (bind(d_sock_raw, reinterpret_cast(&si_me), sizeof(si_me)) == -1) { - std::cout << "Error opening UDP socket" << std::endl; + std::cout << "Error opening UDP socket\n"; return false; } return true; @@ -273,7 +273,7 @@ void Gr_Complex_Ip_Packet_Source::pcap_callback(__attribute__((unused)) u_char * // ih->daddr.byte3, // ih->daddr.byte4, // dport); - // std::cout<<"uh->len:"<len)<len:"<len)<< '\n'; int payload_length_bytes = ntohs(uh->len) - 8; // total udp packet length minus the header length // read the payload bytes and insert them into the shared circular buffer diff --git a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc index 006577344..35cb14c39 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc @@ -45,7 +45,7 @@ labsat23_source::labsat23_source(const char *signal_file_basename, { if (channel_selector < 1 or channel_selector > 2) { - std::cout << "Labsat source config error: channel selection out of bounds, check gnss-sdr config file" << std::endl; + std::cout << "Labsat source config error: channel selection out of bounds, check gnss-sdr config file\n"; exit(1); } d_channel_selector_config = channel_selector; @@ -64,11 +64,11 @@ labsat23_source::labsat23_source(const char *signal_file_basename, if (binary_input_file.is_open()) { - std::cout << "Labsat file source is reading samples from " << signal_file << std::endl; + std::cout << "Labsat file source is reading samples from " << signal_file << '\n'; } else { - std::cout << "Labsat file " << signal_file << " could not be opened!" << std::endl; + std::cout << "Labsat file " << signal_file << " could not be opened!\n"; exit(1); } } @@ -219,7 +219,7 @@ int labsat23_source::general_work(int noutput_items, if (preamble_ok == false) { - std::cout << "Labsat source do not detect the preamble in the selected file" << std::endl; + std::cout << "Labsat source do not detect the preamble in the selected file\n"; return -1; } @@ -227,18 +227,18 @@ int labsat23_source::general_work(int noutput_items, if (memblock[byte_counter] == 0x4C and memblock[byte_counter + 1] == 0x53 and memblock[byte_counter + 2] == 0x32) { d_labsat_version = 2; - std::cout << "Labsat file version 2 detected" << std::endl; + std::cout << "Labsat file version 2 detected\n"; } if (memblock[byte_counter] == 0x4C and memblock[byte_counter + 1] == 0x53 and memblock[byte_counter + 2] == 0x33) { d_labsat_version = 3; - std::cout << "Labsat file version 3 detected" << std::endl; + std::cout << "Labsat file version 3 detected\n"; } if (d_labsat_version == 0) { - std::cout << "Labsat source do not detect the labsat version in file header" << std::endl; + std::cout << "Labsat source do not detect the labsat version in file header\n"; return -1; } @@ -246,7 +246,7 @@ int labsat23_source::general_work(int noutput_items, int sub_version = static_cast(memblock[byte_counter]); - std::cout << "Labsat file sub version " << sub_version << std::endl; + std::cout << "Labsat file sub version " << sub_version << '\n'; byte_counter++; @@ -270,32 +270,32 @@ int labsat23_source::general_work(int noutput_items, switch (d_ref_clock) { case 0: - std::cout << "Labsat reference clock: internal OCXO" << std::endl; + std::cout << "Labsat reference clock: internal OCXO\n"; break; case 1: - std::cout << "Labsat reference clock: internal TCXO" << std::endl; + std::cout << "Labsat reference clock: internal TCXO\n"; break; case 2: - std::cout << "Labsat reference clock: external 10 MHz" << std::endl; + std::cout << "Labsat reference clock: external 10 MHz\n"; break; case 3: - std::cout << "Labsat reference clock: external 16.386 MHz" << std::endl; + std::cout << "Labsat reference clock: external 16.386 MHz\n"; break; default: - std::cout << "Labsat Unknown reference clock ID " << static_cast(d_ref_clock) << std::endl; + std::cout << "Labsat Unknown reference clock ID " << static_cast(d_ref_clock) << '\n'; } byte_counter++; d_bits_per_sample = static_cast(memblock[byte_counter]); switch (d_bits_per_sample) { case 2: - std::cout << "Labsat is using 2 bits per sample" << std::endl; + std::cout << "Labsat is using 2 bits per sample\n"; break; case 4: - std::cout << "Labsat is using 4 bits per sample" << std::endl; + std::cout << "Labsat is using 4 bits per sample\n"; break; default: - std::cout << "Labsat Unknown bits per sample ID " << static_cast(d_bits_per_sample) << std::endl; + std::cout << "Labsat Unknown bits per sample ID " << static_cast(d_bits_per_sample) << '\n'; return -1; } @@ -304,36 +304,36 @@ int labsat23_source::general_work(int noutput_items, switch (d_channel_selector) { case 0: - std::cout << "Available channels: Channel A + B, 1 bit quantisation (I & Q)" << std::endl; + std::cout << "Available channels: Channel A + B, 1 bit quantisation (I & Q)\n"; break; case 1: - std::cout << "Available channels: Channel A, 1 bit quantisation (I & Q)" << std::endl; + std::cout << "Available channels: Channel A, 1 bit quantisation (I & Q)\n"; break; case 2: - std::cout << "Available channels: Channel B, 1 bit quantisation (I & Q)" << std::endl; + std::cout << "Available channels: Channel B, 1 bit quantisation (I & Q)\n"; break; case 3: - std::cout << "Available channels: Channel A, 2 bit quantisation (I & Q)" << std::endl; + std::cout << "Available channels: Channel A, 2 bit quantisation (I & Q)\n"; break; case 4: - std::cout << "Available channels: Channel B, 2 bit quantisation (I & Q)" << std::endl; + std::cout << "Available channels: Channel B, 2 bit quantisation (I & Q)\n"; break; default: - std::cout << "Unknown channel selection ID " << static_cast(d_channel_selector) << std::endl; + std::cout << "Unknown channel selection ID " << static_cast(d_channel_selector) << '\n'; return -1; } // check if the selected channel in config file match the file encoding if (d_channel_selector_config == 2 and d_channel_selector != 0) { - std::cout << "Labsat source channel config inconsistency: channel 2 is selected but the file has only one channel" << std::endl; + std::cout << "Labsat source channel config inconsistency: channel 2 is selected but the file has only one channel\n"; return -1; } // todo: Add support for dual channel files if (d_channel_selector == 0) { - std::cout << "ERROR: Labsat file contains more than one channel and it is not currently supported by Labsat signal source." << std::endl; + std::cout << "ERROR: Labsat file contains more than one channel and it is not currently supported by Labsat signal source.\n"; return -1; } byte_counter++; @@ -343,48 +343,48 @@ int labsat23_source::general_work(int noutput_items, case 0: break; case 1: - std::cout << "1 bit per sample" << std::endl; + std::cout << "1 bit per sample\n"; break; case 2: - std::cout << "2 bit per sample" << std::endl; + std::cout << "2 bit per sample\n"; break; default: - std::cout << "Unknown quantization ID " << static_cast(quantization) << std::endl; + std::cout << "Unknown quantization ID " << static_cast(quantization) << '\n'; } byte_counter++; auto channel_a_constellation = static_cast(memblock[byte_counter]); switch (channel_a_constellation) { case 0: - std::cout << "Labsat Channel A is GPS" << std::endl; + std::cout << "Labsat Channel A is GPS\n"; break; case 1: - std::cout << "Labsat Channel A is GLONASS" << std::endl; + std::cout << "Labsat Channel A is GLONASS\n"; break; case 2: - std::cout << "Labsat Channel A is BDS" << std::endl; + std::cout << "Labsat Channel A is BDS\n"; break; default: - std::cout << "Unknown channel A constellation ID " << static_cast(channel_a_constellation) << std::endl; + std::cout << "Unknown channel A constellation ID " << static_cast(channel_a_constellation) << '\n'; } byte_counter++; auto channel_b_constellation = static_cast(memblock[byte_counter]); switch (channel_b_constellation) { case 0: - std::cout << "Labsat Channel B is GPS" << std::endl; + std::cout << "Labsat Channel B is GPS\n"; break; case 1: - std::cout << "Labsat Channel B is GLONASS" << std::endl; + std::cout << "Labsat Channel B is GLONASS\n"; break; case 2: - std::cout << "Labsat Channel B is BDS" << std::endl; + std::cout << "Labsat Channel B is BDS\n"; break; case 255: // No channel B break; default: - std::cout << "Unknown channel B constellation ID " << static_cast(channel_b_constellation) << std::endl; + std::cout << "Unknown channel B constellation ID " << static_cast(channel_b_constellation) << '\n'; } // end of header @@ -394,10 +394,10 @@ int labsat23_source::general_work(int noutput_items, binary_input_file.seekg(header_bytes, binary_input_file.beg); return 0; } - std::cout << "Labsat file header error: section 2 is not available." << std::endl; + std::cout << "Labsat file header error: section 2 is not available.\n"; return -1; } - std::cout << "Labsat file read error: file is empty." << std::endl; + std::cout << "Labsat file read error: file is empty.\n"; return -1; } @@ -434,23 +434,23 @@ int labsat23_source::general_work(int noutput_items, d_current_file_number++; if (d_labsat_version == 3) { - std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << std::endl; + std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << '\n'; } binary_input_file.close(); binary_input_file.open(generate_filename().c_str(), std::ios::in | std::ios::binary); if (binary_input_file.is_open()) { - std::cout << "Labsat file source is reading samples from " << generate_filename() << std::endl; + std::cout << "Labsat file source is reading samples from " << generate_filename() << '\n'; return 0; } if (d_labsat_version == 3) { - std::cout << "Last file reached, LabSat source stop" << std::endl; + std::cout << "Last file reached, LabSat source stop\n"; } else { - std::cout << "End of file reached, LabSat source stop" << std::endl; + std::cout << "End of file reached, LabSat source stop\n"; } d_queue->push(pmt::make_any(command_event_make(200, 0))); @@ -492,23 +492,23 @@ int labsat23_source::general_work(int noutput_items, d_current_file_number++; if (d_labsat_version == 3) { - std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << std::endl; + std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << '\n'; } binary_input_file.close(); binary_input_file.open(generate_filename().c_str(), std::ios::in | std::ios::binary); if (binary_input_file.is_open()) { - std::cout << "Labsat file source is reading samples from " << generate_filename() << std::endl; + std::cout << "Labsat file source is reading samples from " << generate_filename() << '\n'; return 0; } if (d_labsat_version == 3) { - std::cout << "Last file reached, LabSat source stop" << std::endl; + std::cout << "Last file reached, LabSat source stop\n"; } else { - std::cout << "End of file reached, LabSat source stop" << std::endl; + std::cout << "End of file reached, LabSat source stop\n"; } d_queue->push(pmt::make_any(command_event_make(200, 0))); return -1; @@ -523,6 +523,6 @@ int labsat23_source::general_work(int noutput_items, return -1; } - std::cout << "Warning!!" << std::endl; + std::cout << "Warning!!\n"; return 0; } diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index c69f71fba..b4b21fbb9 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -73,7 +73,7 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address, ip::address addr = ip::address::from_string(address, ec); if (ec) { - std::cout << address << " is not an IP address" << std::endl; + std::cout << address << " is not an IP address\n"; LOG(ERROR) << address << " is not an IP address"; return; } @@ -81,20 +81,20 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address, socket_.open(ep.protocol(), ec); if (ec) { - std::cout << "Failed to open socket." << std::endl; + std::cout << "Failed to open socket.\n"; LOG(ERROR) << "Failed to open socket."; } socket_.set_option(boost::asio::socket_base::reuse_address(true), ec); if (ec) { - std::cout << "Failed to set reuse address option: " << ec << std::endl; + std::cout << "Failed to set reuse address option: " << ec << '\n'; LOG(WARNING) << "Failed to set reuse address option"; } socket_.set_option(boost::asio::socket_base::linger(true, 0), ec); if (ec) { - std::cout << "Failed to set linger option: " << ec << std::endl; + std::cout << "Failed to set linger option: " << ec << '\n'; LOG(WARNING) << "Failed to set linger option"; } @@ -104,19 +104,19 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address, if (ec) { std::cout << "Failed to connect to " << addr << ":" << port - << "(" << ec << ")" << std::endl; + << "(" << ec << ")\n"; LOG(ERROR) << "Failed to connect to " << addr << ":" << port << "(" << ec << ")"; return; } - std::cout << "Connected to " << addr << ":" << port << std::endl; + std::cout << "Connected to " << addr << ":" << port << '\n'; LOG(INFO) << "Connected to " << addr << ":" << port; // 4. Set nodelay socket_.set_option(tcp::no_delay(true), ec); if (ec) { - std::cout << "Failed to set no delay option." << std::endl; + std::cout << "Failed to set no delay option.\n"; LOG(WARNING) << "Failed to set no delay option"; } @@ -124,12 +124,12 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address, ec = info_.read(socket_); if (ec) { - std::cout << "Failed to read dongle info." << std::endl; + std::cout << "Failed to read dongle info.\n"; LOG(WARNING) << "Failed to read dongle info"; } else if (info_.is_valid()) { - std::cout << "Found " << info_.get_type_name() << " tuner." << std::endl; + std::cout << "Found " << info_.get_type_name() << " tuner.\n"; LOG(INFO) << "Found " << info_.get_type_name() << " tuner."; } @@ -166,7 +166,7 @@ void rtl_tcp_signal_source_c::set_frequency(int frequency) rtl_tcp_command(RTL_TCP_SET_FREQUENCY, frequency, socket_); if (ec) { - std::cout << "Failed to set frequency" << std::endl; + std::cout << "Failed to set frequency\n"; LOG(WARNING) << "Failed to set frequency"; } } @@ -178,7 +178,7 @@ void rtl_tcp_signal_source_c::set_sample_rate(int sample_rate) rtl_tcp_command(RTL_TCP_SET_SAMPLE_RATE, sample_rate, socket_); if (ec) { - std::cout << "Failed to set sample rate" << std::endl; + std::cout << "Failed to set sample rate\n"; LOG(WARNING) << "Failed to set sample rate"; } } @@ -190,13 +190,13 @@ void rtl_tcp_signal_source_c::set_agc_mode(bool agc) rtl_tcp_command(RTL_TCP_SET_GAIN_MODE, !agc, socket_); if (ec) { - std::cout << "Failed to set gain mode" << std::endl; + std::cout << "Failed to set gain mode\n"; LOG(WARNING) << "Failed to set gain mode"; } ec = rtl_tcp_command(RTL_TCP_SET_AGC_MODE, agc, socket_); if (ec) { - std::cout << "Failed to set gain mode" << std::endl; + std::cout << "Failed to set gain mode\n"; LOG(WARNING) << "Failed to set gain mode"; } } @@ -208,7 +208,7 @@ void rtl_tcp_signal_source_c::set_gain(int gain) boost::system::error_code ec = rtl_tcp_command(RTL_TCP_SET_GAIN, clipped, socket_); if (ec) { - std::cout << "Failed to set gain" << std::endl; + std::cout << "Failed to set gain\n"; LOG(WARNING) << "Failed to set gain"; } } @@ -275,7 +275,7 @@ void rtl_tcp_signal_source_c::set_if_gain(int gain) boost::system::error_code ec = rtl_tcp_command(RTL_TCP_SET_IF_GAIN, param, socket_); if (ec) { - std::cout << "Failed to set if gain" << std::endl; + std::cout << "Failed to set if gain\n"; LOG(WARNING) << "Failed to set if gain"; } } @@ -287,7 +287,7 @@ void rtl_tcp_signal_source_c::handle_read(const boost::system::error_code &ec, { if (ec) { - std::cout << "Error during read: " << ec << std::endl; + std::cout << "Error during read: " << ec << '\n'; LOG(WARNING) << "Error during read: " << ec; boost::mutex::scoped_lock lock(mutex_); io_context_.stop(); diff --git a/src/algorithms/signal_source/libs/ad9361_manager.cc b/src/algorithms/signal_source/libs/ad9361_manager.cc index 0087b3f1d..ea2f1d01e 100644 --- a/src/algorithms/signal_source/libs/ad9361_manager.cc +++ b/src/algorithms/signal_source/libs/ad9361_manager.cc @@ -146,7 +146,7 @@ bool cfg_ad9361_streaming_ch(struct iio_context *ctx, struct stream_cfg *cfg, en // Configure phy and lo channels // LOG(INFO)<<"* Acquiring AD9361 phy channel"<(freq_dds_tx_hz_)); if (ret < 0) { - std::cout << "Failed to set TX DDS frequency I: " << ret << std::endl; + std::cout << "Failed to set TX DDS frequency I: " << ret << '\n'; } ret = iio_channel_attr_write_longlong(dds_channel0_Q, "frequency", static_cast(freq_dds_tx_hz_)); if (ret < 0) { - std::cout << "Failed to set TX DDS frequency Q: " << ret << std::endl; + std::cout << "Failed to set TX DDS frequency Q: " << ret << '\n'; } ret = iio_channel_attr_write_double(dds_channel0_I, "phase", phase_dds_deg_ * 1000.0); if (ret < 0) { - std::cout << "Failed to set TX DDS phase I: " << ret << std::endl; + std::cout << "Failed to set TX DDS phase I: " << ret << '\n'; } ret = iio_channel_attr_write_double(dds_channel0_Q, "phase", phase_dds_deg_ * 1000.0 + 270000.0); if (ret < 0) { - std::cout << "Failed to set TX DDS phase Q: " << ret << std::endl; + std::cout << "Failed to set TX DDS phase Q: " << ret << '\n'; } ret = iio_channel_attr_write_double(dds_channel0_I, "scale", pow(10, scale_dds_dbfs_ / 20.0)); if (ret < 0) { - std::cout << "Failed to set TX DDS scale I: " << ret << std::endl; + std::cout << "Failed to set TX DDS scale I: " << ret << '\n'; } ret = iio_channel_attr_write_double(dds_channel0_Q, "scale", pow(10, scale_dds_dbfs_ / 20.0)); if (ret < 0) { - std::cout << "Failed to set TX DDS scale Q: " << ret << std::endl; + std::cout << "Failed to set TX DDS scale Q: " << ret << '\n'; } // disable TX2 ret = iio_device_attr_write_double(ad9361_phy, "out_voltage1_hardwaregain", -89.0); if (ret < 0) { - std::cout << "Failed to set out_voltage1_hardwaregain value " << -89.0 << " error " << ret << std::endl; + std::cout << "Failed to set out_voltage1_hardwaregain value " << -89.0 << " error " << ret << '\n'; } struct iio_channel *dds_channel1_I; @@ -796,13 +796,13 @@ bool config_ad9361_lo_local(uint64_t bandwidth_, ret = iio_channel_attr_write_double(dds_channel1_I, "scale", 0); if (ret < 0) { - std::cout << "Failed to set TX2 DDS scale I: " << ret << std::endl; + std::cout << "Failed to set TX2 DDS scale I: " << ret << '\n'; } ret = iio_channel_attr_write_double(dds_channel1_Q, "scale", 0); if (ret < 0) { - std::cout << "Failed to set TX2 DDS scale Q: " << ret << std::endl; + std::cout << "Failed to set TX2 DDS scale Q: " << ret << '\n'; } iio_context_destroy(ctx); @@ -827,7 +827,7 @@ bool config_ad9361_lo_remote(const std::string &remote_host, txcfg.lo_hz = freq_rf_tx_hz_; txcfg.rfport = "A"; - std::cout << "AD9361 Acquiring IIO REMOTE context in host " << remote_host << std::endl; + std::cout << "AD9361 Acquiring IIO REMOTE context in host " << remote_host << '\n'; struct iio_context *ctx; ctx = iio_create_network_context(remote_host.c_str()); if (!ctx) @@ -862,14 +862,14 @@ bool config_ad9361_lo_remote(const std::string &remote_host, ret = iio_device_attr_write_double(ad9361_phy, "out_voltage0_hardwaregain", -std::abs(tx_attenuation_db_)); if (ret < 0) { - std::cout << "Failed to set out_voltage0_hardwaregain value " << -std::abs(tx_attenuation_db_) << ". Error " << ret << std::endl; + std::cout << "Failed to set out_voltage0_hardwaregain value " << -std::abs(tx_attenuation_db_) << ". Error " << ret << '\n'; } // shut down signal in TX2 ret = iio_device_attr_write_double(ad9361_phy, "out_voltage1_hardwaregain", -89.75); if (ret < 0) { - std::cout << "Failed to set out_voltage1_hardwaregain value -89.75 dB. Error " << ret << std::endl; + std::cout << "Failed to set out_voltage1_hardwaregain value -89.75 dB. Error " << ret << '\n'; } struct iio_device *dds; dds = iio_context_find_device(ctx, "cf-ad9361-dds-core-lpc"); @@ -882,51 +882,51 @@ bool config_ad9361_lo_remote(const std::string &remote_host, ret = iio_channel_attr_write_bool(dds_channel0_I, "raw", true); if (ret < 0) { - std::cout << "Failed to toggle DDS: " << ret << std::endl; + std::cout << "Failed to toggle DDS: " << ret << '\n'; } // set frequency, scale and phase ret = iio_channel_attr_write_longlong(dds_channel0_I, "frequency", static_cast(freq_dds_tx_hz_)); if (ret < 0) { - std::cout << "Failed to set TX DDS frequency I: " << ret << std::endl; + std::cout << "Failed to set TX DDS frequency I: " << ret << '\n'; } ret = iio_channel_attr_write_longlong(dds_channel0_Q, "frequency", static_cast(freq_dds_tx_hz_)); if (ret < 0) { - std::cout << "Failed to set TX DDS frequency Q: " << ret << std::endl; + std::cout << "Failed to set TX DDS frequency Q: " << ret << '\n'; } ret = iio_channel_attr_write_double(dds_channel0_I, "phase", phase_dds_deg_ * 1000.0); if (ret < 0) { - std::cout << "Failed to set TX DDS phase I: " << ret << std::endl; + std::cout << "Failed to set TX DDS phase I: " << ret << '\n'; } ret = iio_channel_attr_write_double(dds_channel0_Q, "phase", phase_dds_deg_ * 1000.0 + 270000.0); if (ret < 0) { - std::cout << "Failed to set TX DDS phase Q: " << ret << std::endl; + std::cout << "Failed to set TX DDS phase Q: " << ret << '\n'; } ret = iio_channel_attr_write_double(dds_channel0_I, "scale", pow(10, scale_dds_dbfs_ / 20.0)); if (ret < 0) { - std::cout << "Failed to set TX DDS scale I: " << ret << std::endl; + std::cout << "Failed to set TX DDS scale I: " << ret << '\n'; } ret = iio_channel_attr_write_double(dds_channel0_Q, "scale", pow(10, scale_dds_dbfs_ / 20.0)); if (ret < 0) { - std::cout << "Failed to set TX DDS scale Q: " << ret << std::endl; + std::cout << "Failed to set TX DDS scale Q: " << ret << '\n'; } // disable TX2 ret = iio_device_attr_write_double(ad9361_phy, "out_voltage1_hardwaregain", -89.0); if (ret < 0) { - std::cout << "Failed to set out_voltage1_hardwaregain value " << -89.0 << " error " << ret << std::endl; + std::cout << "Failed to set out_voltage1_hardwaregain value " << -89.0 << " error " << ret << '\n'; } struct iio_channel *dds_channel1_I; @@ -938,13 +938,13 @@ bool config_ad9361_lo_remote(const std::string &remote_host, ret = iio_channel_attr_write_double(dds_channel1_I, "scale", 0); if (ret < 0) { - std::cout << "Failed to set TX2 DDS scale I: " << ret << std::endl; + std::cout << "Failed to set TX2 DDS scale I: " << ret << '\n'; } ret = iio_channel_attr_write_double(dds_channel1_Q, "scale", 0); if (ret < 0) { - std::cout << "Failed to set TX2 DDS scale Q: " << ret << std::endl; + std::cout << "Failed to set TX2 DDS scale Q: " << ret << '\n'; } iio_context_destroy(ctx); @@ -954,7 +954,7 @@ bool config_ad9361_lo_remote(const std::string &remote_host, bool ad9361_disable_lo_remote(const std::string &remote_host) { - std::cout << "AD9361 Acquiring IIO REMOTE context in host " << remote_host << std::endl; + std::cout << "AD9361 Acquiring IIO REMOTE context in host " << remote_host << '\n'; struct iio_context *ctx; ctx = iio_create_network_context(remote_host.c_str()); if (!ctx) @@ -973,19 +973,19 @@ bool ad9361_disable_lo_remote(const std::string &remote_host) ret = iio_channel_attr_write_bool(dds_channel0_I, "raw", false); if (ret < 0) { - std::cout << "Failed to toggle DDS: " << ret << std::endl; + std::cout << "Failed to toggle DDS: " << ret << '\n'; } ret = iio_channel_attr_write_double(dds_channel0_I, "scale", 0.0); if (ret < 0) { - std::cout << "Failed to set TX DDS scale I: " << ret << std::endl; + std::cout << "Failed to set TX DDS scale I: " << ret << '\n'; } ret = iio_channel_attr_write_double(dds_channel0_Q, "scale", 0.0); if (ret < 0) { - std::cout << "Failed to set TX DDS scale Q: " << ret << std::endl; + std::cout << "Failed to set TX DDS scale Q: " << ret << '\n'; } iio_context_destroy(ctx); @@ -996,7 +996,7 @@ bool ad9361_disable_lo_remote(const std::string &remote_host) bool ad9361_disable_lo_local() { - std::cout << "AD9361 Acquiring IIO LOCAL context" << std::endl; + std::cout << "AD9361 Acquiring IIO LOCAL context\n"; struct iio_context *ctx; ctx = iio_create_default_context(); if (!ctx) @@ -1015,19 +1015,19 @@ bool ad9361_disable_lo_local() ret = iio_channel_attr_write_bool(dds_channel0_I, "raw", false); if (ret < 0) { - std::cout << "Failed to toggle DDS: " << ret << std::endl; + std::cout << "Failed to toggle DDS: " << ret << '\n'; } ret = iio_channel_attr_write_double(dds_channel0_I, "scale", 0.0); if (ret < 0) { - std::cout << "Failed to set TX DDS scale I: " << ret << std::endl; + std::cout << "Failed to set TX DDS scale I: " << ret << '\n'; } ret = iio_channel_attr_write_double(dds_channel0_Q, "scale", 0.0); if (ret < 0) { - std::cout << "Failed to set TX DDS scale Q: " << ret << std::endl; + std::cout << "Failed to set TX DDS scale Q: " << ret << '\n'; } iio_context_destroy(ctx); diff --git a/src/algorithms/signal_source/libs/fpga_switch.cc b/src/algorithms/signal_source/libs/fpga_switch.cc index 6274a4ea7..e0fb66855 100644 --- a/src/algorithms/signal_source/libs/fpga_switch.cc +++ b/src/algorithms/signal_source/libs/fpga_switch.cc @@ -26,7 +26,7 @@ #include "fpga_switch.h" #include #include // for open, O_RDWR, O_SYNC -#include // for cout, endl +#include // for cout #include // for mmap Fpga_Switch::Fpga_Switch(const std::string &device_name) @@ -41,11 +41,11 @@ Fpga_Switch::Fpga_Switch(const std::string &device_name) if (d_map_base == reinterpret_cast(-1)) { LOG(WARNING) << "Cannot map the FPGA switch module into tracking memory"; - std::cout << "Could not map switch memory." << std::endl; + std::cout << "Could not map switch memory.\n"; } else { - std::cout << "Switch memory successfully mapped." << std::endl; + std::cout << "Switch memory successfully mapped.\n"; } // sanity check : check test register @@ -95,7 +95,7 @@ void Fpga_Switch::close_device() auto *aux = const_cast(d_map_base); if (munmap(static_cast(aux), FPGA_PAGE_SIZE) == -1) { - std::cout << "Failed to unmap memory uio" << std::endl; + std::cout << "Failed to unmap memory uio\n"; } close(d_device_descriptor); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc index c54c91482..3330272b7 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc @@ -244,7 +244,7 @@ void beidou_b1i_telemetry_decoder_gs::decode_subframe(float *frame_symbols) std::shared_ptr tmp_obj = std::make_shared(d_nav.get_ephemeris()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); LOG(INFO) << "BEIDOU DNAV Ephemeris have been received in channel" << d_channel << " from satellite " << d_satellite; - std::cout << TEXT_YELLOW << "New BEIDOU B1I DNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_YELLOW << "New BEIDOU B1I DNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << TEXT_RESET << '\n'; } if (d_nav.have_new_utc_model() == true) { @@ -252,7 +252,7 @@ void beidou_b1i_telemetry_decoder_gs::decode_subframe(float *frame_symbols) std::shared_ptr tmp_obj = std::make_shared(d_nav.get_utc_model()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); LOG(INFO) << "BEIDOU DNAV UTC Model have been received in channel" << d_channel << " from satellite " << d_satellite; - std::cout << TEXT_YELLOW << "New BEIDOU B1I DNAV utc model message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_YELLOW << "New BEIDOU B1I DNAV utc model message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << '\n'; } if (d_nav.have_new_iono() == true) { @@ -260,15 +260,15 @@ void beidou_b1i_telemetry_decoder_gs::decode_subframe(float *frame_symbols) std::shared_ptr tmp_obj = std::make_shared(d_nav.get_iono()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); LOG(INFO) << "BEIDOU DNAV Iono have been received in channel" << d_channel << " from satellite " << d_satellite; - std::cout << TEXT_YELLOW << "New BEIDOU B1I DNAV Iono message received in channel " << d_channel << ": Iono model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_YELLOW << "New BEIDOU B1I DNAV Iono message received in channel " << d_channel << ": Iono model parameters from satellite " << d_satellite << TEXT_RESET << '\n'; } if (d_nav.have_new_almanac() == true) { // uint32_t slot_nbr = d_nav.i_alm_satellite_PRN; // std::shared_ptr tmp_obj = std::make_shared(d_nav.get_almanac(slot_nbr)); // this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - LOG(INFO) << "BEIDOU DNAV Almanac have been received in channel" << d_channel << " from satellite " << d_satellite << std::endl; - std::cout << TEXT_YELLOW << "New BEIDOU B1I DNAV almanac received in channel " << d_channel << " from satellite " << d_satellite << TEXT_RESET << std::endl; + LOG(INFO) << "BEIDOU DNAV Almanac have been received in channel" << d_channel << " from satellite " << d_satellite << '\n'; + std::cout << TEXT_YELLOW << "New BEIDOU B1I DNAV almanac received in channel " << d_channel << " from satellite " << d_satellite << TEXT_RESET << '\n'; } } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc index 4b4525cc9..20f448d4a 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc @@ -248,7 +248,7 @@ void beidou_b3i_telemetry_decoder_gs::decode_subframe(float *frame_symbols) LOG(INFO) << "BEIDOU DNAV Ephemeris have been received in channel" << d_channel << " from satellite " << d_satellite; std::cout << TEXT_YELLOW << "New BEIDOU B3I DNAV message received in channel " << d_channel - << ": ephemeris from satellite " << d_satellite << TEXT_RESET << std::endl; + << ": ephemeris from satellite " << d_satellite << TEXT_RESET << '\n'; } if (d_nav.have_new_utc_model() == true) { @@ -260,7 +260,7 @@ void beidou_b3i_telemetry_decoder_gs::decode_subframe(float *frame_symbols) << d_channel << " from satellite " << d_satellite; std::cout << TEXT_YELLOW << "New BEIDOU B3I DNAV utc model message received in channel " << d_channel << ": UTC model parameters from satellite " - << d_satellite << TEXT_RESET << std::endl; + << d_satellite << TEXT_RESET << '\n'; } if (d_nav.have_new_iono() == true) { @@ -272,7 +272,7 @@ void beidou_b3i_telemetry_decoder_gs::decode_subframe(float *frame_symbols) << " from satellite " << d_satellite; std::cout << TEXT_YELLOW << "New BEIDOU B3I DNAV Iono message received in channel " << d_channel << ": Iono model parameters from satellite " - << d_satellite << TEXT_RESET << std::endl; + << d_satellite << TEXT_RESET << '\n'; } if (d_nav.have_new_almanac() == true) { @@ -282,9 +282,9 @@ void beidou_b3i_telemetry_decoder_gs::decode_subframe(float *frame_symbols) // this->message_port_pub(pmt::mp("telemetry"), // pmt::make_any(tmp_obj)); LOG(INFO) << "BEIDOU DNAV Almanac have been received in channel" - << d_channel << " from satellite " << d_satellite << std::endl; + << d_channel << " from satellite " << d_satellite << '\n'; std::cout << TEXT_YELLOW << "New BEIDOU B3I DNAV almanac received in channel " << d_channel - << " from satellite " << d_satellite << TEXT_RESET << std::endl; + << " from satellite " << d_satellite << TEXT_RESET << '\n'; } } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc index 53d594996..cac8c056f 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc @@ -114,7 +114,7 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs( d_codelength = 0; d_datalength = 0; d_max_symbols_without_valid_frame = 0; - std::cout << "Galileo unified telemetry decoder error: Unknown frame type " << std::endl; + std::cout << "Galileo unified telemetry decoder error: Unknown frame type \n"; } d_page_part_symbols.reserve(d_frame_length_symbols); @@ -275,21 +275,21 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(float *page_part_symbols, in { // get object for this SV (mandatory) std::shared_ptr tmp_obj = std::make_shared(d_inav_nav.get_ephemeris()); - std::cout << "New Galileo E1 I/NAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << std::endl; + std::cout << "New Galileo E1 I/NAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << '\n'; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_inav_nav.have_new_iono_and_GST() == true) { // get object for this SV (mandatory) std::shared_ptr tmp_obj = std::make_shared(d_inav_nav.get_iono()); - std::cout << "New Galileo E1 I/NAV message received in channel " << d_channel << ": iono/GST model parameters from satellite " << d_satellite << std::endl; + std::cout << "New Galileo E1 I/NAV message received in channel " << d_channel << ": iono/GST model parameters from satellite " << d_satellite << '\n'; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_inav_nav.have_new_utc_model() == true) { // get object for this SV (mandatory) std::shared_ptr tmp_obj = std::make_shared(d_inav_nav.get_utc_model()); - std::cout << "New Galileo E1 I/NAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << std::endl; + std::cout << "New Galileo E1 I/NAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << '\n'; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); d_delta_t = tmp_obj->A_0G_10 + tmp_obj->A_1G_10 * (static_cast(d_TOW_at_current_symbol_ms) / 1000.0 - tmp_obj->t_0G_10 + 604800 * (std::fmod(static_cast(d_inav_nav.get_Galileo_week() - tmp_obj->WN_0G_10), 64.0))); DLOG(INFO) << "delta_t=" << d_delta_t << "[s]"; @@ -299,7 +299,7 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(float *page_part_symbols, in std::shared_ptr tmp_obj = std::make_shared(d_inav_nav.get_almanac()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); // debug - std::cout << "Galileo E1 I/NAV almanac received in channel " << d_channel << " from satellite " << d_satellite << std::endl; + std::cout << "Galileo E1 I/NAV almanac received in channel " << d_channel << " from satellite " << d_satellite << '\n'; DLOG(INFO) << "Current parameters:"; DLOG(INFO) << "d_TOW_at_current_symbol_ms=" << d_TOW_at_current_symbol_ms; DLOG(INFO) << "d_nav.WN_0=" << d_inav_nav.get_Galileo_week(); @@ -355,19 +355,19 @@ void galileo_telemetry_decoder_gs::decode_FNAV_word(float *page_symbols, int32_t if (d_fnav_nav.have_new_ephemeris() == true) { std::shared_ptr tmp_obj = std::make_shared(d_fnav_nav.get_ephemeris()); - std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << TEXT_RESET << '\n'; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_fnav_nav.have_new_iono_and_GST() == true) { std::shared_ptr tmp_obj = std::make_shared(d_fnav_nav.get_iono()); - std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel " << d_channel << ": iono/GST model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel " << d_channel << ": iono/GST model parameters from satellite " << d_satellite << TEXT_RESET << '\n'; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_fnav_nav.have_new_utc_model() == true) { std::shared_ptr tmp_obj = std::make_shared(d_fnav_nav.get_utc_model()); - std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << '\n'; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.cc index 3c3db47fa..ef0db7a80 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.cc @@ -182,7 +182,7 @@ void glonass_l1_ca_telemetry_decoder_gs::decode_string(const double *frame_symbo std::shared_ptr tmp_obj = std::make_shared(d_nav.get_ephemeris()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); LOG(INFO) << "GLONASS GNAV Ephemeris have been received in channel" << d_channel << " from satellite " << d_satellite; - std::cout << "New GLONASS L1 GNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << std::endl; + std::cout << "New GLONASS L1 GNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << '\n'; } if (d_nav.have_new_utc_model() == true) { @@ -190,7 +190,7 @@ void glonass_l1_ca_telemetry_decoder_gs::decode_string(const double *frame_symbo std::shared_ptr tmp_obj = std::make_shared(d_nav.get_utc_model()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); LOG(INFO) << "GLONASS GNAV UTC Model have been received in channel" << d_channel << " from satellite " << d_satellite; - std::cout << "New GLONASS L1 GNAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << std::endl; + std::cout << "New GLONASS L1 GNAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << '\n'; } if (d_nav.have_new_almanac() == true) { @@ -199,7 +199,7 @@ void glonass_l1_ca_telemetry_decoder_gs::decode_string(const double *frame_symbo tmp_obj = std::make_shared(d_nav.get_almanac(slot_nbr)); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); LOG(INFO) << "GLONASS GNAV Almanac have been received in channel" << d_channel << " in slot number " << slot_nbr; - std::cout << "New GLONASS L1 GNAV almanac received in channel " << d_channel << " from satellite " << d_satellite << std::endl; + std::cout << "New GLONASS L1 GNAV almanac received in channel " << d_channel << " from satellite " << d_satellite << '\n'; } // 5. Update satellite information on system if (d_nav.get_flag_update_slot_number() == true) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.cc index e26971e78..7a8e25636 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.cc @@ -182,7 +182,7 @@ void glonass_l2_ca_telemetry_decoder_gs::decode_string(const double *frame_symbo std::shared_ptr tmp_obj = std::make_shared(d_nav.get_ephemeris()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); LOG(INFO) << "GLONASS GNAV Ephemeris have been received in channel" << d_channel << " from satellite " << d_satellite; - std::cout << TEXT_CYAN << "New GLONASS L2 GNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_CYAN << "New GLONASS L2 GNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << TEXT_RESET << '\n'; } if (d_nav.have_new_utc_model() == true) { @@ -190,7 +190,7 @@ void glonass_l2_ca_telemetry_decoder_gs::decode_string(const double *frame_symbo std::shared_ptr tmp_obj = std::make_shared(d_nav.get_utc_model()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); LOG(INFO) << "GLONASS GNAV UTC Model have been received in channel" << d_channel << " from satellite " << d_satellite; - std::cout << TEXT_CYAN << "New GLONASS L2 GNAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_CYAN << "New GLONASS L2 GNAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << '\n'; } if (d_nav.have_new_almanac() == true) { @@ -198,7 +198,7 @@ void glonass_l2_ca_telemetry_decoder_gs::decode_string(const double *frame_symbo std::shared_ptr tmp_obj = std::make_shared(d_nav.get_almanac(slot_nbr)); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); LOG(INFO) << "GLONASS GNAV Almanac have been received in channel" << d_channel << " in slot number " << slot_nbr; - std::cout << TEXT_CYAN << "New GLONASS L2 GNAV almanac received in channel " << d_channel << " from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_CYAN << "New GLONASS L2 GNAV almanac received in channel " << d_channel << " from satellite " << d_satellite << TEXT_RESET << '\n'; } // 5. Update satellite information on system if (d_nav.get_flag_update_slot_number() == true) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc index 7ce75a90e..d93bc338e 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc @@ -275,7 +275,7 @@ bool gps_l1_ca_telemetry_decoder_gs::decode_subframe() std::cout << "New GPS NAV message received in channel " << this->d_channel << ": " << "subframe " << subframe_ID << " from satellite " - << Gnss_Satellite(std::string("GPS"), d_nav.get_satellite_PRN()) << std::endl; + << Gnss_Satellite(std::string("GPS"), d_nav.get_satellite_PRN()) << '\n'; switch (subframe_ID) { diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc index 24148528f..d8555bf01 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc @@ -199,20 +199,20 @@ int gps_l2c_telemetry_decoder_gs::general_work(int noutput_items __attribute__(( { // get ephemeris object for this SV std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_ephemeris()); - std::cout << TEXT_BLUE << "New GPS CNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_BLUE << "New GPS CNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << TEXT_RESET << '\n'; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_CNAV_Message.have_new_iono() == true) { std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_iono()); - std::cout << TEXT_BLUE << "New GPS CNAV message received in channel " << d_channel << ": iono model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_BLUE << "New GPS CNAV message received in channel " << d_channel << ": iono model parameters from satellite " << d_satellite << TEXT_RESET << '\n'; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_CNAV_Message.have_new_utc_model() == true) { std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_utc_model()); - std::cout << TEXT_BLUE << "New GPS CNAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_BLUE << "New GPS CNAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << '\n'; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc index 9e7acd7c7..921b78606 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc @@ -191,20 +191,20 @@ int gps_l5_telemetry_decoder_gs::general_work(int noutput_items __attribute__((u { // get ephemeris object for this SV std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_ephemeris()); - std::cout << TEXT_MAGENTA << "New GPS L5 CNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_MAGENTA << "New GPS L5 CNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << TEXT_RESET << '\n'; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_CNAV_Message.have_new_iono() == true) { std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_iono()); - std::cout << TEXT_MAGENTA << "New GPS L5 CNAV message received in channel " << d_channel << ": iono model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_MAGENTA << "New GPS L5 CNAV message received in channel " << d_channel << ": iono model parameters from satellite " << d_satellite << TEXT_RESET << '\n'; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_CNAV_Message.have_new_utc_model() == true) { std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_utc_model()); - std::cout << TEXT_MAGENTA << "New GPS L5 CNAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_MAGENTA << "New GPS L5 CNAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << '\n'; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc index 21023b4a7..f812f72d8 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc @@ -341,7 +341,7 @@ void sbas_l1_telemetry_decoder_gs::Crc_Verifier::get_valid_frames(const std::vec { ss << std::setw(2) << std::setfill('0') << std::hex << static_cast((*byte_it)); } - VLOG(SAMP_SYNC) << ss.str() << std::setfill(' ') << std::resetiosflags(std::ios::hex) << std::endl; + VLOG(SAMP_SYNC) << ss.str() << std::setfill(' ') << std::resetiosflags(std::ios::hex) << '\n'; } } @@ -465,7 +465,7 @@ int sbas_l1_telemetry_decoder_gs::general_work(int noutput_items __attribute__(( // and send them to the SBAS raw message queue // for(std::vector::iterator it = sbas_raw_msgs.begin(); it != sbas_raw_msgs.end(); it++) // { - // std::cout << "SBAS message type " << it->get_msg_type() << " from PRN" << it->get_prn() << " received" << std::endl; + // std::cout << "SBAS message type " << it->get_msg_type() << " from PRN" << it->get_prn() << " received\n"; // sbas_telemetry_data.update(*it); // } diff --git a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc index 27a819788..3e9ef95e1 100644 --- a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc +++ b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc @@ -21,7 +21,7 @@ #include "viterbi_decoder.h" #include #include // for fill_n -#include // for operator<<, basic_ostream, char_traits, endl +#include // for operator<<, basic_ostream, char_traits // logging #define EVENT 2 // logs important events which don't occur every block @@ -253,7 +253,7 @@ int Viterbi_Decoder::do_traceback(size_t traceback_length) int state; std::deque::iterator it; - VLOG(FLOW) << "do_traceback(): traceback_length=" << traceback_length << std::endl; + VLOG(FLOW) << "do_traceback(): traceback_length=" << traceback_length << '\n'; if (d_trellis_paths.size() < traceback_length) { @@ -516,12 +516,12 @@ Viterbi_Decoder::Prev::~Prev() int Viterbi_Decoder::Prev::get_anchestor_state_of_current_state(int current_state) { - // std::cout << "get prev state: for state " << current_state << " at time " << t << ", the prev state at time " << t-1 << " is " << state[current_state] << std::endl; + // std::cout << "get prev state: for state " << current_state << " at time " << t << ", the prev state at time " << t - 1 << " is " << state[current_state] << '\n'; if (num_states > current_state) { return state[current_state]; } - // std::cout<<"alarm "<<"num_states="< current_state) { return v_bit[current_state]; diff --git a/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc index fd36fea11..75c33af1e 100644 --- a/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc @@ -46,22 +46,22 @@ BeidouB1iDllPllTracking::BeidouB1iDllPllTracking( if (trk_params.extend_correlation_symbols < 1) { trk_params.extend_correlation_symbols = 1; - std::cout << TEXT_RED << "WARNING: BEIDOU B1I. extend_correlation_symbols must be bigger than 1. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: BEIDOU B1I. extend_correlation_symbols must be bigger than 1. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << '\n'; } else if (trk_params.extend_correlation_symbols > 20) { trk_params.extend_correlation_symbols = 20; - std::cout << TEXT_RED << "WARNING: BEIDOU B1I. extend_correlation_symbols must be lower than 21. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: BEIDOU B1I. extend_correlation_symbols must be lower than 21. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << '\n'; } trk_params.track_pilot = configuration->property(role + ".track_pilot", false); if (trk_params.track_pilot) { - std::cout << TEXT_RED << "WARNING: BEIDOU B1I does not have pilot signal. Data tracking has been enabled" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: BEIDOU B1I does not have pilot signal. Data tracking has been enabled" << TEXT_RESET << '\n'; trk_params.track_pilot = false; } if ((trk_params.extend_correlation_symbols > 1) and (trk_params.pll_bw_narrow_hz > trk_params.pll_bw_hz or trk_params.dll_bw_narrow_hz > trk_params.dll_bw_hz)) { - std::cout << TEXT_RED << "WARNING: BEIDOU B1I. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: BEIDOU B1I. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n'; } trk_params.system = 'C'; std::array sig_{'B', '1', '\0'}; diff --git a/src/algorithms/tracking/adapters/beidou_b3i_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/beidou_b3i_dll_pll_tracking.cc index 74e875c4d..37807f4ab 100644 --- a/src/algorithms/tracking/adapters/beidou_b3i_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/beidou_b3i_dll_pll_tracking.cc @@ -48,12 +48,12 @@ BeidouB3iDllPllTracking::BeidouB3iDllPllTracking( if (trk_params.extend_correlation_symbols < 1) { trk_params.extend_correlation_symbols = 1; - std::cout << TEXT_RED << "WARNING: BEIDOU B3I. extend_correlation_symbols must be bigger than 1. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: BEIDOU B3I. extend_correlation_symbols must be bigger than 1. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << '\n'; } else if (trk_params.extend_correlation_symbols > 20) { trk_params.extend_correlation_symbols = 20; - std::cout << TEXT_RED << "WARNING: BEIDOU B3I. extend_correlation_symbols must be lower than 21. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: BEIDOU B3I. extend_correlation_symbols must be lower than 21. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << '\n'; } trk_params.system = 'C'; std::array sig_{'B', '3', '\0'}; diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc index e711d5cb0..b0ef8860f 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc @@ -43,16 +43,16 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( if (trk_params.extend_correlation_symbols < 1) { trk_params.extend_correlation_symbols = 1; - std::cout << TEXT_RED << "WARNING: Galileo E1. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (4 ms)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: Galileo E1. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (4 ms)" << TEXT_RESET << '\n'; } else if (!trk_params.track_pilot and trk_params.extend_correlation_symbols > 1) { trk_params.extend_correlation_symbols = 1; - std::cout << TEXT_RED << "WARNING: Galileo E1. Extended coherent integration is not allowed when tracking the data component. Coherent integration has been set to 4 ms (1 symbol)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: Galileo E1. Extended coherent integration is not allowed when tracking the data component. Coherent integration has been set to 4 ms (1 symbol)" << TEXT_RESET << '\n'; } if ((trk_params.extend_correlation_symbols > 1) and (trk_params.pll_bw_narrow_hz > trk_params.pll_bw_hz or trk_params.dll_bw_narrow_hz > trk_params.dll_bw_hz)) { - std::cout << TEXT_RED << "WARNING: Galileo E1. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: Galileo E1. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n'; } int vector_length = std::round(trk_params.fs_in / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)); trk_params.vector_length = vector_length; diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc index 7aa6c6a34..d12ecc5af 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc @@ -45,16 +45,16 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( if (trk_params_fpga.extend_correlation_symbols < 1) { trk_params_fpga.extend_correlation_symbols = 1; - std::cout << TEXT_RED << "WARNING: Galileo E1. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (4 ms)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: Galileo E1. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (4 ms)" << TEXT_RESET << '\n'; } else if (!trk_params_fpga.track_pilot and trk_params_fpga.extend_correlation_symbols > 1) { trk_params_fpga.extend_correlation_symbols = 1; - std::cout << TEXT_RED << "WARNING: Galileo E1. Extended coherent integration is not allowed when tracking the data component. Coherent integration has been set to 4 ms (1 symbol)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: Galileo E1. Extended coherent integration is not allowed when tracking the data component. Coherent integration has been set to 4 ms (1 symbol)" << TEXT_RESET << '\n'; } if ((trk_params_fpga.extend_correlation_symbols > 1) and (trk_params_fpga.pll_bw_narrow_hz > trk_params_fpga.pll_bw_hz or trk_params_fpga.dll_bw_narrow_hz > trk_params_fpga.dll_bw_hz)) { - std::cout << TEXT_RED << "WARNING: Galileo E1. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: Galileo E1. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n'; } d_track_pilot = trk_params_fpga.track_pilot; int32_t vector_length = std::round(trk_params_fpga.fs_in / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)); diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc index 824736fd5..3cfa0e797 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc @@ -44,16 +44,16 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( if (trk_params.extend_correlation_symbols < 1) { trk_params.extend_correlation_symbols = 1; - std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << '\n'; } else if (!trk_params.track_pilot and trk_params.extend_correlation_symbols > GALILEO_E5A_I_SECONDARY_CODE_LENGTH) { trk_params.extend_correlation_symbols = GALILEO_E5A_I_SECONDARY_CODE_LENGTH; - std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be lower than 21 when tracking the data component. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be lower than 21 when tracking the data component. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << '\n'; } if ((trk_params.extend_correlation_symbols > 1) and (trk_params.pll_bw_narrow_hz > trk_params.pll_bw_hz or trk_params.dll_bw_narrow_hz > trk_params.dll_bw_hz)) { - std::cout << TEXT_RED << "WARNING: Galileo E5a. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: Galileo E5a. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n'; } trk_params.system = 'E'; std::array sig_{'5', 'X', '\0'}; diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc index fe5dc29c0..f3a100f0f 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc @@ -43,16 +43,16 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( if (trk_params_fpga.extend_correlation_symbols < 1) { trk_params_fpga.extend_correlation_symbols = 1; - std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << '\n'; } else if (!trk_params_fpga.track_pilot and trk_params_fpga.extend_correlation_symbols > GALILEO_E5A_I_SECONDARY_CODE_LENGTH) { trk_params_fpga.extend_correlation_symbols = GALILEO_E5A_I_SECONDARY_CODE_LENGTH; - std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be lower than 21 when tracking the data component. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be lower than 21 when tracking the data component. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << '\n'; } if ((trk_params_fpga.extend_correlation_symbols > 1) and (trk_params_fpga.pll_bw_narrow_hz > trk_params_fpga.pll_bw_hz or trk_params_fpga.dll_bw_narrow_hz > trk_params_fpga.dll_bw_hz)) { - std::cout << TEXT_RED << "WARNING: Galileo E5a. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: Galileo E5a. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n'; } trk_params_fpga.system = 'E'; std::array sig_{'5', 'X', '\0'}; diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc index ec249279d..5209d99df 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc @@ -46,22 +46,22 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( if (trk_params.extend_correlation_symbols < 1) { trk_params.extend_correlation_symbols = 1; - std::cout << TEXT_RED << "WARNING: GPS L1 C/A. extend_correlation_symbols must be bigger than 1. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: GPS L1 C/A. extend_correlation_symbols must be bigger than 1. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << '\n'; } else if (trk_params.extend_correlation_symbols > 20) { trk_params.extend_correlation_symbols = 20; - std::cout << TEXT_RED << "WARNING: GPS L1 C/A. extend_correlation_symbols must be lower than 21. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: GPS L1 C/A. extend_correlation_symbols must be lower than 21. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << '\n'; } trk_params.track_pilot = configuration->property(role + ".track_pilot", false); if (trk_params.track_pilot) { trk_params.track_pilot = false; - std::cout << TEXT_RED << "WARNING: GPS L1 C/A does not have pilot signal. Data tracking has been enabled" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: GPS L1 C/A does not have pilot signal. Data tracking has been enabled" << TEXT_RESET << '\n'; } if ((trk_params.extend_correlation_symbols > 1) and (trk_params.pll_bw_narrow_hz > trk_params.pll_bw_hz or trk_params.dll_bw_narrow_hz > trk_params.dll_bw_hz)) { - std::cout << TEXT_RED << "WARNING: GPS L1 C/A. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: GPS L1 C/A. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n'; } trk_params.system = 'G'; diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc index 8a1dad004..5a33cb5cc 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc @@ -47,22 +47,22 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( if (trk_params_fpga.extend_correlation_symbols < 1) { trk_params_fpga.extend_correlation_symbols = 1; - std::cout << TEXT_RED << "WARNING: GPS L1 C/A. extend_correlation_symbols must be bigger than 1. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: GPS L1 C/A. extend_correlation_symbols must be bigger than 1. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << '\n'; } else if (trk_params_fpga.extend_correlation_symbols > GPS_CA_BIT_DURATION_MS) { trk_params_fpga.extend_correlation_symbols = GPS_CA_BIT_DURATION_MS; - std::cout << TEXT_RED << "WARNING: GPS L1 C/A. extend_correlation_symbols must be lower than 21. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: GPS L1 C/A. extend_correlation_symbols must be lower than 21. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << '\n'; } trk_params_fpga.track_pilot = configuration->property(role + ".track_pilot", false); if (trk_params_fpga.track_pilot) { trk_params_fpga.track_pilot = false; - std::cout << TEXT_RED << "WARNING: GPS L1 C/A does not have pilot signal. Data tracking has been enabled" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: GPS L1 C/A does not have pilot signal. Data tracking has been enabled" << TEXT_RESET << '\n'; } if ((trk_params_fpga.extend_correlation_symbols > 1) and (trk_params_fpga.pll_bw_narrow_hz > trk_params_fpga.pll_bw_hz or trk_params_fpga.dll_bw_narrow_hz > trk_params_fpga.dll_bw_hz)) { - std::cout << TEXT_RED << "WARNING: GPS L1 C/A. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: GPS L1 C/A. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n'; } trk_params_fpga.system = 'G'; std::array sig_{'1', 'C', '\0'}; diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc index 18c7ab9e2..313be4b65 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc @@ -45,13 +45,13 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking( if (trk_params.extend_correlation_symbols != 1) { trk_params.extend_correlation_symbols = 1; - std::cout << TEXT_RED << "WARNING: Extended coherent integration is not allowed in GPS L2. Coherent integration has been set to 20 ms (1 symbol)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: Extended coherent integration is not allowed in GPS L2. Coherent integration has been set to 20 ms (1 symbol)" << TEXT_RESET << '\n'; } trk_params.track_pilot = configuration->property(role + ".track_pilot", false); if (trk_params.track_pilot) { trk_params.track_pilot = false; - std::cout << TEXT_RED << "WARNING: GPS L2 does not have pilot signal. Data tracking has been enabled" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: GPS L2 does not have pilot signal. Data tracking has been enabled" << TEXT_RESET << '\n'; } trk_params.system = 'G'; std::array sig_{'2', 'S', '\0'}; diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc index bab6a8ed2..5de5194b5 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc @@ -53,14 +53,14 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( if (trk_params_fpga.extend_correlation_symbols != 1) { trk_params_fpga.extend_correlation_symbols = 1; - std::cout << TEXT_RED << "WARNING: Extended coherent integration is not allowed in GPS L2. Coherent integration has been set to 20 ms (1 symbol)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: Extended coherent integration is not allowed in GPS L2. Coherent integration has been set to 20 ms (1 symbol)" << TEXT_RESET << '\n'; } trk_params_fpga.track_pilot = configuration->property(role + ".track_pilot", false); if (trk_params_fpga.track_pilot) { trk_params_fpga.track_pilot = false; - std::cout << TEXT_RED << "WARNING: GPS L2 does not have pilot signal. Data tracking has been enabled" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: GPS L2 does not have pilot signal. Data tracking has been enabled" << TEXT_RESET << '\n'; } trk_params_fpga.system = 'G'; std::array sig_{'2', 'S', '\0'}; diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc index ca118bc9f..c95b30d24 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc @@ -45,16 +45,16 @@ GpsL5DllPllTracking::GpsL5DllPllTracking( if (trk_params.extend_correlation_symbols < 1) { trk_params.extend_correlation_symbols = 1; - std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << '\n'; } else if (!trk_params.track_pilot and trk_params.extend_correlation_symbols > GPS_L5I_NH_CODE_LENGTH) { trk_params.extend_correlation_symbols = GPS_L5I_NH_CODE_LENGTH; - std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be lower than 11 when tracking the data component. Coherent integration has been set to 10 symbols (10 ms)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be lower than 11 when tracking the data component. Coherent integration has been set to 10 symbols (10 ms)" << TEXT_RESET << '\n'; } if ((trk_params.extend_correlation_symbols > 1) and (trk_params.pll_bw_narrow_hz > trk_params.pll_bw_hz or trk_params.dll_bw_narrow_hz > trk_params.dll_bw_hz)) { - std::cout << TEXT_RED << "WARNING: GPS L5. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: GPS L5. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n'; } trk_params.system = 'G'; std::array sig_{'L', '5', '\0'}; diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc index b75ba231b..7f9fef3b2 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc @@ -49,16 +49,16 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( if (trk_params_fpga.extend_correlation_symbols < 1) { trk_params_fpga.extend_correlation_symbols = 1; - std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << '\n'; } else if (!trk_params_fpga.track_pilot and trk_params_fpga.extend_correlation_symbols > GPS_L5I_NH_CODE_LENGTH) { trk_params_fpga.extend_correlation_symbols = GPS_L5I_NH_CODE_LENGTH; - std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be lower than 11 when tracking the data component. Coherent integration has been set to 10 symbols (10 ms)" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be lower than 11 when tracking the data component. Coherent integration has been set to 10 symbols (10 ms)" << TEXT_RESET << '\n'; } if ((trk_params_fpga.extend_correlation_symbols > 1) and (trk_params_fpga.pll_bw_narrow_hz > trk_params_fpga.pll_bw_hz or trk_params_fpga.dll_bw_narrow_hz > trk_params_fpga.dll_bw_hz)) { - std::cout << TEXT_RED << "WARNING: GPS L5. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << std::endl; + std::cout << TEXT_RED << "WARNING: GPS L5. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n'; } d_track_pilot = trk_params_fpga.track_pilot; trk_params_fpga.system = 'G'; diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 17b40025f..52095973b 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -211,7 +211,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl else { LOG(WARNING) << "Invalid Signal argument when instantiating tracking blocks"; - std::cerr << "Invalid Signal argument when instantiating tracking blocks" << std::endl; + std::cerr << "Invalid Signal argument when instantiating tracking blocks\n"; d_correlation_length_ms = 1; d_secondary = false; d_signal_carrier_freq = 0.0; @@ -286,7 +286,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl else { LOG(WARNING) << "Invalid Signal argument when instantiating tracking blocks"; - std::cout << "Invalid Signal argument when instantiating tracking blocks" << std::endl; + std::cout << "Invalid Signal argument when instantiating tracking blocks\n"; d_correlation_length_ms = 1; d_secondary = false; d_signal_carrier_freq = 0.0; @@ -343,7 +343,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl else { LOG(WARNING) << "Invalid Signal argument when instantiating tracking blocks"; - std::cout << "Invalid Signal argument when instantiating tracking blocks" << std::endl; + std::cout << "Invalid Signal argument when instantiating tracking blocks\n"; d_correlation_length_ms = 1; d_secondary = false; d_signal_carrier_freq = 0.0; @@ -356,7 +356,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl else { LOG(WARNING) << "Invalid System argument when instantiating tracking blocks"; - std::cerr << "Invalid System argument when instantiating tracking blocks" << std::endl; + std::cerr << "Invalid System argument when instantiating tracking blocks\n"; d_correlation_length_ms = 1; d_secondary = false; d_signal_carrier_freq = 0.0; @@ -537,7 +537,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl // create directory if (!gnss_sdr_create_directory(dump_path)) { - std::cerr << "GNSS-SDR cannot create dump files for the tracking block. Wrong permissions?" << std::endl; + std::cerr << "GNSS-SDR cannot create dump files for the tracking block. Wrong permissions?\n"; d_dump = false; } } @@ -762,7 +762,7 @@ void dll_pll_veml_tracking::start_tracking() d_code_loop_filter.initialize(); // initialize the code filter // DEBUG OUTPUT - std::cout << "Tracking of " << d_systemName << " " << d_signal_pretty_name << " signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + std::cout << "Tracking of " << d_systemName << " " << d_signal_pretty_name << " signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << '\n'; DLOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking pull-in @@ -900,7 +900,7 @@ bool dll_pll_veml_tracking::cn0_and_tracking_lock_status(double coh_integration_ } if (d_carrier_lock_fail_counter > d_trk_parameters.max_carrier_lock_fail or d_code_lock_fail_counter > d_trk_parameters.max_code_lock_fail) { - std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; + std::cout << "Loss of lock in channel " << d_channel << "!\n"; LOG(INFO) << "Loss of lock in channel " << d_channel << " (carrier_lock_fail_counter:" << d_carrier_lock_fail_counter << " code_lock_fail_counter : " << d_code_lock_fail_counter << ")"; @@ -968,7 +968,7 @@ void dll_pll_veml_tracking::run_dll_pll() d_carr_freq_error_hz = fll_diff_atan(d_P_accu_old, d_P_accu, 0, d_current_correlation_time_s) / TWO_PI; d_P_accu_old = d_P_accu; - // std::cout << "d_carr_freq_error_hz: " << d_carr_freq_error_hz << std::endl; + // std::cout << "d_carr_freq_error_hz: " << d_carr_freq_error_hz << '\n'; // Carrier discriminator filter if ((d_pull_in_transitory == true and d_trk_parameters.enable_fll_pull_in == true)) { @@ -990,8 +990,8 @@ void dll_pll_veml_tracking::run_dll_pll() // New carrier Doppler frequency estimation d_carrier_doppler_hz = d_carr_error_filt_hz; - // std::cout << "d_carrier_doppler_hz: " << d_carrier_doppler_hz << std::endl; - // std::cout << "d_CN0_SNV_dB_Hz: " << this->d_CN0_SNV_dB_Hz << std::endl; + // std::cout << "d_carrier_doppler_hz: " << d_carrier_doppler_hz << '\n'; + // std::cout << "d_CN0_SNV_dB_Hz: " << this->d_CN0_SNV_dB_Hz << '\n'; // ################## DLL ########################################################## // DLL discriminator @@ -1105,7 +1105,7 @@ void dll_pll_veml_tracking::update_tracking_vars() d_carrier_phase_rate_step_rad = (tmp_cp2 - tmp_cp1) / tmp_samples; } } - // std::cout << d_carrier_phase_rate_step_rad * d_trk_parameters.fs_in * d_trk_parameters.fs_in / TWO_PI << std::endl; + // std::cout << d_carrier_phase_rate_step_rad * d_trk_parameters.fs_in * d_trk_parameters.fs_in / TWO_PI << '\n'; // remnant carrier phase to prevent overflow in the code NCO d_rem_carr_phase_rad += static_cast(d_carrier_phase_step_rad * static_cast(d_current_prn_length_samples) + 0.5 * d_carrier_phase_rate_step_rad * static_cast(d_current_prn_length_samples) * static_cast(d_current_prn_length_samples)); d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, TWO_PI); @@ -1113,7 +1113,7 @@ void dll_pll_veml_tracking::update_tracking_vars() // carrier phase accumulator // double a = d_carrier_phase_step_rad * static_cast(d_current_prn_length_samples); // double b = 0.5 * d_carrier_phase_rate_step_rad * static_cast(d_current_prn_length_samples) * static_cast(d_current_prn_length_samples); - // std::cout << fmod(b, TWO_PI) / fmod(a, TWO_PI) << std::endl; + // std::cout << fmod(b, TWO_PI) / fmod(a, TWO_PI) << '\n'; d_acc_carrier_phase_rad -= (d_carrier_phase_step_rad * static_cast(d_current_prn_length_samples) + 0.5 * d_carrier_phase_rate_step_rad * static_cast(d_current_prn_length_samples) * static_cast(d_current_prn_length_samples)); // ################### DLL COMMANDS ################################################# @@ -1227,7 +1227,7 @@ void dll_pll_veml_tracking::save_correlation_results() else { d_P_data_accu += *d_Prompt; - // std::cout << "s[" << d_current_data_symbol << "]=" << (int)((*d_Prompt).real() > 0) << std::endl; + // std::cout << "s[" << d_current_data_symbol << "]=" << (int)((*d_Prompt).real() > 0) << '\n'; } d_current_data_symbol++; d_current_data_symbol %= d_symbols_per_bit; @@ -1370,7 +1370,7 @@ int32_t dll_pll_veml_tracking::save_matfile() const dump_filename_.append(std::to_string(d_channel)); // add extension dump_filename_.append(".dat"); - std::cout << "Generating .mat file for " << dump_filename_ << std::endl; + std::cout << "Generating .mat file for " << dump_filename_ << '\n'; dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); try { @@ -1378,7 +1378,7 @@ int32_t dll_pll_veml_tracking::save_matfile() const } catch (const std::ifstream::failure &e) { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + std::cerr << "Problem opening dump file:" << e.what() << '\n'; return 1; } // count number of epochs and rewind @@ -1449,7 +1449,7 @@ int32_t dll_pll_veml_tracking::save_matfile() const } catch (const std::ifstream::failure &e) { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + std::cerr << "Problem reading dump file:" << e.what() << '\n'; return 1; } @@ -1683,7 +1683,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) { d_carrier_lock_fail_counter = 300000; // force loss-of-lock condition LOG(INFO) << d_systemName << " " << d_signal_pretty_name << " tracking synchronization time limit reached in channel " << d_channel - << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << '\n'; } // Check lock status if (!cn0_and_tracking_lock_status(d_code_period)) @@ -1713,9 +1713,9 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) if (next_state) { LOG(INFO) << d_systemName << " " << d_signal_pretty_name << " secondary code locked in channel " << d_channel - << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << '\n'; std::cout << d_systemName << " " << d_signal_pretty_name << " secondary code locked in channel " << d_channel - << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << '\n'; } } } @@ -1729,9 +1729,9 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) if (next_state) { LOG(INFO) << d_systemName << " " << d_signal_pretty_name << " tracking bit synchronization locked in channel " << d_channel - << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << '\n'; std::cout << d_systemName << " " << d_signal_pretty_name << " tracking bit synchronization locked in channel " << d_channel - << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << '\n'; } } } @@ -1767,7 +1767,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN); std::cout << "Enabled " << d_trk_parameters.extend_correlation_symbols * static_cast(d_code_period * 1000.0) << " ms extended correlator in channel " << d_channel - << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << '\n'; // Set narrow taps delay values [chips] d_code_loop_filter.set_update_interval(d_current_correlation_time_s); d_code_loop_filter.set_noise_bandwidth(d_trk_parameters.dll_bw_narrow_hz); diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc index 1dc61b9d4..ea10404ac 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc @@ -207,7 +207,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & else { LOG(WARNING) << "Invalid Signal argument when instantiating tracking blocks"; - std::cerr << "Invalid Signal argument when instantiating tracking blocks" << std::endl; + std::cerr << "Invalid Signal argument when instantiating tracking blocks\n"; d_correlation_length_ms = 1; d_secondary = false; d_signal_carrier_freq = 0.0; @@ -285,7 +285,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & else { LOG(WARNING) << "Invalid Signal argument when instantiating tracking blocks"; - std::cout << "Invalid Signal argument when instantiating tracking blocks" << std::endl; + std::cout << "Invalid Signal argument when instantiating tracking blocks\n"; d_correlation_length_ms = 1; d_secondary = false; d_signal_carrier_freq = 0.0; @@ -296,7 +296,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & else { LOG(WARNING) << "Invalid System argument when instantiating tracking blocks"; - std::cerr << "Invalid System argument when instantiating tracking blocks" << std::endl; + std::cerr << "Invalid System argument when instantiating tracking blocks\n"; d_correlation_length_ms = 1; d_secondary = false; d_signal_carrier_freq = 0.0; @@ -461,7 +461,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & // create directory if (!gnss_sdr_create_directory(dump_path)) { - std::cerr << "GNSS-SDR cannot create dump files for the tracking block. Wrong permissions?" << std::endl; + std::cerr << "GNSS-SDR cannot create dump files for the tracking block. Wrong permissions?\n"; d_dump = false; } } @@ -656,7 +656,7 @@ bool dll_pll_veml_tracking_fpga::cn0_and_tracking_lock_status(double coh_integra } if (d_carrier_lock_fail_counter > d_trk_parameters.max_carrier_lock_fail or d_code_lock_fail_counter > d_trk_parameters.max_code_lock_fail) { - std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; + std::cout << "Loss of lock in channel " << d_channel << "!\n"; LOG(INFO) << "Loss of lock in channel " << d_channel << " (carrier_lock_fail_counter:" << d_carrier_lock_fail_counter << " code_lock_fail_counter : " << d_code_lock_fail_counter << ")"; @@ -712,7 +712,7 @@ void dll_pll_veml_tracking_fpga::run_dll_pll() d_carr_freq_error_hz = fll_diff_atan(d_P_accu_old, d_P_accu, 0, d_current_correlation_time_s) / TWO_PI; d_P_accu_old = d_P_accu; - // std::cout << "d_carr_freq_error_hz: " << d_carr_freq_error_hz << std::endl; + // std::cout << "d_carr_freq_error_hz: " << d_carr_freq_error_hz << '\n'; // Carrier discriminator filter if ((d_pull_in_transitory == true and d_trk_parameters.enable_fll_pull_in == true)) { @@ -734,8 +734,8 @@ void dll_pll_veml_tracking_fpga::run_dll_pll() // New carrier Doppler frequency estimation d_carrier_doppler_hz = d_carr_error_filt_hz; - // std::cout << "d_carrier_doppler_hz: " << d_carrier_doppler_hz << std::endl; - // std::cout << "d_CN0_SNV_dB_Hz: " << this->d_CN0_SNV_dB_Hz << std::endl; + // std::cout << "d_carrier_doppler_hz: " << d_carrier_doppler_hz << '\n'; + // std::cout << "d_CN0_SNV_dB_Hz: " << this->d_CN0_SNV_dB_Hz << '\n'; // ################## DLL ########################################################## // DLL discriminator @@ -850,7 +850,7 @@ void dll_pll_veml_tracking_fpga::update_tracking_vars() d_carrier_phase_rate_step_rad = (tmp_cp2 - tmp_cp1) / tmp_samples; } } - // std::cout << d_carrier_phase_rate_step_rad * d_trk_parameters.fs_in * d_trk_parameters.fs_in / TWO_PI << std::endl; + // std::cout << d_carrier_phase_rate_step_rad * d_trk_parameters.fs_in * d_trk_parameters.fs_in / TWO_PI << '\n'; // remnant carrier phase to prevent overflow in the code NCO d_rem_carr_phase_rad += static_cast(d_carrier_phase_step_rad * static_cast(d_current_integration_length_samples) + 0.5 * d_carrier_phase_rate_step_rad * static_cast(d_current_integration_length_samples) * static_cast(d_current_integration_length_samples)); d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, TWO_PI); @@ -858,7 +858,7 @@ void dll_pll_veml_tracking_fpga::update_tracking_vars() // carrier phase accumulator // double a = d_carrier_phase_step_rad * static_cast(d_current_prn_length_samples); // double b = 0.5 * d_carrier_phase_rate_step_rad * static_cast(d_current_prn_length_samples) * static_cast(d_current_prn_length_samples); - // std::cout << fmod(b, TWO_PI) / fmod(a, TWO_PI) << std::endl; + // std::cout << fmod(b, TWO_PI) / fmod(a, TWO_PI) << '\n'; d_acc_carrier_phase_rad -= (d_carrier_phase_step_rad * static_cast(d_current_integration_length_samples) + 0.5 * d_carrier_phase_rate_step_rad * static_cast(d_current_integration_length_samples) * static_cast(d_current_integration_length_samples)); // ################## DLL COMMANDS ################################################# @@ -986,7 +986,7 @@ void dll_pll_veml_tracking_fpga::save_correlation_results() else { d_P_data_accu += *d_Prompt; - // std::cout << "s[" << d_current_data_symbol << "]=" << (int)((*d_Prompt).real() > 0) << std::endl; + // std::cout << "s[" << d_current_data_symbol << "]=" << (int)((*d_Prompt).real() > 0) << '\n'; } d_current_data_symbol += d_current_fpga_integration_period; d_current_data_symbol %= d_symbols_per_bit; @@ -1129,7 +1129,7 @@ int32_t dll_pll_veml_tracking_fpga::save_matfile() const dump_filename_.append(std::to_string(d_channel)); // add extension dump_filename_.append(".dat"); - std::cout << "Generating .mat file for " << dump_filename_ << std::endl; + std::cout << "Generating .mat file for " << dump_filename_ << '\n'; dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); try { @@ -1137,7 +1137,7 @@ int32_t dll_pll_veml_tracking_fpga::save_matfile() const } catch (const std::ifstream::failure &e) { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + std::cerr << "Problem opening dump file:" << e.what() << '\n'; return 1; } // count number of epochs and rewind @@ -1208,7 +1208,7 @@ int32_t dll_pll_veml_tracking_fpga::save_matfile() const } catch (const std::ifstream::failure &e) { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + std::cerr << "Problem reading dump file:" << e.what() << '\n'; return 1; } @@ -1596,11 +1596,11 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un << ". PULL-IN Code Phase [samples] = " << d_acq_code_phase_samples; // DEBUG OUTPUT - std::cout << "Tracking of " << d_systemName << " " << d_signal_pretty_name << " signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + std::cout << "Tracking of " << d_systemName << " " << d_signal_pretty_name << " signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << '\n'; DLOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // DLOG(INFO) << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples << " ( " << acq_trk_diff_seconds << " s)"; - // std::cout << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples << " ( " << acq_trk_diff_seconds << " s)" << std::endl; + // std::cout << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples << " ( " << acq_trk_diff_seconds << " s)\n"; // DLOG(INFO) << "PULL-IN Doppler [Hz] = " << d_carrier_doppler_hz // << ". PULL-IN Code Phase [samples] = " << d_acq_code_phase_samples; @@ -1634,7 +1634,7 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un { d_carrier_lock_fail_counter = 300000; // force loss-of-lock condition LOG(INFO) << d_systemName << " " << d_signal_pretty_name << " tracking synchronization time limit reached in channel " << d_channel - << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << '\n'; } // Check lock status @@ -1672,9 +1672,9 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un if (next_state) { LOG(INFO) << d_systemName << " " << d_signal_pretty_name << " secondary code locked in channel " << d_channel - << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << '\n'; std::cout << d_systemName << " " << d_signal_pretty_name << " secondary code locked in channel " << d_channel - << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << '\n'; } } } @@ -1688,9 +1688,9 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un if (next_state) { LOG(INFO) << d_systemName << " " << d_signal_pretty_name << " tracking bit synchronization locked in channel " << d_channel - << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << '\n'; std::cout << d_systemName << " " << d_signal_pretty_name << " tracking bit synchronization locked in channel " << d_channel - << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << '\n'; } } } @@ -1757,7 +1757,7 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN); std::cout << "Enabled " << d_trk_parameters.extend_correlation_symbols * static_cast(d_code_period * 1000.0) << " ms extended correlator in channel " << d_channel - << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + << " for satellite " << Gnss_Satellite(d_systemName, d_acquisition_gnss_synchro->PRN) << '\n'; // Set narrow taps delay values [chips] d_code_loop_filter.set_update_interval(d_current_correlation_time_s); d_code_loop_filter.set_noise_bandwidth(d_trk_parameters.dll_bw_narrow_hz); diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc index 939b1501d..79c169706 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc @@ -202,7 +202,7 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::start_tracking() sys = sys_.substr(0, 1); // DEBUG OUTPUT - std::cout << "Tracking of Galileo E1 signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + std::cout << "Tracking of Galileo E1 signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << '\n'; LOG(INFO) << "Tracking of Galileo E1 signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking @@ -414,7 +414,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { - std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; + std::cout << "Loss of lock in channel " << d_channel << "!\n"; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc index d1770530f..04a41de20 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -290,7 +290,7 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking() sys = sys_.substr(0, 1); // DEBUG OUTPUT - std::cout << "Tracking of GLONASS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + std::cout << "Tracking of GLONASS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << '\n'; LOG(INFO) << "Tracking of GLONASS L1 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking @@ -334,7 +334,7 @@ glonass_l1_ca_dll_pll_c_aid_tracking_cc::~glonass_l1_ca_dll_pll_c_aid_tracking_c } if (d_channel == 0) { - std::cout << " done." << std::endl; + std::cout << " done.\n"; } } @@ -365,7 +365,7 @@ int32_t glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile() const } catch (const std::ifstream::failure &e) { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + std::cerr << "Problem opening dump file:" << e.what() << '\n'; return 1; } // count number of epochs and rewind @@ -429,7 +429,7 @@ int32_t glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile() const } catch (const std::ifstream::failure &e) { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + std::cerr << "Problem reading dump file:" << e.what() << '\n'; return 1; } @@ -535,7 +535,7 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::set_channel(uint32_t channel) d_dump_filename.append(".dat"); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str() << std::endl; + LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str() << '\n'; } catch (const std::ifstream::failure &e) { @@ -622,7 +622,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at { // compute coherent integration and enable tracking loop // perform coherent integration using correlator output history - // std::cout<<"##### RESET COHERENT INTEGRATION ####"<PRN) - << " pll_bw = " << d_pll_bw_hz << " [Hz], pll_narrow_bw = " << d_pll_bw_narrow_hz << " [Hz]" << std::endl - << " dll_bw = " << d_dll_bw_hz << " [Hz], dll_narrow_bw = " << d_dll_bw_narrow_hz << " [Hz]" << std::endl; + << " pll_bw = " << d_pll_bw_hz << " [Hz], pll_narrow_bw = " << d_pll_bw_narrow_hz << " [Hz]\n" + << " dll_bw = " << d_dll_bw_hz << " [Hz], dll_narrow_bw = " << d_dll_bw_narrow_hz << " [Hz]\n"; } // UPDATE INTEGRATION TIME CURRENT_INTEGRATION_TIME_S = static_cast(d_extend_correlation_ms) * GLONASS_L1_CA_CODE_PERIOD_S; @@ -772,7 +772,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { - std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; + std::cout << "Loss of lock in channel " << d_channel << "!\n"; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock d_carrier_lock_fail_counter = 0; diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc index 90cd7b0fa..5119473e3 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -289,7 +289,7 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking() sys = sys_.substr(0, 1); // DEBUG OUTPUT - std::cout << "Tracking of GLONASS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + std::cout << "Tracking of GLONASS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << '\n'; LOG(INFO) << "Tracking of GLONASS L1 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking @@ -320,7 +320,7 @@ int32_t glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile() const } catch (const std::ifstream::failure &e) { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + std::cerr << "Problem opening dump file:" << e.what() << '\n'; return 1; } // count number of epochs and rewind @@ -384,7 +384,7 @@ int32_t glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile() const } catch (const std::ifstream::failure &e) { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + std::cerr << "Problem reading dump file:" << e.what() << '\n'; return 1; } @@ -506,7 +506,7 @@ glonass_l1_ca_dll_pll_c_aid_tracking_sc::~glonass_l1_ca_dll_pll_c_aid_tracking_s if (d_channel == 0) { - std::cout << " done." << std::endl; + std::cout << " done.\n"; } } @@ -536,7 +536,7 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::set_channel(uint32_t channel) d_dump_filename.append(".dat"); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str() << std::endl; + LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str() << '\n'; } catch (const std::ifstream::failure &e) { @@ -623,7 +623,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at { // compute coherent integration and enable tracking loop // perform coherent integration using correlator output history - // std::cout<<"##### RESET COHERENT INTEGRATION ####"<PRN) - << " pll_bw = " << d_pll_bw_hz << " [Hz], pll_narrow_bw = " << d_pll_bw_narrow_hz << " [Hz]" << std::endl - << " dll_bw = " << d_dll_bw_hz << " [Hz], dll_narrow_bw = " << d_dll_bw_narrow_hz << " [Hz]" << std::endl; + << " pll_bw = " << d_pll_bw_hz << " [Hz], pll_narrow_bw = " << d_pll_bw_narrow_hz << " [Hz]\n" + << " dll_bw = " << d_dll_bw_hz << " [Hz], dll_narrow_bw = " << d_dll_bw_narrow_hz << " [Hz]\n"; } // UPDATE INTEGRATION TIME CURRENT_INTEGRATION_TIME_S = static_cast(d_extend_correlation_ms) * GLONASS_L1_CA_CODE_PERIOD_S; @@ -771,7 +771,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { - std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; + std::cout << "Loss of lock in channel " << d_channel << "!\n"; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock d_carrier_lock_fail_counter = 0; diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc index efe8f32fa..3aba31df0 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc @@ -232,7 +232,7 @@ void Glonass_L1_Ca_Dll_Pll_Tracking_cc::start_tracking() sys = sys_.substr(0, 1); // DEBUG OUTPUT - std::cout << "Tracking of GLONASS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + std::cout << "Tracking of GLONASS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << '\n'; LOG(INFO) << "Tracking of GLONASS L1 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking @@ -275,7 +275,7 @@ Glonass_L1_Ca_Dll_Pll_Tracking_cc::~Glonass_L1_Ca_Dll_Pll_Tracking_cc() if (d_channel == 0) { - std::cout << " done." << std::endl; + std::cout << " done.\n"; } } try @@ -305,7 +305,7 @@ int32_t Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile() const } catch (const std::ifstream::failure &e) { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + std::cerr << "Problem opening dump file:" << e.what() << '\n'; return 1; } // count number of epochs and rewind @@ -369,7 +369,7 @@ int32_t Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile() const } catch (const std::ifstream::failure &e) { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + std::cerr << "Problem reading dump file:" << e.what() << '\n'; return 1; } @@ -619,7 +619,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { - std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; + std::cout << "Loss of lock in channel " << d_channel << "!\n"; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock d_carrier_lock_fail_counter = 0; diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc index b839030e7..22301ad00 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc @@ -286,7 +286,7 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_cc::start_tracking() sys = sys_.substr(0, 1); // DEBUG OUTPUT - std::cout << "Tracking of GLONASS L2 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + std::cout << "Tracking of GLONASS L2 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << '\n'; LOG(INFO) << "Tracking of GLONASS L2 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking @@ -331,7 +331,7 @@ glonass_l2_ca_dll_pll_c_aid_tracking_cc::~glonass_l2_ca_dll_pll_c_aid_tracking_c if (d_channel == 0) { - std::cout << " done." << std::endl; + std::cout << " done.\n"; } } @@ -362,7 +362,7 @@ int32_t glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile() const } catch (const std::ifstream::failure &e) { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + std::cerr << "Problem opening dump file:" << e.what() << '\n'; return 1; } // count number of epochs and rewind @@ -426,7 +426,7 @@ int32_t glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile() const } catch (const std::ifstream::failure &e) { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + std::cerr << "Problem reading dump file:" << e.what() << '\n'; return 1; } @@ -532,7 +532,7 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_cc::set_channel(uint32_t channel) d_dump_filename.append(".dat"); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str() << std::endl; + LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str() << '\n'; } catch (const std::ifstream::failure &e) { @@ -619,7 +619,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at { // compute coherent integration and enable tracking loop // perform coherent integration using correlator output history - // std::cout<<"##### RESET COHERENT INTEGRATION ####"<PRN) - << " pll_bw = " << d_pll_bw_hz << " [Hz], pll_narrow_bw = " << d_pll_bw_narrow_hz << " [Hz]" << std::endl - << " dll_bw = " << d_dll_bw_hz << " [Hz], dll_narrow_bw = " << d_dll_bw_narrow_hz << " [Hz]" << std::endl; + << " pll_bw = " << d_pll_bw_hz << " [Hz], pll_narrow_bw = " << d_pll_bw_narrow_hz << " [Hz]\n" + << " dll_bw = " << d_dll_bw_hz << " [Hz], dll_narrow_bw = " << d_dll_bw_narrow_hz << " [Hz]\n"; } // UPDATE INTEGRATION TIME CURRENT_INTEGRATION_TIME_S = static_cast(d_extend_correlation_ms) * GLONASS_L2_CA_CODE_PERIOD_S; @@ -769,7 +769,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { - std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; + std::cout << "Loss of lock in channel " << d_channel << "!\n"; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock d_carrier_lock_fail_counter = 0; diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc index 860cd767b..c583506a5 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc @@ -287,7 +287,7 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_sc::start_tracking() sys = sys_.substr(0, 1); // DEBUG OUTPUT - std::cout << "Tracking of GLONASS L2 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + std::cout << "Tracking of GLONASS L2 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << '\n'; LOG(INFO) << "Tracking of GLONASS L2 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking @@ -318,7 +318,7 @@ int32_t glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile() const } catch (const std::ifstream::failure &e) { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + std::cerr << "Problem opening dump file:" << e.what() << '\n'; return 1; } // count number of epochs and rewind @@ -382,7 +382,7 @@ int32_t glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile() const } catch (const std::ifstream::failure &e) { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + std::cerr << "Problem reading dump file:" << e.what() << '\n'; return 1; } @@ -504,7 +504,7 @@ glonass_l2_ca_dll_pll_c_aid_tracking_sc::~glonass_l2_ca_dll_pll_c_aid_tracking_s if (d_channel == 0) { - std::cout << " done." << std::endl; + std::cout << " done.\n"; } } @@ -534,7 +534,7 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_sc::set_channel(uint32_t channel) d_dump_filename.append(".dat"); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str() << std::endl; + LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str() << '\n'; } catch (const std::ifstream::failure &e) { @@ -621,7 +621,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at { // compute coherent integration and enable tracking loop // perform coherent integration using correlator output history - // std::cout<<"##### RESET COHERENT INTEGRATION ####"<PRN) - << " pll_bw = " << d_pll_bw_hz << " [Hz], pll_narrow_bw = " << d_pll_bw_narrow_hz << " [Hz]" << std::endl - << " dll_bw = " << d_dll_bw_hz << " [Hz], dll_narrow_bw = " << d_dll_bw_narrow_hz << " [Hz]" << std::endl; + << " pll_bw = " << d_pll_bw_hz << " [Hz], pll_narrow_bw = " << d_pll_bw_narrow_hz << " [Hz]\n" + << " dll_bw = " << d_dll_bw_hz << " [Hz], dll_narrow_bw = " << d_dll_bw_narrow_hz << " [Hz]\n"; } // UPDATE INTEGRATION TIME CURRENT_INTEGRATION_TIME_S = static_cast(d_extend_correlation_ms) * GLONASS_L2_CA_CODE_PERIOD_S; @@ -769,7 +769,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { - std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; + std::cout << "Loss of lock in channel " << d_channel << "!\n"; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock d_carrier_lock_fail_counter = 0; diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc index 0aa3502a5..c144d45d6 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc @@ -233,7 +233,7 @@ void Glonass_L2_Ca_Dll_Pll_Tracking_cc::start_tracking() sys = sys_.substr(0, 1); // DEBUG OUTPUT - std::cout << "Tracking of GLONASS L2 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + std::cout << "Tracking of GLONASS L2 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << '\n'; LOG(INFO) << "Tracking of GLONASS L2 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking @@ -276,7 +276,7 @@ Glonass_L2_Ca_Dll_Pll_Tracking_cc::~Glonass_L2_Ca_Dll_Pll_Tracking_cc() if (d_channel == 0) { - std::cout << " done." << std::endl; + std::cout << " done.\n"; } } try @@ -306,7 +306,7 @@ int32_t Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile() const } catch (const std::ifstream::failure &e) { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + std::cerr << "Problem opening dump file:" << e.what() << '\n'; return 1; } // count number of epochs and rewind @@ -370,7 +370,7 @@ int32_t Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile() const } catch (const std::ifstream::failure &e) { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + std::cerr << "Problem reading dump file:" << e.what() << '\n'; return 1; } @@ -620,7 +620,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { - std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; + std::cout << "Loss of lock in channel " << d_channel << "!\n"; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock d_carrier_lock_fail_counter = 0; diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc index abce5b7af..c926a0422 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc @@ -228,7 +228,7 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::start_tracking() sys = sys_.substr(0, 1); // DEBUG OUTPUT - std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << '\n'; LOG(INFO) << "Tracking of GPS L1 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking @@ -354,7 +354,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work(int noutput_items __attribut static_cast(d_rem_code_phase_chips), d_correlation_length_samples, d_n_correlator_taps); cudaProfilerStop(); - // std::cout<<"c_out[0]="<message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock d_carrier_lock_fail_counter = 0; diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc index 56b0445e0..8ac3ad3ba 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc @@ -329,7 +329,7 @@ void Gps_L1_Ca_Kf_Tracking_cc::start_tracking() sys = sys_.substr(0, 1); // DEBUG OUTPUT - std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << '\n'; LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking @@ -372,7 +372,7 @@ Gps_L1_Ca_Kf_Tracking_cc::~Gps_L1_Ca_Kf_Tracking_cc() if (d_channel == 0) { - std::cout << " done." << std::endl; + std::cout << " done.\n"; } } try @@ -402,7 +402,7 @@ int32_t Gps_L1_Ca_Kf_Tracking_cc::save_matfile() } catch (const std::ifstream::failure &e) { - std::cerr << "Problem opening dump file:" << e.what() << std::endl; + std::cerr << "Problem opening dump file:" << e.what() << '\n'; return 1; } // count number of epochs and rewind @@ -474,7 +474,7 @@ int32_t Gps_L1_Ca_Kf_Tracking_cc::save_matfile() } catch (const std::ifstream::failure &e) { - std::cerr << "Problem reading dump file:" << e.what() << std::endl; + std::cerr << "Problem reading dump file:" << e.what() << '\n'; return 1; } @@ -782,7 +782,7 @@ int Gps_L1_Ca_Kf_Tracking_cc::general_work(int noutput_items __attribute__((unus if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min) { // if (d_channel == 1) - // std::cout << "Carrier Lock Test Fail in channel " << d_channel << ": " << d_carrier_lock_test << " < " << d_carrier_lock_threshold << "," << nfail++ << std::endl; + // std::cout << "Carrier Lock Test Fail in channel " << d_channel << ": " << d_carrier_lock_test << " < " << d_carrier_lock_threshold << "," << nfail++ << '\n'; d_carrier_lock_fail_counter++; // nfail++; } @@ -795,7 +795,7 @@ int Gps_L1_Ca_Kf_Tracking_cc::general_work(int noutput_items __attribute__((unus } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { - std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; + std::cout << "Loss of lock in channel " << d_channel << "!\n"; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock d_carrier_lock_fail_counter = 0; diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc index c023f760f..f59b04fcf 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc @@ -174,7 +174,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking() int64_t acq_trk_diff_samples; float acq_trk_diff_seconds; acq_trk_diff_samples = static_cast(d_sample_counter) - static_cast(d_acq_sample_stamp); - std::cout << "acq_trk_diff_samples=" << acq_trk_diff_samples << std::endl; + std::cout << "acq_trk_diff_samples=" << acq_trk_diff_samples << '\n'; acq_trk_diff_seconds = static_cast(acq_trk_diff_samples) / static_cast(d_fs_in); // doppler effect // Fd=(C/(C+Vr))*F @@ -229,7 +229,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking() sys = sys_.substr(0, 1); // DEBUG OUTPUT - std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << '\n'; LOG(INFO) << "Tracking of GPS L1 C/A signal for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; // enable tracking @@ -448,7 +448,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { - std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; + std::cout << "Loss of lock in channel " << d_channel << "!\n"; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock d_carrier_lock_fail_counter = 0; diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator.cc b/src/algorithms/tracking/libs/fpga_multicorrelator.cc index c53141728..87e4e3b5a 100644 --- a/src/algorithms/tracking/libs/fpga_multicorrelator.cc +++ b/src/algorithms/tracking/libs/fpga_multicorrelator.cc @@ -178,8 +178,8 @@ void Fpga_Multicorrelator_8sc::Carrier_wipeoff_multicorrelator_resampler( nb = read(d_device_descriptor, &irq_count, sizeof(irq_count)); if (nb != sizeof(irq_count)) { - std::cout << "Tracking_module Read failed to retrieve 4 bytes!" << std::endl; - std::cout << "Tracking_module Interrupt number " << irq_count << std::endl; + std::cout << "Tracking_module Read failed to retrieve 4 bytes!\n"; + std::cout << "Tracking_module Interrupt number " << irq_count << '\n'; } // release secondary code indices, keep channel locked @@ -222,12 +222,12 @@ void Fpga_Multicorrelator_8sc::set_channel(uint32_t channel) mergedname.copy(device_io_name, mergedname.size() + 1); device_io_name[mergedname.size()] = '\0'; - std::cout << "trk device_io_name = " << device_io_name << std::endl; + std::cout << "trk device_io_name = " << device_io_name << '\n'; if ((d_device_descriptor = open(device_io_name, O_RDWR | O_SYNC)) == -1) { LOG(WARNING) << "Cannot open deviceio" << device_io_name; - std::cout << "Cannot open deviceio" << device_io_name << std::endl; + std::cout << "Cannot open deviceio" << device_io_name << '\n'; } d_map_base = reinterpret_cast(mmap(nullptr, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, d_device_descriptor, 0)); @@ -236,7 +236,7 @@ void Fpga_Multicorrelator_8sc::set_channel(uint32_t channel) { LOG(WARNING) << "Cannot map the FPGA tracking module " << d_channel << "into user memory"; - std::cout << "Cannot map deviceio" << device_io_name << std::endl; + std::cout << "Cannot map deviceio" << device_io_name << '\n'; } // sanity check: check test register @@ -246,7 +246,7 @@ void Fpga_Multicorrelator_8sc::set_channel(uint32_t channel) if (writeval != readval) { LOG(WARNING) << "Test register sanity check failed"; - std::cout << "Tracking test register sanity check failed" << std::endl; + std::cout << "Tracking test register sanity check failed\n"; } else { @@ -395,7 +395,7 @@ void Fpga_Multicorrelator_8sc::fpga_launch_multicorrelator_fpga() ssize_t nbytes = TEMP_FAILURE_RETRY(write(d_device_descriptor, reinterpret_cast(&reenable), sizeof(int32_t))); if (nbytes != sizeof(int32_t)) { - std::cerr << "Error launching the FPGA multicorrelator" << std::endl; + std::cerr << "Error launching the FPGA multicorrelator\n"; } // writing 1 to reg 14 launches the tracking d_map_base[start_flag_addr] = 1; @@ -436,7 +436,7 @@ void Fpga_Multicorrelator_8sc::close_device() auto *aux = const_cast(d_map_base); if (munmap(static_cast(aux), page_size) == -1) { - std::cout << "Failed to unmap memory uio" << std::endl; + std::cout << "Failed to unmap memory uio\n"; } close(d_device_descriptor); } diff --git a/src/algorithms/tracking/libs/tcp_communication.cc b/src/algorithms/tracking/libs/tcp_communication.cc index 07be9c5a0..5e36377f7 100644 --- a/src/algorithms/tracking/libs/tcp_communication.cc +++ b/src/algorithms/tracking/libs/tcp_communication.cc @@ -38,7 +38,7 @@ int Tcp_Communication::listen_tcp_connection(size_t d_port_, size_t d_port_ch0_) if (d_port_ == d_port_ch0_) { - std::cout << "Server ready. Listening for TCP connections..." << std::endl; + std::cout << "Server ready. Listening for TCP connections...\n"; } // Reuse the IP address for each connection @@ -48,12 +48,12 @@ int Tcp_Communication::listen_tcp_connection(size_t d_port_, size_t d_port_ch0_) acceptor.listen(12); acceptor.accept(tcp_socket_); - std::cout << "Socket accepted on port " << d_port_ << std::endl; + std::cout << "Socket accepted on port " << d_port_ << '\n'; } catch (const std::exception& e) { - std::cerr << "Exception: " << e.what() << std::endl; + std::cerr << "Exception: " << e.what() << '\n'; } return false; @@ -88,7 +88,7 @@ void Tcp_Communication::send_receive_tcp_packet_galileo_e1(boost::array> controlc; } } @@ -122,7 +122,7 @@ void Tcp_Communication::send_receive_tcp_packet_gps_l1_ca(boost::array> controlc; } } @@ -132,5 +132,5 @@ void Tcp_Communication::close_tcp_connection(size_t d_port_) { // Close the TCP connection tcp_socket_.close(); - std::cout << "Socket closed on port " << d_port_ << std::endl; + std::cout << "Socket closed on port " << d_port_ << '\n'; } diff --git a/src/core/libs/channel_status_msg_receiver.cc b/src/core/libs/channel_status_msg_receiver.cc index 63afb7172..339ec83b9 100644 --- a/src/core/libs/channel_status_msg_receiver.cc +++ b/src/core/libs/channel_status_msg_receiver.cc @@ -74,12 +74,12 @@ void channel_status_msg_receiver::msg_handler_events(const pmt::pmt_t& msg) d_channel_status_map.erase(gnss_synchro_obj->Channel_ID); } - // std::cout << "-------- " << std::endl << std::endl; + // std::cout << "-------- \n" << '\n'; // for (std::map>::iterator it = d_channel_status_map.begin(); it != d_channel_status_map.end(); ++it) // { - // std::cout << " Channel: " << it->first << " => Doppler: " << it->second->Carrier_Doppler_hz << "[Hz] " << std::endl; + // std::cout << " Channel: " << it->first << " => Doppler: " << it->second->Carrier_Doppler_hz << "[Hz] \n"; // } - // std::cout << "-------- " << std::endl << std::endl; + // std::cout << "-------- \n" << '\n'; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { @@ -88,9 +88,9 @@ void channel_status_msg_receiver::msg_handler_events(const pmt::pmt_t& msg) monitor_pvt_obj = boost::any_cast>(pmt::any_ref(msg)); d_pvt_status = *monitor_pvt_obj.get(); - // std::cout << "-------- " << std::endl << std::endl; - // std::cout << "PVT TOW: " << d_pvt_status->TOW_at_current_symbol_ms << std::endl; - // std::cout << "-------- " << std::endl << std::endl; + // std::cout << "-------- \n" << '\n'; + // std::cout << "PVT TOW: " << d_pvt_status->TOW_at_current_symbol_ms << '\n'; + // std::cout << "-------- \n" << '\n'; } else { diff --git a/src/core/libs/gnss_sdr_fpga_sample_counter.cc b/src/core/libs/gnss_sdr_fpga_sample_counter.cc index 509539b4a..019cf7a26 100644 --- a/src/core/libs/gnss_sdr_fpga_sample_counter.cc +++ b/src/core/libs/gnss_sdr_fpga_sample_counter.cc @@ -27,7 +27,7 @@ #include // for mp #include // for round #include // for O_RDWR, libraries used by the GIPO -#include // for operator<<, endl +#include // for operator<< #include // libraries used by the GIPO #include // for write, close, read, ssize_t @@ -136,7 +136,7 @@ void gnss_sdr_fpga_sample_counter::open_device() if ((fd = open(device_name.c_str(), O_RDWR | O_SYNC)) == -1) { LOG(WARNING) << "Cannot open deviceio" << device_name; - std::cout << "Counter-Intr: cannot open deviceio" << device_name << std::endl; + std::cout << "Counter-Intr: cannot open deviceio" << device_name << '\n'; } map_base = reinterpret_cast(mmap(nullptr, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)); @@ -144,7 +144,7 @@ void gnss_sdr_fpga_sample_counter::open_device() if (map_base == reinterpret_cast(-1)) { LOG(WARNING) << "Cannot map the FPGA acquisition module into user memory"; - std::cout << "Counter-Intr: cannot map deviceio" << device_name << std::endl; + std::cout << "Counter-Intr: cannot map deviceio" << device_name << '\n'; } // sanity check : check test register @@ -158,7 +158,7 @@ void gnss_sdr_fpga_sample_counter::open_device() else { LOG(INFO) << "Acquisition test register sanity check success!"; - // std::cout << "Acquisition test register sanity check success!" << std::endl; + // std::cout << "Acquisition test register sanity check success!\n"; } } @@ -170,7 +170,7 @@ void gnss_sdr_fpga_sample_counter::close_device() auto *aux = const_cast(map_base); if (munmap(static_cast(aux), page_size) == -1) { - std::cout << "Failed to unmap memory uio" << std::endl; + std::cout << "Failed to unmap memory uio\n"; } close(fd); } @@ -233,23 +233,23 @@ int gnss_sdr_fpga_sample_counter::general_work(int noutput_items __attribute__(( { day = " days "; } - std::cout << "Current receiver time: " << current_days << day << current_h << " h " << current_m << " min " << current_s << " s" << std::endl; + std::cout << "Current receiver time: " << current_days << day << current_h << " h " << current_m << " min " << current_s << " s\n"; } else { if (flag_h) { - std::cout << "Current receiver time: " << current_h << " h " << current_m << " min " << current_s << " s" << std::endl; + std::cout << "Current receiver time: " << current_h << " h " << current_m << " min " << current_s << " s\n"; } else { if (flag_m) { - std::cout << "Current receiver time: " << current_m << " min " << current_s << " s" << std::endl; + std::cout << "Current receiver time: " << current_m << " min " << current_s << " s\n"; } else { - std::cout << "Current receiver time: " << current_s << " s" << std::endl; + std::cout << "Current receiver time: " << current_s << " s\n"; } } } @@ -277,7 +277,7 @@ void gnss_sdr_fpga_sample_counter::wait_for_interrupt() nb = read(fd, &irq_count, sizeof(irq_count)); if (nb != sizeof(irq_count)) { - std::cout << "fpga sample counter module read failed to retrieve 4 bytes!" << std::endl; - std::cout << "fpga sample counter module interrupt number " << irq_count << std::endl; + std::cout << "fpga sample counter module read failed to retrieve 4 bytes!\n"; + std::cout << "fpga sample counter module interrupt number " << irq_count << '\n'; } } diff --git a/src/core/libs/gnss_sdr_sample_counter.cc b/src/core/libs/gnss_sdr_sample_counter.cc index d373d14ed..62d0f5cc1 100644 --- a/src/core/libs/gnss_sdr_sample_counter.cc +++ b/src/core/libs/gnss_sdr_sample_counter.cc @@ -104,23 +104,23 @@ int gnss_sdr_sample_counter::work(int noutput_items __attribute__((unused)), { day = " days "; } - std::cout << "Current receiver time: " << current_days << day << current_h << " h " << current_m << " min " << current_s << " s" << std::endl; + std::cout << "Current receiver time: " << current_days << day << current_h << " h " << current_m << " min " << current_s << " s\n"; } else { if (flag_h) { - std::cout << "Current receiver time: " << current_h << " h " << current_m << " min " << current_s << " s" << std::endl; + std::cout << "Current receiver time: " << current_h << " h " << current_m << " min " << current_s << " s\n"; } else { if (flag_m) { - std::cout << "Current receiver time: " << current_m << " min " << current_s << " s" << std::endl; + std::cout << "Current receiver time: " << current_m << " min " << current_s << " s\n"; } else { - std::cout << "Current receiver time: " << current_s << " s" << std::endl; + std::cout << "Current receiver time: " << current_s << " s\n"; } } } diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index 2cbd8a6db..4952e2fc8 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -888,7 +888,7 @@ bool Gnss_Sdr_Supl_Client::read_gal_almanac_from_gsa(const std::string& file_nam } catch (const std::exception& e) { - std::cerr << e.what() << std::endl; + std::cerr << e.what() << '\n'; } } if (this->gal_almanac_map.empty()) diff --git a/src/core/libs/gnss_sdr_time_counter.cc b/src/core/libs/gnss_sdr_time_counter.cc index bdc518616..58d3df8b2 100644 --- a/src/core/libs/gnss_sdr_time_counter.cc +++ b/src/core/libs/gnss_sdr_time_counter.cc @@ -87,23 +87,23 @@ int gnss_sdr_time_counter::general_work(int noutput_items __attribute__((unused) { day = " days "; } - std::cout << "Current receiver time: " << current_days << day << current_h << " h " << current_m << " min " << current_s << " s" << std::endl; + std::cout << "Current receiver time: " << current_days << day << current_h << " h " << current_m << " min " << current_s << " s\n"; } else { if (flag_h) { - std::cout << "Current receiver time: " << current_h << " h " << current_m << " min " << current_s << " s" << std::endl; + std::cout << "Current receiver time: " << current_h << " h " << current_m << " min " << current_s << " s\n"; } else { if (flag_m) { - std::cout << "Current receiver time: " << current_m << " min " << current_s << " s" << std::endl; + std::cout << "Current receiver time: " << current_m << " min " << current_s << " s\n"; } else { - std::cout << "Current receiver time: " << current_s << " s" << std::endl; + std::cout << "Current receiver time: " << current_s << " s\n"; } } } diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 2ddd366e5..ba9e7d3a9 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -61,7 +61,7 @@ #include // for milliseconds #include // for floor, fmod, log #include // for exception -#include // for operator<<, endl +#include // for operator<< #include // for numeric_limits #include // for map #include // for pthread_cancel @@ -114,7 +114,7 @@ void ControlThread::init() } catch (const boost::bad_lexical_cast &e) { - std::cout << "Caught bad lexical cast with error " << e.what() << std::endl; + std::cout << "Caught bad lexical cast with error " << e.what() << '\n'; } stop_ = false; processed_control_messages_ = 0; @@ -154,7 +154,7 @@ void ControlThread::init() } else { - std::cerr << "GNSS-SDR.AGNSS_ref_location=" << ref_location_str << " is not a valid position." << std::endl; + std::cerr << "GNSS-SDR.AGNSS_ref_location=" << ref_location_str << " is not a valid position.\n"; agnss_ref_location_.valid = false; } } @@ -180,12 +180,12 @@ void ControlThread::init() } else { - std::cerr << "GNSS-SDR.AGNSS_ref_utc_time=" << ref_time_str << " is not well-formed. Please use four digits for the year: DD/MM/YYYY HH:MM:SS" << std::endl; + std::cerr << "GNSS-SDR.AGNSS_ref_utc_time=" << ref_time_str << " is not well-formed. Please use four digits for the year: DD/MM/YYYY HH:MM:SS\n"; } } else { - std::cerr << "GNSS-SDR.AGNSS_ref_utc_time=" << ref_time_str << " is not well-formed. Should be DD/MM/YYYY HH:MM:SS in UTC" << std::endl; + std::cerr << "GNSS-SDR.AGNSS_ref_utc_time=" << ref_time_str << " is not well-formed. Should be DD/MM/YYYY HH:MM:SS in UTC\n"; agnss_ref_time_.valid = false; } } @@ -342,7 +342,7 @@ int ControlThread::run() // call the new sat dispatcher and receiver controller event_dispatcher(valid_event, msg); } - std::cout << "Stopping GNSS-SDR, please wait!" << std::endl; + std::cout << "Stopping GNSS-SDR, please wait!\n"; flowgraph_->stop(); stop_ = true; flowgraph_->disconnect(); @@ -432,7 +432,7 @@ bool ControlThread::read_assistance_from_XML() gps_almanac_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gps_almanac_xml", gps_almanac_default_xml_filename_); } - std::cout << "Trying to read GNSS ephemeris from XML file(s)..." << std::endl; + std::cout << "Trying to read GNSS ephemeris from XML file(s)...\n"; if (configuration_->property("Channels_1C.count", 0) > 0) { @@ -443,7 +443,7 @@ bool ControlThread::read_assistance_from_XML() gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend(); gps_eph_iter++) { - std::cout << "From XML file: Read NAV ephemeris for satellite " << Gnss_Satellite("GPS", gps_eph_iter->second.i_satellite_PRN) << std::endl; + std::cout << "From XML file: Read NAV ephemeris for satellite " << Gnss_Satellite("GPS", gps_eph_iter->second.i_satellite_PRN) << '\n'; std::shared_ptr tmp_obj = std::make_shared(gps_eph_iter->second); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } @@ -454,7 +454,7 @@ bool ControlThread::read_assistance_from_XML() { std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_utc); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); - std::cout << "From XML file: Read GPS UTC model parameters." << std::endl; + std::cout << "From XML file: Read GPS UTC model parameters.\n"; ret = true; } @@ -462,7 +462,7 @@ bool ControlThread::read_assistance_from_XML() { std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_iono); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); - std::cout << "From XML file: Read GPS ionosphere model parameters." << std::endl; + std::cout << "From XML file: Read GPS ionosphere model parameters.\n"; ret = true; } @@ -473,7 +473,7 @@ bool ControlThread::read_assistance_from_XML() gps_alm_iter != supl_client_ephemeris_.gps_almanac_map.cend(); gps_alm_iter++) { - std::cout << "From XML file: Read GPS almanac for satellite " << Gnss_Satellite("GPS", gps_alm_iter->second.i_satellite_PRN) << std::endl; + std::cout << "From XML file: Read GPS almanac for satellite " << Gnss_Satellite("GPS", gps_alm_iter->second.i_satellite_PRN) << '\n'; std::shared_ptr tmp_obj = std::make_shared(gps_alm_iter->second); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } @@ -490,7 +490,7 @@ bool ControlThread::read_assistance_from_XML() gal_eph_iter != supl_client_ephemeris_.gal_ephemeris_map.cend(); gal_eph_iter++) { - std::cout << "From XML file: Read ephemeris for satellite " << Gnss_Satellite("Galileo", gal_eph_iter->second.i_satellite_PRN) << std::endl; + std::cout << "From XML file: Read ephemeris for satellite " << Gnss_Satellite("Galileo", gal_eph_iter->second.i_satellite_PRN) << '\n'; std::shared_ptr tmp_obj = std::make_shared(gal_eph_iter->second); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } @@ -501,7 +501,7 @@ bool ControlThread::read_assistance_from_XML() { std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gal_iono); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); - std::cout << "From XML file: Read Galileo ionosphere model parameters." << std::endl; + std::cout << "From XML file: Read Galileo ionosphere model parameters.\n"; ret = true; } @@ -509,7 +509,7 @@ bool ControlThread::read_assistance_from_XML() { std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gal_utc); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); - std::cout << "From XML file: Read Galileo UTC model parameters." << std::endl; + std::cout << "From XML file: Read Galileo UTC model parameters.\n"; ret = true; } @@ -520,7 +520,7 @@ bool ControlThread::read_assistance_from_XML() gal_alm_iter != supl_client_ephemeris_.gal_almanac_map.cend(); gal_alm_iter++) { - std::cout << "From XML file: Read Galileo almanac for satellite " << Gnss_Satellite("Galileo", gal_alm_iter->second.i_satellite_PRN) << std::endl; + std::cout << "From XML file: Read Galileo almanac for satellite " << Gnss_Satellite("Galileo", gal_alm_iter->second.i_satellite_PRN) << '\n'; std::shared_ptr tmp_obj = std::make_shared(gal_alm_iter->second); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } @@ -537,7 +537,7 @@ bool ControlThread::read_assistance_from_XML() gps_cnav_eph_iter != supl_client_ephemeris_.gps_cnav_ephemeris_map.cend(); gps_cnav_eph_iter++) { - std::cout << "From XML file: Read CNAV ephemeris for satellite " << Gnss_Satellite("GPS", gps_cnav_eph_iter->second.i_satellite_PRN) << std::endl; + std::cout << "From XML file: Read CNAV ephemeris for satellite " << Gnss_Satellite("GPS", gps_cnav_eph_iter->second.i_satellite_PRN) << '\n'; std::shared_ptr tmp_obj = std::make_shared(gps_cnav_eph_iter->second); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } @@ -548,7 +548,7 @@ bool ControlThread::read_assistance_from_XML() { std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_cnav_utc); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); - std::cout << "From XML file: Read GPS CNAV UTC model parameters." << std::endl; + std::cout << "From XML file: Read GPS CNAV UTC model parameters.\n"; ret = true; } } @@ -562,7 +562,7 @@ bool ControlThread::read_assistance_from_XML() glo_gnav_eph_iter != supl_client_ephemeris_.glonass_gnav_ephemeris_map.cend(); glo_gnav_eph_iter++) { - std::cout << "From XML file: Read GLONASS GNAV ephemeris for satellite " << Gnss_Satellite("GLONASS", glo_gnav_eph_iter->second.i_satellite_PRN) << std::endl; + std::cout << "From XML file: Read GLONASS GNAV ephemeris for satellite " << Gnss_Satellite("GLONASS", glo_gnav_eph_iter->second.i_satellite_PRN) << '\n'; std::shared_ptr tmp_obj = std::make_shared(glo_gnav_eph_iter->second); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } @@ -573,15 +573,15 @@ bool ControlThread::read_assistance_from_XML() { std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.glo_gnav_utc); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); - std::cout << "From XML file: Read GLONASS UTC model parameters." << std::endl; + std::cout << "From XML file: Read GLONASS UTC model parameters.\n"; ret = true; } } if (ret == false) { - std::cout << "Error reading XML files" << std::endl; - std::cout << "Disabling GNSS assistance..." << std::endl; + std::cout << "Error reading XML files\n"; + std::cout << "Disabling GNSS assistance...\n"; } // Only look for {ref time, ref location} if SUPL is enabled @@ -625,7 +625,7 @@ void ControlThread::assist_GNSS() bool enable_agnss_xml = configuration_->property("GNSS-SDR.AGNSS_XML_enabled", false); if ((enable_gps_supl_assistance == true) and (enable_agnss_xml == false)) { - std::cout << "SUPL RRLP GPS assistance enabled!" << std::endl; + std::cout << "SUPL RRLP GPS assistance enabled!\n"; std::string default_acq_server = "supl.google.com"; std::string default_eph_server = "supl.google.com"; supl_client_ephemeris_.server_name = configuration_->property("GNSS-SDR.SUPL_gps_ephemeris_server", default_acq_server); @@ -674,8 +674,8 @@ void ControlThread::assist_GNSS() // Read assistance from file if (read_assistance_from_XML()) { - std::cout << "GNSS assistance data loaded from local XML file(s)." << std::endl; - std::cout << "No SUPL request has been performed." << std::endl; + std::cout << "GNSS assistance data loaded from local XML file(s).\n"; + std::cout << "No SUPL request has been performed.\n"; } } else @@ -683,7 +683,7 @@ void ControlThread::assist_GNSS() // Request ephemeris from SUPL server int error; supl_client_ephemeris_.request = 1; - std::cout << "SUPL: Try to read GPS ephemeris data from SUPL server..." << std::endl; + std::cout << "SUPL: Try to read GPS ephemeris data from SUPL server...\n"; error = supl_client_ephemeris_.get_assistance(supl_mcc_, supl_mns_, supl_lac_, supl_ci_); if (error == 0) { @@ -692,7 +692,7 @@ void ControlThread::assist_GNSS() gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend(); gps_eph_iter++) { - std::cout << "SUPL: Received ephemeris data for satellite " << Gnss_Satellite("GPS", gps_eph_iter->second.i_satellite_PRN) << std::endl; + std::cout << "SUPL: Received ephemeris data for satellite " << Gnss_Satellite("GPS", gps_eph_iter->second.i_satellite_PRN) << '\n'; std::shared_ptr tmp_obj = std::make_shared(gps_eph_iter->second); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } @@ -700,27 +700,27 @@ void ControlThread::assist_GNSS() std::string eph_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_ephemeris_xml", eph_default_xml_filename_); if (supl_client_ephemeris_.save_ephemeris_map_xml(eph_xml_filename, supl_client_ephemeris_.gps_ephemeris_map) == true) { - std::cout << "SUPL: XML ephemeris data file created" << std::endl; + std::cout << "SUPL: XML ephemeris data file created\n"; } else { - std::cout << "SUPL: Failed to create XML ephemeris data file" << std::endl; + std::cout << "SUPL: Failed to create XML ephemeris data file\n"; } } else { - std::cout << "ERROR: SUPL client request for ephemeris data returned " << error << std::endl; - std::cout << "Please check your network connectivity and SUPL server configuration" << std::endl; - std::cout << "Trying to read AGNSS data from local XML file(s)..." << std::endl; + std::cout << "ERROR: SUPL client request for ephemeris data returned " << error << '\n'; + std::cout << "Please check your network connectivity and SUPL server configuration\n"; + std::cout << "Trying to read AGNSS data from local XML file(s)...\n"; if (read_assistance_from_XML() == false) { - std::cout << "ERROR: Could not read XML files: Disabling SUPL assistance." << std::endl; + std::cout << "ERROR: Could not read XML files: Disabling SUPL assistance.\n"; } } // Request almanac, IONO and UTC Model data supl_client_ephemeris_.request = 0; - std::cout << "SUPL: Try to read Almanac, Iono, Utc Model, Ref Time and Ref Location data from SUPL server..." << std::endl; + std::cout << "SUPL: Try to read Almanac, Iono, Utc Model, Ref Time and Ref Location data from SUPL server...\n"; error = supl_client_ephemeris_.get_assistance(supl_mcc_, supl_mns_, supl_lac_, supl_ci_); if (error == 0) { @@ -729,20 +729,20 @@ void ControlThread::assist_GNSS() gps_alm_iter != supl_client_ephemeris_.gps_almanac_map.cend(); gps_alm_iter++) { - std::cout << "SUPL: Received almanac data for satellite " << Gnss_Satellite("GPS", gps_alm_iter->second.i_satellite_PRN) << std::endl; + std::cout << "SUPL: Received almanac data for satellite " << Gnss_Satellite("GPS", gps_alm_iter->second.i_satellite_PRN) << '\n'; std::shared_ptr tmp_obj = std::make_shared(gps_alm_iter->second); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } supl_client_ephemeris_.save_gps_almanac_xml("gps_almanac_map.xml", supl_client_ephemeris_.gps_almanac_map); if (supl_client_ephemeris_.gps_iono.valid == true) { - std::cout << "SUPL: Received GPS Ionosphere model parameters" << std::endl; + std::cout << "SUPL: Received GPS Ionosphere model parameters\n"; std::shared_ptr tmp_obj = std::make_shared(supl_client_ephemeris_.gps_iono); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } if (supl_client_ephemeris_.gps_utc.valid == true) { - std::cout << "SUPL: Received GPS UTC model parameters" << std::endl; + std::cout << "SUPL: Received GPS UTC model parameters\n"; std::shared_ptr tmp_obj = std::make_shared(supl_client_ephemeris_.gps_utc); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } @@ -750,31 +750,31 @@ void ControlThread::assist_GNSS() std::string iono_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_iono_xml", iono_default_xml_filename_); if (supl_client_ephemeris_.save_iono_xml(iono_xml_filename, supl_client_ephemeris_.gps_iono) == true) { - std::cout << "SUPL: Iono data file created" << std::endl; + std::cout << "SUPL: Iono data file created\n"; } else { - std::cout << "SUPL: Failed to create Iono data file" << std::endl; + std::cout << "SUPL: Failed to create Iono data file\n"; } std::string utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_utc_model_xml", utc_default_xml_filename_); if (supl_client_ephemeris_.save_utc_xml(utc_xml_filename, supl_client_ephemeris_.gps_utc) == true) { - std::cout << "SUPL: UTC model data file created" << std::endl; + std::cout << "SUPL: UTC model data file created\n"; } else { - std::cout << "SUPL: Failed to create UTC model data file" << std::endl; + std::cout << "SUPL: Failed to create UTC model data file\n"; } } else { - std::cout << "ERROR: SUPL client for almanac data returned " << error << std::endl; - std::cout << "Please check your network connectivity and SUPL server configuration" << std::endl; + std::cout << "ERROR: SUPL client for almanac data returned " << error << '\n'; + std::cout << "Please check your network connectivity and SUPL server configuration\n"; } // Request acquisition assistance supl_client_acquisition_.request = 2; - std::cout << "SUPL: Try to read acquisition assistance data from SUPL server..." << std::endl; + std::cout << "SUPL: Try to read acquisition assistance data from SUPL server...\n"; error = supl_client_acquisition_.get_assistance(supl_mcc_, supl_mns_, supl_lac_, supl_ci_); if (error == 0) { @@ -783,12 +783,12 @@ void ControlThread::assist_GNSS() gps_acq_iter != supl_client_acquisition_.gps_acq_map.cend(); gps_acq_iter++) { - std::cout << "SUPL: Received acquisition assistance data for satellite " << Gnss_Satellite("GPS", gps_acq_iter->second.i_satellite_PRN) << std::endl; + std::cout << "SUPL: Received acquisition assistance data for satellite " << Gnss_Satellite("GPS", gps_acq_iter->second.i_satellite_PRN) << '\n'; global_gps_acq_assist_map.write(gps_acq_iter->second.i_satellite_PRN, gps_acq_iter->second); } if (supl_client_acquisition_.gps_ref_loc.valid == true) { - std::cout << "SUPL: Received Ref Location data (Acquisition Assistance)" << std::endl; + std::cout << "SUPL: Received Ref Location data (Acquisition Assistance)\n"; agnss_ref_location_ = supl_client_acquisition_.gps_ref_loc; std::shared_ptr tmp_obj = std::make_shared(agnss_ref_location_); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); @@ -796,7 +796,7 @@ void ControlThread::assist_GNSS() } if (supl_client_acquisition_.gps_time.valid == true) { - std::cout << "SUPL: Received Ref Time data (Acquisition Assistance)" << std::endl; + std::cout << "SUPL: Received Ref Time data (Acquisition Assistance)\n"; agnss_ref_time_ = supl_client_acquisition_.gps_time; std::shared_ptr tmp_obj = std::make_shared(agnss_ref_time_); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); @@ -805,9 +805,9 @@ void ControlThread::assist_GNSS() } else { - std::cout << "ERROR: SUPL client for acquisition assistance returned " << error << std::endl; - std::cout << "Please check your network connectivity and SUPL server configuration" << std::endl; - std::cout << "Disabling SUPL acquisition assistance." << std::endl; + std::cout << "ERROR: SUPL client for acquisition assistance returned " << error << '\n'; + std::cout << "Please check your network connectivity and SUPL server configuration\n"; + std::cout << "Disabling SUPL acquisition assistance.\n"; } } } @@ -817,7 +817,7 @@ void ControlThread::assist_GNSS() // read assistance from file if (read_assistance_from_XML()) { - std::cout << "GNSS assistance data loaded from local XML file(s)." << std::endl; + std::cout << "GNSS assistance data loaded from local XML file(s).\n"; } } @@ -932,7 +932,7 @@ std::vector> ControlThread::get_visible_sats(time strftime(buf, sizeof(buf), "%d/%m/%Y %H:%M:%S ", &tstruct); std::string str_time = std::string(buf); std::cout << "Get visible satellites at " << str_time - << "UTC, assuming RX position " << LLH[0] << " [deg], " << LLH[1] << " [deg], " << LLH[2] << " [m]" << std::endl; + << "UTC, assuming RX position " << LLH[0] << " [deg], " << LLH[1] << " [deg], " << LLH[2] << " [m]\n"; std::map gps_eph_map = pvt_ptr->get_gps_ephemeris(); for (auto &it : gps_eph_map) @@ -952,7 +952,7 @@ std::vector> ControlThread::get_visible_sats(time // push sat if (El > 0) { - std::cout << "Using GPS Ephemeris: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + std::cout << "Using GPS Ephemeris: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << '\n'; available_satellites.emplace_back(floor(El), (Gnss_Satellite(std::string("GPS"), it.second.i_satellite_PRN))); visible_gps.push_back(it.second.i_satellite_PRN); @@ -977,7 +977,7 @@ std::vector> ControlThread::get_visible_sats(time // push sat if (El > 0) { - std::cout << "Using Galileo Ephemeris: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + std::cout << "Using Galileo Ephemeris: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << '\n'; available_satellites.emplace_back(floor(El), (Gnss_Satellite(std::string("Galileo"), it.second.i_satellite_PRN))); visible_gal.push_back(it.second.i_satellite_PRN); @@ -1007,7 +1007,7 @@ std::vector> ControlThread::get_visible_sats(time it2 = std::find(visible_gps.begin(), visible_gps.end(), it.second.i_satellite_PRN); if (it2 == visible_gps.end()) { - std::cout << "Using GPS Almanac: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + std::cout << "Using GPS Almanac: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << '\n'; available_satellites.emplace_back(floor(El), (Gnss_Satellite(std::string("GPS"), it.second.i_satellite_PRN))); } @@ -1037,7 +1037,7 @@ std::vector> ControlThread::get_visible_sats(time it2 = std::find(visible_gal.begin(), visible_gal.end(), it.second.i_satellite_PRN); if (it2 == visible_gal.end()) { - std::cout << "Using Galileo Almanac: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + std::cout << "Using Galileo Almanac: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << '\n'; available_satellites.emplace_back(floor(El), (Gnss_Satellite(std::string("Galileo"), it.second.i_satellite_PRN))); } @@ -1072,11 +1072,11 @@ void ControlThread::gps_acq_assist_data_collector() << gps_acq.i_satellite_PRN << " with Doppler " << gps_acq.d_Doppler0 - << " [Hz] " << std::endl; + << " [Hz]\n"; // insert new acq record to the global ephemeris map if (global_gps_acq_assist_map.read(gps_acq.i_satellite_PRN, gps_acq_old)) { - std::cout << "Acquisition assistance record updated" << std::endl; + std::cout << "Acquisition assistance record updated\n"; global_gps_acq_assist_map.write(gps_acq.i_satellite_PRN, gps_acq); } else @@ -1106,7 +1106,7 @@ void ControlThread::sysv_queue_listener() if ((msqid_ = msgget(key, 0644 | IPC_CREAT)) == -1) { - std::cerr << "GNSS-SDR cannot create SysV message queues" << std::endl; + std::cerr << "GNSS-SDR cannot create SysV message queues\n"; read_queue = false; } @@ -1117,7 +1117,7 @@ void ControlThread::sysv_queue_listener() received_message = msg.stop_message; if ((std::abs(received_message - (-200.0)) < 10 * std::numeric_limits::epsilon())) { - std::cout << "Quit order received, stopping GNSS-SDR !!" << std::endl; + std::cout << "Quit order received, stopping GNSS-SDR !!\n"; control_queue_->push(pmt::make_any(command_event_make(200, 0))); read_queue = false; } @@ -1135,7 +1135,7 @@ void ControlThread::keyboard_listener() std::cin.get(c); if (c == 'q') { - std::cout << "Quit keystroke order received, stopping GNSS-SDR !!" << std::endl; + std::cout << "Quit keystroke order received, stopping GNSS-SDR !!\n"; control_queue_->push(pmt::make_any(command_event_make(200, 0))); read_keys = false; } diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index e891c1e13..73ab37685 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -1223,7 +1223,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( catch (const std::exception& e) { - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "GNSS-SDR program ended.\n"; exit(1); } } @@ -1238,7 +1238,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( catch (const std::exception& e) { - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "GNSS-SDR program ended.\n"; exit(1); } } @@ -1254,7 +1254,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( catch (const std::exception& e) { - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "GNSS-SDR program ended.\n"; exit(1); } } @@ -1269,7 +1269,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } catch (const std::exception& e) { - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "GNSS-SDR program ended.\n"; exit(1); } } @@ -1283,7 +1283,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } catch (const std::exception& e) { - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "GNSS-SDR program ended.\n"; exit(1); } } @@ -1297,7 +1297,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } catch (const std::exception& e) { - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "GNSS-SDR program ended.\n"; exit(1); } } @@ -1311,7 +1311,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } catch (const std::exception& e) { - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "GNSS-SDR program ended.\n"; exit(1); } } @@ -1325,7 +1325,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } catch (const std::exception& e) { - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "GNSS-SDR program ended.\n"; exit(1); } } @@ -1339,7 +1339,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( } catch (const std::exception& e) { - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "GNSS-SDR program ended.\n"; exit(1); } } @@ -1354,7 +1354,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( catch (const std::exception& e) { - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "GNSS-SDR program ended.\n"; exit(1); } } diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 543bda840..f3943fd3d 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -228,10 +228,10 @@ void GNSSFlowgraph::connect() if (sig_source_.at(i)->implementation() == "Raw_Array_Signal_Source") { // Multichannel Array - std::cout << "ARRAY MODE" << std::endl; + std::cout << "ARRAY MODE\n"; for (int j = 0; j < GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_CHANNELS; j++) { - std::cout << "connecting ch " << j << std::endl; + std::cout << "connecting ch " << j << '\n'; top_block_->connect(sig_source_.at(i)->get_right_block(), j, sig_conditioner_.at(i)->get_left_block(), j); } } @@ -298,7 +298,7 @@ void GNSSFlowgraph::connect() if (fs == 0.0) { LOG(WARNING) << "Set GNSS-SDR.internal_fs_sps in configuration file"; - std::cout << "Set GNSS-SDR.internal_fs_sps in configuration file" << std::endl; + std::cout << "Set GNSS-SDR.internal_fs_sps in configuration file\n"; throw(std::invalid_argument("Set GNSS-SDR.internal_fs_sps in configuration")); } int observable_interval_ms = static_cast(configuration_->property("GNSS-SDR.observable_interval_ms", 20)); @@ -323,7 +323,7 @@ void GNSSFlowgraph::connect() if (fs == 0.0) { LOG(WARNING) << "Set GNSS-SDR.internal_fs_sps in configuration file"; - std::cout << "Set GNSS-SDR.internal_fs_sps in configuration file" << std::endl; + std::cout << "Set GNSS-SDR.internal_fs_sps in configuration file\n"; throw(std::invalid_argument("Set GNSS-SDR.internal_fs_sps in configuration")); } int observable_interval_ms = static_cast(configuration_->property("GNSS-SDR.observable_interval_ms", 20)); @@ -347,7 +347,7 @@ void GNSSFlowgraph::connect() if (fs == 0.0) { LOG(WARNING) << "Set GNSS-SDR.internal_fs_sps in configuration file"; - std::cout << "Set GNSS-SDR.internal_fs_sps in configuration file" << std::endl; + std::cout << "Set GNSS-SDR.internal_fs_sps in configuration file\n"; throw(std::invalid_argument("Set GNSS-SDR.internal_fs_sps in configuration")); } @@ -555,7 +555,7 @@ void GNSSFlowgraph::connect() null_sinks_.push_back(gr::blocks::null_sink::make(sizeof(gr_complex))); top_block_->connect(sig_conditioner_.at(n)->get_right_block(), 0, null_sinks_.back(), 0); - LOG(INFO) << "Null sink connected to signal conditioner " << n << " due to lack of connection to any channel" << std::endl; + LOG(INFO) << "Null sink connected to signal conditioner " << n << " due to lack of connection to any channel\n"; } } } @@ -1507,13 +1507,13 @@ void GNSSFlowgraph::init() { for (int i = 0; i < sources_count_; i++) { - std::cout << "Creating source " << i << std::endl; + std::cout << "Creating source " << i << '\n'; sig_source_.push_back(block_factory->GetSignalSource(configuration_.get(), queue_.get(), i)); // TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. // Include GetRFChannels in the interface to avoid read config parameters here // read the number of RF channels for each front-end RF_Channels = configuration_->property(sig_source_.at(i)->role() + ".RF_channels", 1); - std::cout << "RF Channels " << RF_Channels << std::endl; + std::cout << "RF Channels " << RF_Channels << '\n'; for (int j = 0; j < RF_Channels; j++) { sig_conditioner_.push_back(block_factory->GetSignalConditioner(configuration_.get(), signal_conditioner_ID)); @@ -1551,8 +1551,8 @@ void GNSSFlowgraph::init() if ((obs_implementation == "GPS_L1_CA_Observables") || (obs_implementation == "GPS_L2C_Observables") || (obs_implementation == "Galileo_E1B_Observables") || (obs_implementation == "Galileo_E5A_Observables")) { - std::cout << "WARNING: Implementation '" << obs_implementation << "' of the Observables block has been replaced by 'Hybrid_Observables'." << std::endl; - std::cout << "Please update your configuration file." << std::endl; + std::cout << "WARNING: Implementation '" << obs_implementation << "' of the Observables block has been replaced by 'Hybrid_Observables'.\n"; + std::cout << "Please update your configuration file.\n"; } pvt_ = block_factory->GetPVT(configuration_.get()); @@ -1560,8 +1560,8 @@ void GNSSFlowgraph::init() std::string pvt_implementation = configuration_->property("PVT.implementation", default_str); if ((pvt_implementation == "GPS_L1_CA_PVT") || (pvt_implementation == "Galileo_E1_PVT") || (pvt_implementation == "Hybrid_PVT")) { - std::cout << "WARNING: Implementation '" << pvt_implementation << "' of the PVT block has been replaced by 'RTKLIB_PVT'." << std::endl; - std::cout << "Please update your configuration file." << std::endl; + std::cout << "WARNING: Implementation '" << pvt_implementation << "' of the PVT block has been replaced by 'RTKLIB_PVT'.\n"; + std::cout << "Please update your configuration file.\n"; } auto channels = block_factory->GetChannels(configuration_.get(), queue_.get()); diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index c15034cd8..d481ba0d3 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -154,16 +154,16 @@ std::string TcpCmdInterface::status(const std::vector &commandLine tstruct = *gmtime(&UTC_time); strftime(buf1.data(), buf1.size(), "%d/%m/%Y %H:%M:%S", &tstruct); std::string str_time = std::string(buf1.data()); - str_stream << "- Receiver UTC Time: " << str_time << std::endl; + str_stream << "- Receiver UTC Time: " << str_time << '\n'; str_stream << std::setprecision(9); str_stream << "- Receiver Position WGS84 [Lat, Long, H]: " << latitude_deg << ", " << longitude_deg << ", "; str_stream << std::setprecision(3); - str_stream << height_m << std::endl; + str_stream << height_m << '\n'; str_stream << std::setprecision(1); - str_stream << "- Receiver Speed over Ground [km/h]: " << ground_speed_kmh << std::endl; - str_stream << "- Receiver Course over ground [deg]: " << course_over_ground_deg << std::endl; + str_stream << "- Receiver Speed over Ground [km/h]: " << ground_speed_kmh << '\n'; + str_stream << "- Receiver Course over ground [deg]: " << course_over_ground_deg << '\n'; } else { @@ -319,13 +319,13 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) { try { - std::cout << "TcpCmdInterface: Telecommand TCP interface listening on port " << tcp_port << std::endl; + std::cout << "TcpCmdInterface: Telecommand TCP interface listening on port " << tcp_port << '\n'; boost::asio::ip::tcp::socket socket(context); acceptor.accept(socket, not_throw); if (not_throw) { - std::cout << "TcpCmdInterface: Error when binding the port in the socket" << std::endl; + std::cout << "TcpCmdInterface: Error when binding the port in the socket\n"; continue; } @@ -376,7 +376,7 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) socket.write_some(boost::asio::buffer(response), not_throw); if (not_throw) { - std::cout << "Error sending(" << not_throw.value() << "): " << not_throw.message() << std::endl; + std::cout << "Error sending(" << not_throw.value() << "): " << not_throw.message() << '\n'; break; } } @@ -388,7 +388,7 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) } else { - std::cout << "TcpCmdInterface unexpected error: " << error << std::endl; + std::cout << "TcpCmdInterface unexpected error: " << error << '\n'; } // Close socket @@ -396,16 +396,16 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) } catch (const boost::exception &e) { - std::cout << "TcpCmdInterface: Boost exception " << std::endl; + std::cout << "TcpCmdInterface: Boost exception\n"; } catch (const std::exception &ex) { - std::cout << "TcpCmdInterface: Exception " << ex.what() << std::endl; + std::cout << "TcpCmdInterface: Exception " << ex.what() << '\n'; } } } catch (const boost::exception &e) { - std::cout << "TCP Command Interface exception: address already in use" << std::endl; + std::cout << "TCP Command Interface exception: address already in use\n"; } } diff --git a/src/core/system_parameters/beidou_dnav_navigation_message.cc b/src/core/system_parameters/beidou_dnav_navigation_message.cc index c1663bb94..e3c0b50cc 100644 --- a/src/core/system_parameters/beidou_dnav_navigation_message.cc +++ b/src/core/system_parameters/beidou_dnav_navigation_message.cc @@ -22,7 +22,7 @@ #include "beidou_dnav_navigation_message.h" #include "gnss_satellite.h" #include // for cos, sin, fmod, sqrt, atan2, fabs, floor -#include // for string, operator<<, cout, ostream, endl +#include // for string, operator<<, cout, ostream #include // for std::numeric_limits @@ -43,9 +43,7 @@ Beidou_Dnav_Navigation_Message::Beidou_Dnav_Navigation_Message() void Beidou_Dnav_Navigation_Message::print_beidou_word_bytes(uint32_t BEIDOU_word) const { - std::cout << " Word ="; - std::cout << std::bitset<32>(BEIDOU_word); - std::cout << std::endl; + std::cout << " Word =" << std::bitset<32>(BEIDOU_word) << '\n'; } diff --git a/src/core/system_parameters/glonass_gnav_navigation_message.cc b/src/core/system_parameters/glonass_gnav_navigation_message.cc index eb10d43aa..6dbcaedeb 100644 --- a/src/core/system_parameters/glonass_gnav_navigation_message.cc +++ b/src/core/system_parameters/glonass_gnav_navigation_message.cc @@ -651,7 +651,7 @@ bool Glonass_Gnav_Navigation_Message::have_new_ephemeris() // Check if we have flag_all_ephemeris = true; // Update the time of ephemeris information d_previous_tb = gnav_ephemeris.d_t_b; - DLOG(INFO) << "GLONASS GNAV Ephemeris (1, 2, 3, 4) have been received and belong to the same batch" << std::endl; + DLOG(INFO) << "GLONASS GNAV Ephemeris (1, 2, 3, 4) have been received and belong to the same batch"; new_eph = true; } } diff --git a/src/core/system_parameters/gps_cnav_navigation_message.cc b/src/core/system_parameters/gps_cnav_navigation_message.cc index 17c77ba99..1e63821b2 100644 --- a/src/core/system_parameters/gps_cnav_navigation_message.cc +++ b/src/core/system_parameters/gps_cnav_navigation_message.cc @@ -296,7 +296,7 @@ bool Gps_CNAV_Navigation_Message::have_new_ephemeris() // Check if we have a ne if (ephemeris_record.d_Toe1 == ephemeris_record.d_Toe2) // and ephemeris_record.d_Toe1==ephemeris_record.d_Toc) { // if all ephemeris pages have the same TOE, then they belong to the same block - // std::cout << "Ephemeris (1, 2) have been received and belong to the same batch" << std::endl; + // std::cout << "Ephemeris (1, 2) have been received and belong to the same batch\n"; b_flag_ephemeris_1 = false; // clear the flag b_flag_ephemeris_2 = false; // clear the flag return true; diff --git a/src/core/system_parameters/gps_navigation_message.cc b/src/core/system_parameters/gps_navigation_message.cc index fd884cb73..4bde9386a 100644 --- a/src/core/system_parameters/gps_navigation_message.cc +++ b/src/core/system_parameters/gps_navigation_message.cc @@ -24,7 +24,7 @@ #include "gnss_satellite.h" #include // for fmod, abs, floor #include // for memcpy -#include // for operator<<, cout, endl +#include // for operator<<, cout #include // for std::numeric_limits @@ -45,7 +45,7 @@ Gps_Navigation_Message::Gps_Navigation_Message() void Gps_Navigation_Message::print_gps_word_bytes(uint32_t GPS_word) const { - std::cout << " Word =" << std::bitset<32>(GPS_word) << std::endl; + std::cout << " Word =" << std::bitset<32>(GPS_word) << '\n'; } diff --git a/src/main/main.cc b/src/main/main.cc index cb9595b7a..e3a7af728 100644 --- a/src/main/main.cc +++ b/src/main/main.cc @@ -40,7 +40,7 @@ #include // for FLAGS_log_dir #include // for time_point #include // for exception -#include // for operator<<, endl +#include // for operator<< #include // for unique_ptr #include // for string @@ -89,7 +89,7 @@ int main(int argc, char** argv) google::SetUsageMessage(intro_help); google::SetVersionString(gnss_sdr_version); google::ParseCommandLineFlags(&argc, &argv, true); - std::cout << "Initializing GNSS-SDR v" << gnss_sdr_version << " ... Please wait." << std::endl; + std::cout << "Initializing GNSS-SDR v" << gnss_sdr_version << " ... Please wait.\n"; #if CUDA_GPU_ACCEL // Reset the device @@ -99,7 +99,7 @@ int main(int argc, char** argv) // profiled. Calling cudaDeviceReset causes all profile data to be // flushed before the application exits cudaDeviceReset(); - std::cout << "Reset CUDA device done " << std::endl; + std::cout << "Reset CUDA device done.\n"; #endif if (GOOGLE_STRIP_LOG == 0) @@ -109,9 +109,8 @@ int main(int argc, char** argv) { std::cout << "Logging will be written at " << fs::temp_directory_path() - << std::endl - << "Use gnss-sdr --log_dir=/path/to/log to change that." - << std::endl; + << '\n' + << "Use gnss-sdr --log_dir=/path/to/log to change that.\n"; } else { @@ -120,17 +119,16 @@ int main(int argc, char** argv) { std::cout << "The path " << FLAGS_log_dir - << " does not exist, attempting to create it." - << std::endl; + << " does not exist, attempting to create it.\n"; errorlib::error_code ec; if (!fs::create_directory(p, ec)) { - std::cerr << "Could not create the " << FLAGS_log_dir << " folder. GNSS-SDR program ended." << std::endl; + std::cerr << "Could not create the " << FLAGS_log_dir << " folder. GNSS-SDR program ended.\n"; google::ShutDownCommandLineFlags(); return 1; } } - std::cout << "Logging will be written at " << FLAGS_log_dir << std::endl; + std::cout << "Logging will be written at " << FLAGS_log_dir << '\n'; } } @@ -147,9 +145,9 @@ int main(int argc, char** argv) } catch (const boost::thread_resource_error& e) { - std::cerr << "Failed to create boost thread." << std::endl; + std::cerr << "Failed to create boost thread.\n"; google::ShutDownCommandLineFlags(); - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "GNSS-SDR program ended.\n"; return 1; } catch (const boost::exception& e) @@ -157,14 +155,14 @@ int main(int argc, char** argv) if (GOOGLE_STRIP_LOG == 0) { LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e); - std::cerr << boost::diagnostic_information(e) << std::endl; + std::cerr << boost::diagnostic_information(e) << '\n'; } else { - std::cerr << "Boost exception: " << boost::diagnostic_information(e) << std::endl; + std::cerr << "Boost exception: " << boost::diagnostic_information(e) << '\n'; } google::ShutDownCommandLineFlags(); - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "GNSS-SDR program ended.\n"; return 1; } catch (const std::exception& ex) @@ -172,14 +170,14 @@ int main(int argc, char** argv) if (GOOGLE_STRIP_LOG == 0) { LOG(WARNING) << "C++ Standard Library exception: " << ex.what(); - std::cerr << ex.what() << std::endl; + std::cerr << ex.what() << '\n'; } else { - std::cerr << "C++ Standard Library exception: " << ex.what() << std::endl; + std::cerr << "C++ Standard Library exception: " << ex.what() << '\n'; } google::ShutDownCommandLineFlags(); - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "GNSS-SDR program ended.\n"; return 1; } catch (...) @@ -187,14 +185,14 @@ int main(int argc, char** argv) if (GOOGLE_STRIP_LOG == 0) { LOG(WARNING) << "Unexpected catch. This should not happen."; - std::cerr << "Unexpected error." << std::endl; + std::cerr << "Unexpected error.\n"; } else { - std::cerr << "Unexpected catch. This should not happen." << std::endl; + std::cerr << "Unexpected catch. This should not happen.\n"; } google::ShutDownCommandLineFlags(); - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "GNSS-SDR program ended.\n"; return 1; } @@ -204,9 +202,9 @@ int main(int argc, char** argv) std::cout << "Total GNSS-SDR run time: " << elapsed_seconds.count() - << " [seconds]" << std::endl; + << " [seconds]\n"; google::ShutDownCommandLineFlags(); - std::cout << "GNSS-SDR program ended." << std::endl; + std::cout << "GNSS-SDR program ended.\n"; return return_code; } diff --git a/src/tests/common-files/gnuplot_i.h b/src/tests/common-files/gnuplot_i.h index 881ae935c..958306581 100644 --- a/src/tests/common-files/gnuplot_i.h +++ b/src/tests/common-files/gnuplot_i.h @@ -794,7 +794,7 @@ Gnuplot &Gnuplot::plot_x(const X &x, const std::string &title) // for (unsigned int i = 0; i < x.size(); i++) { - tmp << x[i] << std::endl; + tmp << x[i] << '\n'; } tmp.flush(); @@ -837,7 +837,7 @@ Gnuplot &Gnuplot::plot_xy(const X &x, const Y &y, const std::string &title, cons // for (unsigned int i = 0; i < x.size(); i++) { - tmp << x[i] << " " << y[i] << std::endl; + tmp << x[i] << " " << y[i] << '\n'; } tmp.flush(); @@ -883,7 +883,7 @@ Gnuplot &Gnuplot::plot_xy_err(const X &x, // for (unsigned int i = 0; i < x.size(); i++) { - tmp << x[i] << " " << y[i] << " " << dy[i] << std::endl; + tmp << x[i] << " " << y[i] << " " << dy[i] << '\n'; } tmp.flush(); @@ -925,7 +925,7 @@ Gnuplot &Gnuplot::plot_grid3d(const X &x, { for (unsigned int k = 0; k < y.size(); k++) { - tmp << static_cast(x.at(i)) << " " << static_cast(y.at(k)) << " " << mag.at(i).at(k) << std::endl; + tmp << static_cast(x.at(i)) << " " << static_cast(y.at(k)) << " " << mag.at(i).at(k) << '\n'; } tmp.flush(); } @@ -993,7 +993,7 @@ Gnuplot &Gnuplot::plot_xyz(const X &x, // for (unsigned int i = 0; i < x.size(); i++) { - tmp << x[i] << " " << y[i] << " " << z[i] << std::endl; + tmp << x[i] << " " << y[i] << " " << z[i] << '\n'; } tmp.flush(); @@ -1106,7 +1106,7 @@ Gnuplot::~Gnuplot() { #endif // throw GnuplotException("Problem closing communication to gnuplot"); - std::cout << "Gnuplot window left open." << std::endl; + std::cout << "Gnuplot window left open.\n"; } } @@ -1862,7 +1862,7 @@ inline Gnuplot &Gnuplot::plot_image(const unsigned char *ucPicBuf, for (unsigned int iColumn = 0; iColumn < iWidth; iColumn++) { tmp << iColumn << " " << iRow << " " - << static_cast(ucPicBuf[iIndex++]) << std::endl; + << static_cast(ucPicBuf[iIndex++]) << '\n'; } } @@ -2188,7 +2188,7 @@ inline std::string Gnuplot::create_tmpfile(std::ofstream &tmp) { std::ostringstream except; except << "Maximum number of temporary files reached (" - << GP_MAX_TMP_FILES << "): cannot open more files" << std::endl; + << GP_MAX_TMP_FILES << "): cannot open more files\n"; throw GnuplotException(except.str()); } @@ -2250,7 +2250,7 @@ inline void Gnuplot::remove_tmpfiles() { if (remove(i.c_str()) != 0) { - std::cout << "Problem closing files" << std::endl; + std::cout << "Problem closing files\n"; } } diff --git a/src/tests/system-tests/libs/rtklib_solver_dump_reader.cc b/src/tests/system-tests/libs/rtklib_solver_dump_reader.cc index a8c8e254c..345176485 100644 --- a/src/tests/system-tests/libs/rtklib_solver_dump_reader.cc +++ b/src/tests/system-tests/libs/rtklib_solver_dump_reader.cc @@ -103,7 +103,7 @@ bool Rtklib_Solver_Dump_Reader::open_obs_file(std::string out_file) } catch (const std::ifstream::failure &e) { - std::cout << "Problem opening rtklib_solver dump Log file: " << d_dump_filename << std::endl; + std::cout << "Problem opening rtklib_solver dump Log file: " << d_dump_filename << '\n'; return false; } } diff --git a/src/tests/system-tests/libs/spirent_motion_csv_dump_reader.cc b/src/tests/system-tests/libs/spirent_motion_csv_dump_reader.cc index 8ab8a96e7..54816679f 100644 --- a/src/tests/system-tests/libs/spirent_motion_csv_dump_reader.cc +++ b/src/tests/system-tests/libs/spirent_motion_csv_dump_reader.cc @@ -226,7 +226,7 @@ bool Spirent_Motion_Csv_Dump_Reader::open_obs_file(std::string out_file) } catch (const std::ifstream::failure &e) { - std::cout << "Problem opening Spirent CSV dump Log file: " << d_dump_filename << std::endl; + std::cout << "Problem opening Spirent CSV dump Log file: " << d_dump_filename << '\n'; return false; } } diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index 5cc882a2f..e894258e0 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -108,7 +108,7 @@ int PositionSystemTest::configure_generator() p2 = std::string("-static_position=") + FLAGS_static_position + std::string(",") + std::to_string(std::min(FLAGS_duration * 10, 3000)); if (FLAGS_duration > 300) { - std::cout << "WARNING: Duration has been set to its maximum value of 300 s" << std::endl; + std::cout << "WARNING: Duration has been set to its maximum value of 300 s\n"; } } else @@ -145,7 +145,7 @@ int PositionSystemTest::generate_signal() else if (pid == 0) { execv(&generator_binary[0], parmList); - std::cout << "Return not expected. Must be an execv error. Does " << generator_binary << " exist?" << std::endl; + std::cout << "Return not expected. Must be an execv error. Does " << generator_binary << " exist?\n"; std::terminate(); } @@ -373,7 +373,7 @@ int PositionSystemTest::run_receiver() fp = popen(&argum2[0], "r"); if (fp == nullptr) { - std::cout << "Failed to run command: " << argum2 << std::endl; + std::cout << "Failed to run command: " << argum2 << '\n'; return -1; } while (fgets(buffer.data(), buffer.size(), fp) != nullptr) @@ -396,7 +396,7 @@ bool PositionSystemTest::save_mat_xy(std::vector* x, std::vector mat_t* matfp; matvar_t* matvar; filename.append(".mat"); - std::cout << "save_mat_xy write " << filename << std::endl; + std::cout << "save_mat_xy write " << filename << '\n'; matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT5); if (reinterpret_cast(matfp) != nullptr) { @@ -411,14 +411,14 @@ bool PositionSystemTest::save_mat_xy(std::vector* x, std::vector } else { - std::cout << "save_mat_xy: error creating file" << std::endl; + std::cout << "save_mat_xy: error creating file\n"; } Mat_Close(matfp); return true; } catch (const std::exception& ex) { - std::cout << "save_mat_xy: " << ex.what() << std::endl; + std::cout << "save_mat_xy: " << ex.what() << '\n'; return false; } } @@ -432,7 +432,7 @@ bool PositionSystemTest::save_mat_x(std::vector* x, std::string filename mat_t* matfp; matvar_t* matvar; filename.append(".mat"); - std::cout << "save_mat_x write " << filename << std::endl; + std::cout << "save_mat_x write " << filename << '\n'; matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT5); if (reinterpret_cast(matfp) != nullptr) { @@ -443,14 +443,14 @@ bool PositionSystemTest::save_mat_x(std::vector* x, std::string filename } else { - std::cout << "save_mat_x: error creating file" << std::endl; + std::cout << "save_mat_x: error creating file\n"; } Mat_Close(matfp); return true; } catch (const std::exception& ex) { - std::cout << "save_mat_x: " << ex.what() << std::endl; + std::cout << "save_mat_x: " << ex.what() << '\n'; return false; } } @@ -513,9 +513,9 @@ void PositionSystemTest::check_results() R_eb_enu.insert_cols(current_epoch, tmp_r_enu); // debug check - // std::cout << "t1: " << pvt_reader.RX_time << std::endl; - // std::cout << "t2: " << pvt_reader.TOW_at_current_symbol_ms << std::endl; - // std::cout << "offset: " << pvt_reader.clk_offset_s << std::endl; + // std::cout << "t1: " << pvt_reader.RX_time << '\n'; + // std::cout << "t2: " << pvt_reader.TOW_at_current_symbol_ms << '\n'; + // std::cout << "offset: " << pvt_reader.clk_offset_s << '\n'; // getchar(); current_epoch++; } @@ -565,32 +565,32 @@ void PositionSystemTest::check_results() std::ofstream position_test_file; if (!FLAGS_config_file_ptest.empty()) { - stm << "Configuration file: " << FLAGS_config_file_ptest << std::endl; + stm << "Configuration file: " << FLAGS_config_file_ptest << '\n'; } - stm << "---- STATIC ACCURACY ----" << std::endl; - stm << "2DRMS = " << 2 * sqrt(sigma_E_2_accuracy + sigma_N_2_accuracy) << " [m]" << std::endl; - stm << "DRMS = " << sqrt(sigma_E_2_accuracy + sigma_N_2_accuracy) << " [m]" << std::endl; - stm << "CEP = " << 0.62 * sqrt(sigma_N_2_accuracy) + 0.56 * sqrt(sigma_E_2_accuracy) << " [m]" << std::endl; - stm << "99% SAS = " << 1.122 * (sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]" << std::endl; - stm << "90% SAS = " << 0.833 * (sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]" << std::endl; - stm << "MRSE = " << sqrt(sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]" << std::endl; - stm << "SEP = " << 0.51 * (sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]" << std::endl; - stm << "Static Bias 2D = " << static_2D_error_m << " [m]" << std::endl; - stm << "Static Bias 3D = " << static_3D_error_m << " [m]" << std::endl; - stm << std::endl; + stm << "---- STATIC ACCURACY ----\n"; + stm << "2DRMS = " << 2 * sqrt(sigma_E_2_accuracy + sigma_N_2_accuracy) << " [m]\n"; + stm << "DRMS = " << sqrt(sigma_E_2_accuracy + sigma_N_2_accuracy) << " [m]\n"; + stm << "CEP = " << 0.62 * sqrt(sigma_N_2_accuracy) + 0.56 * sqrt(sigma_E_2_accuracy) << " [m]\n"; + stm << "99% SAS = " << 1.122 * (sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]\n"; + stm << "90% SAS = " << 0.833 * (sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]\n"; + stm << "MRSE = " << sqrt(sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]\n"; + stm << "SEP = " << 0.51 * (sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]\n"; + stm << "Static Bias 2D = " << static_2D_error_m << " [m]\n"; + stm << "Static Bias 3D = " << static_3D_error_m << " [m]\n"; + stm << '\n'; - stm << "---- STATIC PRECISION ----" << std::endl; - stm << "2DRMS = " << 2 * sqrt(sigma_E_2_precision + sigma_N_2_precision) << " [m]" << std::endl; - stm << "DRMS = " << sqrt(sigma_E_2_precision + sigma_N_2_precision) << " [m]" << std::endl; - stm << "CEP = " << 0.62 * sqrt(sigma_N_2_precision) + 0.56 * sqrt(sigma_E_2_precision) << " [m]" << std::endl; - stm << "99% SAS = " << 1.122 * (sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision) << " [m]" << std::endl; - stm << "90% SAS = " << 0.833 * (sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision) << " [m]" << std::endl; - stm << "MRSE = " << sqrt(sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision) << " [m]" << std::endl; - stm << "SEP = " << 0.51 * (sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision) << " [m]" << std::endl; - stm << std::endl; + stm << "---- STATIC PRECISION ----\n"; + stm << "2DRMS = " << 2 * sqrt(sigma_E_2_precision + sigma_N_2_precision) << " [m]\n"; + stm << "DRMS = " << sqrt(sigma_E_2_precision + sigma_N_2_precision) << " [m]\n"; + stm << "CEP = " << 0.62 * sqrt(sigma_N_2_precision) + 0.56 * sqrt(sigma_E_2_precision) << " [m]\n"; + stm << "99% SAS = " << 1.122 * (sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision) << " [m]\n"; + stm << "90% SAS = " << 0.833 * (sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision) << " [m]\n"; + stm << "MRSE = " << sqrt(sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision) << " [m]\n"; + stm << "SEP = " << 0.51 * (sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision) << " [m]\n"; + stm << '\n'; - stm << "Receiver runtime: " << elapsed_seconds.count() << " [seconds]" << std::endl; + stm << "Receiver runtime: " << elapsed_seconds.count() << " [seconds]\n"; std::cout << stm.rdbuf(); std::string output_filename = "position_test_output_" + PositionSystemTest::generated_kml_file.erase(PositionSystemTest::generated_kml_file.length() - 3, 3) + "txt"; @@ -688,10 +688,10 @@ void PositionSystemTest::check_results() double min_error_V_eb_e = arma::min(error_module_V_eb_e); // report - std::cout << "----- Position and Velocity 3D ECEF error statistics -----" << std::endl; + std::cout << "----- Position and Velocity 3D ECEF error statistics -----\n"; if (!FLAGS_config_file_ptest.empty()) { - std::cout << "---- Configuration file: " << FLAGS_config_file_ptest << std::endl; + std::cout << "---- Configuration file: " << FLAGS_config_file_ptest << '\n'; } std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << "---- 3D ECEF Position RMSE = " @@ -699,13 +699,13 @@ void PositionSystemTest::check_results() << ", stdev = " << sqrt(error_var_R_eb_e) << " (max,min) = " << max_error_R_eb_e << "," << min_error_R_eb_e - << " [m]" << std::endl; + << " [m]\n"; std::cout << "---- 3D ECEF Velocity RMSE = " << rmse_V_eb_e << ", mean = " << error_mean_V_eb_e << ", stdev = " << sqrt(error_var_V_eb_e) << " (max,min) = " << max_error_V_eb_e << "," << min_error_V_eb_e - << " [m/s]" << std::endl; + << " [m/s]\n"; std::cout.precision(ss); // plots @@ -823,9 +823,9 @@ void PositionSystemTest::print_results(const arma::mat& R_eb_enu) const std::string gnuplot_executable(FLAGS_gnuplot_executable); if (gnuplot_executable.empty()) { - std::cout << "WARNING: Although the flag plot_position_test has been set to TRUE," << std::endl; - std::cout << "gnuplot has not been found in your system." << std::endl; - std::cout << "Test results will not be plotted." << std::endl; + std::cout << "WARNING: Although the flag plot_position_test has been set to TRUE,\n"; + std::cout << "gnuplot has not been found in your system.\n"; + std::cout << "Test results will not be plotted.\n"; } else { @@ -940,7 +940,7 @@ void PositionSystemTest::print_results(const arma::mat& R_eb_enu) } catch (const GnuplotException& ge) { - std::cout << ge.what() << std::endl; + std::cout << ge.what() << '\n'; } } } @@ -978,7 +978,7 @@ TEST_F(PositionSystemTest /*unused*/, Position_system_test /*unused*/) int main(int argc, char** argv) { - std::cout << "Running Position precision test..." << std::endl; + std::cout << "Running Position precision test...\n"; int res = 0; try { diff --git a/src/tests/system-tests/ttff.cc b/src/tests/system-tests/ttff.cc index 4962aeba0..fbfc5a464 100644 --- a/src/tests/system-tests/ttff.cc +++ b/src/tests/system-tests/ttff.cc @@ -351,53 +351,53 @@ void TtffTest::print_TTFF_report(const std::vector &ttff_v, const std::s std::stringstream stm; - stm << "---------------------------" << std::endl; - stm << " Time-To-First-Fix Report" << std::endl; - stm << "---------------------------" << std::endl; + stm << "---------------------------\n"; + stm << " Time-To-First-Fix Report\n"; + stm << "---------------------------\n"; stm << "Initial receiver status: "; if (read_ephemeris) { - stm << "Hot start." << std::endl; + stm << "Hot start.\n"; } else { - stm << "Cold start." << std::endl; + stm << "Cold start.\n"; } stm << "A-GNSS: "; if (agnss && read_ephemeris) { - stm << "Enabled." << std::endl; + stm << "Enabled.\n"; } else { - stm << "Disabled." << std::endl; + stm << "Disabled.\n"; } stm << "Valid measurements (" << ttff.size() << "/" << FLAGS_num_measurements << "): "; for (double ttff_ : ttff) { stm << ttff_ << " "; } - stm << std::endl; - stm << "TTFF mean: " << mean << " [s]" << std::endl; + stm << '\n'; + stm << "TTFF mean: " << mean << " [s]\n"; if (!ttff.empty()) { - stm << "TTFF max: " << *max_ttff << " [s]" << std::endl; - stm << "TTFF min: " << *min_ttff << " [s]" << std::endl; + stm << "TTFF max: " << *max_ttff << " [s]\n"; + stm << "TTFF min: " << *min_ttff << " [s]\n"; } - stm << "TTFF stdev: " << stdev << " [s]" << std::endl; - stm << "Operating System: " << std::string(HOST_SYSTEM) << std::endl; + stm << "TTFF stdev: " << stdev << " [s]\n"; + stm << "Operating System: " << std::string(HOST_SYSTEM) << '\n'; stm << "Navigation mode: " - << "3D" << std::endl; + << "3D\n"; if (source != "UHD_Signal_Source") { - stm << "Source: File" << std::endl; + stm << "Source: File\n"; } else { - stm << "Source: Live" << std::endl; + stm << "Source: Live\n"; } - stm << "---------------------------" << std::endl; + stm << "---------------------------\n"; std::cout << stm.rdbuf(); if (ttff_report_file.is_open()) @@ -437,7 +437,7 @@ TEST_F(TtffTest /*unused*/, ColdStart /*unused*/) } // record startup time - std::cout << "Starting measurement " << num_measurements + 1 << " / " << FLAGS_num_measurements << std::endl; + std::cout << "Starting measurement " << num_measurements + 1 << " / " << FLAGS_num_measurements << '\n'; std::chrono::time_point start; std::chrono::time_point end; start = std::chrono::system_clock::now(); @@ -464,7 +464,7 @@ TEST_F(TtffTest /*unused*/, ColdStart /*unused*/) EXPECT_FALSE(flowgraph->running()); num_measurements = num_measurements + 1; - std::cout << "Just finished measurement " << num_measurements << ", which took " << ttff << " seconds." << std::endl; + std::cout << "Just finished measurement " << num_measurements << ", which took " << ttff << " seconds.\n"; if (n < FLAGS_num_measurements - 1) { std::random_device r; @@ -472,9 +472,9 @@ TEST_F(TtffTest /*unused*/, ColdStart /*unused*/) std::uniform_real_distribution uniform_dist(0, 1); float random_variable_0_1 = uniform_dist(e1); int random_delay_s = static_cast(random_variable_0_1 * 25.0); - std::cout << "Waiting a random amount of time (from 5 to 30 s) to start a new measurement... " << std::endl; - std::cout << "This time will wait " << random_delay_s + 5 << " s." << std::endl - << std::endl; + std::cout << "Waiting a random amount of time (from 5 to 30 s) to start a new measurement... \n"; + std::cout << "This time will wait " << random_delay_s + 5 << " s.\n" + << '\n'; std::this_thread::sleep_until(std::chrono::system_clock::now() + std::chrono::seconds(5) + std::chrono::seconds(random_delay_s)); } } @@ -521,7 +521,7 @@ TEST_F(TtffTest /*unused*/, HotStart /*unused*/) control_thread = std::make_shared(config2); } // record startup time - std::cout << "Starting measurement " << num_measurements + 1 << " / " << FLAGS_num_measurements << std::endl; + std::cout << "Starting measurement " << num_measurements + 1 << " / " << FLAGS_num_measurements << '\n'; std::chrono::time_point start; std::chrono::time_point end; start = std::chrono::system_clock::now(); @@ -549,7 +549,7 @@ TEST_F(TtffTest /*unused*/, HotStart /*unused*/) EXPECT_FALSE(flowgraph->running()); num_measurements = num_measurements + 1; - std::cout << "Just finished measurement " << num_measurements << ", which took " << ttff << " seconds." << std::endl; + std::cout << "Just finished measurement " << num_measurements << ", which took " << ttff << " seconds.\n"; if (n < FLAGS_num_measurements - 1) { std::random_device r; @@ -557,9 +557,9 @@ TEST_F(TtffTest /*unused*/, HotStart /*unused*/) std::uniform_real_distribution uniform_dist(0, 1); float random_variable_0_1 = uniform_dist(e1); int random_delay_s = static_cast(random_variable_0_1 * 25.0); - std::cout << "Waiting a random amount of time (from 5 to 30 s) to start new measurement... " << std::endl; - std::cout << "This time will wait " << random_delay_s + 5 << " s." << std::endl - << std::endl; + std::cout << "Waiting a random amount of time (from 5 to 30 s) to start new measurement... \n"; + std::cout << "This time will wait " << random_delay_s + 5 << " s.\n" + << '\n'; std::this_thread::sleep_until(std::chrono::system_clock::now() + std::chrono::seconds(5) + std::chrono::seconds(random_delay_s)); } } @@ -578,7 +578,7 @@ TEST_F(TtffTest /*unused*/, HotStart /*unused*/) int main(int argc, char **argv) { - std::cout << "Running Time-To-First-Fix test..." << std::endl; + std::cout << "Running Time-To-First-Fix test...\n"; int res = 0; TTFF_v.clear(); try @@ -612,7 +612,7 @@ int main(int argc, char **argv) int msgflg = IPC_CREAT | 0666; if ((sysv_msqid = msgget(sysv_msg_key, msgflg)) == -1) { - std::cout << "GNSS-SDR can not create message queues!" << std::endl; + std::cout << "GNSS-SDR can not create message queues!\n"; return 1; } ttff_msgbuf msg; diff --git a/src/tests/test_main.cc b/src/tests/test_main.cc index 00639b3db..bbb5c37a0 100644 --- a/src/tests/test_main.cc +++ b/src/tests/test_main.cc @@ -153,7 +153,7 @@ Concurrent_Map global_gps_acq_assist_map; int main(int argc, char **argv) { - std::cout << "Running GNSS-SDR Tests..." << std::endl; + std::cout << "Running GNSS-SDR Tests...\n"; int res = 0; try { diff --git a/src/tests/unit-tests/arithmetic/code_generation_test.cc b/src/tests/unit-tests/arithmetic/code_generation_test.cc index 850e97a69..f86056f67 100644 --- a/src/tests/unit-tests/arithmetic/code_generation_test.cc +++ b/src/tests/unit-tests/arithmetic/code_generation_test.cc @@ -45,7 +45,7 @@ TEST(CodeGenerationTest, CodeGenGPSL1Test) std::chrono::duration elapsed_seconds = end - start; ASSERT_LE(0, elapsed_seconds.count()); - std::cout << "Generation completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Generation completed in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -73,7 +73,7 @@ TEST(CodeGenerationTest, CodeGenGPSL1SampledTest) std::chrono::duration elapsed_seconds = end - start; ASSERT_LE(0, elapsed_seconds.count()); - std::cout << "Generation completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Generation completed in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -100,5 +100,5 @@ TEST(CodeGenerationTest, ComplexConjugateTest) std::chrono::duration elapsed_seconds = end - start; ASSERT_LE(0, elapsed_seconds.count()); - std::cout << "Generation completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Generation completed in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } diff --git a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc index f9edb0751..d940b4d08 100644 --- a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc +++ b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc @@ -51,7 +51,7 @@ TEST(ComplexCarrierTest, StandardComplexImplementation) std::chrono::duration elapsed_seconds = end - start; std::cout << "A " << FLAGS_size_carrier_test << "-length complex carrier in standard C++ (dynamic allocation) generated in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; std::complex expected(1, 0); std::vector> mag(FLAGS_size_carrier_test); @@ -90,7 +90,7 @@ TEST(ComplexCarrierTest, C11ComplexImplementation) std::chrono::duration elapsed_seconds = end - start; std::cout << "A " << FLAGS_size_carrier_test << "-length complex carrier in standard C++ (declaration) generated in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; ASSERT_LE(0, elapsed_seconds.count() * 1e6); std::complex expected(1, 0); std::vector> mag(FLAGS_size_carrier_test); @@ -117,7 +117,7 @@ TEST(ComplexCarrierTest, OwnComplexImplementation) std::chrono::duration elapsed_seconds = end - start; std::cout << "A " << FLAGS_size_carrier_test << "-length complex carrier using fixed point generated in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; std::complex expected(1, 0); std::vector> mag(FLAGS_size_carrier_test); diff --git a/src/tests/unit-tests/arithmetic/conjugate_test.cc b/src/tests/unit-tests/arithmetic/conjugate_test.cc index 0e7b34990..b523b6d26 100644 --- a/src/tests/unit-tests/arithmetic/conjugate_test.cc +++ b/src/tests/unit-tests/arithmetic/conjugate_test.cc @@ -47,7 +47,7 @@ TEST(ConjugateTest, StandardCComplexImplementation) std::chrono::duration elapsed_seconds = end - start; std::cout << "Conjugate of a " << FLAGS_size_conjugate_test << "-length complex float vector in standard C finished in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; delete[] input; delete[] output; @@ -70,7 +70,7 @@ TEST(ConjugateTest, C11ComplexImplementation) std::chrono::duration elapsed_seconds = end - start; std::cout << "Conjugate of a " << FLAGS_size_conjugate_test << " complex vector (C++11-style) finished in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; ASSERT_LE(0, elapsed_seconds.count() * 1e6); std::complex expected(0, 0); @@ -97,7 +97,7 @@ TEST(ConjugateTest, ArmadilloComplexImplementation) std::chrono::duration elapsed_seconds = end - start; std::cout << "Conjugate of a " << FLAGS_size_conjugate_test << "-length complex float Armadillo vector finished in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; ASSERT_LE(0, elapsed_seconds.count() * 1e6); } @@ -117,7 +117,7 @@ TEST(ConjugateTest, VolkComplexImplementation) std::chrono::duration elapsed_seconds = end - start; std::cout << "Conjugate of a " << FLAGS_size_conjugate_test << "-length complex float vector using VOLK finished in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; ASSERT_LE(0, elapsed_seconds.count() * 1e6); volk_gnsssdr_free(input); volk_gnsssdr_free(output); @@ -138,6 +138,6 @@ TEST(ConjugateTest, VolkComplexImplementationAlloc) std::chrono::duration elapsed_seconds = end - start; std::cout << "Conjugate of a " << FLAGS_size_conjugate_test << "-length complex float vector using VOLK ALLOC finished in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; ASSERT_LE(0, elapsed_seconds.count() * 1e6); } diff --git a/src/tests/unit-tests/arithmetic/fft_length_test.cc b/src/tests/unit-tests/arithmetic/fft_length_test.cc index 24e616ed4..3e0094e0e 100644 --- a/src/tests/unit-tests/arithmetic/fft_length_test.cc +++ b/src/tests/unit-tests/arithmetic/fft_length_test.cc @@ -87,7 +87,7 @@ TEST(FFTLengthTest, MeasureExecutionTime) std::chrono::duration elapsed_seconds = end - start; double exec_time = elapsed_seconds.count() / static_cast(FLAGS_fft_iterations_test); execution_times.push_back(exec_time * 1e3); - std::cout << "FFT execution time for length=" << d_fft_size << " : " << exec_time << " [s]" << std::endl; + std::cout << "FFT execution time for length=" << d_fft_size << " : " << exec_time << " [s]\n"; if ((d_fft_size & (d_fft_size - 1)) == 0) // if it is a power of two { @@ -101,9 +101,9 @@ TEST(FFTLengthTest, MeasureExecutionTime) const std::string gnuplot_executable(FLAGS_gnuplot_executable); if (gnuplot_executable.empty()) { - std::cout << "WARNING: Although the flag plot_fft_length_test has been set to TRUE," << std::endl; - std::cout << "gnuplot has not been found in your system." << std::endl; - std::cout << "Test results will not be plotted." << std::endl; + std::cout << "WARNING: Although the flag plot_fft_length_test has been set to TRUE,\n"; + std::cout << "gnuplot has not been found in your system.\n"; + std::cout << "Test results will not be plotted.\n"; } else { @@ -157,7 +157,7 @@ TEST(FFTLengthTest, MeasureExecutionTime) } catch (const GnuplotException& ge) { - std::cout << ge.what() << std::endl; + std::cout << ge.what() << '\n'; } } } diff --git a/src/tests/unit-tests/arithmetic/fft_speed_test.cc b/src/tests/unit-tests/arithmetic/fft_speed_test.cc index e919da746..0e374c98e 100644 --- a/src/tests/unit-tests/arithmetic/fft_speed_test.cc +++ b/src/tests/unit-tests/arithmetic/fft_speed_test.cc @@ -53,7 +53,7 @@ TEST(FFTSpeedTest, ArmadilloVSGNURadioExecutionTime) end = std::chrono::system_clock::now(); elapsed_seconds = end - start; d_execution_time = elapsed_seconds.count() / static_cast(FLAGS_fft_speed_iterations_test); - std::cout << "GNU Radio FFT execution time for length = " << d_fft_size << " : " << d_execution_time * 1e6 << " [us]" << std::endl; + std::cout << "GNU Radio FFT execution time for length = " << d_fft_size << " : " << d_execution_time * 1e6 << " [us]\n"; start = std::chrono::system_clock::now(); for (int k = 0; k < FLAGS_fft_speed_iterations_test; k++) @@ -63,6 +63,6 @@ TEST(FFTSpeedTest, ArmadilloVSGNURadioExecutionTime) end = std::chrono::system_clock::now(); elapsed_seconds = end - start; d_execution_time = elapsed_seconds.count() / static_cast(FLAGS_fft_speed_iterations_test); - std::cout << "Armadillo FFT execution time for length = " << d_fft_size << " : " << d_execution_time * 1e6 << " [us]" << std::endl; + std::cout << "Armadillo FFT execution time for length = " << d_fft_size << " : " << d_execution_time * 1e6 << " [us]\n"; }); } diff --git a/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc b/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc index d61f839f3..0043a9326 100644 --- a/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc +++ b/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc @@ -51,7 +51,7 @@ TEST(MagnitudeSquaredTest, StandardCComplexImplementation) std::chrono::duration elapsed_seconds = end - start; std::cout << "The squared magnitude of a " << FLAGS_size_magnitude_test << "-length complex vector in standard C computed in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; delete[] input; delete[] output; ASSERT_LE(0, elapsed_seconds.count() * 1e6); @@ -75,7 +75,7 @@ TEST(MagnitudeSquaredTest, C11ComplexImplementation) std::chrono::duration elapsed_seconds = end - start; std::cout << "The squared magnitude of a " << FLAGS_size_magnitude_test << " complex vector (C++11-style) finished in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; ASSERT_LE(0, elapsed_seconds.count() * 1e6); std::complex expected(0, 0); @@ -101,7 +101,7 @@ TEST(MagnitudeSquaredTest, ArmadilloComplexImplementation) std::chrono::duration elapsed_seconds = end - start; std::cout << "The squared magnitude of a " << FLAGS_size_magnitude_test << "-length vector using Armadillo computed in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; ASSERT_LE(0, elapsed_seconds.count() * 1e6); } @@ -120,7 +120,7 @@ TEST(MagnitudeSquaredTest, VolkComplexImplementation) std::chrono::duration elapsed_seconds = end - start; std::cout << "The squared magnitude of a " << FLAGS_size_magnitude_test << "-length vector using VOLK computed in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; volk_gnsssdr_free(input); volk_gnsssdr_free(output); ASSERT_LE(0, elapsed_seconds.count() * 1e6); @@ -142,7 +142,7 @@ TEST(MagnitudeSquaredTest, VolkComplexImplementationAlloc) std::chrono::duration elapsed_seconds = end - start; std::cout << "The squared magnitude of a " << FLAGS_size_magnitude_test << "-length vector using VOLK ALLOC computed in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; ASSERT_LE(0, elapsed_seconds.count() * 1e6); } diff --git a/src/tests/unit-tests/arithmetic/multiply_test.cc b/src/tests/unit-tests/arithmetic/multiply_test.cc index 21142bea1..0363e50c2 100644 --- a/src/tests/unit-tests/arithmetic/multiply_test.cc +++ b/src/tests/unit-tests/arithmetic/multiply_test.cc @@ -47,7 +47,7 @@ TEST(MultiplyTest, StandardCDoubleImplementation) std::chrono::duration elapsed_seconds = end - start; std::cout << "Element-wise multiplication of " << FLAGS_size_multiply_test << " doubles in standard C finished in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; double acc = 0.0; double expected = 0.0; @@ -76,7 +76,7 @@ TEST(MultiplyTest, ArmadilloImplementation) std::chrono::duration elapsed_seconds = end - start; std::cout << "Element-wise multiplication of " << FLAGS_size_multiply_test << "-length double Armadillo vectors finished in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; ASSERT_LE(0, elapsed_seconds.count() * 1e6); ASSERT_EQ(0, arma::norm(output, 2)); } @@ -99,7 +99,7 @@ TEST(MultiplyTest, StandardCComplexImplementation) std::chrono::duration elapsed_seconds = end - start; std::cout << "Element-wise multiplication of " << FLAGS_size_multiply_test << " complex in standard C finished in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; std::complex expected(0.0, 0.0); std::complex result(0.0, 0.0); @@ -132,7 +132,7 @@ TEST(MultiplyTest, C11ComplexImplementation) std::chrono::duration elapsed_seconds = end - start; std::cout << "Element-wise multiplication of " << FLAGS_size_multiply_test << " complex vector (C++11-style) finished in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; ASSERT_LE(0, elapsed_seconds.count() * 1e6); std::complex expected(0.0, 0.0); @@ -155,7 +155,7 @@ TEST(MultiplyTest, ArmadilloComplexImplementation) std::chrono::duration elapsed_seconds = end - start; std::cout << "Element-wise multiplication of " << FLAGS_size_multiply_test << "-length complex float Armadillo vectors finished in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; ASSERT_LE(0, elapsed_seconds.count() * 1e6); ASSERT_EQ(0, arma::norm(output, 2)); } @@ -176,7 +176,7 @@ TEST(MultiplyTest, VolkComplexImplementation) std::chrono::duration elapsed_seconds = end - start; std::cout << "Element-wise multiplication of " << FLAGS_size_multiply_test << "-length complex float vector using VOLK finished in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; ASSERT_LE(0, elapsed_seconds.count() * 1e6); auto* mag = static_cast(volk_gnsssdr_malloc(FLAGS_size_multiply_test * sizeof(float), volk_gnsssdr_get_alignment())); @@ -209,7 +209,7 @@ TEST(MultiplyTest, VolkComplexImplementationAlloc) std::chrono::duration elapsed_seconds = end - start; std::cout << "Element-wise multiplication of " << FLAGS_size_multiply_test << "-length complex float vector using VOLK ALLOC finished in " << elapsed_seconds.count() * 1e6 - << " microseconds" << std::endl; + << " microseconds\n"; ASSERT_LE(0, elapsed_seconds.count() * 1e6); volk_gnsssdr::vector mag(FLAGS_size_multiply_test); volk_32fc_magnitude_32f(mag.data(), output.data(), FLAGS_size_multiply_test); diff --git a/src/tests/unit-tests/arithmetic/preamble_correlator_test.cc b/src/tests/unit-tests/arithmetic/preamble_correlator_test.cc index 0163650ce..128ee3702 100644 --- a/src/tests/unit-tests/arithmetic/preamble_correlator_test.cc +++ b/src/tests/unit-tests/arithmetic/preamble_correlator_test.cc @@ -111,7 +111,7 @@ TEST(PreambleCorrelationTest, TestMethods) EXPECT_EQ(corr_value, corr_value3); EXPECT_EQ(sum_corr1, sum_corr3); - std::cout << "Correlation computed with 'C for' : done in " << elapsed_seconds.count() * 1.0e9 / n_iter << " nanoseconds" << std::endl; - std::cout << "Correlation computed with accumulate : done in " << elapsed_seconds2.count() * 1.0e9 / n_iter << " nanoseconds" << std::endl; - std::cout << "Correlation computed with inner_product : done in " << elapsed_seconds3.count() * 1.0e9 / n_iter << " nanoseconds" << std::endl; + std::cout << "Correlation computed with 'C for' : done in " << elapsed_seconds.count() * 1.0e9 / n_iter << " nanoseconds\n"; + std::cout << "Correlation computed with accumulate : done in " << elapsed_seconds2.count() * 1.0e9 / n_iter << " nanoseconds\n"; + std::cout << "Correlation computed with inner_product : done in " << elapsed_seconds3.count() * 1.0e9 / n_iter << " nanoseconds\n"; } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc index a89ac0ff1..549e9e479 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc @@ -485,7 +485,7 @@ int AcquisitionPerformanceTest::generate_signal() { pid_t wait_result; int child_status; - std::cout << "Generating signal for " << p6 << "..." << std::endl; + std::cout << "Generating signal for " << p6 << "...\n"; char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], &p6[0], nullptr}; int pid; @@ -496,7 +496,7 @@ int AcquisitionPerformanceTest::generate_signal() else if (pid == 0) { execv(&generator_binary[0], parmList); - std::cout << "Return not expected. Must be an execv error." << std::endl; + std::cout << "Return not expected. Must be an execv error.\n"; std::terminate(); } @@ -684,7 +684,7 @@ int AcquisitionPerformanceTest::count_executions(const std::string& basename, un int num_executions = 1; if (fp == nullptr) { - std::cout << "Failed to run command: " << argum2 << std::endl; + std::cout << "Failed to run command: " << argum2 << '\n'; return 0; } while (fgets(buffer, sizeof(buffer), fp) != nullptr) @@ -705,9 +705,9 @@ void AcquisitionPerformanceTest::plot_results() const std::string gnuplot_executable(FLAGS_gnuplot_executable); if (gnuplot_executable.empty()) { - std::cout << "WARNING: Although the flag plot_gps_l1_tracking_test has been set to TRUE," << std::endl; - std::cout << "gnuplot has not been found in your system." << std::endl; - std::cout << "Test results will not be plotted." << std::endl; + std::cout << "WARNING: Although the flag plot_gps_l1_tracking_test has been set to TRUE,\n"; + std::cout << "gnuplot has not been found in your system.\n"; + std::cout << "Test results will not be plotted.\n"; } else { @@ -792,7 +792,7 @@ void AcquisitionPerformanceTest::plot_results() } catch (const GnuplotException& ge) { - std::cout << ge.what() << std::endl; + std::cout << ge.what() << '\n'; } } } @@ -819,7 +819,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) if (FLAGS_acq_test_input_file.empty()) { - std::cout << "Execution for CN0 = " << it << " dB-Hz" << std::endl; + std::cout << "Execution for CN0 = " << it << " dB-Hz\n"; } // Do N_iterations of the experiment @@ -827,11 +827,11 @@ TEST_F(AcquisitionPerformanceTest, ROC) { if (FLAGS_acq_test_pfa_init > 0.0) { - std::cout << "Setting threshold for Pfa = " << pfa_vector[pfa_iter] << std::endl; + std::cout << "Setting threshold for Pfa = " << pfa_vector[pfa_iter] << '\n'; } else { - std::cout << "Setting threshold to " << pfa_vector[pfa_iter] << std::endl; + std::cout << "Setting threshold to " << pfa_vector[pfa_iter] << '\n'; } // Configure the signal generator @@ -879,7 +879,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) double coh_time_ms = config->property("Acquisition.coherent_integration_time_ms", 1); - std::cout << "Num executions: " << num_executions << std::endl; + std::cout << "Num executions: " << num_executions << '\n'; unsigned int fft_size = 0; unsigned int d_consumed_samples = coh_time_ms * config->property("GNSS-SDR.internal_fs_sps", 0) * 0.001; // * (config->property("Acquisition.bit_transition_flag", false) ? 2 : 1); @@ -904,7 +904,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) acq_dump.read_binary_acq(); if (acq_dump.positive_acq) { - // std::cout << "Meas acq_delay_samples: " << acq_dump.acq_delay_samples << " chips: " << acq_dump.acq_delay_samples / (baseband_sampling_freq * GPS_L1_CA_CODE_PERIOD_S / GPS_L1_CA_CODE_LENGTH_CHIPS) << std::endl; + // std::cout << "Meas acq_delay_samples: " << acq_dump.acq_delay_samples << " chips: " << acq_dump.acq_delay_samples / (baseband_sampling_freq * GPS_L1_CA_CODE_PERIOD_S / GPS_L1_CA_CODE_LENGTH_CHIPS) << '\n'; meas_timestamp_s(execution - 1) = acq_dump.sample_counter / baseband_sampling_freq; meas_doppler(execution - 1) = acq_dump.acq_doppler_hz; meas_acq_delay_chips(execution - 1) = acq_dump.acq_delay_samples / (baseband_sampling_freq * GPS_L1_CA_CODE_PERIOD_S / GPS_L1_CA_CODE_LENGTH_CHIPS); @@ -912,7 +912,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) } else { - // std::cout << "Failed acquisition." << std::endl; + // std::cout << "Failed acquisition.\n"; meas_timestamp_s(execution - 1) = arma::datum::inf; meas_doppler(execution - 1) = arma::datum::inf; meas_acq_delay_chips(execution - 1) = arma::datum::inf; @@ -945,7 +945,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) true_prn_delay_chips(epoch_counter) = GPS_L1_CA_CODE_LENGTH_CHIPS - true_trk_data.prn_delay_chips; true_tow_s(epoch_counter) = true_trk_data.tow; epoch_counter++; - // std::cout << "True PRN_Delay chips = " << GPS_L1_CA_CODE_LENGTH_CHIPS - true_trk_data.prn_delay_chips << " at " << true_trk_data.signal_timestamp_s << std::endl; + // std::cout << "True PRN_Delay chips = " << GPS_L1_CA_CODE_LENGTH_CHIPS - true_trk_data.prn_delay_chips << " at " << true_trk_data.signal_timestamp_s << '\n'; } // Process results @@ -988,7 +988,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) { std::cout << doppler_estimation_error(i) << " "; } - std::cout << std::endl; + std::cout << '\n'; std::cout << "Delay estimation error [chips]: "; for (int i = 0; i < num_executions - 1; i++) @@ -996,7 +996,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) std::cout << delay_estimation_error(i) << " "; } - std::cout << std::endl; */ + std::cout << '\n'; */ } if (k == 0) { @@ -1011,7 +1011,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) meas_Pd_.push_back(0.0); } std::cout << TEXT_BOLD_BLACK << "Probability of detection for channel=" << ch << ", CN0=" << it << " dBHz" - << ": " << (num_executions > 0 ? computed_Pd : 0.0) << TEXT_RESET << std::endl; + << ": " << (num_executions > 0 ? computed_Pd : 0.0) << TEXT_RESET << '\n'; } if (num_clean_executions > 0) { @@ -1028,11 +1028,11 @@ TEST_F(AcquisitionPerformanceTest, ROC) double computed_Pd_correct = correctly_detected / static_cast(num_clean_executions); meas_Pd_correct_.push_back(computed_Pd_correct); std::cout << TEXT_BOLD_BLACK << "Probability of correct detection for channel=" << ch << ", CN0=" << it << " dBHz" - << ": " << computed_Pd_correct << TEXT_RESET << std::endl; + << ": " << computed_Pd_correct << TEXT_RESET << '\n'; } else { - // std::cout << "No reference data has been found. Maybe a non-present satellite?" << num_executions << std::endl; + // std::cout << "No reference data has been found. Maybe a non-present satellite?" << num_executions << '\n'; if (k == 1) { double wrongly_detected = arma::accu(positive_acq); @@ -1046,7 +1046,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) meas_Pfa_.push_back(0.0); } std::cout << TEXT_BOLD_BLACK << "Probability of false alarm for channel=" << ch << ", CN0=" << it << " dBHz" - << ": " << (num_executions > 0 ? computed_Pfa : 0.0) << TEXT_RESET << std::endl; + << ": " << (num_executions > 0 ? computed_Pfa : 0.0) << TEXT_RESET << '\n'; } } true_trk_data.restart(); @@ -1099,25 +1099,25 @@ TEST_F(AcquisitionPerformanceTest, ROC) unsigned int aux_index = 0; for (double it : cn0_vector) { - std::cout << "Results for CN0 = " << it << " dBHz:" << std::endl; + std::cout << "Results for CN0 = " << it << " dBHz:\n"; std::cout << "Pd = "; for (int pfa_iter = 0; pfa_iter < num_thresholds; pfa_iter++) { std::cout << Pd[aux_index][pfa_iter] << " "; } - std::cout << std::endl; + std::cout << '\n'; std::cout << "Pd_correct = "; for (int pfa_iter = 0; pfa_iter < num_thresholds; pfa_iter++) { std::cout << Pd_correct[aux_index][pfa_iter] << " "; } - std::cout << std::endl; + std::cout << '\n'; std::cout << "Pfa = "; for (int pfa_iter = 0; pfa_iter < num_thresholds; pfa_iter++) { std::cout << Pfa[aux_index][pfa_iter] << " "; } - std::cout << std::endl; + std::cout << '\n'; aux_index++; } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc index ae15ded1b..f88c636ff 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc @@ -197,7 +197,7 @@ void BeidouB1iPcpsAcquisitionTest::plot_grid() if (!acq_dump.read_binary_acq()) { - std::cout << "Error reading files" << std::endl; + std::cout << "Error reading files\n"; } std::vector *doppler = &acq_dump.doppler; @@ -207,13 +207,13 @@ void BeidouB1iPcpsAcquisitionTest::plot_grid() const std::string gnuplot_executable(FLAGS_gnuplot_executable); if (gnuplot_executable.empty()) { - std::cout << "WARNING: Although the flag plot_acq_grid has been set to TRUE," << std::endl; - std::cout << "gnuplot has not been found in your system." << std::endl; - std::cout << "Test results will not be plotted." << std::endl; + std::cout << "WARNING: Although the flag plot_acq_grid has been set to TRUE,\n"; + std::cout << "gnuplot has not been found in your system.\n"; + std::cout << "Test results will not be plotted.\n"; } else { - std::cout << "Plotting the acquisition grid. This can take a while..." << std::endl; + std::cout << "Plotting the acquisition grid. This can take a while...\n"; try { fs::path p(gnuplot_executable); @@ -241,7 +241,7 @@ void BeidouB1iPcpsAcquisitionTest::plot_grid() } catch (const GnuplotException &ge) { - std::cout << ge.what() << std::endl; + std::cout << ge.what() << '\n'; } } std::string data_str = "./tmp-acq-bds-b1i"; @@ -288,7 +288,7 @@ TEST_F(BeidouB1iPcpsAcquisitionTest, ConnectAndRun) elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -361,7 +361,7 @@ TEST_F(BeidouB1iPcpsAcquisitionTest, ValidationOfResults) }) << "Failure running the top_block."; uint64_t nsamples = gnss_synchro.Acq_samplestamp_samples; - std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; ASSERT_EQ(1, msg_rx->rx_message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro.Acq_delay_samples); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc index c0f745b3f..7b4b86a9c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc @@ -196,7 +196,7 @@ void BeidouB3iPcpsAcquisitionTest::plot_grid() if (!acq_dump.read_binary_acq()) { - std::cout << "Error reading files" << std::endl; + std::cout << "Error reading files\n"; } std::vector *doppler = &acq_dump.doppler; @@ -206,13 +206,13 @@ void BeidouB3iPcpsAcquisitionTest::plot_grid() const std::string gnuplot_executable(FLAGS_gnuplot_executable); if (gnuplot_executable.empty()) { - std::cout << "WARNING: Although the flag plot_acq_grid has been set to TRUE," << std::endl; - std::cout << "gnuplot has not been found in your system." << std::endl; - std::cout << "Test results will not be plotted." << std::endl; + std::cout << "WARNING: Although the flag plot_acq_grid has been set to TRUE,\n"; + std::cout << "gnuplot has not been found in your system.\n"; + std::cout << "Test results will not be plotted.\n"; } else { - std::cout << "Plotting the acquisition grid. This can take a while..." << std::endl; + std::cout << "Plotting the acquisition grid. This can take a while...\n"; try { fs::path p(gnuplot_executable); @@ -240,7 +240,7 @@ void BeidouB3iPcpsAcquisitionTest::plot_grid() } catch (const GnuplotException &ge) { - std::cout << ge.what() << std::endl; + std::cout << ge.what() << '\n'; } } std::string data_str = "./tmp-acq-bds-b3i"; @@ -287,7 +287,7 @@ TEST_F(BeidouB3iPcpsAcquisitionTest, ConnectAndRun) elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -360,7 +360,7 @@ TEST_F(BeidouB3iPcpsAcquisitionTest, ValidationOfResults) }) << "Failure running the top_block."; uint64_t nsamples = gnss_synchro.Acq_samplestamp_samples; - std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; ASSERT_EQ(1, msg_rx->rx_message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro.Acq_delay_samples); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc index 203fe6899..513034900 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc @@ -487,7 +487,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ConnectAndRun) elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -623,7 +623,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProb top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl; + std::cout << "Probability of false alarm (target) = " << 0.1 << '\n'; // i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation) // i = 1 --> satellite in acquisition is not visible (prob of false detection) @@ -650,14 +650,14 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProb stop_queue(); if (i == 0) { - std::cout << "Estimated probability of detection = " << Pd << std::endl; - std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of detection = " << Pd << '\n'; + std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; } else if (i == 1) { - std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; } ch_thread.join(); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc index 7d39259b5..d4f25bdf6 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc @@ -468,7 +468,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ConnectAndRun) elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -592,7 +592,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabi top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl; + std::cout << "Probability of false alarm (target) = " << 0.1 << '\n'; // i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation) // i = 1 --> satellite in acquisition is not visible (prob of false detection) @@ -621,14 +621,14 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabi if (i == 0) { - std::cout << "Estimated probability of detection = " << Pd << std::endl; - std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of detection = " << Pd << '\n'; + std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; } else if (i == 1) { - std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; } ch_thread.join(); } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc index c241a42d6..8df75e7e0 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc @@ -251,7 +251,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ConnectAndRun) end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -319,7 +319,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ValidationOfResults) stop_queue(); uint64_t nsamples = gnss_synchro.Acq_samplestamp_samples; - std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 0=ACQ STOP."; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc index 0f6828b8d..0b40fa83e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc @@ -210,7 +210,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid() if (!acq_dump.read_binary_acq()) { - std::cout << "Error reading files" << std::endl; + std::cout << "Error reading files\n"; } std::vector* doppler = &acq_dump.doppler; @@ -220,13 +220,13 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid() const std::string gnuplot_executable(FLAGS_gnuplot_executable); if (gnuplot_executable.empty()) { - std::cout << "WARNING: Although the flag plot_acq_grid has been set to TRUE," << std::endl; - std::cout << "gnuplot has not been found in your system." << std::endl; - std::cout << "Test results will not be plotted." << std::endl; + std::cout << "WARNING: Although the flag plot_acq_grid has been set to TRUE,\n"; + std::cout << "gnuplot has not been found in your system.\n"; + std::cout << "Test results will not be plotted.\n"; } else { - std::cout << "Plotting the acquisition grid. This can take a while..." << std::endl; + std::cout << "Plotting the acquisition grid. This can take a while...\n"; try { fs::path p(gnuplot_executable); @@ -254,7 +254,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid() } catch (const GnuplotException& ge) { - std::cout << ge.what() << std::endl; + std::cout << ge.what() << '\n'; } } std::string data_str = "./tmp-acq-gal1"; @@ -301,7 +301,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ConnectAndRun) end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -374,11 +374,11 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults) }) << "Failure running the top_block."; uint64_t nsamples = gnss_synchro.Acq_samplestamp_samples; - std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; ASSERT_EQ(1, msg_rx->rx_message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; - std::cout << "Delay: " << gnss_synchro.Acq_delay_samples << std::endl; - std::cout << "Doppler: " << gnss_synchro.Acq_doppler_hz << std::endl; + std::cout << "Delay: " << gnss_synchro.Acq_delay_samples << '\n'; + std::cout << "Doppler: " << gnss_synchro.Acq_doppler_hz << '\n'; double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro.Acq_delay_samples); auto delay_error_chips = static_cast(delay_error_samples * 1023 / 4000000); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test_fpga.cc index 26d2f32af..dc262017d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test_fpga.cc @@ -138,7 +138,7 @@ void* handler_DMA_galileo_e1_pcps_ambiguous_acq_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception opening file " << Filename << std::endl; + std::cerr << "Exception opening file " << Filename << '\n'; return nullptr; } @@ -148,7 +148,7 @@ void* handler_DMA_galileo_e1_pcps_ambiguous_acq_test(void* arguments) tx_fd = open("/dev/loop_tx", O_WRONLY); if (tx_fd < 0) { - std::cout << "Cannot open loop device" << std::endl; + std::cout << "Cannot open loop device\n"; return nullptr; } @@ -165,7 +165,7 @@ void* handler_DMA_galileo_e1_pcps_ambiguous_acq_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception reading file " << Filename << std::endl; + std::cerr << "Exception reading file " << Filename << '\n'; } } @@ -192,7 +192,7 @@ void* handler_DMA_galileo_e1_pcps_ambiguous_acq_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception reading file " << Filename << std::endl; + std::cerr << "Exception reading file " << Filename << '\n'; } for (int index0 = 0; index0 < (nsamples_block_size * 2); index0 += 2) @@ -209,7 +209,7 @@ void* handler_DMA_galileo_e1_pcps_ambiguous_acq_test(void* arguments) if (write(tx_fd, input_samples_dma.data(), nsamples_block_size * 2 * 2) != nsamples_block_size * 2 * 2) { - std::cerr << "Error: DMA could not send all the required samples " << std::endl; + std::cerr << "Error: DMA could not send all the required samples \n"; } // Throttle the DMA @@ -229,7 +229,7 @@ void* handler_DMA_galileo_e1_pcps_ambiguous_acq_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception closing files " << Filename << std::endl; + std::cerr << "Exception closing files " << Filename << '\n'; } try @@ -238,7 +238,7 @@ void* handler_DMA_galileo_e1_pcps_ambiguous_acq_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception closing loop device " << std::endl; + std::cerr << "Exception closing loop device \n"; } return nullptr; @@ -368,7 +368,7 @@ bool GalileoE1PcpsAmbiguousAcquisitionTestFpga::acquire_signal() if (pthread_create(&thread_acquisition, nullptr, handler_acquisition_galileo_e1_pcps_ambiguous_acq_test, reinterpret_cast(&args_acq)) < 0) { - std::cout << "ERROR cannot create acquisition Process" << std::endl; + std::cout << "ERROR cannot create acquisition Process\n"; } // wait to give time for the acquisition thread to set up the acquisition HW accelerator in the FPGA @@ -377,7 +377,7 @@ bool GalileoE1PcpsAmbiguousAcquisitionTestFpga::acquire_signal() // create DMA child process if (pthread_create(&thread_DMA, nullptr, handler_DMA_galileo_e1_pcps_ambiguous_acq_test, reinterpret_cast(&args)) < 0) { - std::cout << "ERROR cannot create DMA Process" << std::endl; + std::cout << "ERROR cannot create DMA Process\n"; } // wait until the acquisition is finished @@ -441,7 +441,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTestFpga, ValidationOfResults) elapsed_seconds = end - start; uint32_t n = 0; // there is only one channel - std::cout << "Acquired " << nsamples_to_transfer << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Acquired " << nsamples_to_transfer << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro_vec.at(n).Acq_delay_samples); auto delay_error_chips = static_cast(delay_error_samples * 1023 / 4000); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc index ec1235deb..1d1844ee8 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc @@ -422,7 +422,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::process_message() stop_queue(); top_block->stop(); - std::cout << std::endl; + std::cout << '\n'; } } @@ -471,7 +471,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ConnectAndRun) elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -612,7 +612,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabili top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl; + std::cout << "Probability of false alarm (target) = " << 0.1 << '\n'; // i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation) // i = 1 --> satellite in acquisition is not visible (prob of false detection) @@ -644,14 +644,14 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabili if (i == 0) { - std::cout << "Estimated probability of detection = " << Pd << std::endl; - std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of detection = " << Pd << '\n'; + std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; } else if (i == 1) { - std::cout << "Probability of false alarm (satellite absent) = " << Pfa_a << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Probability of false alarm (satellite absent) = " << Pfa_a << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; } ch_thread.join(); } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc index 67ca50933..a2a6f9a37 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc @@ -593,7 +593,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ConnectAndRun) elapsed_seconds = end - begin; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; LOG(INFO) << "----end connect and run test-----"; LOG(INFO) << "**End connect and run test"; } @@ -822,7 +822,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl; + std::cout << "Probability of false alarm (target) = " << 0.1 << '\n'; // i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation) // i = 1 --> satellite in acquisition is not visible (prob of false detection) @@ -853,10 +853,10 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul if (i == 0) { - std::cout << "Estimated probability of detection = " << Pd << std::endl; - std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; - std::cout << "Estimated probability of miss detection (satellite present) = " << Pmd << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of detection = " << Pd << '\n'; + std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << '\n'; + std::cout << "Estimated probability of miss detection (satellite present) = " << Pmd << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; if (dump_test_results) { @@ -867,14 +867,14 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul << gnss_synchro.PRN << "CN0_dB_0_" << FLAGS_e1_value_CN0_dB_0 << "_dBHz.csv"; pdpfafile.open(filenamepd.str().c_str(), std::ios::app | std::ios::out); - pdpfafile << FLAGS_e1_value_threshold << "," << Pd << "," << Pfa_p << "," << Pmd << std::endl; + pdpfafile << FLAGS_e1_value_threshold << "," << Pd << "," << Pfa_p << "," << Pmd << '\n'; pdpfafile.close(); } } else if (i == 1) { - std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; if (dump_test_results) { @@ -885,7 +885,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul << gnss_synchro.PRN << "CN0_dB_0_" << FLAGS_e1_value_CN0_dB_0 << "_dBHz.csv"; pdpfafile.open(filenamepf.str().c_str(), std::ios::app | std::ios::out); - pdpfafile << FLAGS_e1_value_threshold << "," << Pfa_a << std::endl; + pdpfafile << FLAGS_e1_value_threshold << "," << Pfa_a << '\n'; pdpfafile.close(); } } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc index a87e5657b..175033150 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc @@ -420,7 +420,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::process_message() stop_queue(); top_block->stop(); - std::cout << std::endl; + std::cout << '\n'; } } @@ -465,7 +465,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ConnectAndRun) elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -550,8 +550,8 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults) EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; } - // std::cout << "Delay: " << gnss_synchro.Acq_delay_samples << std::endl; - // std::cout << "Doppler: " << gnss_synchro.Acq_doppler_hz << std::endl; + // std::cout << "Delay: " << gnss_synchro.Acq_delay_samples << '\n'; + // std::cout << "Doppler: " << gnss_synchro.Acq_doppler_hz << '\n'; ch_thread.join(); } } @@ -601,7 +601,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsPro top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl; + std::cout << "Probability of false alarm (target) = " << 0.1 << '\n'; // i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation) // i = 1 --> satellite in acquisition is not visible (prob of false detection) @@ -630,14 +630,14 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsPro if (i == 0) { - std::cout << "Estimated probability of detection = " << Pd << std::endl; - std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of detection = " << Pd << '\n'; + std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; } else if (i == 1) { - std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; } ch_thread.join(); } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc index d84c99051..6133c66a9 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc @@ -484,7 +484,7 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::process_message() doppler_error_hz = std::abs(expected_doppler_hz3 - gnss_synchro.Acq_doppler_hz); break; default: // case 3 - std::cout << "Error: message from unexpected acquisition channel" << std::endl; + std::cout << "Error: message from unexpected acquisition channel\n"; break; } detection_counter++; @@ -505,9 +505,9 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::process_message() realization_counter++; - // std::cout << correct_estimation_counter << "correct estimation counter" << std::endl; + // std::cout << correct_estimation_counter << "correct estimation counter\n"; std::cout << "Progress: " << round(static_cast(realization_counter / num_of_realizations * 100)) << "% \r" << std::flush; - // std::cout << message << "message" <(1), correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation."; } } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc index 860c1af34..2dc97fb09 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc @@ -472,7 +472,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ConnectAndRun) elapsed_seconds = end - begin; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -598,7 +598,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResultsProbabilities) top_block->connect(filter->get_right_block(), 0, acquisition->get_left_block(), 0); }) << "Failure connecting the blocks of acquisition test."; - std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl; + std::cout << "Probability of false alarm (target) = " << 0.1 << '\n'; // i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation) // i = 1 --> satellite in acquisition is not visible (prob of false detection) @@ -622,23 +622,23 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResultsProbabilities) EXPECT_NO_THROW({ top_block->run(); // Start threads and wait }) << "Failure running the top_block." - << std::endl; + << '\n'; if (i == 0) { - std::cout << "Estimated probability of detection = " << Pd << std::endl; - std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of detection = " << Pd << '\n'; + std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; } else if (i == 1) { - std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; } ASSERT_NO_THROW({ ch_thread.join(); }) << "Failure while waiting the queue to stop" - << std::endl; + << '\n'; } } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc index 3aa0f4377..263ce4b28 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc @@ -87,7 +87,7 @@ void GlonassL1CaPcpsAcquisitionTest_msg_rx::msg_handler_events(pmt::pmt_t msg) } catch (boost::bad_any_cast& e) { - std::cout << "msg_handler_telemetry Bad any cast!" << std::endl; + std::cout << "msg_handler_telemetry Bad any cast!\n"; rx_message = 0; } } @@ -223,7 +223,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionTest, ConnectAndRun) elapsed_seconds = end - begin; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -286,7 +286,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionTest, ValidationOfResults) }) << "Failure running the top_block."; uint64_t nsamples = gnss_synchro.Acq_samplestamp_samples; - std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; ASSERT_EQ(1, msg_rx->rx_message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc index 97bb911b5..96d3c056b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc @@ -469,7 +469,7 @@ TEST_F(GlonassL2CaPcpsAcquisitionTest, ConnectAndRun) elapsed_seconds = end - begin; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -603,7 +603,7 @@ TEST_F(GlonassL2CaPcpsAcquisitionTest, ValidationOfResultsProbabilities) top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); }) << "Failure connecting the blocks of acquisition test."; - std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl; + std::cout << "Probability of false alarm (target) = " << 0.1 << '\n'; // i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation) // i = 1 --> satellite in acquisition is not visible (prob of false detection) @@ -630,14 +630,14 @@ TEST_F(GlonassL2CaPcpsAcquisitionTest, ValidationOfResultsProbabilities) if (i == 0) { - std::cout << "Estimated probability of detection = " << Pd << std::endl; - std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of detection = " << Pd << '\n'; + std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; } else if (i == 1) { - std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; } ASSERT_NO_THROW({ diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc index 911eb5b4e..ffc261918 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc @@ -465,7 +465,7 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ConnectAndRun) elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -591,7 +591,7 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResultsProbabilities) top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); }) << "Failure connecting the blocks of acquisition test."; - std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl; + std::cout << "Probability of false alarm (target) = " << 0.1 << '\n'; // i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation) // i = 1 --> satellite in acquisition is not visible (prob of false detection) @@ -618,14 +618,14 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResultsProbabilities) if (i == 0) { - std::cout << "Estimated probability of detection = " << Pd << std::endl; - std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of detection = " << Pd << '\n'; + std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; } else if (i == 1) { - std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; } ASSERT_NO_THROW({ diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc index 5f185af40..fea15c66c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc @@ -207,7 +207,7 @@ void GpsL1CaPcpsAcquisitionTest::plot_grid() if (!acq_dump.read_binary_acq()) { - std::cout << "Error reading files" << std::endl; + std::cout << "Error reading files\n"; } std::vector *doppler = &acq_dump.doppler; @@ -217,13 +217,13 @@ void GpsL1CaPcpsAcquisitionTest::plot_grid() const std::string gnuplot_executable(FLAGS_gnuplot_executable); if (gnuplot_executable.empty()) { - std::cout << "WARNING: Although the flag plot_acq_grid has been set to TRUE," << std::endl; - std::cout << "gnuplot has not been found in your system." << std::endl; - std::cout << "Test results will not be plotted." << std::endl; + std::cout << "WARNING: Although the flag plot_acq_grid has been set to TRUE,\n"; + std::cout << "gnuplot has not been found in your system.\n"; + std::cout << "Test results will not be plotted.\n"; } else { - std::cout << "Plotting the acquisition grid. This can take a while..." << std::endl; + std::cout << "Plotting the acquisition grid. This can take a while...\n"; try { fs::path p(gnuplot_executable); @@ -251,7 +251,7 @@ void GpsL1CaPcpsAcquisitionTest::plot_grid() } catch (const GnuplotException &ge) { - std::cout << ge.what() << std::endl; + std::cout << ge.what() << '\n'; } } std::string data_str = "./tmp-acq-gps1"; @@ -308,7 +308,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTest /*unused*/, ConnectAndRun /*unused*/) elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -386,7 +386,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTest /*unused*/, ValidationOfResults /*unused*/) }) << "Failure running the top_block."; uint64_t nsamples = gnss_synchro.Acq_samplestamp_samples; - std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Acquired " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; ASSERT_EQ(1, msg_rx->rx_message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro.Acq_delay_samples); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc index 089af6e65..7a2c6c1e6 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc @@ -136,7 +136,7 @@ void* handler_DMA_gps_l1_acq_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception opening file " << Filename << std::endl; + std::cerr << "Exception opening file " << Filename << '\n'; return nullptr; } @@ -146,7 +146,7 @@ void* handler_DMA_gps_l1_acq_test(void* arguments) tx_fd = open("/dev/loop_tx", O_WRONLY); if (tx_fd < 0) { - std::cout << "Cannot open loop device" << std::endl; + std::cout << "Cannot open loop device\n"; return nullptr; } @@ -163,7 +163,7 @@ void* handler_DMA_gps_l1_acq_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception reading file " << Filename << std::endl; + std::cerr << "Exception reading file " << Filename << '\n'; } } @@ -190,7 +190,7 @@ void* handler_DMA_gps_l1_acq_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception reading file " << Filename << std::endl; + std::cerr << "Exception reading file " << Filename << '\n'; } for (int index0 = 0; index0 < (nsamples_block_size * 2); index0 += 2) @@ -207,7 +207,7 @@ void* handler_DMA_gps_l1_acq_test(void* arguments) if (write(tx_fd, input_samples_dma.data(), nsamples_block_size * 2 * 2) != nsamples_block_size * 2 * 2) { - std::cerr << "Error: DMA could not send all the required samples " << std::endl; + std::cerr << "Error: DMA could not send all the required samples \n"; } // Throttle the DMA @@ -227,7 +227,7 @@ void* handler_DMA_gps_l1_acq_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception closing files " << Filename << std::endl; + std::cerr << "Exception closing files " << Filename << '\n'; } try @@ -236,7 +236,7 @@ void* handler_DMA_gps_l1_acq_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception closing loop device " << std::endl; + std::cerr << "Exception closing loop device \n"; } return nullptr; @@ -366,7 +366,7 @@ bool GpsL1CaPcpsAcquisitionTestFpga::acquire_signal() if (pthread_create(&thread_acquisition, nullptr, handler_acquisition_gps_l1_acq_test, reinterpret_cast(&args_acq)) < 0) { - std::cout << "ERROR cannot create acquisition Process" << std::endl; + std::cout << "ERROR cannot create acquisition Process\n"; } // wait to give time for the acquisition thread to set up the acquisition HW accelerator in the FPGA @@ -375,7 +375,7 @@ bool GpsL1CaPcpsAcquisitionTestFpga::acquire_signal() // create DMA child process if (pthread_create(&thread_DMA, nullptr, handler_DMA_gps_l1_acq_test, reinterpret_cast(&args)) < 0) { - std::cout << "ERROR cannot create DMA Process" << std::endl; + std::cout << "ERROR cannot create DMA Process\n"; } // wait until the acquisition is finished @@ -439,7 +439,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTestFpga, ValidationOfResults) elapsed_seconds = end - start; uint32_t n = 0; // there is only one channel - std::cout << "Acquired " << nsamples_to_transfer << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Acquired " << nsamples_to_transfer << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro_vec.at(n).Acq_delay_samples); auto delay_error_chips = static_cast(delay_error_samples * 1023 / 4000); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc index 41abc4dc1..53dad6774 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc @@ -419,7 +419,7 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::process_message() stop_queue(); top_block->stop(); - std::cout << std::endl; + std::cout << '\n'; } } @@ -463,7 +463,7 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ConnectAndRun) elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -502,7 +502,7 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResults) if (!acquisition->opencl_ready()) { - std::cout << "OpenCL Platform is not ready." << std::endl; + std::cout << "OpenCL Platform is not ready.\n"; } else { @@ -589,7 +589,7 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResultsProbabilitie acquisition->init(); if (!acquisition->opencl_ready()) { - std::cout << "OpenCL Platform is not ready." << std::endl; + std::cout << "OpenCL Platform is not ready.\n"; } else { @@ -602,7 +602,7 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResultsProbabilitie top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl; + std::cout << "Probability of false alarm (target) = " << 0.1 << '\n'; // i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation) // i = 1 --> satellite in acquisition is not visible (prob of false detection) @@ -629,14 +629,14 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResultsProbabilitie if (i == 0) { - std::cout << "Estimated probability of detection = " << Pd << std::endl; - std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of detection = " << Pd << '\n'; + std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; } else if (i == 1) { - std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; } } } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc index 9e9395e78..25e5f47b9 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc @@ -573,7 +573,7 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ConnectAndRun) elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -792,7 +792,7 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsProbabili top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl; + std::cout << "Probability of false alarm (target) = " << 0.1 << '\n'; // i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation) // i = 1 --> satellite in acquisition is not visible (prob of false detection) @@ -823,10 +823,10 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsProbabili if (i == 0) { - std::cout << "Estimated probability of detection = " << Pd << std::endl; - std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; - std::cout << "Estimated probability of miss detection (satellite present) = " << Pmd << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of detection = " << Pd << '\n'; + std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << '\n'; + std::cout << "Estimated probability of miss detection (satellite present) = " << Pmd << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; if (dump_test_results) { @@ -837,14 +837,14 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsProbabili << gnss_synchro.PRN << "CN0_dB_0_" << FLAGS_value_CN0_dB_0 << "_dBHz.csv"; pdpfafile.open(filenamepd.str().c_str(), std::ios::app | std::ios::out); - pdpfafile << FLAGS_value_threshold << "," << Pd << "," << Pfa_p << "," << Pmd << std::endl; + pdpfafile << FLAGS_value_threshold << "," << Pd << "," << Pfa_p << "," << Pmd << '\n'; pdpfafile.close(); } } else if (i == 1) { - std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; if (dump_test_results) { @@ -855,7 +855,7 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsProbabili << gnss_synchro.PRN << "CN0_dB_0_" << FLAGS_value_CN0_dB_0 << "_dBHz.csv"; pdpfafile.open(filenamepf.str().c_str(), std::ios::app | std::ios::out); - pdpfafile << FLAGS_value_threshold << "," << Pfa_a << std::endl; + pdpfafile << FLAGS_value_threshold << "," << Pfa_a << '\n'; pdpfafile.close(); } } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc index 44797e866..41c4d3d1d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc @@ -413,7 +413,7 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::process_message() stop_queue(); top_block->stop(); - std::cout << std::endl; + std::cout << '\n'; } } @@ -459,7 +459,7 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ConnectAndRun) elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -594,7 +594,7 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResultsProbabilities) top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of acquisition test."; - std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl; + std::cout << "Probability of false alarm (target) = " << 0.1 << '\n'; // i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation) // i = 1 --> satellite in acquisition is not visible (prob of false detection) @@ -623,14 +623,14 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResultsProbabilities) if (i == 0) { - std::cout << "Estimated probability of detection = " << Pd << std::endl; - std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of detection = " << Pd << '\n'; + std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; } else if (i == 1) { - std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; - std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; + std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << '\n'; + std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds.\n"; } ch_thread.join(); } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc index 400150a22..a771a5a58 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc @@ -204,7 +204,7 @@ void GpsL2MPcpsAcquisitionTest::plot_grid() Acquisition_Dump_Reader acq_dump(basename, sat, doppler_max, doppler_step, samples_per_code, 1); if (!acq_dump.read_binary_acq()) { - std::cout << "Error reading files" << std::endl; + std::cout << "Error reading files\n"; } std::vector *doppler = &acq_dump.doppler; @@ -214,13 +214,13 @@ void GpsL2MPcpsAcquisitionTest::plot_grid() const std::string gnuplot_executable(FLAGS_gnuplot_executable); if (gnuplot_executable.empty()) { - std::cout << "WARNING: Although the flag plot_acq_grid has been set to TRUE," << std::endl; - std::cout << "gnuplot has not been found in your system." << std::endl; - std::cout << "Test results will not be plotted." << std::endl; + std::cout << "WARNING: Although the flag plot_acq_grid has been set to TRUE,\n"; + std::cout << "gnuplot has not been found in your system.\n"; + std::cout << "Test results will not be plotted.\n"; } else { - std::cout << "Plotting the acquisition grid. This can take a while..." << std::endl; + std::cout << "Plotting the acquisition grid. This can take a while...\n"; try { fs::path p(gnuplot_executable); @@ -248,7 +248,7 @@ void GpsL2MPcpsAcquisitionTest::plot_grid() } catch (const GnuplotException &ge) { - std::cout << ge.what() << std::endl; + std::cout << ge.what() << '\n'; } } std::string data_str = "./tmp-acq-gps2"; @@ -293,7 +293,7 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ConnectAndRun) elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -374,10 +374,10 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults) elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Acquisition process runtime duration: " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Acquisition process runtime duration: " << elapsed_seconds.count() * 1e6 << " microseconds\n"; - std::cout << "gnss_synchro.Acq_doppler_hz = " << gnss_synchro.Acq_doppler_hz << " Hz" << std::endl; - std::cout << "gnss_synchro.Acq_delay_samples = " << gnss_synchro.Acq_delay_samples << " Samples" << std::endl; + std::cout << "gnss_synchro.Acq_doppler_hz = " << gnss_synchro.Acq_doppler_hz << " Hz\n"; + std::cout << "gnss_synchro.Acq_delay_samples = " << gnss_synchro.Acq_delay_samples << " Samples\n"; ASSERT_EQ(1, msg_rx->rx_message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; diff --git a/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc b/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc index 9c975a8b7..6aaa227af 100644 --- a/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc @@ -258,7 +258,7 @@ TEST_F(DataTypeAdapter, ByteToShortValidationOfResults) } catch (std::system_error& e) { - std::cerr << e.code().message() << std::endl; + std::cerr << e.code().message() << '\n'; } ifs.close(); ASSERT_EQ(remove(file_name_input.c_str()), 0) << "Problem deleting temporary file"; @@ -284,7 +284,7 @@ TEST_F(DataTypeAdapter, IbyteToCbyteValidationOfResults) } catch (std::system_error& e) { - std::cerr << e.code().message() << std::endl; + std::cerr << e.code().message() << '\n'; } ifs.close(); ASSERT_EQ(remove(file_name_input.c_str()), 0) << "Problem deleting temporary file"; @@ -310,7 +310,7 @@ TEST_F(DataTypeAdapter, IbyteToComplexValidationOfResults) } catch (std::system_error& e) { - std::cerr << e.code().message() << std::endl; + std::cerr << e.code().message() << '\n'; } ifs.close(); ASSERT_EQ(remove(file_name_input.c_str()), 0) << "Problem deleting temporary file"; @@ -336,7 +336,7 @@ TEST_F(DataTypeAdapter, IbyteToCshortValidationOfResults) } catch (std::system_error& e) { - std::cerr << e.code().message() << std::endl; + std::cerr << e.code().message() << '\n'; } ifs.close(); ASSERT_EQ(remove(file_name_input.c_str()), 0) << "Problem deleting temporary file"; @@ -362,7 +362,7 @@ TEST_F(DataTypeAdapter, IshortToComplexValidationOfResults) } catch (std::system_error& e) { - std::cerr << e.code().message() << std::endl; + std::cerr << e.code().message() << '\n'; } ifs.close(); ASSERT_EQ(remove(file_name_input.c_str()), 0) << "Problem deleting temporary file"; @@ -388,7 +388,7 @@ TEST_F(DataTypeAdapter, IshortToCshortValidationOfResults) } catch (std::system_error& e) { - std::cerr << e.code().message() << std::endl; + std::cerr << e.code().message() << '\n'; } ifs.close(); ASSERT_EQ(remove(file_name_input.c_str()), 0) << "Problem deleting temporary file"; diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc index a1003ae88..59c55a3e8 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc @@ -206,7 +206,7 @@ TEST_F(FirFilterTest, ConnectAndRun) end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -249,7 +249,7 @@ TEST_F(FirFilterTest, ConnectAndRunGrcomplex) end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " gr_complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " gr_complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -294,7 +294,7 @@ TEST_F(FirFilterTest, ConnectAndRunCshorts) end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " std::complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " std::complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -339,7 +339,7 @@ TEST_F(FirFilterTest, ConnectAndRunCbytes) end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " std::complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " std::complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -384,5 +384,5 @@ TEST_F(FirFilterTest, ConnectAndRunCbyteGrcomplex) end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc index 59a9e2ce7..95defafbd 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc @@ -123,7 +123,7 @@ TEST_F(NotchFilterLiteTest, ConnectAndRun) end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -165,5 +165,5 @@ TEST_F(NotchFilterLiteTest, ConnectAndRunGrcomplex) end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " gr_complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " gr_complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc index adbd8a4bf..27847dd93 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc @@ -123,7 +123,7 @@ TEST_F(NotchFilterTest, ConnectAndRun) end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -165,5 +165,5 @@ TEST_F(NotchFilterTest, ConnectAndRunGrcomplex) end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " gr_complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " gr_complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc index 187a0ddb3..545f060cb 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc @@ -122,7 +122,7 @@ TEST_F(PulseBlankingFilterTest, ConnectAndRun) end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -164,5 +164,5 @@ TEST_F(PulseBlankingFilterTest, ConnectAndRunGrcomplex) end = std::chrono::system_clock::now(); elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Filtered " << nsamples << " gr_complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Filtered " << nsamples << " gr_complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc index 391e05f0f..e82ab9a3d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc @@ -30,33 +30,33 @@ bool Acquisition_Dump_Reader::read_binary_acq() mat_t* matfile = Mat_Open(d_dump_filename.c_str(), MAT_ACC_RDONLY); if (matfile == nullptr) { - std::cout << "¡¡¡Unreachable Acquisition dump file!!!" << std::endl; + std::cout << "¡¡¡Unreachable Acquisition dump file!!!\n"; return false; } matvar_t* var_ = Mat_VarRead(matfile, "acq_grid"); if (var_ == nullptr) { - std::cout << "¡¡¡Unreachable grid variable into Acquisition dump file!!!" << std::endl; + std::cout << "¡¡¡Unreachable grid variable into Acquisition dump file!!!\n"; Mat_Close(matfile); return false; } if (var_->rank != 2) { - std::cout << "Invalid Acquisition dump file: rank error" << std::endl; + std::cout << "Invalid Acquisition dump file: rank error\n"; Mat_VarFree(var_); Mat_Close(matfile); return false; } if ((var_->dims[0] != d_samples_per_code) or (var_->dims[1] != d_num_doppler_bins)) { - std::cout << "Invalid Acquisition dump file: dimension matrix error" << std::endl; + std::cout << "Invalid Acquisition dump file: dimension matrix error\n"; if (var_->dims[0] != d_samples_per_code) { - std::cout << "Expected " << d_samples_per_code << " samples per code. Obtained " << var_->dims[0] << std::endl; + std::cout << "Expected " << d_samples_per_code << " samples per code. Obtained " << var_->dims[0] << '\n'; } if (var_->dims[1] != d_num_doppler_bins) { - std::cout << "Expected " << d_num_doppler_bins << " Doppler bins. Obtained " << var_->dims[1] << std::endl; + std::cout << "Expected " << d_num_doppler_bins << " Doppler bins. Obtained " << var_->dims[1] << '\n'; } Mat_VarFree(var_); Mat_Close(matfile); @@ -64,7 +64,7 @@ bool Acquisition_Dump_Reader::read_binary_acq() } if (var_->data_type != MAT_T_SINGLE) { - std::cout << "Invalid Acquisition dump file: data type error" << std::endl; + std::cout << "Invalid Acquisition dump file: data type error\n"; Mat_VarFree(var_); Mat_Close(matfile); return false; @@ -165,7 +165,7 @@ Acquisition_Dump_Reader::Acquisition_Dump_Reader(const std::string& basename, } else { - std::cout << "¡¡¡Unreachable Acquisition dump file!!!" << std::endl; + std::cout << "¡¡¡Unreachable Acquisition dump file!!!\n"; } acq_doppler_hz = 0.0; acq_delay_samples = 0.0; diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc index 5497815c1..2defb468b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc @@ -86,7 +86,7 @@ bool Observables_Dump_Reader::open_obs_file(std::string out_file) } catch (const std::ifstream::failure &e) { - std::cout << "Problem opening Observables dump Log file: " << d_dump_filename << std::endl; + std::cout << "Problem opening Observables dump Log file: " << d_dump_filename << '\n'; return false; } } diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc index 6851d1978..c8f3f9fa3 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc @@ -75,12 +75,12 @@ bool Tlm_Dump_Reader::open_obs_file(std::string out_file) d_dump_filename = std::move(out_file); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::in | std::ios::binary); - std::cout << "TLM dump enabled, Log file: " << d_dump_filename.c_str() << std::endl; + std::cout << "TLM dump enabled, Log file: " << d_dump_filename.c_str() << '\n'; return true; } catch (const std::ifstream::failure &e) { - std::cout << "Problem opening TLM dump Log file: " << d_dump_filename << std::endl; + std::cout << "Problem opening TLM dump Log file: " << d_dump_filename << '\n'; return false; } } diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc index 6030f73f9..4d6a98376 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc @@ -102,7 +102,7 @@ bool Tracking_Dump_Reader::open_obs_file(std::string out_file) } catch (const std::ifstream::failure &e) { - std::cout << "Problem opening Tracking dump Log file: " << d_dump_filename << std::endl; + std::cout << "Problem opening Tracking dump Log file: " << d_dump_filename << '\n'; return false; } } diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc index 7be7a5711..1465579af 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc @@ -82,7 +82,7 @@ bool Tracking_True_Obs_Reader::open_obs_file(std::string out_file) } catch (const std::ifstream::failure &e) { - std::cout << "Problem opening Tracking dump Log file: " << d_dump_filename << std::endl; + std::cout << "Problem opening Tracking dump Log file: " << d_dump_filename << '\n'; return false; } } diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.cc index 4673591d2..07123d185 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.cc @@ -82,12 +82,12 @@ bool True_Observables_Reader::open_obs_file(std::string out_file) d_dump_filename = std::move(out_file); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::in | std::ios::binary); - std::cout << "True observables Log file opened: " << d_dump_filename.c_str() << std::endl; + std::cout << "True observables Log file opened: " << d_dump_filename.c_str() << '\n'; return true; } catch (const std::ifstream::failure &e) { - std::cout << "Problem opening true Observables Log file: " << d_dump_filename << std::endl; + std::cout << "Problem opening true Observables Log file: " << d_dump_filename << '\n'; return false; } } diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc index b239e1b29..cade85ca4 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc @@ -366,13 +366,13 @@ int HybridObservablesTest::generate_signal() else if (pid == 0) { execv(&generator_binary[0], parmList); - std::cout << "Return not expected. Must be an execv err." << std::endl; + std::cout << "Return not expected. Must be an execv err.\n"; std::terminate(); } waitpid(pid, &child_status, 0); - std::cout << "Signal and Observables RINEX and RAW files created." << std::endl; + std::cout << "Signal and Observables RINEX and RAW files created.\n"; return 0; } @@ -556,7 +556,7 @@ bool HybridObservablesTest::acquire_signal() acq_fs / 2.1, acq_fs / 10, gr::filter::firdes::win_type::WIN_HAMMING); - std::cout << "Enabled decimation low pass filter with " << taps.size() << " taps and decimation factor of " << decimation << std::endl; + std::cout << "Enabled decimation low pass filter with " << taps.size() << " taps and decimation factor of " << decimation << '\n'; acquisition->set_resampler_latency((taps.size() - 1) / 2); gr::basic_block_sptr fir_filter_ccf_ = gr::filter::fir_filter_ccf::make(decimation, taps); top_block_acq->connect(gr_interleaved_char_to_complex, 0, fir_filter_ccf_, 0); @@ -591,7 +591,7 @@ bool HybridObservablesTest::acquire_signal() } catch (const std::exception& e) { - std::cout << "Failure connecting the message port system: " << e.what() << std::endl; + std::cout << "Failure connecting the message port system: " << e.what() << '\n'; exit(0); } @@ -633,8 +633,8 @@ bool HybridObservablesTest::acquire_signal() top_block_acq->run(); if (start_msg == true) { - std::cout << "Reading external signal file: " << FLAGS_signal_file << std::endl; - std::cout << "Searching for " << System_and_Signal << " Satellites..." << std::endl; + std::cout << "Reading external signal file: " << FLAGS_signal_file << '\n'; + std::cout << "Searching for " << System_and_Signal << " Satellites...\n"; std::cout << "["; start_msg = false; } @@ -655,7 +655,7 @@ bool HybridObservablesTest::acquire_signal() file_source->seek(2 * FLAGS_skip_samples, 0); // skip head. ibyte, two bytes per complex sample std::cout.flush(); } - std::cout << "]" << std::endl; + std::cout << "]\n"; std::cout << "-------------------------------------------\n"; for (auto& x : gnss_synchro_vec) @@ -672,7 +672,7 @@ bool HybridObservablesTest::acquire_signal() elapsed_seconds = end - start; std::cout << "Total signal acquisition run time " << elapsed_seconds.count() - << " [seconds]" << std::endl; + << " [seconds]\n"; if (!gnss_synchro_vec.empty()) { return true; @@ -870,7 +870,7 @@ void HybridObservablesTest::check_results_carrier_phase( << ", stdev = " << sqrt(error_var_ch0) << " (max,min) = " << max_error_ch0 << "," << min_error_ch0 - << " [cycles]" << std::endl; + << " [cycles]\n"; std::cout.precision(ss); // plots @@ -961,7 +961,7 @@ void HybridObservablesTest::check_results_carrier_phase_double_diff( << ", stdev = " << sqrt(error_var) << " (max,min) = " << max_error << "," << min_error - << " [Cycles]" << std::endl; + << " [Cycles]\n"; std::cout.precision(ss); // plots @@ -1055,7 +1055,7 @@ void HybridObservablesTest::check_results_carrier_doppler_double_diff( << ", stdev = " << sqrt(error_var) << " (max,min) = " << max_error << "," << min_error - << " [Hz]" << std::endl; + << " [Hz]\n"; std::cout.precision(ss); // plots @@ -1140,7 +1140,7 @@ void HybridObservablesTest::check_results_carrier_doppler( << ", stdev = " << sqrt(error_var_ch0) << " (max,min) = " << max_error_ch0 << "," << min_error_ch0 - << " [Hz]" << std::endl; + << " [Hz]\n"; std::cout.precision(ss); // plots @@ -1275,7 +1275,7 @@ void HybridObservablesTest::check_results_duplicated_satellite( << ", stdev = " << sqrt(error_var_ch0) << " (max,min) = " << max_error_ch0 << "," << min_error_ch0 - << " [Hz]" << std::endl; + << " [Hz]\n"; std::cout.precision(ss); // plots @@ -1335,7 +1335,7 @@ void HybridObservablesTest::check_results_duplicated_satellite( << ", stdev = " << sqrt(error_var_carrier_phase) << " (max,min) = " << max_error_carrier_phase << "," << min_error_carrier_phase - << " [Cycles]" << std::endl; + << " [Cycles]\n"; std::cout.precision(ss); // plots @@ -1394,7 +1394,7 @@ void HybridObservablesTest::check_results_duplicated_satellite( << ", stdev = " << sqrt(error_var_pseudorange) << " (max,min) = " << max_error_pseudorange << "," << min_error_pseudorange - << " [meters]" << std::endl; + << " [meters]\n"; std::cout.precision(ss); // plots @@ -1435,7 +1435,7 @@ bool HybridObservablesTest::save_mat_xy(std::vector& x, std::vector(matfp) != nullptr) { @@ -1450,14 +1450,14 @@ bool HybridObservablesTest::save_mat_xy(std::vector& x, std::vector* obs_vec, Gnss_S } else { - std::cout << "ReadRinexObs unknown signal requested: " << gnss.Signal << std::endl; + std::cout << "ReadRinexObs unknown signal requested: " << gnss.Signal << '\n'; return false; } } @@ -1690,13 +1690,13 @@ bool HybridObservablesTest::ReadRinexObs(std::vector* obs_vec, Gnss_S catch (const std::exception& e) { std::cout << "Exception: " << e.what(); - std::cout << "unknown error. I don't feel so well..." << std::endl; + std::cout << "unknown error. I don't feel so well...\n"; return false; } - std::cout << "ReadRinexObs info:" << std::endl; + std::cout << "ReadRinexObs info:\n"; for (unsigned int n = 0; n < gnss_synchro_vec.size(); n++) { - std::cout << "SAT PRN " << gnss_synchro_vec.at(n).PRN << " RINEX epoch read: " << obs_vec->at(n).n_rows << std::endl; + std::cout << "SAT PRN " << gnss_synchro_vec.at(n).PRN << " RINEX epoch read: " << obs_vec->at(n).n_rows << '\n'; } return true; } @@ -1757,7 +1757,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) std::vector> true_reader_vec; // read true data from the generator logs true_reader_vec.push_back(std::make_shared()); - std::cout << "Loading true observable data for PRN " << n.PRN << std::endl; + std::cout << "Loading true observable data for PRN " << n.PRN << '\n'; std::string true_obs_file = std::string("./gps_l1_ca_obs_prn"); true_obs_file.append(std::to_string(n.PRN)); true_obs_file.append(".dat"); @@ -1780,7 +1780,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) true_reader_vec.back()->restart(); std::cout << "Initial Doppler [Hz]=" << true_reader_vec.back()->doppler_l1_hz << " Initial code delay [Chips]=" - << true_reader_vec.back()->prn_delay_chips << std::endl; + << true_reader_vec.back()->prn_delay_chips << '\n'; n.Acq_delay_samples = (GPS_L1_CA_CODE_LENGTH_CHIPS - true_reader_vec.back()->prn_delay_chips / GPS_L1_CA_CODE_LENGTH_CHIPS) * baseband_sampling_freq * GPS_L1_CA_CODE_PERIOD_S; n.Acq_doppler_hz = true_reader_vec.back()->doppler_l1_hz; n.Acq_samplestamp_samples = 0; @@ -1790,7 +1790,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) // based on the signal acquisition process std::cout << "Estimated Initial Doppler " << n.Acq_doppler_hz << " [Hz], estimated Initial code delay " << n.Acq_delay_samples << " [Samples]" - << " Acquisition SampleStamp is " << n.Acq_samplestamp_samples << std::endl; + << " Acquisition SampleStamp is " << n.Acq_samplestamp_samples << '\n'; n.Acq_samplestamp_samples = 0; } } @@ -1913,7 +1913,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) auto nepoch = static_cast(true_observables.num_epochs()); - std::cout << "True observation epochs = " << nepoch << std::endl; + std::cout << "True observation epochs = " << nepoch << '\n'; true_observables.restart(); int64_t epoch_counter = 0; @@ -1930,7 +1930,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) if (round(true_observables.prn[n]) != gnss_synchro_vec.at(n).PRN) { std::cout << "True observables SV PRN does not match measured ones: " - << round(true_observables.prn[n]) << " vs. " << gnss_synchro_vec.at(n).PRN << std::endl; + << round(true_observables.prn[n]) << " vs. " << gnss_synchro_vec.at(n).PRN << '\n'; throw std::exception(); } true_obs_vec.at(n)(epoch_counter, 0) = true_observables.gps_time_sec[n]; @@ -1960,7 +1960,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) }) << "Failure opening dump observables file"; auto nepoch = static_cast(estimated_observables.num_epochs()); - std::cout << "Measured observations epochs = " << nepoch << std::endl; + std::cout << "Measured observations epochs = " << nepoch << '\n'; // Matrices for storing columnwise measured RX_time, TOW, Doppler, Carrier phase and Pseudorange std::vector measured_obs_vec; @@ -2109,7 +2109,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) if ((!index2.empty()) and (index2(0) > 0)) { receiver_time_offset_ref_channel_s = (true_obs_vec.at(min_pr_ch_id).col(1)(index2(0)) - measured_obs_vec.at(min_pr_ch_id).col(4)(0)) / SPEED_OF_LIGHT_M_S; - std::cout << "Ref. channel initial Receiver time offset " << receiver_time_offset_ref_channel_s(0) * 1e3 << " [ms]" << std::endl; + std::cout << "Ref. channel initial Receiver time offset " << receiver_time_offset_ref_channel_s(0) * 1e3 << " [ms]\n"; } else { @@ -2194,7 +2194,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) } else { - std::cout << "[CH " << std::to_string(n) << "] PRN " << std::to_string(gnss_synchro_vec.at(n).PRN) << " is the reference satellite" << std::endl; + std::cout << "[CH " << std::to_string(n) << "] PRN " << std::to_string(gnss_synchro_vec.at(n).PRN) << " is the reference satellite\n"; } if (FLAGS_compute_single_diffs) { @@ -2214,5 +2214,5 @@ TEST_F(HybridObservablesTest, ValidationOfResults) } } } - std::cout << "Test completed in " << elapsed_seconds.count() << " [s]" << std::endl; + std::cout << "Test completed in " << elapsed_seconds.count() << " [s]\n"; } diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc index 6200ca248..d616f2bc1 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc @@ -333,13 +333,13 @@ int HybridObservablesTestFpga::generate_signal() else if (pid == 0) { execv(&generator_binary[0], parmList); - std::cout << "Return not expected. Must be an execv err." << std::endl; + std::cout << "Return not expected. Must be an execv err.\n"; std::terminate(); } waitpid(pid, &child_status, 0); - std::cout << "Signal and Observables RINEX and RAW files created." << std::endl; + std::cout << "Signal and Observables RINEX and RAW files created.\n"; return 0; } @@ -398,7 +398,7 @@ void* handler_DMA_obs_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception opening file " << Filename << std::endl; + std::cerr << "Exception opening file " << Filename << '\n'; return nullptr; } @@ -408,7 +408,7 @@ void* handler_DMA_obs_test(void* arguments) tx_fd = open("/dev/loop_tx", O_WRONLY); if (tx_fd < 0) { - std::cout << "Cannot open loop device" << std::endl; + std::cout << "Cannot open loop device\n"; return nullptr; } @@ -426,7 +426,7 @@ void* handler_DMA_obs_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception reading file " << Filename << std::endl; + std::cerr << "Exception reading file " << Filename << '\n'; } } @@ -453,7 +453,7 @@ void* handler_DMA_obs_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception reading file " << Filename << std::endl; + std::cerr << "Exception reading file " << Filename << '\n'; } for (int index0 = 0; index0 < (nsamples_block_size * 2); index0 += 2) @@ -480,10 +480,10 @@ void* handler_DMA_obs_test(void* arguments) dma_index += 4; } - // std::cout << "DMA: sending nsamples_block_size = " << nsamples_block_size << " samples" << std::endl; + // std::cout << "DMA: sending nsamples_block_size = " << nsamples_block_size << " samples\n"; if (write(tx_fd, input_samples_dma.data(), (int)(nsamples_block_size * 4)) != (int)(nsamples_block_size * 4)) { - std::cerr << "Error: DMA could not send all the required samples " << std::endl; + std::cerr << "Error: DMA could not send all the required samples \n"; } // Throttle the DMA @@ -504,7 +504,7 @@ void* handler_DMA_obs_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception closing files " << Filename << std::endl; + std::cerr << "Exception closing files " << Filename << '\n'; } try @@ -513,7 +513,7 @@ void* handler_DMA_obs_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception closing loop device " << std::endl; + std::cerr << "Exception closing loop device \n"; } return nullptr; @@ -725,7 +725,7 @@ bool HybridObservablesTestFpga::acquire_signal() // create DMA child process if (pthread_create(&thread_DMA, nullptr, handler_DMA_obs_test, reinterpret_cast(&args)) < 0) { - std::cout << "ERROR cannot create DMA Process" << std::endl; + std::cout << "ERROR cannot create DMA Process\n"; } pthread_join(thread_DMA, nullptr); @@ -745,13 +745,13 @@ bool HybridObservablesTestFpga::acquire_signal() if (pthread_create(&thread_acquisition, nullptr, handler_acquisition_obs_test, reinterpret_cast(&args_acq)) < 0) { - std::cout << "ERROR cannot create acquisition Process" << std::endl; + std::cout << "ERROR cannot create acquisition Process\n"; } if (start_msg == true) { - std::cout << "Reading external signal file: " << FLAGS_signal_file << std::endl; - std::cout << "Searching for " << System_and_Signal << " Satellites..." << std::endl; + std::cout << "Reading external signal file: " << FLAGS_signal_file << '\n'; + std::cout << "Searching for " << System_and_Signal << " Satellites...\n"; std::cout << "["; start_msg = false; } @@ -762,7 +762,7 @@ bool HybridObservablesTestFpga::acquire_signal() // create DMA child process if (pthread_create(&thread_DMA, nullptr, handler_DMA_obs_test, reinterpret_cast(&args)) < 0) { - std::cout << "ERROR cannot create DMA Process" << std::endl; + std::cout << "ERROR cannot create DMA Process\n"; } // wait until the acquisition is finished @@ -787,7 +787,7 @@ bool HybridObservablesTestFpga::acquire_signal() std::cout.flush(); } - std::cout << "]" << std::endl; + std::cout << "]\n"; std::cout << "-------------------------------------------\n"; for (auto& x : gnss_synchro_vec) @@ -804,7 +804,7 @@ bool HybridObservablesTestFpga::acquire_signal() elapsed_seconds = end - start; std::cout << "Total signal acquisition run time " << elapsed_seconds.count() - << " [seconds]" << std::endl; + << " [seconds]\n"; if (!gnss_synchro_vec.empty()) { return true; @@ -981,7 +981,7 @@ void HybridObservablesTestFpga::check_results_carrier_phase( << ", stdev = " << sqrt(error_var_ch0) << " (max,min) = " << max_error_ch0 << "," << min_error_ch0 - << " [cycles]" << std::endl; + << " [cycles]\n"; std::cout.precision(ss); // plots @@ -1070,7 +1070,7 @@ void HybridObservablesTestFpga::check_results_carrier_phase_double_diff( << ", stdev = " << sqrt(error_var) << " (max,min) = " << max_error << "," << min_error - << " [Cycles]" << std::endl; + << " [Cycles]\n"; std::cout.precision(ss); // plots @@ -1158,7 +1158,7 @@ void HybridObservablesTestFpga::check_results_carrier_doppler_double_diff( << ", stdev = " << sqrt(error_var) << " (max,min) = " << max_error << "," << min_error - << " [Hz]" << std::endl; + << " [Hz]\n"; std::cout.precision(ss); // plots @@ -1236,7 +1236,7 @@ void HybridObservablesTestFpga::check_results_carrier_doppler( << ", stdev = " << sqrt(error_var_ch0) << " (max,min) = " << max_error_ch0 << "," << min_error_ch0 - << " [Hz]" << std::endl; + << " [Hz]\n"; std::cout.precision(ss); // plots @@ -1370,7 +1370,7 @@ void HybridObservablesTestFpga::check_results_duplicated_satellite( << ", stdev = " << sqrt(error_var_ch0) << " (max,min) = " << max_error_ch0 << "," << min_error_ch0 - << " [Hz]" << std::endl; + << " [Hz]\n"; std::cout.precision(ss); // plots @@ -1430,7 +1430,7 @@ void HybridObservablesTestFpga::check_results_duplicated_satellite( << ", stdev = " << sqrt(error_var_carrier_phase) << " (max,min) = " << max_error_carrier_phase << "," << min_error_carrier_phase - << " [Cycles]" << std::endl; + << " [Cycles]\n"; std::cout.precision(ss); // plots @@ -1489,7 +1489,7 @@ void HybridObservablesTestFpga::check_results_duplicated_satellite( << ", stdev = " << sqrt(error_var_pseudorange) << " (max,min) = " << max_error_pseudorange << "," << min_error_pseudorange - << " [meters]" << std::endl; + << " [meters]\n"; std::cout.precision(ss); // plots @@ -1530,7 +1530,7 @@ bool HybridObservablesTestFpga::save_mat_xy(std::vector& x, std::vector< mat_t* matfp; matvar_t* matvar; filename.append(".mat"); - std::cout << "save_mat_xy write " << filename << std::endl; + std::cout << "save_mat_xy write " << filename << '\n'; matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT5); if (reinterpret_cast(matfp) != nullptr) { @@ -1545,14 +1545,14 @@ bool HybridObservablesTestFpga::save_mat_xy(std::vector& x, std::vector< } else { - std::cout << "save_mat_xy: error creating file" << std::endl; + std::cout << "save_mat_xy: error creating file\n"; } Mat_Close(matfp); return true; } catch (const std::exception& ex) { - std::cout << "save_mat_xy: " << ex.what() << std::endl; + std::cout << "save_mat_xy: " << ex.what() << '\n'; return false; } } @@ -1614,7 +1614,7 @@ void HybridObservablesTestFpga::check_results_code_pseudorange( << ", stdev = " << sqrt(error_var) << " (max,min) = " << max_error << "," << min_error - << " [meters]" << std::endl; + << " [meters]\n"; std::cout.precision(ss); // plots @@ -1756,7 +1756,7 @@ bool HybridObservablesTestFpga::ReadRinexObs(std::vector* obs_vec, Gn } else { - std::cout << "ReadRinexObs unknown signal requested: " << gnss.Signal << std::endl; + std::cout << "ReadRinexObs unknown signal requested: " << gnss.Signal << '\n'; return false; } } @@ -1777,14 +1777,14 @@ bool HybridObservablesTestFpga::ReadRinexObs(std::vector* obs_vec, Gn catch (const std::exception& e) { std::cout << "Exception: " << e.what(); - std::cout << "unknown error. I don't feel so well..." << std::endl; + std::cout << "unknown error. I don't feel so well...\n"; return false; } - std::cout << "ReadRinexObs info:" << std::endl; + std::cout << "ReadRinexObs info:\n"; for (unsigned int n = 0; n < gnss_synchro_vec.size(); n++) { - std::cout << "SAT PRN " << gnss_synchro_vec.at(n).PRN << " RINEX epoch read: " << obs_vec->at(n).n_rows << std::endl; + std::cout << "SAT PRN " << gnss_synchro_vec.at(n).PRN << " RINEX epoch read: " << obs_vec->at(n).n_rows << '\n'; } return true; } @@ -1850,7 +1850,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) std::vector> true_reader_vec; // read true data from the generator logs true_reader_vec.push_back(std::make_shared()); - std::cout << "Loading true observable data for PRN " << n.PRN << std::endl; + std::cout << "Loading true observable data for PRN " << n.PRN << '\n'; std::string true_obs_file = std::string("./gps_l1_ca_obs_prn"); true_obs_file.append(std::to_string(n.PRN)); true_obs_file.append(".dat"); @@ -1873,7 +1873,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) true_reader_vec.back()->restart(); std::cout << "Initial Doppler [Hz]=" << true_reader_vec.back()->doppler_l1_hz << " Initial code delay [Chips]=" - << true_reader_vec.back()->prn_delay_chips << std::endl; + << true_reader_vec.back()->prn_delay_chips << '\n'; n.Acq_delay_samples = (GPS_L1_CA_CODE_LENGTH_CHIPS - true_reader_vec.back()->prn_delay_chips / GPS_L1_CA_CODE_LENGTH_CHIPS) * baseband_sampling_freq * GPS_L1_CA_CODE_PERIOD_S; n.Acq_doppler_hz = true_reader_vec.back()->doppler_l1_hz; n.Acq_samplestamp_samples = 0; @@ -1883,7 +1883,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) // based on the signal acquisition process std::cout << "Estimated Initial Doppler " << n.Acq_doppler_hz << " [Hz], estimated Initial code delay " << n.Acq_delay_samples << " [Samples]" - << " Acquisition SampleStamp is " << n.Acq_samplestamp_samples << std::endl; + << " Acquisition SampleStamp is " << n.Acq_samplestamp_samples << '\n'; // n.Acq_samplestamp_samples = 0; } } @@ -2029,7 +2029,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) if (pthread_create(&thread_DMA, nullptr, handler_DMA_obs_test, reinterpret_cast(&args)) < 0) { - std::cout << "ERROR cannot create DMA Process" << std::endl; + std::cout << "ERROR cannot create DMA Process\n"; } EXPECT_NO_THROW({ @@ -2074,7 +2074,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) auto nepoch = static_cast(true_observables.num_epochs()); - std::cout << "True observation epochs = " << nepoch << std::endl; + std::cout << "True observation epochs = " << nepoch << '\n'; true_observables.restart(); int64_t epoch_counter = 0; @@ -2091,7 +2091,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) if (round(true_observables.prn[n]) != gnss_synchro_vec.at(n).PRN) { std::cout << "True observables SV PRN does not match measured ones: " - << round(true_observables.prn[n]) << " vs. " << gnss_synchro_vec.at(n).PRN << std::endl; + << round(true_observables.prn[n]) << " vs. " << gnss_synchro_vec.at(n).PRN << '\n'; throw std::exception(); } true_obs_vec.at(n)(epoch_counter, 0) = true_observables.gps_time_sec[n]; @@ -2122,7 +2122,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) }) << "Failure opening dump observables file"; auto nepoch = static_cast(estimated_observables.num_epochs()); - std::cout << "Measured observations epochs = " << nepoch << std::endl; + std::cout << "Measured observations epochs = " << nepoch << '\n'; // Matrices for storing columnwise measured RX_time, TOW, Doppler, Carrier phase and Pseudorange std::vector measured_obs_vec; @@ -2272,7 +2272,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) if ((!index2.empty()) and (index2(0) > 0)) { receiver_time_offset_ref_channel_s = (true_obs_vec.at(min_pr_ch_id).col(1)(index2(0)) - measured_obs_vec.at(min_pr_ch_id).col(4)(0)) / SPEED_OF_LIGHT_M_S; - std::cout << "Ref. channel initial Receiver time offset " << receiver_time_offset_ref_channel_s(0) * 1e3 << " [ms]" << std::endl; + std::cout << "Ref. channel initial Receiver time offset " << receiver_time_offset_ref_channel_s(0) * 1e3 << " [ms]\n"; } else { @@ -2357,7 +2357,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) } else { - std::cout << "[CH " << std::to_string(n) << "] PRN " << std::to_string(gnss_synchro_vec.at(n).PRN) << " is the reference satellite" << std::endl; + std::cout << "[CH " << std::to_string(n) << "] PRN " << std::to_string(gnss_synchro_vec.at(n).PRN) << " is the reference satellite\n"; } if (FLAGS_compute_single_diffs) { @@ -2378,5 +2378,5 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) } } - std::cout << "Test completed in " << elapsed_seconds.count() << " [s]" << std::endl; + std::cout << "Test completed in " << elapsed_seconds.count() << " [s]\n"; } diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc index 06bc503aa..793b01eeb 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc @@ -72,10 +72,10 @@ rtk_t configure_rtklib_options() if (positioning_mode == -1) { // warn user and set the default - std::cout << "WARNING: Bad specification of positioning mode." << std::endl; - std::cout << "positioning_mode possible values: Single / Static / Kinematic / PPP_Static / PPP_Kinematic" << std::endl; - std::cout << "positioning_mode specified value: " << positioning_mode_str << std::endl; - std::cout << "Setting positioning_mode to Single" << std::endl; + std::cout << "WARNING: Bad specification of positioning mode.\n"; + std::cout << "positioning_mode possible values: Single / Static / Kinematic / PPP_Static / PPP_Kinematic\n"; + std::cout << "positioning_mode specified value: " << positioning_mode_str << '\n'; + std::cout << "Setting positioning_mode to Single\n"; positioning_mode = PMODE_SINGLE; } @@ -139,10 +139,10 @@ rtk_t configure_rtklib_options() if (iono_model == -1) { // warn user and set the default - std::cout << "WARNING: Bad specification of ionospheric model." << std::endl; - std::cout << "iono_model possible values: OFF / Broadcast / SBAS / Iono-Free-LC / Estimate_STEC / IONEX" << std::endl; - std::cout << "iono_model specified value: " << iono_model_str << std::endl; - std::cout << "Setting iono_model to OFF" << std::endl; + std::cout << "WARNING: Bad specification of ionospheric model.\n"; + std::cout << "iono_model possible values: OFF / Broadcast / SBAS / Iono-Free-LC / Estimate_STEC / IONEX\n"; + std::cout << "iono_model specified value: " << iono_model_str << '\n'; + std::cout << "Setting iono_model to OFF\n"; iono_model = IONOOPT_OFF; /* 0: ionosphere option: correction off */ } @@ -172,10 +172,10 @@ rtk_t configure_rtklib_options() if (trop_model == -1) { // warn user and set the default - std::cout << "WARNING: Bad specification of tropospheric model." << std::endl; - std::cout << "trop_model possible values: OFF / Saastamoinen / SBAS / Estimate_ZTD / Estimate_ZTD_Grad" << std::endl; - std::cout << "trop_model specified value: " << trop_model_str << std::endl; - std::cout << "Setting trop_model to OFF" << std::endl; + std::cout << "WARNING: Bad specification of tropospheric model.\n"; + std::cout << "trop_model possible values: OFF / Saastamoinen / SBAS / Estimate_ZTD / Estimate_ZTD_Grad\n"; + std::cout << "trop_model specified value: " << trop_model_str << '\n'; + std::cout << "Setting trop_model to OFF\n"; trop_model = TROPOPT_OFF; } @@ -236,10 +236,10 @@ rtk_t configure_rtklib_options() if (integer_ambiguity_resolution_gps == -1) { // warn user and set the default - std::cout << "WARNING: Bad specification of GPS ambiguity resolution method." << std::endl; - std::cout << "AR_GPS possible values: OFF / Continuous / Instantaneous / Fix-and-Hold / PPP-AR" << std::endl; - std::cout << "AR_GPS specified value: " << integer_ambiguity_resolution_gps_str << std::endl; - std::cout << "Setting AR_GPS to OFF" << std::endl; + std::cout << "WARNING: Bad specification of GPS ambiguity resolution method.\n"; + std::cout << "AR_GPS possible values: OFF / Continuous / Instantaneous / Fix-and-Hold / PPP-AR\n"; + std::cout << "AR_GPS specified value: " << integer_ambiguity_resolution_gps_str << '\n'; + std::cout << "Setting AR_GPS to OFF\n"; integer_ambiguity_resolution_gps = ARMODE_OFF; } @@ -393,7 +393,7 @@ TEST(RTKLibSolverTest, test1) std::string eph_xml_filename = path + "data/rtklib_test/eph_GPS_L1CA_test1.xml"; Gnss_Sdr_Supl_Client supl_client_ephemeris_; - std::cout << "SUPL: Try read GPS ephemeris from XML file " << eph_xml_filename << std::endl; + std::cout << "SUPL: Try read GPS ephemeris from XML file " << eph_xml_filename << '\n'; if (supl_client_ephemeris_.load_ephemeris_xml(eph_xml_filename) == true) { std::map::const_iterator gps_eph_iter; @@ -401,7 +401,7 @@ TEST(RTKLibSolverTest, test1) gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend(); gps_eph_iter++) { - std::cout << "SUPL: Read XML Ephemeris for GPS SV " << gps_eph_iter->first << std::endl; + std::cout << "SUPL: Read XML Ephemeris for GPS SV " << gps_eph_iter->first << '\n'; std::shared_ptr tmp_obj = std::make_shared(gps_eph_iter->second); // update/insert new ephemeris record to the global ephemeris map d_ls_pvt->gps_ephemeris_map[gps_eph_iter->first] = *tmp_obj; @@ -409,7 +409,7 @@ TEST(RTKLibSolverTest, test1) } else { - std::cout << "ERROR: SUPL client error reading XML" << std::endl; + std::cout << "ERROR: SUPL client error reading XML\n"; } // insert observables epoch @@ -433,7 +433,7 @@ TEST(RTKLibSolverTest, test1) boost::archive::xml_iarchive xml(ifs); gnss_synchro_map.clear(); xml >> boost::serialization::make_nvp("GNSS-SDR_gnss_synchro_map", gnss_synchro_map); - std::cout << "Loaded gnss_synchro map data with " << gnss_synchro_map.size() << " pseudoranges" << std::endl; + std::cout << "Loaded gnss_synchro map data with " << gnss_synchro_map.size() << " pseudoranges\n"; } catch (std::exception& e) { @@ -459,25 +459,25 @@ TEST(RTKLibSolverTest, test1) << std::fixed << std::setprecision(9) << " observations is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude() << std::fixed << std::setprecision(3) - << " [deg], Height = " << d_ls_pvt->get_height() << " [m]" << std::endl; + << " [deg], Height = " << d_ls_pvt->get_height() << " [m]\n"; std::cout << std::setprecision(ss); - std::cout << "RX clock offset: " << d_ls_pvt->get_time_offset_s() << "[s]" << std::endl; + std::cout << "RX clock offset: " << d_ls_pvt->get_time_offset_s() << "[s]\n"; // boost::posix_time::ptime p_time; // gtime_t rtklib_utc_time = gpst2time(adjgpsweek(d_ls_pvt->gps_ephemeris_map.cbegin()->second.i_GPS_week), d_rx_time); // p_time = boost::posix_time::from_time_t(rtklib_utc_time.time); // p_time += boost::posix_time::microseconds(round(rtklib_utc_time.sec * 1e6)); - // std::cout << TEXT_MAGENTA << "Observable RX time (GPST) " << boost::posix_time::to_simple_string(p_time) << TEXT_RESET << std::endl; + // std::cout << TEXT_MAGENTA << "Observable RX time (GPST) " << boost::posix_time::to_simple_string(p_time) << TEXT_RESET << '\n'; std::cout << "RTKLIB Position at RX TOW = " << gnss_synchro_map.begin()->second.RX_time << " in ECEF (X,Y,Z,t[meters]) = " << std::fixed << std::setprecision(16) << d_ls_pvt->pvt_sol.rr[0] << "," << d_ls_pvt->pvt_sol.rr[1] << "," - << d_ls_pvt->pvt_sol.rr[2] << std::endl; + << d_ls_pvt->pvt_sol.rr[2] << '\n'; /* std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time()) << " UTC using "<< d_ls_pvt->get_num_valid_observations() <<" observations is HDOP = " << d_ls_pvt->get_hdop() << " VDOP = " << d_ls_pvt->get_vdop() - << " GDOP = " << d_ls_pvt->get_gdop() << std::endl; */ + << " GDOP = " << d_ls_pvt->get_gdop() << '\n'; */ // todo: check here the positioning error against the reference position generated with gnss-sim // reference position on in WGS84: Lat (deg), Long (deg) , H (m): 30.286502,120.032669,100 @@ -486,9 +486,9 @@ TEST(RTKLibSolverTest, test1) double error_LLH_m = great_circle_distance(LLH(0), LLH(1), d_ls_pvt->get_latitude(), d_ls_pvt->get_longitude()); std::cout << "Lat, Long, H error: " << d_ls_pvt->get_latitude() - LLH(0) << "," << d_ls_pvt->get_longitude() - LLH(1) - << "," << d_ls_pvt->get_height() - LLH(2) << " [deg,deg,meters]" << std::endl; + << "," << d_ls_pvt->get_height() - LLH(2) << " [deg,deg,meters]\n"; - std::cout << "Haversine Great Circle error LLH distance: " << error_LLH_m << " [meters]" << std::endl; + std::cout << "Haversine Great Circle error LLH distance: " << error_LLH_m << " [meters]\n"; arma::vec v_eb_n = {0.0, 0.0, 0.0}; arma::vec true_r_eb_e; @@ -499,11 +499,11 @@ TEST(RTKLibSolverTest, test1) arma::vec error_r_eb_e = measured_r_eb_e - true_r_eb_e; - std::cout << "ECEF position error vector: " << error_r_eb_e << " [meters]" << std::endl; + std::cout << "ECEF position error vector: " << error_r_eb_e << " [meters]\n"; double error_3d_m = arma::norm(error_r_eb_e, 2); - std::cout << "3D positioning error: " << error_3d_m << " [meters]" << std::endl; + std::cout << "3D positioning error: " << error_3d_m << " [meters]\n"; // check results against the test tolerance ASSERT_LT(error_3d_m, 0.2); diff --git a/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc b/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc index 31157617c..fc109cd77 100644 --- a/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc @@ -67,5 +67,5 @@ TEST(DirectResamplerConditionerCcTest, InstantiationAndRunTest) top_block->stop(); }) << "Failure running direct_resampler_conditioner."; - std::cout << "Resampled " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Resampled " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } diff --git a/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc b/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc index 4018380a2..1d855049d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc @@ -68,7 +68,7 @@ TEST(MmseResamplerTest, InstantiationAndRunTestWarning) top_block->stop(); }) << "Failure running direct_resampler_conditioner."; - std::cout << "Resampled " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Resampled " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -109,5 +109,5 @@ TEST(MmseResamplerTest, InstantiationAndRunTest2) top_block->stop(); }) << "Failure running direct_resampler_conditioner."; - std::cout << "Resampled " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Resampled " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } diff --git a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc index 550ff3a30..fa0d2ac58 100644 --- a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc @@ -108,7 +108,7 @@ public: if (INAV_decoder.get_flag_CRC_test() == true) { std::cout << "Galileo E1 INAV PAGE CRC correct \n"; - // std::cout << "Galileo E1 CRC correct on channel " << d_channel << " from satellite " << d_satellite << std::endl; + // std::cout << "Galileo E1 CRC correct on channel " << d_channel << " from satellite " << d_satellite << '\n'; crc_ok = true; } flag_even_word_arrived = 0; @@ -270,5 +270,5 @@ TEST_F(Galileo_FNAV_INAV_test, ValidationOfResults) }) << "Exception during INAV frame decoding"; end = std::chrono::system_clock::now(); elapsed_seconds = end - start; - std::cout << "Galileo FNAV/INAV Test completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Galileo FNAV/INAV Test completed in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } diff --git a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc index e55639437..c9ba88913 100644 --- a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc @@ -258,13 +258,13 @@ int GpsL1CATelemetryDecoderTest::generate_signal() else if (pid == 0) { execv(&generator_binary[0], parmList); - std::cout << "Return not expected. Must be an execv err." << std::endl; + std::cout << "Return not expected. Must be an execv err.\n"; std::terminate(); } waitpid(pid, &child_status, 0); - std::cout << "Signal and Observables RINEX and RAW files created." << std::endl; + std::cout << "Signal and Observables RINEX and RAW files created.\n"; return 0; } @@ -329,7 +329,7 @@ void GpsL1CATelemetryDecoderTest::check_results(arma::vec& true_time_s, << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error - << " [Seconds]" << std::endl; + << " [Seconds]\n"; std::cout.precision(ss); ASSERT_LT(rmse, 0.3E-6); @@ -360,7 +360,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) // open true observables log file written by the simulator Tracking_True_Obs_Reader true_obs_data; int test_satellite_PRN = FLAGS_test_satellite_PRN; - std::cout << "Testing satellite PRN=" << test_satellite_PRN << std::endl; + std::cout << "Testing satellite PRN=" << test_satellite_PRN << '\n'; std::string true_obs_file = std::string("./gps_l1_ca_obs_prn"); true_obs_file.append(std::to_string(test_satellite_PRN)); true_obs_file.append(".dat"); @@ -388,7 +388,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) // restart the epoch counter true_obs_data.restart(); - std::cout << "Initial Doppler [Hz]=" << true_obs_data.doppler_l1_hz << " Initial code delay [Chips]=" << true_obs_data.prn_delay_chips << std::endl; + std::cout << "Initial Doppler [Hz]=" << true_obs_data.doppler_l1_hz << " Initial code delay [Chips]=" << true_obs_data.prn_delay_chips << '\n'; gnss_synchro.Acq_delay_samples = (GPS_L1_CA_CODE_LENGTH_CHIPS - true_obs_data.prn_delay_chips / GPS_L1_CA_CODE_LENGTH_CHIPS) * baseband_sampling_freq * GPS_L1_CA_CODE_PERIOD_S; gnss_synchro.Acq_doppler_hz = true_obs_data.doppler_l1_hz; gnss_synchro.Acq_samplestamp_samples = 0; @@ -435,7 +435,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) // check results // load the true values int64_t nepoch = true_obs_data.num_epochs(); - std::cout << "True observation epochs=" << nepoch << std::endl; + std::cout << "True observation epochs=" << nepoch << '\n'; arma::vec true_timestamp_s = arma::zeros(nepoch, 1); arma::vec true_acc_carrier_phase_cycles = arma::zeros(nepoch, 1); @@ -464,7 +464,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) }) << "Failure opening telemetry dump file"; nepoch = tlm_dump.num_epochs(); - std::cout << "Measured observation epochs=" << nepoch << std::endl; + std::cout << "Measured observation epochs=" << nepoch << '\n'; arma::vec tlm_timestamp_s = arma::zeros(nepoch, 1); arma::vec tlm_TOW_at_Preamble = arma::zeros(nepoch, 1); @@ -487,5 +487,5 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) check_results(true_timestamp_s, true_tow_s, tlm_timestamp_s, tlm_tow_s); - std::cout << "Test completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Test completed in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc index 1f803c077..07c3ddb5b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc @@ -124,7 +124,7 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime) for (int correlation_sizes_idx = 0; correlation_sizes_idx < 3; correlation_sizes_idx++) { for (int current_max_threads = 1; current_max_threads < (max_threads + 1); current_max_threads++) { - std::cout << "Running " << current_max_threads << " concurrent correlators" << std::endl; + std::cout << "Running " << current_max_threads << " concurrent correlators\n"; start = std::chrono::system_clock::now(); // create the concurrent correlator threads for (int current_thread = 0; current_thread < current_max_threads; current_thread++) @@ -148,7 +148,7 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime) elapsed_seconds = end - start; execution_times[correlation_sizes_idx] = elapsed_seconds.count() / static_cast(FLAGS_cpu_multicorrelator_real_codes_iterations_test); std::cout << "CPU Multicorrelator (real codes) execution time for length=" << correlation_sizes[correlation_sizes_idx] - << " : " << execution_times[correlation_sizes_idx] << " [s]" << std::endl; + << " : " << execution_times[correlation_sizes_idx] << " [s]\n"; } }); @@ -222,7 +222,7 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTimeAlloc) for (int correlation_sizes_idx = 0; correlation_sizes_idx < 3; correlation_sizes_idx++) { for (int current_max_threads = 1; current_max_threads < (max_threads + 1); current_max_threads++) { - std::cout << "Running " << current_max_threads << " concurrent correlators" << std::endl; + std::cout << "Running " << current_max_threads << " concurrent correlators\n"; start = std::chrono::system_clock::now(); // create the concurrent correlator threads for (int current_thread = 0; current_thread < current_max_threads; current_thread++) @@ -246,7 +246,7 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTimeAlloc) elapsed_seconds = end - start; execution_times[correlation_sizes_idx] = elapsed_seconds.count() / static_cast(FLAGS_cpu_multicorrelator_real_codes_iterations_test); std::cout << "CPU Multicorrelator (real codes) execution time for length=" << correlation_sizes[correlation_sizes_idx] - << " : " << execution_times[correlation_sizes_idx] << " [s]" << std::endl; + << " : " << execution_times[correlation_sizes_idx] << " [s]\n"; } }); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc index 9dad1c863..fd37e86b9 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc @@ -120,7 +120,7 @@ TEST(CpuMulticorrelatorTest, MeasureExecutionTime) for (int correlation_sizes_idx = 0; correlation_sizes_idx < 3; correlation_sizes_idx++) { for (int current_max_threads = 1; current_max_threads < (max_threads + 1); current_max_threads++) { - std::cout << "Running " << current_max_threads << " concurrent correlators" << std::endl; + std::cout << "Running " << current_max_threads << " concurrent correlators\n"; start = std::chrono::system_clock::now(); // create the concurrent correlator threads for (int current_thread = 0; current_thread < current_max_threads; current_thread++) @@ -143,7 +143,7 @@ TEST(CpuMulticorrelatorTest, MeasureExecutionTime) elapsed_seconds = end - start; execution_times[correlation_sizes_idx] = elapsed_seconds.count() / static_cast(FLAGS_cpu_multicorrelator_iterations_test); std::cout << "CPU Multicorrelator execution time for length=" << correlation_sizes[correlation_sizes_idx] - << " : " << execution_times[correlation_sizes_idx] << " [s]" << std::endl; + << " : " << execution_times[correlation_sizes_idx] << " [s]\n"; } }); @@ -218,7 +218,7 @@ TEST(CpuMulticorrelatorTest, MeasureExecutionTimeAlloc) for (int correlation_sizes_idx = 0; correlation_sizes_idx < 3; correlation_sizes_idx++) { for (int current_max_threads = 1; current_max_threads < (max_threads + 1); current_max_threads++) { - std::cout << "Running " << current_max_threads << " concurrent correlators" << std::endl; + std::cout << "Running " << current_max_threads << " concurrent correlators\n"; start = std::chrono::system_clock::now(); // create the concurrent correlator threads for (int current_thread = 0; current_thread < current_max_threads; current_thread++) @@ -241,7 +241,7 @@ TEST(CpuMulticorrelatorTest, MeasureExecutionTimeAlloc) elapsed_seconds = end - start; execution_times[correlation_sizes_idx] = elapsed_seconds.count() / static_cast(FLAGS_cpu_multicorrelator_iterations_test); std::cout << "CPU Multicorrelator execution time for length=" << correlation_sizes[correlation_sizes_idx] - << " : " << execution_times[correlation_sizes_idx] << " [s]" << std::endl; + << " : " << execution_times[correlation_sizes_idx] << " [s]\n"; } }); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc index 76e1df291..9c158bb65 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc @@ -138,7 +138,7 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun) elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } @@ -200,5 +200,5 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults) elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Tracked " << num_samples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Tracked " << num_samples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc index 307d35945..5db62ed90 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc @@ -143,5 +143,5 @@ TEST_F(GalileoE5aTrackingTest, ValidationOfResults) elapsed_seconds = end - start; }) << "Failure running the top_block."; - std::cout << "Tracked " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Tracked " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc index cd01585bf..514cc953f 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc @@ -201,5 +201,5 @@ TEST_F(GlonassL1CaDllPllCAidTrackingTest, ValidationOfResults) }) << "Failure running the top_block."; // TODO: Verify tracking results - std::cout << "Tracked " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Tracked " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc index ae99757d1..eb0ae14b5 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc @@ -208,5 +208,5 @@ TEST_F(GlonassL1CaDllPllTrackingTest, ValidationOfResults) }) << "Failure running the top_block."; // TODO: Verify tracking results - std::cout << "Tracked " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Tracked " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc index 7f4904c68..6783b151b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc @@ -109,7 +109,7 @@ void GpsL1CADllPllTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg) { int64_t message = pmt::to_long(std::move(msg)); rx_message = message; // 3 -> loss of lock - // std::cout << "Received trk message: " << rx_message << std::endl; + // std::cout << "Received trk message: " << rx_message << '\n'; } catch (boost::bad_any_cast& e) { @@ -243,13 +243,13 @@ int GpsL1CADllPllTrackingTest::generate_signal() else if (pid == 0) { execv(&generator_binary[0], parmList); - std::cout << "Return not expected. Must be an execv err." << std::endl; + std::cout << "Return not expected. Must be an execv err.\n"; std::terminate(); } waitpid(pid, &child_status, 0); - std::cout << "Signal and Observables RINEX and RAW files created." << std::endl; + std::cout << "Signal and Observables RINEX and RAW files created.\n"; return 0; } @@ -340,7 +340,7 @@ std::vector GpsL1CADllPllTrackingTest::check_results_doppler(arma::vec& std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << "TRK Doppler RMSE=" << rmse << ", mean=" << error_mean - << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Hz]" << std::endl; + << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Hz]\n"; std::cout.precision(ss); return err_std_vector; } @@ -389,7 +389,7 @@ std::vector GpsL1CADllPllTrackingTest::check_results_acc_carrier_phase(a std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << "TRK acc carrier phase RMSE=" << rmse << ", mean=" << error_mean - << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Hz]" << std::endl; + << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Hz]\n"; std::cout.precision(ss); return err_std_vector; } @@ -439,7 +439,7 @@ std::vector GpsL1CADllPllTrackingTest::check_results_codephase(arma::vec std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << "TRK code phase RMSE=" << rmse << ", mean=" << error_mean - << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Chips]" << std::endl; + << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Chips]\n"; std::cout.precision(ss); return err_std_vector; } @@ -595,11 +595,11 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) ASSERT_EQ(true_obs_data.open_obs_file(true_obs_file), true) << "Failure opening true observables file"; // load acquisition data based on the first epoch of the true observations ASSERT_EQ(true_obs_data.read_binary_obs(), true) - << "Failure reading true tracking dump file." << std::endl + << "Failure reading true tracking dump file.\n" << "Maybe sat PRN #" + std::to_string(FLAGS_test_satellite_PRN) + " is not available?"; - std::cout << "Testing satellite PRN=" << test_satellite_PRN << std::endl; - std::cout << "Initial Doppler [Hz]=" << true_obs_data.doppler_l1_hz << " Initial code delay [Chips]=" << true_obs_data.prn_delay_chips << std::endl; + std::cout << "Testing satellite PRN=" << test_satellite_PRN << '\n'; + std::cout << "Initial Doppler [Hz]=" << true_obs_data.doppler_l1_hz << " Initial code delay [Chips]=" << true_obs_data.prn_delay_chips << '\n'; acq_doppler_hz = true_obs_data.doppler_l1_hz; acq_delay_samples = (GPS_L1_CA_CODE_LENGTH_CHIPS - true_obs_data.prn_delay_chips / GPS_L1_CA_CODE_LENGTH_CHIPS) * static_cast(baseband_sampling_freq) * GPS_L1_CA_CODE_PERIOD_S; // restart the epoch counter @@ -646,7 +646,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) // ******************************************************************** // ***** STEP 5: Perform the signal tracking and read the results ***** // ******************************************************************** - std::cout << "------------ START TRACKING -------------" << std::endl; + std::cout << "------------ START TRACKING -------------\n"; tracking->start_tracking(); EXPECT_NO_THROW({ @@ -656,7 +656,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) }) << "Failure running the top_block."; std::chrono::duration elapsed_seconds = end - start; - std::cout << "Signal tracking completed in " << elapsed_seconds.count() << " seconds" << std::endl; + std::cout << "Signal tracking completed in " << elapsed_seconds.count() << " seconds\n"; int tracking_last_msg = msg_rx->rx_message; // save last aasynchronous tracking message in order to detect a loss of lock @@ -667,7 +667,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) << "Failure opening tracking dump file"; int64_t n_measured_epochs = trk_dump.num_epochs(); - // std::cout << "Measured observation epochs=" << n_measured_epochs << std::endl; + // std::cout << "Measured observation epochs=" << n_measured_epochs << '\n'; arma::vec trk_timestamp_s = arma::zeros(n_measured_epochs, 1); arma::vec trk_acc_carrier_phase_cycles = arma::zeros(n_measured_epochs, 1); @@ -724,7 +724,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) { // load the true values int64_t n_true_epochs = true_obs_data.num_epochs(); - // std::cout << "True observation epochs=" << n_true_epochs << std::endl; + // std::cout << "True observation epochs=" << n_true_epochs << '\n'; arma::vec true_timestamp_s = arma::zeros(n_true_epochs, 1); arma::vec true_acc_carrier_phase_cycles = arma::zeros(n_true_epochs, 1); @@ -789,12 +789,12 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) } else { - std::cout << "Tracking output could not be used, possible loss of lock " << std::endl; + std::cout << "Tracking output could not be used, possible loss of lock \n"; } } catch (const std::exception& ex) { - std::cout << "Tracking output could not be used, possible loss of lock " << ex.what() << std::endl; + std::cout << "Tracking output could not be used, possible loss of lock " << ex.what() << '\n'; } } } // CN0 LOOP @@ -825,9 +825,9 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) const std::string gnuplot_executable(FLAGS_gnuplot_executable); if (gnuplot_executable.empty()) { - std::cout << "WARNING: Although the flag plot_gps_l1_tracking_test has been set to TRUE," << std::endl; - std::cout << "gnuplot has not been found in your system." << std::endl; - std::cout << "Test results will not be plotted." << std::endl; + std::cout << "WARNING: Although the flag plot_gps_l1_tracking_test has been set to TRUE,\n"; + std::cout << "gnuplot has not been found in your system.\n"; + std::cout << "Test results will not be plotted.\n"; } else { @@ -1061,7 +1061,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) } catch (const GnuplotException& ge) { - std::cout << ge.what() << std::endl; + std::cout << ge.what() << '\n'; } } } @@ -1069,7 +1069,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) if (FLAGS_plot_gps_l1_tracking_test == true) { - std::cout << "Plotting performance metrics..." << std::endl; + std::cout << "Plotting performance metrics...\n"; try { if (generator_CN0_values.size() > 1) @@ -1159,7 +1159,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) } catch (const GnuplotException& ge) { - std::cout << ge.what() << std::endl; + std::cout << ge.what() << '\n'; } } } diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc index fbd0cbd75..2558aad3a 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc @@ -84,7 +84,7 @@ void send_tracking_gps_input_samples(FILE *rx_signal_file, buffer_DMA = reinterpret_cast(malloc(DMA_TRACK_TRANSFER_SIZE)); if (!buffer_DMA) { - std::cerr << "Memory error!" << std::endl; + std::cerr << "Memory error!\n"; close(dma_descr); return; } @@ -105,7 +105,7 @@ void send_tracking_gps_input_samples(FILE *rx_signal_file, size_t result = fread(buffer_DMA, DMA_TRACK_TRANSFER_SIZE, 1, rx_signal_file); if (result != DMA_TRACK_TRANSFER_SIZE) { - std::cerr << "Error reading from DMA" << std::endl; + std::cerr << "Error reading from DMA\n"; } assert(DMA_TRACK_TRANSFER_SIZE == write(dma_descr, &buffer_DMA[0], DMA_TRACK_TRANSFER_SIZE)); @@ -117,7 +117,7 @@ void send_tracking_gps_input_samples(FILE *rx_signal_file, size_t result = fread(buffer_DMA, num_remaining_samples, 1, rx_signal_file); if (static_cast(result) != num_remaining_samples) { - std::cerr << "Error reading from DMA" << std::endl; + std::cerr << "Error reading from DMA\n"; } assert(num_remaining_samples == write(dma_descr, &buffer_DMA[0], num_remaining_samples)); num_samples_transferred = num_samples_transferred + num_remaining_samples; @@ -140,7 +140,7 @@ void sending_thread(const gr::top_block_sptr &top_block, const char *file_name) rx_signal_file = fopen(file_name, "rb"); if (!rx_signal_file) { - std::cerr << "Unable to open file!" << std::endl; + std::cerr << "Unable to open file!\n"; return; } @@ -308,13 +308,13 @@ int GpsL1CADllPllTrackingTestFpga::generate_signal() else if (pid == 0) { execv(&generator_binary[0], parmList); - std::cout << "Return not expected. Must be an execv err." << std::endl; + std::cout << "Return not expected. Must be an execv err.\n"; std::terminate(); } waitpid(pid, &child_status, 0); - std::cout << "Signal and Observables RINEX and RAW files created." << std::endl; + std::cout << "Signal and Observables RINEX and RAW files created.\n"; return 0; } @@ -375,7 +375,7 @@ void GpsL1CADllPllTrackingTestFpga::check_results_doppler(arma::vec &true_time_s std::cout << std::setprecision(10) << "TRK Doppler RMSE=" << rmse << ", mean=" << error_mean << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Hz]" - << std::endl; + << '\n'; std::cout.precision(ss); } @@ -414,7 +414,7 @@ void GpsL1CADllPllTrackingTestFpga::check_results_acc_carrier_phase( std::cout << std::setprecision(10) << "TRK acc carrier phase RMSE=" << rmse << ", mean=" << error_mean << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Hz]" - << std::endl; + << '\n'; std::cout.precision(ss); } @@ -452,7 +452,7 @@ void GpsL1CADllPllTrackingTestFpga::check_results_codephase( std::cout << std::setprecision(10) << "TRK code phase RMSE=" << rmse << ", mean=" << error_mean << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Chips]" - << std::endl; + << '\n'; std::cout.precision(ss); } @@ -473,7 +473,7 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) // open true observables log file written by the simulator Tracking_True_Obs_Reader true_obs_data; int test_satellite_PRN = FLAGS_test_satellite_PRN; - std::cout << "Testing satellite PRN=" << test_satellite_PRN << std::endl; + std::cout << "Testing satellite PRN=" << test_satellite_PRN << '\n'; std::string true_obs_file = std::string("./gps_l1_ca_obs_prn"); true_obs_file.append(std::to_string(test_satellite_PRN)); true_obs_file.append(".dat"); @@ -507,7 +507,7 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) std::cout << "Initial Doppler [Hz]=" << true_obs_data.doppler_l1_hz << " Initial code delay [Chips]=" << true_obs_data.prn_delay_chips - << std::endl; + << '\n'; gnss_synchro.Acq_delay_samples = (GPS_L1_CA_CODE_LENGTH_CHIPS - true_obs_data.prn_delay_chips / GPS_L1_CA_CODE_LENGTH_CHIPS) * baseband_sampling_freq * GPS_L1_CA_CODE_PERIOD_S; gnss_synchro.Acq_doppler_hz = true_obs_data.doppler_l1_hz; @@ -564,7 +564,7 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) // check results // load the true values int64_t nepoch = true_obs_data.num_epochs(); - std::cout << "True observation epochs=" << nepoch << std::endl; + std::cout << "True observation epochs=" << nepoch << '\n'; arma::vec true_timestamp_s = arma::zeros(nepoch, 1); arma::vec true_acc_carrier_phase_cycles = arma::zeros(nepoch, 1); @@ -595,7 +595,7 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) << "Failure opening tracking dump file"; nepoch = trk_dump.num_epochs(); - std::cout << "Measured observation epochs=" << nepoch << std::endl; + std::cout << "Measured observation epochs=" << nepoch << '\n'; arma::vec trk_timestamp_s = arma::zeros(nepoch, 1); arma::vec trk_acc_carrier_phase_cycles = arma::zeros(nepoch, 1); @@ -630,5 +630,5 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) true_acc_carrier_phase_cycles, trk_timestamp_s, trk_acc_carrier_phase_cycles); - std::cout << "Signal tracking completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Signal tracking completed in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc index 3e5513c03..bc3154f67 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc @@ -229,13 +229,13 @@ int GpsL1CAKfTrackingTest::generate_signal() else if (pid == 0) { execv(&generator_binary[0], parmList); - std::cout << "Return not expected. Must be an execv err." << std::endl; + std::cout << "Return not expected. Must be an execv err.\n"; std::terminate(); } waitpid(pid, &child_status, 0); - std::cout << "Signal and Observables RINEX and RAW files created." << std::endl; + std::cout << "Signal and Observables RINEX and RAW files created.\n"; return 0; } @@ -301,7 +301,7 @@ void GpsL1CAKfTrackingTest::check_results_doppler(arma::vec& true_time_s, std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << "TRK Doppler RMSE=" << rmse << ", mean=" << error_mean - << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Hz]" << std::endl; + << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Hz]\n"; std::cout.precision(ss); } @@ -340,7 +340,7 @@ void GpsL1CAKfTrackingTest::check_results_acc_carrier_phase(arma::vec& true_time std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << "TRK acc carrier phase RMSE=" << rmse << ", mean=" << error_mean - << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Hz]" << std::endl; + << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Hz]\n"; std::cout.precision(ss); } @@ -380,7 +380,7 @@ void GpsL1CAKfTrackingTest::check_results_codephase(arma::vec& true_time_s, std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << "TRK code phase RMSE=" << rmse << ", mean=" << error_mean - << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Chips]" << std::endl; + << ", stdev=" << sqrt(error_var) << " (max,min)=" << max_error << "," << min_error << " [Chips]\n"; std::cout.precision(ss); } @@ -403,7 +403,7 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults) // open true observables log file written by the simulator Tracking_True_Obs_Reader true_obs_data; int test_satellite_PRN = FLAGS_test_satellite_PRN; - std::cout << "Testing satellite PRN=" << test_satellite_PRN << std::endl; + std::cout << "Testing satellite PRN=" << test_satellite_PRN << '\n'; std::string true_obs_file = std::string("./gps_l1_ca_obs_prn"); true_obs_file.append(std::to_string(test_satellite_PRN)); true_obs_file.append(".dat"); @@ -418,14 +418,14 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults) // load acquisition data based on the first epoch of the true observations ASSERT_EQ(true_obs_data.read_binary_obs(), true) - << "Failure reading true tracking dump file." << std::endl + << "Failure reading true tracking dump file.\n" << "Maybe sat PRN #" + std::to_string(FLAGS_test_satellite_PRN) + " is not available?"; // restart the epoch counter true_obs_data.restart(); - std::cout << "Initial Doppler [Hz]=" << true_obs_data.doppler_l1_hz << " Initial code delay [Chips]=" << true_obs_data.prn_delay_chips << std::endl; + std::cout << "Initial Doppler [Hz]=" << true_obs_data.doppler_l1_hz << " Initial code delay [Chips]=" << true_obs_data.prn_delay_chips << '\n'; gnss_synchro.Acq_delay_samples = (GPS_L1_CA_CODE_LENGTH_CHIPS - true_obs_data.prn_delay_chips / GPS_L1_CA_CODE_LENGTH_CHIPS) * baseband_sampling_freq * GPS_L1_CA_CODE_PERIOD_S; gnss_synchro.Acq_doppler_hz = true_obs_data.doppler_l1_hz; gnss_synchro.Acq_samplestamp_samples = 0; @@ -465,7 +465,7 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults) // check results // load the true values long int nepoch = true_obs_data.num_epochs(); - std::cout << "True observation epochs=" << nepoch << std::endl; + std::cout << "True observation epochs=" << nepoch << '\n'; arma::vec true_timestamp_s = arma::zeros(nepoch, 1); arma::vec true_acc_carrier_phase_cycles = arma::zeros(nepoch, 1); @@ -491,7 +491,7 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults) << "Failure opening tracking dump file"; nepoch = trk_dump.num_epochs(); - std::cout << "Measured observation epochs=" << nepoch << std::endl; + std::cout << "Measured observation epochs=" << nepoch << '\n'; // trk_dump.restart(); arma::vec trk_timestamp_s = arma::zeros(nepoch, 1); @@ -536,16 +536,16 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults) check_results_acc_carrier_phase(true_timestamp_s, true_acc_carrier_phase_cycles, trk_timestamp_s, trk_acc_carrier_phase_cycles); std::chrono::duration elapsed_seconds = end - start; - std::cout << "Signal tracking completed in " << elapsed_seconds.count() << " seconds." << std::endl; + std::cout << "Signal tracking completed in " << elapsed_seconds.count() << " seconds.\n"; if (FLAGS_plot_gps_l1_kf_tracking_test == true) { const std::string gnuplot_executable(FLAGS_gnuplot_executable); if (gnuplot_executable.empty()) { - std::cout << "WARNING: Although the flag plot_gps_l1_tracking_test has been set to TRUE," << std::endl; - std::cout << "gnuplot has not been found in your system." << std::endl; - std::cout << "Test results will not be plotted." << std::endl; + std::cout << "WARNING: Although the flag plot_gps_l1_tracking_test has been set to TRUE,\n"; + std::cout << "gnuplot has not been found in your system.\n"; + std::cout << "Test results will not be plotted.\n"; } else { @@ -604,7 +604,7 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults) } catch (const GnuplotException& ge) { - std::cout << ge.what() << std::endl; + std::cout << ge.what() << '\n'; } } } diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc index 9e678dbed..ff201892d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc @@ -215,5 +215,5 @@ TEST_F(GpsL2MDllPllTrackingTest, ValidationOfResults) }) << "Failure running the top_block."; // TODO: Verify tracking results - std::cout << "Tracked " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; + std::cout << "Tracked " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds\n"; } diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc index b20a8cec0..31a64561d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc @@ -112,7 +112,7 @@ TEST(GpuMulticorrelatorTest, MeasureExecutionTime) for (int correlation_sizes_idx = 0; correlation_sizes_idx < 3; correlation_sizes_idx++) { for (int current_max_threads = 1; current_max_threads < (max_threads + 1); current_max_threads++) { - std::cout << "Running " << current_max_threads << " concurrent correlators" << std::endl; + std::cout << "Running " << current_max_threads << " concurrent correlators\n"; start = std::chrono::system_clock::now(); // create the concurrent correlator threads for (int current_thread = 0; current_thread < current_max_threads; current_thread++) @@ -137,7 +137,7 @@ TEST(GpuMulticorrelatorTest, MeasureExecutionTime) end = std::chrono::system_clock::now(); elapsed_seconds = end - start; execution_times[correlation_sizes_idx] = elapsed_seconds.count() / static_cast(FLAGS_gpu_multicorrelator_iterations_test); - std::cout << "GPU Multicorrelator execution time for length=" << correlation_sizes[correlation_sizes_idx] << " : " << execution_times[correlation_sizes_idx] << " [s]" << std::endl; + std::cout << "GPU Multicorrelator execution time for length=" << correlation_sizes[correlation_sizes_idx] << " : " << execution_times[correlation_sizes_idx] << " [s]\n"; } }); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc index fdbf8173e..6a36a6597 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc @@ -125,7 +125,7 @@ void TrackingPullInTest_msg_rx::msg_handler_events(pmt::pmt_t msg) { int64_t message = pmt::to_long(std::move(msg)); rx_message = message; // 3 -> loss of lock - // std::cout << "Received trk message: " << rx_message << std::endl; + // std::cout << "Received trk message: " << rx_message << '\n'; } catch (boost::bad_any_cast& e) { @@ -282,13 +282,13 @@ int TrackingPullInTest::generate_signal() else if (pid == 0) { execv(&generator_binary[0], parmList); - std::cout << "Return not expected. Must be an execv err." << std::endl; + std::cout << "Return not expected. Must be an execv err.\n"; std::terminate(); } waitpid(pid, &child_status, 0); - std::cout << "Signal and Observables RINEX and RAW files created." << std::endl; + std::cout << "Signal and Observables RINEX and RAW files created.\n"; return 0; } @@ -569,7 +569,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) acq_fs / 2.1, acq_fs / 10, gr::filter::firdes::win_type::WIN_HAMMING); - std::cout << "Enabled decimation low pass filter with " << taps.size() << " taps and decimation factor of " << decimation << std::endl; + std::cout << "Enabled decimation low pass filter with " << taps.size() << " taps and decimation factor of " << decimation << '\n'; acquisition->set_resampler_latency((taps.size() - 1) / 2); gr::basic_block_sptr fir_filter_ccf_ = gr::filter::fir_filter_ccf::make(decimation, taps); top_block_acq->connect(gr_interleaved_char_to_complex, 0, fir_filter_ccf_, 0); @@ -603,7 +603,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) } catch (const std::exception& e) { - std::cout << "Failure connecting the message port system: " << e.what() << std::endl; + std::cout << "Failure connecting the message port system: " << e.what() << '\n'; exit(0); } @@ -649,8 +649,8 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) top_block_acq->run(); if (start_msg == true) { - std::cout << "Reading external signal file: " << FLAGS_signal_file << std::endl; - std::cout << "Searching for " << System_and_Signal << " Satellites..." << std::endl; + std::cout << "Reading external signal file: " << FLAGS_signal_file << '\n'; + std::cout << "Searching for " << System_and_Signal << " Satellites...\n"; std::cout << "["; start_msg = false; } @@ -673,7 +673,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) file_source->seek(2 * FLAGS_skip_samples, SEEK_SET); // skip head. ibyte, two bytes per complex sample std::cout.flush(); } - std::cout << "]" << std::endl; + std::cout << "]\n"; std::cout << "-------------------------------------------\n"; for (auto& x : doppler_measurements_map) @@ -686,7 +686,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) elapsed_seconds = end - start; std::cout << "Total signal acquisition run time " << elapsed_seconds.count() - << " [seconds]" << std::endl; + << " [seconds]\n"; return true; } @@ -786,11 +786,11 @@ TEST_F(TrackingPullInTest, ValidationOfResults) ASSERT_EQ(true_obs_data.open_obs_file(true_obs_file), true) << "Failure opening true observables file"; // load acquisition data based on the first epoch of the true observations ASSERT_EQ(true_obs_data.read_binary_obs(), true) - << "Failure reading true tracking dump file." << std::endl + << "Failure reading true tracking dump file.\n" << "Maybe sat PRN #" + std::to_string(FLAGS_test_satellite_PRN) + " is not available?"; - std::cout << "Testing satellite PRN=" << test_satellite_PRN << std::endl; - std::cout << "True Initial Doppler " << true_obs_data.doppler_l1_hz << " [Hz], true Initial code delay [Chips]=" << true_obs_data.prn_delay_chips << "[Chips]" << std::endl; + std::cout << "Testing satellite PRN=" << test_satellite_PRN << '\n'; + std::cout << "True Initial Doppler " << true_obs_data.doppler_l1_hz << " [Hz], true Initial code delay [Chips]=" << true_obs_data.prn_delay_chips << "[Chips]\n"; true_acq_doppler_hz = true_obs_data.doppler_l1_hz; true_acq_delay_samples = (GPS_L1_CA_CODE_LENGTH_CHIPS - true_obs_data.prn_delay_chips / GPS_L1_CA_CODE_LENGTH_CHIPS) * static_cast(baseband_sampling_freq) * GPS_L1_CA_CODE_PERIOD_S; acq_samplestamp_samples = 0; @@ -802,7 +802,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults) acq_samplestamp_samples = 0; std::cout << "Estimated Initial Doppler " << true_acq_doppler_hz << " [Hz], estimated Initial code delay " << true_acq_delay_samples << " [Samples]" - << " Acquisition SampleStamp is " << acq_samplestamp_map.find(FLAGS_test_satellite_PRN)->second << std::endl; + << " Acquisition SampleStamp is " << acq_samplestamp_map.find(FLAGS_test_satellite_PRN)->second << '\n'; } // create the msg queue for valve @@ -878,7 +878,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults) // ******************************************************************** // ***** STEP 5: Perform the signal tracking and read the results ***** // ******************************************************************** - std::cout << "--- START TRACKING WITH PULL-IN ERROR: " << acq_doppler_error_hz_values.at(current_acq_doppler_error_idx) << " [Hz] and " << acq_delay_error_chips_values.at(current_acq_doppler_error_idx).at(current_acq_code_error_idx) << " [Chips] ---" << std::endl; + std::cout << "--- START TRACKING WITH PULL-IN ERROR: " << acq_doppler_error_hz_values.at(current_acq_doppler_error_idx) << " [Hz] and " << acq_delay_error_chips_values.at(current_acq_doppler_error_idx).at(current_acq_code_error_idx) << " [Chips] ---\n"; std::chrono::time_point start, end; if (acq_to_trk_delay_samples > 0) { @@ -909,7 +909,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults) } std::chrono::duration elapsed_seconds = end - start; - std::cout << "Signal tracking completed in " << elapsed_seconds.count() << " seconds" << std::endl; + std::cout << "Signal tracking completed in " << elapsed_seconds.count() << " seconds\n"; pull_in_results_v.push_back(msg_rx->rx_message != 3); // save last asynchronous tracking message in order to detect a loss of lock @@ -965,9 +965,9 @@ TEST_F(TrackingPullInTest, ValidationOfResults) const std::string gnuplot_executable(FLAGS_gnuplot_executable); if (gnuplot_executable.empty()) { - std::cout << "WARNING: Although the flag show_plots has been set to TRUE," << std::endl; - std::cout << "gnuplot has not been found in your system." << std::endl; - std::cout << "Test results will not be plotted." << std::endl; + std::cout << "WARNING: Although the flag show_plots has been set to TRUE,\n"; + std::cout << "gnuplot has not been found in your system.\n"; + std::cout << "Test results will not be plotted.\n"; } else { @@ -1072,7 +1072,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults) } catch (const GnuplotException& ge) { - std::cout << ge.what() << std::endl; + std::cout << ge.what() << '\n'; } } } // end plot diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc index 524a24e46..74b0eba55 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc @@ -206,7 +206,7 @@ void* handler_DMA_trk_pull_in_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception opening file " << Filename << std::endl; + std::cerr << "Exception opening file " << Filename << '\n'; return nullptr; } @@ -216,7 +216,7 @@ void* handler_DMA_trk_pull_in_test(void* arguments) tx_fd = open("/dev/loop_tx", O_WRONLY); if (tx_fd < 0) { - std::cout << "Cannot open loop device" << std::endl; + std::cout << "Cannot open loop device\n"; return nullptr; } @@ -233,7 +233,7 @@ void* handler_DMA_trk_pull_in_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception reading file " << Filename << std::endl; + std::cerr << "Exception reading file " << Filename << '\n'; } } @@ -260,7 +260,7 @@ void* handler_DMA_trk_pull_in_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception reading file " << Filename << std::endl; + std::cerr << "Exception reading file " << Filename << '\n'; } for (int index0 = 0; index0 < (nsamples_block_size * 2); index0 += 2) @@ -289,7 +289,7 @@ void* handler_DMA_trk_pull_in_test(void* arguments) if (write(tx_fd, input_samples_dma.data(), nsamples_block_size * 2 * 2) != nsamples_block_size * 2 * 2) { - std::cerr << "Error: DMA could not send all the required samples " << std::endl; + std::cerr << "Error: DMA could not send all the required samples \n"; } // Throttle the DMA @@ -309,7 +309,7 @@ void* handler_DMA_trk_pull_in_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception closing files " << Filename << std::endl; + std::cerr << "Exception closing files " << Filename << '\n'; } try @@ -318,7 +318,7 @@ void* handler_DMA_trk_pull_in_test(void* arguments) } catch (const std::ifstream::failure& e) { - std::cerr << "Exception closing loop device " << std::endl; + std::cerr << "Exception closing loop device \n"; } return nullptr; @@ -444,13 +444,13 @@ int TrackingPullInTestFpga::generate_signal() else if (pid == 0) { execv(&generator_binary[0], parmList); - std::cout << "Return not expected. Must be an execv err." << std::endl; + std::cout << "Return not expected. Must be an execv err.\n"; std::terminate(); } waitpid(pid, &child_status, 0); - std::cout << "Signal and Observables RINEX and RAW files created." << std::endl; + std::cout << "Signal and Observables RINEX and RAW files created.\n"; return 0; } @@ -747,7 +747,7 @@ bool TrackingPullInTestFpga::acquire_signal(int SV_ID) // create DMA child process if (pthread_create(&thread_DMA, nullptr, handler_DMA_trk_pull_in_test, reinterpret_cast(&args)) < 0) { - std::cout << "ERROR cannot create DMA Process" << std::endl; + std::cout << "ERROR cannot create DMA Process\n"; } pthread_join(thread_DMA, nullptr); @@ -769,13 +769,13 @@ bool TrackingPullInTestFpga::acquire_signal(int SV_ID) if (pthread_create(&thread_acquisition, nullptr, handler_acquisition_trk_pull_in_test, reinterpret_cast(&args_acq)) < 0) { - std::cout << "ERROR cannot create acquisition Process" << std::endl; + std::cout << "ERROR cannot create acquisition Process\n"; } if (start_msg == true) { - std::cout << "Reading external signal file: " << FLAGS_signal_file << std::endl; - std::cout << "Searching for " << System_and_Signal << " Satellites..." << std::endl; + std::cout << "Reading external signal file: " << FLAGS_signal_file << '\n'; + std::cout << "Searching for " << System_and_Signal << " Satellites...\n"; std::cout << "["; start_msg = false; } @@ -786,7 +786,7 @@ bool TrackingPullInTestFpga::acquire_signal(int SV_ID) // create DMA child process if (pthread_create(&thread_DMA, nullptr, handler_DMA_trk_pull_in_test, reinterpret_cast(&args)) < 0) { - std::cout << "ERROR cannot create DMA Process" << std::endl; + std::cout << "ERROR cannot create DMA Process\n"; } // wait until the acquisition is finished @@ -812,7 +812,7 @@ bool TrackingPullInTestFpga::acquire_signal(int SV_ID) std::cout.flush(); } - std::cout << "]" << std::endl; + std::cout << "]\n"; std::cout << "-------------------------------------------\n"; for (auto& x : doppler_measurements_map) @@ -825,7 +825,7 @@ bool TrackingPullInTestFpga::acquire_signal(int SV_ID) elapsed_seconds = end - start; std::cout << "Total signal acquisition run time " << elapsed_seconds.count() - << " [seconds]" << std::endl; + << " [seconds]\n"; return true; } @@ -930,11 +930,11 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) ASSERT_EQ(true_obs_data.open_obs_file(true_obs_file), true) << "Failure opening true observables file"; // load acquisition data based on the first epoch of the true observations ASSERT_EQ(true_obs_data.read_binary_obs(), true) - << "Failure reading true tracking dump file." << std::endl + << "Failure reading true tracking dump file.\n" << "Maybe sat PRN #" + std::to_string(FLAGS_test_satellite_PRN) + " is not available?"; - std::cout << "Testing satellite PRN=" << test_satellite_PRN << std::endl; - std::cout << "True Initial Doppler " << true_obs_data.doppler_l1_hz << " [Hz], true Initial code delay [Chips]=" << true_obs_data.prn_delay_chips << "[Chips]" << std::endl; + std::cout << "Testing satellite PRN=" << test_satellite_PRN << '\n'; + std::cout << "True Initial Doppler " << true_obs_data.doppler_l1_hz << " [Hz], true Initial code delay [Chips]=" << true_obs_data.prn_delay_chips << "[Chips]\n"; true_acq_doppler_hz = true_obs_data.doppler_l1_hz; true_acq_delay_samples = (GPS_L1_CA_CODE_LENGTH_CHIPS - true_obs_data.prn_delay_chips / GPS_L1_CA_CODE_LENGTH_CHIPS) * static_cast(baseband_sampling_freq) * GPS_L1_CA_CODE_PERIOD_S; acq_samplestamp_samples = 0; @@ -947,7 +947,7 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) std::cout << "Estimated Initial Doppler " << true_acq_doppler_hz << " [Hz], estimated Initial code delay " << true_acq_delay_samples << " [Samples]" - << " Acquisition SampleStamp is " << acq_samplestamp_map.find(FLAGS_test_satellite_PRN)->second << std::endl; + << " Acquisition SampleStamp is " << acq_samplestamp_map.find(FLAGS_test_satellite_PRN)->second << '\n'; } int64_t acq_to_trk_delay_samples = ceil(static_cast(FLAGS_fs_gen_sps) * FLAGS_acq_to_trk_delay_s); @@ -1044,7 +1044,7 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) // ******************************************************************** // ***** STEP 5: Perform the signal tracking and read the results ***** // ******************************************************************** - std::cout << "--- START TRACKING WITH PULL-IN ERROR: " << acq_doppler_error_hz_values.at(current_acq_doppler_error_idx) << " [Hz] and " << acq_delay_error_chips_values.at(current_acq_doppler_error_idx).at(current_acq_code_error_idx) << " [Chips] ---" << std::endl; + std::cout << "--- START TRACKING WITH PULL-IN ERROR: " << acq_doppler_error_hz_values.at(current_acq_doppler_error_idx) << " [Hz] and " << acq_delay_error_chips_values.at(current_acq_doppler_error_idx).at(current_acq_code_error_idx) << " [Chips] ---\n"; std::chrono::time_point start, end; top_block->start(); @@ -1062,7 +1062,7 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) if (pthread_create(&thread_DMA, nullptr, handler_DMA_trk_pull_in_test, reinterpret_cast(&args)) < 0) { - std::cout << "ERROR cannot create DMA Process" << std::endl; + std::cout << "ERROR cannot create DMA Process\n"; } } @@ -1078,7 +1078,7 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) if (pthread_create(&thread_DMA, nullptr, handler_DMA_trk_pull_in_test, reinterpret_cast(&args)) < 0) { - std::cout << "ERROR cannot create DMA Process" << std::endl; + std::cout << "ERROR cannot create DMA Process\n"; } // wait for the child DMA process to finish @@ -1094,7 +1094,7 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) acquisition->stop_acquisition(); std::chrono::duration elapsed_seconds = end - start; - std::cout << "Signal tracking completed in " << elapsed_seconds.count() << " seconds" << std::endl; + std::cout << "Signal tracking completed in " << elapsed_seconds.count() << " seconds\n"; pull_in_results_v.push_back(msg_rx->rx_message != 3); // save last asynchronous tracking message in order to detect a loss of lock @@ -1150,9 +1150,9 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) const std::string gnuplot_executable(FLAGS_gnuplot_executable); if (gnuplot_executable.empty()) { - std::cout << "WARNING: Although the flag show_plots has been set to TRUE," << std::endl; - std::cout << "gnuplot has not been found in your system." << std::endl; - std::cout << "Test results will not be plotted." << std::endl; + std::cout << "WARNING: Although the flag show_plots has been set to TRUE,\n"; + std::cout << "gnuplot has not been found in your system.\n"; + std::cout << "Test results will not be plotted.\n"; } else { @@ -1257,7 +1257,7 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) } catch (const GnuplotException& ge) { - std::cout << ge.what() << std::endl; + std::cout << ge.what() << '\n'; } } } // end plot diff --git a/src/utils/front-end-cal/front_end_cal.cc b/src/utils/front-end-cal/front_end_cal.cc index 023a030e1..18fdf94c0 100644 --- a/src/utils/front-end-cal/front_end_cal.cc +++ b/src/utils/front-end-cal/front_end_cal.cc @@ -48,7 +48,7 @@ bool FrontEndCal::read_assistance_from_XML() { Gnss_Sdr_Supl_Client supl_client_ephemeris_; std::string eph_xml_filename = "gps_ephemeris.xml"; - std::cout << "SUPL: Trying to read GPS ephemeris from XML file " << eph_xml_filename << std::endl; + std::cout << "SUPL: Trying to read GPS ephemeris from XML file " << eph_xml_filename << '\n'; LOG(INFO) << "SUPL: Trying to read GPS ephemeris from XML file " << eph_xml_filename; if (supl_client_ephemeris_.load_ephemeris_xml(eph_xml_filename) == true) { @@ -57,14 +57,14 @@ bool FrontEndCal::read_assistance_from_XML() gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.end(); gps_eph_iter++) { - std::cout << "SUPL: Read XML Ephemeris for GPS SV " << gps_eph_iter->first << std::endl; + std::cout << "SUPL: Read XML Ephemeris for GPS SV " << gps_eph_iter->first << '\n'; LOG(INFO) << "SUPL: Read XML Ephemeris for GPS SV " << gps_eph_iter->first; LOG(INFO) << "New Ephemeris record inserted with Toe=" << gps_eph_iter->second.d_Toe << " and GPS Week=" << gps_eph_iter->second.i_GPS_week; global_gps_ephemeris_map.write(gps_eph_iter->second.i_satellite_PRN, gps_eph_iter->second); } return true; } - std::cout << "ERROR: SUPL client error reading XML" << std::endl; + std::cout << "ERROR: SUPL client error reading XML\n"; LOG(WARNING) << "ERROR: SUPL client error reading XML"; return false; } @@ -126,7 +126,7 @@ int FrontEndCal::Get_SUPL_Assist() // Request ephemeris from SUPL server supl_client_ephemeris_.request = 1; LOG(INFO) << "SUPL: Trying to read GPS ephemeris from SUPL server..."; - std::cout << "SUPL: Trying to read GPS ephemeris from SUPL server..." << std::endl; + std::cout << "SUPL: Trying to read GPS ephemeris from SUPL server...\n"; error = supl_client_ephemeris_.get_assistance(supl_mcc, supl_mns, supl_lac, supl_ci); if (error == 0) { @@ -136,7 +136,7 @@ int FrontEndCal::Get_SUPL_Assist() gps_eph_iter++) { LOG(INFO) << "SUPL: Received Ephemeris for GPS SV " << gps_eph_iter->first; - std::cout << "SUPL: Received Ephemeris for GPS SV " << gps_eph_iter->first << std::endl; + std::cout << "SUPL: Received Ephemeris for GPS SV " << gps_eph_iter->first << '\n'; LOG(INFO) << "New Ephemeris record inserted with Toe=" << gps_eph_iter->second.d_Toe << " and GPS Week=" << gps_eph_iter->second.i_GPS_week; global_gps_ephemeris_map.write(gps_eph_iter->second.i_satellite_PRN, gps_eph_iter->second); } @@ -150,7 +150,7 @@ int FrontEndCal::Get_SUPL_Assist() else { LOG(WARNING) << "ERROR: SUPL client for Ephemeris returned " << error; - std::cout << "ERROR in SUPL client. Please check your Internet connection and SUPL server configuration" << std::endl; + std::cout << "ERROR in SUPL client. Please check your Internet connection and SUPL server configuration\n"; } // Request almanac , IONO and UTC Model @@ -165,32 +165,32 @@ int FrontEndCal::Get_SUPL_Assist() gps_alm_iter++) { LOG(INFO) << "SUPL: Received Almanac for GPS SV " << gps_alm_iter->first; - std::cout << "SUPL: Received Almanac for GPS SV " << gps_alm_iter->first << std::endl; + std::cout << "SUPL: Received Almanac for GPS SV " << gps_alm_iter->first << '\n'; global_gps_almanac_map.write(gps_alm_iter->first, gps_alm_iter->second); } if (supl_client_ephemeris_.gps_iono.valid == true) { LOG(INFO) << "SUPL: Received GPS Iono"; - std::cout << "SUPL: Received GPS Iono" << std::endl; + std::cout << "SUPL: Received GPS Iono\n"; global_gps_iono_map.write(0, supl_client_ephemeris_.gps_iono); } if (supl_client_ephemeris_.gps_utc.valid == true) { LOG(INFO) << "SUPL: Received GPS UTC Model"; - std::cout << "SUPL: Received GPS UTC Model" << std::endl; + std::cout << "SUPL: Received GPS UTC Model\n"; global_gps_utc_model_map.write(0, supl_client_ephemeris_.gps_utc); } } else { LOG(WARNING) << "ERROR: SUPL client for Almanac returned " << error; - std::cout << "ERROR in SUPL client. Please check your Internet connection and SUPL server configuration" << std::endl; + std::cout << "ERROR in SUPL client. Please check your Internet connection and SUPL server configuration\n"; } // Request acquisition assistance supl_client_acquisition_.request = 2; LOG(INFO) << "SUPL: Trying to read Acquisition assistance from SUPL server..."; - std::cout << "SUPL: Trying to read Acquisition assistance from SUPL server..." << std::endl; + std::cout << "SUPL: Trying to read Acquisition assistance from SUPL server...\n"; error = supl_client_acquisition_.get_assistance(supl_mcc, supl_mns, supl_lac, supl_ci); if (error == 0) @@ -201,7 +201,7 @@ int FrontEndCal::Get_SUPL_Assist() gps_acq_iter++) { LOG(INFO) << "SUPL: Received Acquisition assistance for GPS SV " << gps_acq_iter->first; - std::cout << "SUPL: Received Acquisition assistance for GPS SV " << gps_acq_iter->first << std::endl; + std::cout << "SUPL: Received Acquisition assistance for GPS SV " << gps_acq_iter->first << '\n'; LOG(INFO) << "New acq assist record inserted"; global_gps_acq_assist_map.write(gps_acq_iter->second.i_satellite_PRN, gps_acq_iter->second); } @@ -209,7 +209,7 @@ int FrontEndCal::Get_SUPL_Assist() else { LOG(WARNING) << "ERROR: SUPL client for Acquisition assistance returned " << error; - std::cout << "ERROR in SUPL client. Please check your Internet connection and SUPL server configuration" << std::endl; + std::cout << "ERROR in SUPL client. Please check your Internet connection and SUPL server configuration\n"; } } } @@ -229,11 +229,11 @@ bool FrontEndCal::get_ephemeris() if (read_ephemeris_from_xml == true) { - std::cout << "Trying to read ephemeris from XML file..." << std::endl; + std::cout << "Trying to read ephemeris from XML file...\n"; LOG(INFO) << "Trying to read ephemeris from XML file..."; if (read_assistance_from_XML() == false) { - std::cout << "ERROR: Could not read Ephemeris file: Trying to get ephemeris from SUPL server..." << std::endl; + std::cout << "ERROR: Could not read Ephemeris file: Trying to get ephemeris from SUPL server...\n"; LOG(INFO) << "ERROR: Could not read Ephemeris file: Trying to get ephemeris from SUPL server..."; if (Get_SUPL_Assist() == 1) { @@ -244,7 +244,7 @@ bool FrontEndCal::get_ephemeris() return true; } - std::cout << "Trying to read ephemeris from SUPL server..." << std::endl; + std::cout << "Trying to read ephemeris from SUPL server...\n"; LOG(INFO) << "Trying to read ephemeris from SUPL server..."; if (Get_SUPL_Assist() == 0) { diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index 39c15ce68..204975bb8 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -164,7 +164,7 @@ void wait_message() { int message; channel_internal_queue.wait_and_pop(message); - // std::cout<<"Acq message rx="<& configurat } catch (const boost::exception_ptr& e) { - std::cout << "Exception caught in creating signal conditioner " << e << std::endl; + std::cout << "Exception caught in creating signal conditioner " << e << '\n'; return false; } gr::block_sptr sink; @@ -240,7 +240,7 @@ bool front_end_capture(const std::shared_ptr& configurat } catch (const std::exception& e) { - std::cout << "Failure connecting the GNU Radio blocks " << e.what() << std::endl; + std::cout << "Failure connecting the GNU Radio blocks " << e.what() << '\n'; return false; } @@ -277,16 +277,16 @@ int main(int argc, char** argv) google::SetVersionString(FRONT_END_CAL_VERSION); google::ParseCommandLineFlags(&argc, &argv, true); - std::cout << "Initializing... Please wait." << std::endl; + std::cout << "Initializing... Please wait.\n"; google::InitGoogleLogging(argv[0]); if (FLAGS_log_dir.empty()) { std::cout << "Logging will be done at " << "/tmp" - << std::endl + << '\n' << "Use front-end-cal --log_dir=/path/to/log to change that." - << std::endl; + << '\n'; } else { @@ -296,11 +296,11 @@ int main(int argc, char** argv) std::cout << "The path " << FLAGS_log_dir << " does not exist, attempting to create it" - << std::endl; + << '\n'; fs::create_directory(p); } std::cout << "Logging with be done at " - << FLAGS_log_dir << std::endl; + << FLAGS_log_dir << '\n'; } // 0. Instantiate the FrontEnd Calibration class @@ -315,16 +315,16 @@ int main(int argc, char** argv) { if (front_end_cal.get_ephemeris() == true) { - std::cout << "SUPL data received OK!" << std::endl; + std::cout << "SUPL data received OK!\n"; } else { - std::cout << "Failure connecting to SUPL server" << std::endl; + std::cout << "Failure connecting to SUPL server\n"; } } catch (const boost::exception& e) { - std::cout << "Failure connecting to SUPL server" << std::endl; + std::cout << "Failure connecting to SUPL server\n"; } // 3. Capture some front-end samples to hard disk @@ -332,24 +332,24 @@ int main(int argc, char** argv) { if (front_end_capture(configuration)) { - std::cout << "Front-end RAW samples captured" << std::endl; + std::cout << "Front-end RAW samples captured\n"; } else { - std::cout << "Failure capturing front-end samples" << std::endl; + std::cout << "Failure capturing front-end samples\n"; } } catch (const boost::bad_lexical_cast& e) { - std::cout << "Exception caught while capturing samples (bad lexical cast)" << std::endl; + std::cout << "Exception caught while capturing samples (bad lexical cast)\n"; } catch (const boost::io::too_few_args& e) { - std::cout << "Exception caught while capturing samples (too few args)" << std::endl; + std::cout << "Exception caught while capturing samples (too few args)\n"; } catch (...) { - std::cout << "Unexpected exception" << std::endl; + std::cout << "Unexpected exception\n"; } // 4. Setup GNU Radio flowgraph (file_source -> Acquisition_10m) @@ -388,7 +388,7 @@ int main(int argc, char** argv) } catch (const std::exception& e) { - std::cout << "Failure connecting the message port system: " << e.what() << std::endl; + std::cout << "Failure connecting the message port system: " << e.what() << '\n'; exit(0); } @@ -400,7 +400,7 @@ int main(int argc, char** argv) } catch (const std::exception& e) { - std::cout << "Failure connecting the GNU Radio blocks: " << e.what() << std::endl; + std::cout << "Failure connecting the GNU Radio blocks: " << e.what() << '\n'; } // 5. Run the flowgraph @@ -440,7 +440,7 @@ int main(int argc, char** argv) top_block->run(); if (start_msg == true) { - std::cout << "Searching for GPS Satellites in L1 band..." << std::endl; + std::cout << "Searching for GPS Satellites in L1 band...\n"; std::cout << "["; start_msg = false; } @@ -483,14 +483,14 @@ int main(int argc, char** argv) #endif std::cout.flush(); } - std::cout << "]" << std::endl; + std::cout << "]\n"; // report the elapsed time end = std::chrono::system_clock::now(); elapsed_seconds = end - start; std::cout << "Total signal acquisition run time " << elapsed_seconds.count() - << " [seconds]" << std::endl; + << " [seconds]\n"; // 6. find TOW from SUPL assistance double current_TOW = 0; @@ -504,25 +504,25 @@ int main(int argc, char** argv) time_t t = utc_time(Eph_map.begin()->second.i_GPS_week, static_cast(current_TOW)); - std::cout << "Reference Time:" << std::endl; - std::cout << " GPS Week: " << Eph_map.begin()->second.i_GPS_week << std::endl; - std::cout << " GPS TOW: " << static_cast(current_TOW) << " " << static_cast(current_TOW) * 0.08 << std::endl; - std::cout << " ~ UTC: " << ctime(&t) << std::endl; - std::cout << "Current TOW obtained from SUPL assistance = " << current_TOW << std::endl; + std::cout << "Reference Time:\n"; + std::cout << " GPS Week: " << Eph_map.begin()->second.i_GPS_week << '\n'; + std::cout << " GPS TOW: " << static_cast(current_TOW) << " " << static_cast(current_TOW) * 0.08 << '\n'; + std::cout << " ~ UTC: " << ctime(&t) << '\n'; + std::cout << "Current TOW obtained from SUPL assistance = " << current_TOW << '\n'; } else { - std::cout << "Unable to get Ephemeris SUPL assistance. TOW is unknown!" << std::endl; + std::cout << "Unable to get Ephemeris SUPL assistance. TOW is unknown!\n"; google::ShutDownCommandLineFlags(); - std::cout << "GNSS-SDR Front-end calibration program ended." << std::endl; + std::cout << "GNSS-SDR Front-end calibration program ended.\n"; return 0; } } catch (const boost::exception& e) { - std::cout << "Exception in getting Global ephemeris map" << std::endl; + std::cout << "Exception in getting Global ephemeris map\n"; google::ShutDownCommandLineFlags(); - std::cout << "GNSS-SDR Front-end calibration program ended." << std::endl; + std::cout << "GNSS-SDR Front-end calibration program ended.\n"; return 0; } @@ -531,17 +531,17 @@ int main(int argc, char** argv) double lon_deg = configuration->property("GNSS-SDR.init_longitude_deg", 2.0); double altitude_m = configuration->property("GNSS-SDR.init_altitude_m", 100); - std::cout << "Reference location (defined in config file):" << std::endl; + std::cout << "Reference location (defined in config file):\n"; - std::cout << "Latitude=" << lat_deg << " [º]" << std::endl; - std::cout << "Longitude=" << lon_deg << " [º]" << std::endl; - std::cout << "Altitude=" << altitude_m << " [m]" << std::endl; + std::cout << "Latitude=" << lat_deg << " [º]\n"; + std::cout << "Longitude=" << lon_deg << " [º]\n"; + std::cout << "Altitude=" << altitude_m << " [m]\n"; if (doppler_measurements_map.empty()) { - std::cout << "Sorry, no GPS satellites detected in the front-end capture, please check the antenna setup..." << std::endl; + std::cout << "Sorry, no GPS satellites detected in the front-end capture, please check the antenna setup...\n"; google::ShutDownCommandLineFlags(); - std::cout << "GNSS-SDR Front-end calibration program ended." << std::endl; + std::cout << "GNSS-SDR Front-end calibration program ended.\n"; return 0; } @@ -549,9 +549,9 @@ int main(int argc, char** argv) std::map f_fs_estimation_Hz_map; std::map f_ppm_estimation_Hz_map; - std::cout << std::setiosflags(std::ios::fixed) << std::setprecision(2) << "Doppler analysis results:" << std::endl; + std::cout << std::setiosflags(std::ios::fixed) << std::setprecision(2) << "Doppler analysis results:\n"; - std::cout << "SV ID Measured [Hz] Predicted [Hz]" << std::endl; + std::cout << "SV ID Measured [Hz] Predicted [Hz]\n"; for (auto& it : doppler_measurements_map) { @@ -559,7 +559,7 @@ int main(int argc, char** argv) { double doppler_estimated_hz; doppler_estimated_hz = front_end_cal.estimate_doppler_from_eph(it.first, current_TOW, lat_deg, lon_deg, altitude_m); - std::cout << " " << it.first << " " << it.second << " " << doppler_estimated_hz << std::endl; + std::cout << " " << it.first << " " << it.second << " " << doppler_estimated_hz << '\n'; // 7. Compute front-end IF and sampling frequency estimation // Compare with the measurements and compute clock drift using FE model double estimated_fs_Hz; @@ -573,15 +573,15 @@ int main(int argc, char** argv) } catch (const std::logic_error& e) { - std::cout << "Logic error caught: " << e.what() << std::endl; + std::cout << "Logic error caught: " << e.what() << '\n'; } catch (const boost::lock_error& e) { - std::cout << "Exception caught while reading ephemeris" << std::endl; + std::cout << "Exception caught while reading ephemeris\n"; } catch (const std::exception& ex) { - std::cout << " " << it.first << " " << it.second << " (Eph not found)" << std::endl; + std::cout << " " << it.first << " " << it.second << " (Eph not found)\n"; } } @@ -602,15 +602,15 @@ int main(int argc, char** argv) mean_fs_Hz /= n_elements; mean_osc_err_ppm /= n_elements; - std::cout << std::setiosflags(std::ios::fixed) << std::setprecision(2) << "Parameters estimation for Elonics E4000 Front-End:" << std::endl; + std::cout << std::setiosflags(std::ios::fixed) << std::setprecision(2) << "Parameters estimation for Elonics E4000 Front-End:\n"; - std::cout << "Sampling frequency =" << mean_fs_Hz << " [Hz]" << std::endl; - std::cout << "IF bias present in baseband=" << mean_f_if_Hz << " [Hz]" << std::endl; - std::cout << "Reference oscillator error =" << mean_osc_err_ppm << " [ppm]" << std::endl; + std::cout << "Sampling frequency =" << mean_fs_Hz << " [Hz]\n"; + std::cout << "IF bias present in baseband=" << mean_f_if_Hz << " [Hz]\n"; + std::cout << "Reference oscillator error =" << mean_osc_err_ppm << " [ppm]\n"; std::cout << std::setiosflags(std::ios::fixed) << std::setprecision(2) - << "Corrected Doppler vs. Predicted" << std::endl; - std::cout << "SV ID Corrected [Hz] Predicted [Hz]" << std::endl; + << "Corrected Doppler vs. Predicted\n"; + std::cout << "SV ID Corrected [Hz] Predicted [Hz]\n"; for (auto& it : doppler_measurements_map) { @@ -618,22 +618,22 @@ int main(int argc, char** argv) { double doppler_estimated_hz; doppler_estimated_hz = front_end_cal.estimate_doppler_from_eph(it.first, current_TOW, lat_deg, lon_deg, altitude_m); - std::cout << " " << it.first << " " << it.second - mean_f_if_Hz << " " << doppler_estimated_hz << std::endl; + std::cout << " " << it.first << " " << it.second - mean_f_if_Hz << " " << doppler_estimated_hz << '\n'; } catch (const std::logic_error& e) { - std::cout << "Logic error caught: " << e.what() << std::endl; + std::cout << "Logic error caught: " << e.what() << '\n'; } catch (const boost::lock_error& e) { - std::cout << "Exception caught while reading ephemeris" << std::endl; + std::cout << "Exception caught while reading ephemeris\n"; } catch (const std::exception& ex) { - std::cout << " " << it.first << " " << it.second - mean_f_if_Hz << " (Eph not found)" << std::endl; + std::cout << " " << it.first << " " << it.second - mean_f_if_Hz << " (Eph not found)\n"; } } google::ShutDownCommandLineFlags(); - std::cout << "GNSS-SDR Front-end calibration program ended." << std::endl; + std::cout << "GNSS-SDR Front-end calibration program ended.\n"; } diff --git a/src/utils/rinex-tools/obsdiff.cc b/src/utils/rinex-tools/obsdiff.cc index ac2400496..547519663 100644 --- a/src/utils/rinex-tools/obsdiff.cc +++ b/src/utils/rinex-tools/obsdiff.cc @@ -197,7 +197,7 @@ std::map ReadRinexObs(const std::string& rinex_file, char system } else { - std::cout << "ReadRinexObs unknown signal requested: " << signal << std::endl; + std::cout << "ReadRinexObs unknown signal requested: " << signal << '\n'; return obs_map; } } @@ -217,14 +217,14 @@ std::map ReadRinexObs(const std::string& rinex_file, char system catch (const std::exception& e) { std::cout << "Exception: " << e.what(); - std::cout << "unknown error. I don't feel so well..." << std::endl; + std::cout << "unknown error. I don't feel so well...\n"; return obs_map; } if (obs_map.empty()) { std::cout << "Warning: file " << rinex_file - << " contains no data." << std::endl; + << " contains no data.\n"; } return obs_map; } @@ -238,7 +238,7 @@ bool save_mat_xy(std::vector& x, std::vector& y, std::string fil mat_t* matfp; matvar_t* matvar; filename.append(".mat"); - // std::cout << "save_mat_xy write " << filename << std::endl; + // std::cout << "save_mat_xy write " << filename << '\n'; matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT5); if (reinterpret_cast(matfp) != nullptr) { @@ -253,14 +253,14 @@ bool save_mat_xy(std::vector& x, std::vector& y, std::string fil } else { - std::cout << "save_mat_xy: error creating file" << std::endl; + std::cout << "save_mat_xy: error creating file\n"; } Mat_Close(matfp); return true; } catch (const std::exception& ex) { - std::cout << "save_mat_xy: " << ex.what() << std::endl; + std::cout << "save_mat_xy: " << ex.what() << '\n'; return false; } } @@ -274,7 +274,7 @@ bool save_mat_x(std::vector* x, std::string filename) mat_t* matfp; matvar_t* matvar; filename.append(".mat"); - std::cout << "save_mat_x write " << filename << std::endl; + std::cout << "save_mat_x write " << filename << '\n'; matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT5); if (reinterpret_cast(matfp) != nullptr) { @@ -285,14 +285,14 @@ bool save_mat_x(std::vector* x, std::string filename) } else { - std::cout << "save_mat_x: error creating file" << std::endl; + std::cout << "save_mat_x: error creating file\n"; } Mat_Close(matfp); return true; } catch (const std::exception& ex) { - std::cout << "save_mat_x: " << ex.what() << std::endl; + std::cout << "save_mat_x: " << ex.what() << '\n'; return false; } } @@ -377,7 +377,7 @@ void carrier_phase_double_diff( << ", stdev = " << sqrt(error_var) << " (max,min) = " << max_error << "," << min_error - << " [Cycles]" << std::endl; + << " [Cycles]\n"; std::cout.precision(ss); // plots @@ -461,7 +461,7 @@ void carrier_phase_single_diff( << ", stdev = " << sqrt(error_var) << " (max,min) = " << max_error << "," << min_error - << " [Cycles]" << std::endl; + << " [Cycles]\n"; std::cout.precision(ss); // plots @@ -568,7 +568,7 @@ void carrier_doppler_double_diff( << ", stdev = " << sqrt(error_var) << " (max,min) = " << max_error << "," << min_error - << " [Hz]" << std::endl; + << " [Hz]\n"; std::cout.precision(ss); // plots @@ -651,7 +651,7 @@ void carrier_doppler_single_diff( << ", stdev = " << sqrt(error_var) << " (max,min) = " << max_error << "," << min_error - << " [Hz]" << std::endl; + << " [Hz]\n"; std::cout.precision(ss); // plots @@ -759,7 +759,7 @@ void code_pseudorange_double_diff( << ", stdev = " << sqrt(error_var) << " (max,min) = " << max_error << "," << min_error - << " [meters]" << std::endl; + << " [meters]\n"; std::cout.precision(ss); // plots @@ -844,7 +844,7 @@ void code_pseudorange_single_diff( << ", stdev = " << sqrt(error_var) << " (max,min) = " << max_error << "," << min_error - << " [meters]" << std::endl; + << " [meters]\n"; std::cout.precision(ss); // plots @@ -993,7 +993,7 @@ void coderate_phaserate_consistence( << ", stdev = " << sqrt(error_var) << " (max,min) = " << max_error << "," << min_error - << " [m/s]" << std::endl; + << " [m/s]\n"; std::cout.precision(ss); // plots @@ -1077,7 +1077,7 @@ void code_phase_diff( << ", stdev = " << sqrt(error_var) << " (max,min) = " << max_error << "," << min_error - << " [meters]" << std::endl; + << " [meters]\n"; std::cout.precision(ss); // plots @@ -1112,7 +1112,7 @@ void code_phase_diff( double compute_rx_clock_error(const std::string& rinex_nav_filename, const std::string& rinex_obs_file) { - std::cout << "Computing receiver's clock error..." << std::endl; + std::cout << "Computing receiver's clock error...\n"; if (not file_exist(rinex_nav_filename.c_str())) { std::cout << "Warning: RINEX Nav file " << rinex_nav_filename << " does not exist, receiver's clock error could not be computed!\n"; @@ -1171,7 +1171,7 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std:: } catch (...) { - std::cerr << "The observation file doesn't have C1 pseudoranges, RX clock error could not be computed!" << std::endl; + std::cerr << "The observation file doesn't have C1 pseudoranges, RX clock error could not be computed!\n"; return (0.0); } @@ -1310,15 +1310,15 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std:: } catch (const gpstk::FFStreamError& e) { - std::cout << "GPSTK exception: " << e << std::endl; + std::cout << "GPSTK exception: " << e << '\n'; } catch (const gpstk::Exception& e) { - std::cout << "GPSTK exception: " << e << std::endl; + std::cout << "GPSTK exception: " << e << '\n'; } catch (...) { - std::cout << "Caught an unexpected exception." << std::endl; + std::cout << "Caught an unexpected exception.\n"; } return rx_clock_error_s; @@ -1336,7 +1336,7 @@ void RINEX_doublediff_dupli_sat() } // Cut measurement initial transitory of the measurements double initial_transitory_s = FLAGS_skip_obs_transitory_s; - std::cout << "Skipping initial transitory of " << initial_transitory_s << " [s]" << std::endl; + std::cout << "Skipping initial transitory of " << initial_transitory_s << " [s]\n"; arma::uvec index; for (auto& rover_ob : rover_obs) { @@ -1370,8 +1370,8 @@ void RINEX_doublediff_dupli_sat() // compute double differences if (rover_obs.find(prn_pairs.at(n)) != rover_obs.end() and rover_obs.find(prn_pairs.at(n + 1)) != rover_obs.end()) { - std::cout << "Computing single difference observables for duplicated SV pairs..." << std::endl; - std::cout << "SD = OBS_ROVER(SV" << prn_pairs.at(n) << ") - OBS_ROVER(SV" << prn_pairs.at(n + 1) << ")" << std::endl; + std::cout << "Computing single difference observables for duplicated SV pairs...\n"; + std::cout << "SD = OBS_ROVER(SV" << prn_pairs.at(n) << ") - OBS_ROVER(SV" << prn_pairs.at(n + 1) << ")\n"; code_pseudorange_single_diff(rover_obs.at(prn_pairs.at(n)), rover_obs.at(prn_pairs.at(n + 1)), @@ -1419,7 +1419,7 @@ void RINEX_doublediff(bool remove_rx_clock_error) // Cut measurement initial transitory of the measurements double initial_transitory_s = FLAGS_skip_obs_transitory_s; - std::cout << "Skipping initial transitory of " << initial_transitory_s << " [s]" << std::endl; + std::cout << "Skipping initial transitory of " << initial_transitory_s << " [s]\n"; arma::uvec index; for (auto& rover_ob : rover_obs) { @@ -1438,7 +1438,7 @@ void RINEX_doublediff(bool remove_rx_clock_error) { // there are more rover observations than base observations // cut rover vector - std::cout << "Cutting rover observations vector end.." << std::endl; + std::cout << "Cutting rover observations vector end..\n"; arma::uvec index2; for (auto& rover_ob : rover_obs) { @@ -1453,7 +1453,7 @@ void RINEX_doublediff(bool remove_rx_clock_error) { // there are more base observations than rover observations // cut base vector - std::cout << "Cutting base observations vector end.." << std::endl; + std::cout << "Cutting base observations vector end..\n"; for (auto& base_ob : base_obs) { index = arma::find(base_ob.second.col(0) >= rover_obs_time.back(), 1, "first"); @@ -1469,7 +1469,7 @@ void RINEX_doublediff(bool remove_rx_clock_error) rover_obs_time = rover_obs.begin()->second.col(0); double skip_ends_s = FLAGS_skip_obs_ends_s; - std::cout << "Skipping last " << skip_ends_s << " [s] of observations" << std::endl; + std::cout << "Skipping last " << skip_ends_s << " [s] of observations\n"; for (auto& rover_ob : rover_obs) { index = arma::find(rover_ob.second.col(0) >= (rover_obs_time.back() - skip_ends_s), 1, "first"); @@ -1545,16 +1545,16 @@ void RINEX_doublediff(bool remove_rx_clock_error) // compute double differences if (base_obs.find(reference_sat_id) != base_obs.end() and rover_obs.find(reference_sat_id) != rover_obs.end()) { - std::cout << "Using reference satellite SV " << reference_sat_id << " with minimum range of " << min_range << " [meters]" << std::endl; + std::cout << "Using reference satellite SV " << reference_sat_id << " with minimum range of " << min_range << " [meters]\n"; for (auto& current_sat_id : PRN_set) { if (current_sat_id != reference_sat_id) { if (base_obs.find(current_sat_id) != base_obs.end() and rover_obs.find(current_sat_id) != rover_obs.end()) { - std::cout << "Computing double difference observables for SV " << current_sat_id << std::endl; + std::cout << "Computing double difference observables for SV " << current_sat_id << '\n'; std::cout << "DD = (OBS_ROVER(SV" << current_sat_id << ") - OBS_ROVER(SV" << reference_sat_id << "))" - << " - (OBS_BASE(SV" << current_sat_id << ") - OBS_BASE(SV" << reference_sat_id << "))" << std::endl; + << " - (OBS_BASE(SV" << current_sat_id << ") - OBS_BASE(SV" << reference_sat_id << "))\n"; code_pseudorange_double_diff(base_obs.at(reference_sat_id), base_obs.at(current_sat_id), @@ -1596,7 +1596,7 @@ void RINEX_singlediff() // Cut measurement initial transitory of the measurements double initial_transitory_s = FLAGS_skip_obs_transitory_s; - std::cout << "Skipping initial transitory of " << initial_transitory_s << " [s]" << std::endl; + std::cout << "Skipping initial transitory of " << initial_transitory_s << " [s]\n"; arma::uvec index; for (auto& rover_ob : rover_obs) { @@ -1611,7 +1611,7 @@ void RINEX_singlediff() arma::colvec rover_obs_time = rover_obs.begin()->second.col(0); double skip_ends_s = FLAGS_skip_obs_ends_s; - std::cout << "Skipping last " << skip_ends_s << " [s] of observations" << std::endl; + std::cout << "Skipping last " << skip_ends_s << " [s] of observations\n"; for (auto& rover_ob : rover_obs) { index = arma::find(rover_ob.second.col(0) >= (rover_obs_time.back() - skip_ends_s), 1, "first"); @@ -1645,12 +1645,12 @@ void RINEX_singlediff() // compute single differences std::set PRN_set = available_gps_prn; - std::cout << "Computing Code Pseudorange rate vs. Carrier phase rate difference..." << std::endl; + std::cout << "Computing Code Pseudorange rate vs. Carrier phase rate difference...\n"; for (auto& current_sat_id : PRN_set) { if (rover_obs.find(current_sat_id) != rover_obs.end()) { - std::cout << "RateError = PR_rate(SV" << current_sat_id << ") - Phase_rate(SV" << current_sat_id << ")" << std::endl; + std::cout << "RateError = PR_rate(SV" << current_sat_id << ") - Phase_rate(SV" << current_sat_id << ")\n"; coderate_phaserate_consistence(rover_obs.at(current_sat_id), "PRN " + std::to_string(current_sat_id) + " "); } } @@ -1659,7 +1659,7 @@ void RINEX_singlediff() int main(int argc, char** argv) { - std::cout << "Running RINEX observables difference tool..." << std::endl; + std::cout << "Running RINEX observables difference tool...\n"; google::ParseCommandLineFlags(&argc, &argv, true); if (FLAGS_single_diff) { diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index 835dbff36..d41fb1f30 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -55,10 +55,10 @@ int main(int argc, char** argv) if ((argc != 2)) { - std::cerr << "Usage:" << std::endl; + std::cerr << "Usage:\n"; std::cerr << " " << argv[0] << " " - << std::endl; + << '\n'; google::ShutDownCommandLineFlags(); return 1; } @@ -77,7 +77,7 @@ int main(int argc, char** argv) std::ifstream file(rinex_filename, std::ios_base::in | std::ios_base::binary); if (file.fail()) { - std::cerr << "Could not open file " << rinex_filename << std::endl; + std::cerr << "Could not open file " << rinex_filename << '\n'; return 1; } boost::iostreams::filtering_streambuf in; @@ -87,7 +87,7 @@ int main(int argc, char** argv) } catch (const boost::exception& e) { - std::cerr << "Could not decompress file " << rinex_filename << std::endl; + std::cerr << "Could not decompress file " << rinex_filename << '\n'; return 1; } in.push(file); @@ -95,7 +95,7 @@ int main(int argc, char** argv) std::ofstream output_file(rinex_filename_unzipped.c_str(), std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); if (file.fail()) { - std::cerr << "Could not create file " << rinex_filename_unzipped << std::endl; + std::cerr << "Could not create file " << rinex_filename_unzipped << '\n'; return 1; } boost::iostreams::copy(in, output_file); @@ -109,7 +109,7 @@ int main(int argc, char** argv) std::ifstream file(rinex_filename, std::ios_base::in | std::ios_base::binary); if (file.fail()) { - std::cerr << "Could not open file" << rinex_filename << std::endl; + std::cerr << "Could not open file" << rinex_filename << '\n'; return 1; } file.close(); @@ -126,13 +126,13 @@ int main(int argc, char** argv) input_filename = rinex_filename.substr(0, found); if ((s1 != 0) or (s2 != 0) or (s3 != 0)) { - std::cerr << "Failure uncompressing file." << std::endl; + std::cerr << "Failure uncompressing file.\n"; return 1; } } else { - std::cerr << "uncompress program not found." << std::endl; + std::cerr << "uncompress program not found.\n"; return 1; } } @@ -162,8 +162,8 @@ int main(int argc, char** argv) // Check that it really is a RINEX navigation file if (hdr.fileType.substr(0, 1) != "N") { - std::cerr << "This is not a valid RINEX navigation file, or file not found." << std::endl; - std::cerr << "No XML file will be created." << std::endl; + std::cerr << "This is not a valid RINEX navigation file, or file not found.\n"; + std::cerr << "No XML file will be created.\n"; return 1; } @@ -295,15 +295,15 @@ int main(int argc, char** argv) } catch (std::exception& e) { - std::cerr << "Error reading the RINEX file: " << e.what() << std::endl; - std::cerr << "No XML file will be created." << std::endl; + std::cerr << "Error reading the RINEX file: " << e.what() << '\n'; + std::cerr << "No XML file will be created.\n"; google::ShutDownCommandLineFlags(); return 1; } if (i == 0 and j == 0) { - std::cerr << "No navigation data found in the RINEX file. No XML file will be created." << std::endl; + std::cerr << "No navigation data found in the RINEX file. No XML file will be created.\n"; google::ShutDownCommandLineFlags(); return 1; } @@ -324,11 +324,11 @@ int main(int argc, char** argv) } catch (std::exception& e) { - std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << std::endl; + std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << '\n'; google::ShutDownCommandLineFlags(); return 1; } - std::cout << "Generated file: " << xml_filename << std::endl; + std::cout << "Generated file: " << xml_filename << '\n'; } if (j != 0) { @@ -342,11 +342,11 @@ int main(int argc, char** argv) } catch (std::exception& e) { - std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << std::endl; + std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << '\n'; google::ShutDownCommandLineFlags(); return 1; } - std::cout << "Generated file: " << xml_filename << std::endl; + std::cout << "Generated file: " << xml_filename << '\n'; } // Write XML UTC @@ -362,11 +362,11 @@ int main(int argc, char** argv) } catch (std::exception& e) { - std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << std::endl; + std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << '\n'; google::ShutDownCommandLineFlags(); return 1; } - std::cout << "Generated file: " << xml_filename << std::endl; + std::cout << "Generated file: " << xml_filename << '\n'; } // Write XML iono @@ -382,11 +382,11 @@ int main(int argc, char** argv) } catch (std::exception& e) { - std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << std::endl; + std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << '\n'; google::ShutDownCommandLineFlags(); return 1; } - std::cout << "Generated file: " << xml_filename << std::endl; + std::cout << "Generated file: " << xml_filename << '\n'; } if (gal_utc_model.A0_6 != 0) @@ -401,11 +401,11 @@ int main(int argc, char** argv) } catch (std::exception& e) { - std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << std::endl; + std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << '\n'; google::ShutDownCommandLineFlags(); return 1; } - std::cout << "Generated file: " << xml_filename << std::endl; + std::cout << "Generated file: " << xml_filename << '\n'; } if (gal_iono.ai0_5 != 0) { @@ -419,11 +419,11 @@ int main(int argc, char** argv) } catch (std::exception& e) { - std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << std::endl; + std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << '\n'; google::ShutDownCommandLineFlags(); return 1; } - std::cout << "Generated file: " << xml_filename << std::endl; + std::cout << "Generated file: " << xml_filename << '\n'; } google::ShutDownCommandLineFlags(); return 0;