From 79d6a3f166caa65e612d2d46e714ddacbc970708 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 11 Dec 2022 12:48:00 +0100 Subject: [PATCH] Use ofstream instead of ifstream where appropriate --- src/algorithms/PVT/libs/rtklib_solver.cc | 2 +- .../observables/gnuradio_blocks/hybrid_observables_gs.cc | 6 +++--- .../gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc | 6 +++--- .../gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc | 6 +++--- .../gnuradio_blocks/galileo_telemetry_decoder_gs.cc | 6 +++--- .../gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.cc | 6 +++--- .../gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.cc | 6 +++--- .../gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc | 6 +++--- .../gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc | 6 +++--- .../gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc | 6 +++--- .../tracking/gnuradio_blocks/dll_pll_veml_tracking.cc | 6 +++--- .../tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc | 6 +++--- .../gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc | 6 +++--- .../glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc | 6 +++--- .../glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc | 6 +++--- .../gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc | 6 +++--- .../glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc | 6 +++--- .../gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc | 6 +++--- .../gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc | 6 +++--- .../gnuradio_blocks/gps_l1_ca_gaussian_tracking_cc.cc | 6 +++--- .../gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc | 6 +++--- src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc | 6 +++--- 22 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index bab77a024..bb4fbd63d 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -1228,7 +1228,7 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ d_dump_file.write(reinterpret_cast(&d_dop[2]), sizeof(double)); d_dump_file.write(reinterpret_cast(&d_dop[3]), sizeof(double)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing RTKLIB dump file " << e.what(); } diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc index ea55fe1c7..b7f2c56be 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc @@ -149,13 +149,13 @@ hybrid_observables_gs::hybrid_observables_gs(const Obs_Conf &conf_) 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); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::badbit); try { d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Observables dump enabled Log file: " << d_dump_filename.c_str(); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception opening observables dump file " << e.what(); d_dump = false; @@ -871,7 +871,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused) d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); } } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing observables dump file " << e.what(); d_dump = false; 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 729dd2af3..1cd4d849a 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 @@ -402,11 +402,11 @@ void beidou_b1i_telemetry_decoder_gs::set_channel(int32_t channel) { d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << ": exception opening Beidou TLM dump file. " << e.what(); } @@ -663,7 +663,7 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_ tmp_int = static_cast(current_symbol.PRN); d_dump_file.write(reinterpret_cast(&tmp_int), sizeof(int32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing Telemetry GPS L5 dump file " << e.what(); } 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 0ea53fad5..8088f51d7 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 @@ -418,13 +418,13 @@ void beidou_b3i_telemetry_decoder_gs::set_channel(int32_t channel) { d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << ": exception opening Beidou TLM dump file. " @@ -692,7 +692,7 @@ int beidou_b3i_telemetry_decoder_gs::general_work( tmp_int = static_cast(current_symbol.PRN); d_dump_file.write(reinterpret_cast(&tmp_int), sizeof(int32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing Telemetry GPS L5 dump file " << e.what(); } 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 6b451b04a..def867de7 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 @@ -718,11 +718,11 @@ void galileo_telemetry_decoder_gs::set_channel(int32_t channel) { d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); } @@ -1276,7 +1276,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__(( tmp_int = static_cast(current_symbol.PRN); d_dump_file.write(reinterpret_cast(&tmp_int), sizeof(int32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing navigation data dump file " << e.what(); } 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 ef9964a4a..44d0bf1f9 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 @@ -289,11 +289,11 @@ void glonass_l1_ca_telemetry_decoder_gs::set_channel(int32_t channel) { d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << ": exception opening Glonass TLM dump file. " << e.what(); } @@ -495,7 +495,7 @@ int glonass_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribu tmp_int = static_cast(current_symbol.PRN); d_dump_file.write(reinterpret_cast(&tmp_int), sizeof(int32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing observables dump file " << e.what(); } 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 b0a6d8812..a115907a6 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 @@ -288,11 +288,11 @@ void glonass_l2_ca_telemetry_decoder_gs::set_channel(int32_t channel) { d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << ": exception opening Glonass TLM dump file. " << e.what(); } @@ -497,7 +497,7 @@ int glonass_l2_ca_telemetry_decoder_gs::general_work(int noutput_items __attribu tmp_int = static_cast(current_symbol.PRN); d_dump_file.write(reinterpret_cast(&tmp_int), sizeof(int32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing observables dump file " << e.what(); } 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 b44dc0abc..e03d02eaa 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 @@ -234,12 +234,12 @@ void gps_l1_ca_telemetry_decoder_gs::set_channel(int32_t channel) { d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); } @@ -646,7 +646,7 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__ tmp_int = static_cast(current_symbol.PRN); d_dump_file.write(reinterpret_cast(&tmp_int), sizeof(int32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing observables dump file " << e.what(); } 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 d84b34d41..cd0c817f6 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 @@ -156,12 +156,12 @@ void gps_l2c_telemetry_decoder_gs::set_channel(int channel) { d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << " Exception opening Telemetry GPS L2 dump file " << e.what(); } @@ -336,7 +336,7 @@ int gps_l2c_telemetry_decoder_gs::general_work(int noutput_items __attribute__(( tmp_int = static_cast(current_synchro_data.PRN); d_dump_file.write(reinterpret_cast(&tmp_int), sizeof(int32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing Telemetry GPS L2 dump file " << e.what(); } 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 77ceed511..d4c915cc5 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 @@ -155,12 +155,12 @@ void gps_l5_telemetry_decoder_gs::set_channel(int32_t channel) { d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << " Exception opening Telemetry GPS L5 dump file " << e.what(); } @@ -352,7 +352,7 @@ int gps_l5_telemetry_decoder_gs::general_work(int noutput_items __attribute__((u tmp_int = static_cast(current_synchro_data.PRN); d_dump_file.write(reinterpret_cast(&tmp_int), sizeof(int32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing Telemetry GPS L5 dump file " << e.what(); } 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 beb9c11b6..1d367d70e 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -1464,7 +1464,7 @@ void dll_pll_veml_tracking::log_data() uint32_t prn_ = d_acquisition_gnss_synchro->PRN; d_dump_file.write(reinterpret_cast(&prn_), sizeof(uint32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing trk dump file " << e.what(); } @@ -1690,11 +1690,11 @@ void dll_pll_veml_tracking::set_channel(uint32_t channel) { try { - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::badbit); d_dump_file.open(dump_filename_.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << dump_filename_.c_str(); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); } 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 3c30b5fe2..923fc8fa0 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 @@ -1101,7 +1101,7 @@ void dll_pll_veml_tracking_fpga::log_data() uint32_t prn_ = d_acquisition_gnss_synchro->PRN; d_dump_file.write(reinterpret_cast(&prn_), sizeof(uint32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing trk dump file " << e.what(); } @@ -1329,11 +1329,11 @@ void dll_pll_veml_tracking_fpga::set_channel(uint32_t channel, const std::string { try { - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::badbit); d_dump_file.open(dump_filename_.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << dump_filename_.c_str(); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); } 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 9f2a4bbef..4b6a44d14 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 @@ -234,11 +234,11 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::set_channel(uint32_t channel) { d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::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(); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); } @@ -501,7 +501,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri uint32_t prn_ = d_acquisition_gnss_synchro->PRN; d_dump_file.write(reinterpret_cast(&prn_), sizeof(uint32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing trk dump file " << e.what(); } 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 a0a7948c2..d3531eac8 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 @@ -513,11 +513,11 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::set_channel(uint32_t channel) { d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::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() << '\n'; } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); } @@ -873,7 +873,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at uint32_t prn_ = d_acquisition_gnss_synchro->PRN; d_dump_file.write(reinterpret_cast(&prn_), sizeof(uint32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing trk dump file " << e.what(); } 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 f106df5af..c7dc7c22c 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 @@ -516,11 +516,11 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::set_channel(uint32_t channel) { d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::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() << '\n'; } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); } @@ -875,7 +875,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at uint32_t prn_ = d_acquisition_gnss_synchro->PRN; d_dump_file.write(reinterpret_cast(&prn_), sizeof(uint32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing trk dump file " << e.what(); } 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 a2755d6d4..4962899df 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 @@ -453,11 +453,11 @@ void Glonass_L1_Ca_Dll_Pll_Tracking_cc::set_channel(uint32_t channel) { d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::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(); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); } @@ -699,7 +699,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut uint32_t prn_ = d_acquisition_gnss_synchro->PRN; d_dump_file.write(reinterpret_cast(&prn_), sizeof(uint32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing trk dump file " << e.what(); } 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 d59e9ecd3..bbba59cbf 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 @@ -512,11 +512,11 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_cc::set_channel(uint32_t channel) { d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::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() << '\n'; } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); } @@ -868,7 +868,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at uint32_t prn_ = d_acquisition_gnss_synchro->PRN; d_dump_file.write(reinterpret_cast(&prn_), sizeof(uint32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing trk dump file " << e.what(); } 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 58295fe21..a1afb3c84 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 @@ -455,11 +455,11 @@ void Glonass_L2_Ca_Dll_Pll_Tracking_cc::set_channel(uint32_t channel) { d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::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(); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); } @@ -701,7 +701,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut uint32_t prn_ = d_acquisition_gnss_synchro->PRN; d_dump_file.write(reinterpret_cast(&prn_), sizeof(uint32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing trk dump file " << e.what(); } 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 41cf605ae..1b6e7f2f6 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 @@ -282,11 +282,11 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::set_channel(uint32_t channel) { d_dump_filename.append(boost::lexical_cast(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::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(); } - catch (const std::ifstream::failure *e) + catch (const std::ofstream::failure *e) { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e->what(); } @@ -540,7 +540,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work(int noutput_items __attribut uint32_t prn_ = d_acquisition_gnss_synchro->PRN; d_dump_file.write(reinterpret_cast(&prn_), sizeof(uint32_t)); } - catch (const std::ifstream::failure *e) + catch (const std::ofstream::failure *e) { LOG(WARNING) << "Exception writing trk dump file " << e->what(); } diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_gaussian_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_gaussian_tracking_cc.cc index 1092ed3a6..6faf12488 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_gaussian_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_gaussian_tracking_cc.cc @@ -575,11 +575,11 @@ void Gps_L1_Ca_Gaussian_Tracking_cc::set_channel(uint32_t channel) { d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::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(); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); } @@ -879,7 +879,7 @@ int Gps_L1_Ca_Gaussian_Tracking_cc::general_work(int noutput_items __attribute__ uint32_t prn_ = d_acquisition_gnss_synchro->PRN; d_dump_file.write(reinterpret_cast(&prn_), sizeof(uint32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing trk dump file " << e.what(); } 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 06b2c262e..f646d7512 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 @@ -257,11 +257,11 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::set_channel(uint32_t channel) { d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::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(); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); } @@ -531,7 +531,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib uint32_t prn_ = d_acquisition_gnss_synchro->PRN; d_dump_file.write(reinterpret_cast(&prn_), sizeof(uint32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing trk dump file " << e.what(); } diff --git a/src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc index 7b53a6f0f..a12be9774 100644 --- a/src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc @@ -1521,7 +1521,7 @@ void kf_tracking::log_data() uint32_t prn_ = d_acquisition_gnss_synchro->PRN; d_dump_file.write(reinterpret_cast(&prn_), sizeof(uint32_t)); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception writing trk dump file " << e.what(); } @@ -1747,11 +1747,11 @@ void kf_tracking::set_channel(uint32_t channel) { try { - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::badbit); d_dump_file.open(dump_filename_.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << dump_filename_.c_str(); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); }