mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-18 21:23:02 +00:00
Add new conf parameter TelemetryDecoder_XX.remove_dat
By default set to false. If dump=true and dump_mat=true, if this parameter is set to true, the .dat file is removed after conversion to .mat, leaving a cleaner output if the user is not interested in the .dat file
This commit is contained in:
parent
abcd16e166
commit
e289e3f6b3
@ -63,6 +63,7 @@ beidou_b1i_telemetry_decoder_gs::beidou_b1i_telemetry_decoder_gs(
|
|||||||
d_dump_filename = conf.dump_filename;
|
d_dump_filename = conf.dump_filename;
|
||||||
d_dump = conf.dump;
|
d_dump = conf.dump;
|
||||||
d_dump_mat = conf.dump_mat;
|
d_dump_mat = conf.dump_mat;
|
||||||
|
d_remove_dat = conf.remove_dat;
|
||||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||||
LOG(INFO) << "Initializing BeiDou B1I Telemetry Decoding for satellite " << this->d_satellite;
|
LOG(INFO) << "Initializing BeiDou B1I Telemetry Decoding for satellite " << this->d_satellite;
|
||||||
|
|
||||||
@ -131,6 +132,13 @@ beidou_b1i_telemetry_decoder_gs::~beidou_b1i_telemetry_decoder_gs()
|
|||||||
if (d_dump && (pos != 0) && d_dump_mat)
|
if (d_dump && (pos != 0) && d_dump_mat)
|
||||||
{
|
{
|
||||||
save_tlm_matfile(d_dump_filename);
|
save_tlm_matfile(d_dump_filename);
|
||||||
|
if (d_remove_dat)
|
||||||
|
{
|
||||||
|
if (!tlm_remove_file(d_dump_filename))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "Error deleting temporary file";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,6 +121,7 @@ private:
|
|||||||
bool Flag_valid_word;
|
bool Flag_valid_word;
|
||||||
bool d_dump;
|
bool d_dump;
|
||||||
bool d_dump_mat;
|
bool d_dump_mat;
|
||||||
|
bool d_remove_dat;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,6 +63,7 @@ beidou_b3i_telemetry_decoder_gs::beidou_b3i_telemetry_decoder_gs(
|
|||||||
d_dump_filename = conf.dump_filename;
|
d_dump_filename = conf.dump_filename;
|
||||||
d_dump = conf.dump;
|
d_dump = conf.dump;
|
||||||
d_dump_mat = conf.dump_mat;
|
d_dump_mat = conf.dump_mat;
|
||||||
|
d_remove_dat = conf.remove_dat;
|
||||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||||
LOG(INFO) << "Initializing BeiDou B3I Telemetry Decoding for satellite " << this->d_satellite;
|
LOG(INFO) << "Initializing BeiDou B3I Telemetry Decoding for satellite " << this->d_satellite;
|
||||||
|
|
||||||
@ -131,6 +132,13 @@ beidou_b3i_telemetry_decoder_gs::~beidou_b3i_telemetry_decoder_gs()
|
|||||||
if (d_dump && (pos != 0) && d_dump_mat)
|
if (d_dump && (pos != 0) && d_dump_mat)
|
||||||
{
|
{
|
||||||
save_tlm_matfile(d_dump_filename);
|
save_tlm_matfile(d_dump_filename);
|
||||||
|
if (d_remove_dat)
|
||||||
|
{
|
||||||
|
if (!tlm_remove_file(d_dump_filename))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "Error deleting temporary file";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,6 +118,7 @@ private:
|
|||||||
bool Flag_valid_word;
|
bool Flag_valid_word;
|
||||||
bool d_dump;
|
bool d_dump;
|
||||||
bool d_dump_mat;
|
bool d_dump_mat;
|
||||||
|
bool d_remove_dat;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,6 +75,7 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
|
|||||||
d_dump_filename = conf.dump_filename;
|
d_dump_filename = conf.dump_filename;
|
||||||
d_dump = conf.dump;
|
d_dump = conf.dump;
|
||||||
d_dump_mat = conf.dump_mat;
|
d_dump_mat = conf.dump_mat;
|
||||||
|
d_remove_dat = conf.remove_dat;
|
||||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||||
d_frame_type = frame_type;
|
d_frame_type = frame_type;
|
||||||
DLOG(INFO) << "Initializing GALILEO UNIFIED TELEMETRY DECODER";
|
DLOG(INFO) << "Initializing GALILEO UNIFIED TELEMETRY DECODER";
|
||||||
@ -241,6 +242,13 @@ galileo_telemetry_decoder_gs::~galileo_telemetry_decoder_gs()
|
|||||||
if (d_dump && (pos != 0) && d_dump_mat)
|
if (d_dump && (pos != 0) && d_dump_mat)
|
||||||
{
|
{
|
||||||
save_tlm_matfile(d_dump_filename);
|
save_tlm_matfile(d_dump_filename);
|
||||||
|
if (d_remove_dat)
|
||||||
|
{
|
||||||
|
if (!tlm_remove_file(d_dump_filename))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "Error deleting temporary file";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,6 +141,7 @@ private:
|
|||||||
bool d_flag_preamble;
|
bool d_flag_preamble;
|
||||||
bool d_dump;
|
bool d_dump;
|
||||||
bool d_dump_mat;
|
bool d_dump_mat;
|
||||||
|
bool d_remove_dat;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,6 +60,7 @@ glonass_l1_ca_telemetry_decoder_gs::glonass_l1_ca_telemetry_decoder_gs(
|
|||||||
d_dump_filename = conf.dump_filename;
|
d_dump_filename = conf.dump_filename;
|
||||||
d_dump = conf.dump;
|
d_dump = conf.dump;
|
||||||
d_dump_mat = conf.dump_mat;
|
d_dump_mat = conf.dump_mat;
|
||||||
|
d_remove_dat = conf.remove_dat;
|
||||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||||
LOG(INFO) << "Initializing GLONASS L1 CA TELEMETRY DECODING";
|
LOG(INFO) << "Initializing GLONASS L1 CA TELEMETRY DECODING";
|
||||||
|
|
||||||
@ -124,6 +125,13 @@ glonass_l1_ca_telemetry_decoder_gs::~glonass_l1_ca_telemetry_decoder_gs()
|
|||||||
if (d_dump && (pos != 0) && d_dump_mat)
|
if (d_dump && (pos != 0) && d_dump_mat)
|
||||||
{
|
{
|
||||||
save_tlm_matfile(d_dump_filename);
|
save_tlm_matfile(d_dump_filename);
|
||||||
|
if (d_remove_dat)
|
||||||
|
{
|
||||||
|
if (!tlm_remove_file(d_dump_filename))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "Error deleting temporary file";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,6 +120,7 @@ private:
|
|||||||
bool Flag_valid_word;
|
bool Flag_valid_word;
|
||||||
bool d_dump;
|
bool d_dump;
|
||||||
bool d_dump_mat;
|
bool d_dump_mat;
|
||||||
|
bool d_remove_dat;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,6 +60,7 @@ glonass_l2_ca_telemetry_decoder_gs::glonass_l2_ca_telemetry_decoder_gs(
|
|||||||
d_dump_filename = conf.dump_filename;
|
d_dump_filename = conf.dump_filename;
|
||||||
d_dump = conf.dump;
|
d_dump = conf.dump;
|
||||||
d_dump_mat = conf.dump_mat;
|
d_dump_mat = conf.dump_mat;
|
||||||
|
d_remove_dat = conf.remove_dat;
|
||||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||||
LOG(INFO) << "Initializing GLONASS L2 CA TELEMETRY DECODING";
|
LOG(INFO) << "Initializing GLONASS L2 CA TELEMETRY DECODING";
|
||||||
|
|
||||||
@ -124,6 +125,13 @@ glonass_l2_ca_telemetry_decoder_gs::~glonass_l2_ca_telemetry_decoder_gs()
|
|||||||
if (d_dump && (pos != 0) && d_dump_mat)
|
if (d_dump && (pos != 0) && d_dump_mat)
|
||||||
{
|
{
|
||||||
save_tlm_matfile(d_dump_filename);
|
save_tlm_matfile(d_dump_filename);
|
||||||
|
if (d_remove_dat)
|
||||||
|
{
|
||||||
|
if (!tlm_remove_file(d_dump_filename))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "Error deleting temporary file";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,6 +114,7 @@ private:
|
|||||||
bool flag_TOW_set; // Indicates when time of week is set
|
bool flag_TOW_set; // Indicates when time of week is set
|
||||||
bool d_dump;
|
bool d_dump;
|
||||||
bool d_dump_mat;
|
bool d_dump_mat;
|
||||||
|
bool d_remove_dat;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,6 +75,7 @@ gps_l1_ca_telemetry_decoder_gs::gps_l1_ca_telemetry_decoder_gs(
|
|||||||
d_dump_filename = conf.dump_filename;
|
d_dump_filename = conf.dump_filename;
|
||||||
d_dump = conf.dump;
|
d_dump = conf.dump;
|
||||||
d_dump_mat = conf.dump_mat;
|
d_dump_mat = conf.dump_mat;
|
||||||
|
d_remove_dat = conf.remove_dat;
|
||||||
|
|
||||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||||
DLOG(INFO) << "Initializing GPS L1 TELEMETRY DECODER";
|
DLOG(INFO) << "Initializing GPS L1 TELEMETRY DECODER";
|
||||||
@ -146,6 +147,13 @@ gps_l1_ca_telemetry_decoder_gs::~gps_l1_ca_telemetry_decoder_gs()
|
|||||||
if (d_dump && (pos != 0) && d_dump_mat)
|
if (d_dump && (pos != 0) && d_dump_mat)
|
||||||
{
|
{
|
||||||
save_tlm_matfile(d_dump_filename);
|
save_tlm_matfile(d_dump_filename);
|
||||||
|
if (d_remove_dat)
|
||||||
|
{
|
||||||
|
if (!tlm_remove_file(d_dump_filename))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "Error deleting temporary file";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,6 +112,7 @@ private:
|
|||||||
bool d_flag_TOW_set;
|
bool d_flag_TOW_set;
|
||||||
bool d_dump;
|
bool d_dump;
|
||||||
bool d_dump_mat;
|
bool d_dump_mat;
|
||||||
|
bool d_remove_dat;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ gps_l2c_telemetry_decoder_gs::gps_l2c_telemetry_decoder_gs(
|
|||||||
d_dump_filename = conf.dump_filename;
|
d_dump_filename = conf.dump_filename;
|
||||||
d_dump = conf.dump;
|
d_dump = conf.dump;
|
||||||
d_dump_mat = conf.dump_mat;
|
d_dump_mat = conf.dump_mat;
|
||||||
|
d_remove_dat = conf.remove_dat;
|
||||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||||
DLOG(INFO) << "GPS L2C M TELEMETRY PROCESSING: satellite " << d_satellite;
|
DLOG(INFO) << "GPS L2C M TELEMETRY PROCESSING: satellite " << d_satellite;
|
||||||
// set_output_multiple (1);
|
// set_output_multiple (1);
|
||||||
@ -109,6 +110,13 @@ gps_l2c_telemetry_decoder_gs::~gps_l2c_telemetry_decoder_gs()
|
|||||||
if (d_dump && (pos != 0) && d_dump_mat)
|
if (d_dump && (pos != 0) && d_dump_mat)
|
||||||
{
|
{
|
||||||
save_tlm_matfile(d_dump_filename);
|
save_tlm_matfile(d_dump_filename);
|
||||||
|
if (d_remove_dat)
|
||||||
|
{
|
||||||
|
if (!tlm_remove_file(d_dump_filename))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "Error deleting temporary file";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,6 +99,7 @@ private:
|
|||||||
bool d_flag_PLL_180_deg_phase_locked;
|
bool d_flag_PLL_180_deg_phase_locked;
|
||||||
bool d_flag_valid_word;
|
bool d_flag_valid_word;
|
||||||
bool d_dump_mat;
|
bool d_dump_mat;
|
||||||
|
bool d_remove_dat;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,6 +63,7 @@ gps_l5_telemetry_decoder_gs::gps_l5_telemetry_decoder_gs(
|
|||||||
d_dump_filename = conf.dump_filename;
|
d_dump_filename = conf.dump_filename;
|
||||||
d_dump = conf.dump;
|
d_dump = conf.dump;
|
||||||
d_dump_mat = conf.dump_mat;
|
d_dump_mat = conf.dump_mat;
|
||||||
|
d_remove_dat = conf.remove_dat;
|
||||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||||
DLOG(INFO) << "GPS L5 TELEMETRY PROCESSING: satellite " << d_satellite;
|
DLOG(INFO) << "GPS L5 TELEMETRY PROCESSING: satellite " << d_satellite;
|
||||||
d_channel = 0;
|
d_channel = 0;
|
||||||
@ -103,6 +104,13 @@ gps_l5_telemetry_decoder_gs::~gps_l5_telemetry_decoder_gs()
|
|||||||
if (d_dump && (pos != 0) && d_dump_mat)
|
if (d_dump && (pos != 0) && d_dump_mat)
|
||||||
{
|
{
|
||||||
save_tlm_matfile(d_dump_filename);
|
save_tlm_matfile(d_dump_filename);
|
||||||
|
if (d_remove_dat)
|
||||||
|
{
|
||||||
|
if (!tlm_remove_file(d_dump_filename))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "Error deleting temporary file";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,6 +95,7 @@ private:
|
|||||||
bool d_sent_tlm_failed_msg;
|
bool d_sent_tlm_failed_msg;
|
||||||
bool d_dump;
|
bool d_dump;
|
||||||
bool d_dump_mat;
|
bool d_dump_mat;
|
||||||
|
bool d_remove_dat;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,4 +34,5 @@ void Tlm_Conf::SetFromConfiguration(const ConfigurationInterface *configuration,
|
|||||||
dump_filename = configuration->property(role + ".dump_filename", default_dumpname);
|
dump_filename = configuration->property(role + ".dump_filename", default_dumpname);
|
||||||
dump = configuration->property(role + ".dump", false);
|
dump = configuration->property(role + ".dump", false);
|
||||||
dump_mat = configuration->property(role + ".dump_mat", dump);
|
dump_mat = configuration->property(role + ".dump_mat", dump);
|
||||||
|
remove_dat = configuration->property(role + ".remove_dat", false);
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,7 @@ public:
|
|||||||
std::string dump_filename;
|
std::string dump_filename;
|
||||||
bool dump;
|
bool dump;
|
||||||
bool dump_mat;
|
bool dump_mat;
|
||||||
|
bool remove_dat;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ int save_tlm_matfile(const std::string &dumpfile)
|
|||||||
std::ifstream dump_file;
|
std::ifstream dump_file;
|
||||||
std::string dump_filename_(dumpfile);
|
std::string dump_filename_(dumpfile);
|
||||||
|
|
||||||
std::cout << "Generating .mat file for " << dump_filename_ << '\n';
|
std::cout << "Generating .mat file for " << std::string(dump_filename_.begin(), dump_filename_.end() - 4) << '\n';
|
||||||
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user