mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2026-08-16 07:08:53 +00:00
Use ofstream instead of ifstream where appropriate
This commit is contained in:
@@ -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<int32_t>(current_symbol.PRN);
|
||||
d_dump_file.write(reinterpret_cast<char *>(&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();
|
||||
}
|
||||
|
||||
@@ -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<int32_t>(current_symbol.PRN);
|
||||
d_dump_file.write(reinterpret_cast<char *>(&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();
|
||||
}
|
||||
|
||||
@@ -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<int32_t>(current_symbol.PRN);
|
||||
d_dump_file.write(reinterpret_cast<char *>(&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();
|
||||
}
|
||||
|
||||
+3
-3
@@ -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<int32_t>(current_symbol.PRN);
|
||||
d_dump_file.write(reinterpret_cast<char *>(&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();
|
||||
}
|
||||
|
||||
+3
-3
@@ -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<int32_t>(current_symbol.PRN);
|
||||
d_dump_file.write(reinterpret_cast<char *>(&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();
|
||||
}
|
||||
|
||||
@@ -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<int32_t>(current_symbol.PRN);
|
||||
d_dump_file.write(reinterpret_cast<char *>(&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();
|
||||
}
|
||||
|
||||
@@ -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<int32_t>(current_synchro_data.PRN);
|
||||
d_dump_file.write(reinterpret_cast<char *>(&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();
|
||||
}
|
||||
|
||||
@@ -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<int32_t>(current_synchro_data.PRN);
|
||||
d_dump_file.write(reinterpret_cast<char *>(&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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user