diff --git a/docs/changelog b/docs/changelog index 0cce2d121..f4fe83fe7 100644 --- a/docs/changelog +++ b/docs/changelog @@ -26,6 +26,7 @@ SPDX-License-Identifier: GPL-3.0-or-later - New PVT parameter enable_rx_clock_correction allows to enable or disable the continuous application of the Time solution correction (clock steering) to the computation of Observables. By default is set to false (that is, disabled). - New PVT parameter max_clock_offset_ms: if PVT.enable_rx_clock_correction is set to false, this parameter sets the maximum allowed local clock offset with respect to the Time solution. If the estimated offset exceeds this parameter, a clock correction is applied to the computation of Observables. - Fixed L5 and E5a receiver chains when tracking the data component. +- Added new PVT parameter rinex_name to specify a custom name of the generated RINEX files. A commandline flag --RINEX_name is also available, and overrides the configuration. ### Improvements in Interoperability: diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index f6d523be0..59be524cb 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -98,6 +98,11 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration, pvt_output_parameters.rinex_version = 2; } pvt_output_parameters.rinexobs_rate_ms = bc::lcm(configuration->property(role + ".rinexobs_rate_ms", 1000), pvt_output_parameters.output_rate_ms); + pvt_output_parameters.rinex_name = configuration->property(role + ".rinex_name", std::string("-")); + if (FLAGS_RINEX_name != "-") + { + pvt_output_parameters.rinex_name = FLAGS_RINEX_name; + } // RTCM Printer settings pvt_output_parameters.flag_rtcm_tty_port = configuration->property(role + ".flag_rtcm_tty_port", false); diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index e633559a6..17c3a98ae 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -341,7 +341,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, d_rinex_version = conf_.rinex_version; if (b_rinex_output_enabled) { - rp = std::make_shared<Rinex_Printer>(d_rinex_version, conf_.rinex_output_path); + rp = std::make_shared<Rinex_Printer>(d_rinex_version, conf_.rinex_output_path, conf_.rinex_name); rp->set_pre_2009_file(conf_.pre_2009_file); } else diff --git a/src/algorithms/PVT/libs/pvt_conf.cc b/src/algorithms/PVT/libs/pvt_conf.cc index 7ad008da6..f1d7a02ce 100644 --- a/src/algorithms/PVT/libs/pvt_conf.cc +++ b/src/algorithms/PVT/libs/pvt_conf.cc @@ -32,6 +32,7 @@ Pvt_Conf::Pvt_Conf() max_obs_block_rx_clock_offset_ms = 40; rinex_version = 0; rinexobs_rate_ms = 0; + rinex_name = "-"; dump = false; dump_mat = true; diff --git a/src/algorithms/PVT/libs/pvt_conf.h b/src/algorithms/PVT/libs/pvt_conf.h index ea0682f08..a2223d090 100644 --- a/src/algorithms/PVT/libs/pvt_conf.h +++ b/src/algorithms/PVT/libs/pvt_conf.h @@ -37,6 +37,7 @@ public: int32_t rinex_version; int32_t rinexobs_rate_ms; + std::string rinex_name; std::map<int, int> rtcm_msg_rate_ms; bool dump; diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 0436132c3..2137b7b5e 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -75,7 +75,7 @@ namespace errorlib = boost::system; #endif -Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path) +Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path, const std::string& base_name) { pre_2009_file_ = false; std::string base_rinex_path = base_path; @@ -108,13 +108,13 @@ Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path) std::cout << "RINEX files will be stored at " << base_rinex_path << std::endl; } - navfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_GPS_NAV"); - obsfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_OBS"); - sbsfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_SBAS"); - navGalfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_GAL_NAV"); - navMixfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_MIXED_NAV"); - navGlofilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_GLO_NAV"); - navBdsfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_BDS_NAV"); + navfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_GPS_NAV", base_name); + obsfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_OBS", base_name); + sbsfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_SBAS", base_name); + navGalfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_GAL_NAV", base_name); + navMixfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_MIXED_NAV", base_name); + navGlofilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_GLO_NAV", base_name); + navBdsfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_BDS_NAV", base_name); Rinex_Printer::navFile.open(navfilename, std::ios::out | std::ios::in | std::ios::app); Rinex_Printer::obsFile.open(obsfilename, std::ios::out | std::ios::in | std::ios::app); @@ -335,7 +335,7 @@ void Rinex_Printer::lengthCheck(const std::string& line) } -std::string Rinex_Printer::createFilename(const std::string& type) +std::string Rinex_Printer::createFilename(const std::string& type, const std::string& base_name) { const std::string stationName = "GSDR"; // 4-character station name designator boost::gregorian::date today = boost::gregorian::day_clock::local_day(); @@ -365,7 +365,6 @@ std::string Rinex_Printer::createFilename(const std::string& type) fileType.insert(std::pair<std::string, std::string>("RINEX_FILE_TYPE_SUMMARY", "S")); // S - Summary file (used e.g., by IGS, not a standard!). fileType.insert(std::pair<std::string, std::string>("RINEX_FILE_TYPE_BDS_NAV", "F")); // G - GLONASS navigation file. - boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); tm pt_tm = boost::posix_time::to_tm(pt); int32_t local_hour = pt_tm.tm_hour; @@ -416,8 +415,15 @@ std::string Rinex_Printer::createFilename(const std::string& type) std::string yearTag = strm3.str(); std::string typeOfFile = fileType[type]; - - std::string filename(stationName + dayOfTheYearTag + hourTag + minTag + "." + yearTag + typeOfFile); + std::string filename; + if (base_name == "-") + { + filename = stationName + dayOfTheYearTag + hourTag + minTag + "." + yearTag + typeOfFile; + } + else + { + filename = base_name + "." + yearTag + typeOfFile; + } return filename; } diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h index 4531b9335..c40712ac6 100644 --- a/src/algorithms/PVT/libs/rinex_printer.h +++ b/src/algorithms/PVT/libs/rinex_printer.h @@ -78,7 +78,7 @@ public: /*! * \brief Default constructor. Creates GNSS Navigation and Observables RINEX files and their headers */ - explicit Rinex_Printer(int version = 0, const std::string& base_path = "."); + explicit Rinex_Printer(int version = 0, const std::string& base_path = ".", const std::string& base_name = "-"); /*! * \brief Default destructor. Closes GNSS Navigation and Observables RINEX files @@ -465,7 +465,7 @@ private: * "RINEX_FILE_TYPE_SBAS" - SBAS broadcast data file. * "RINEX_FILE_TYPE_CLK" - Clock file. */ - std::string createFilename(const std::string& type); + std::string createFilename(const std::string& type, const std::string& base_name); /* * Generates the data for the PGM / RUN BY / DATE line diff --git a/src/algorithms/libs/gnss_sdr_flags.cc b/src/algorithms/libs/gnss_sdr_flags.cc index 97eacb24b..f9535d1ff 100644 --- a/src/algorithms/libs/gnss_sdr_flags.cc +++ b/src/algorithms/libs/gnss_sdr_flags.cc @@ -64,14 +64,16 @@ DEFINE_int32(max_lock_fail, 50, "Maximum number of code lock failures before dro // cos(2xError_angle)=0.7 -> Error_angle=22 deg DEFINE_double(carrier_lock_th, 0.7, "Carrier lock threshold (in rad)."); -DEFINE_string(RINEX_version, "-", "If defined, specifies the RINEX version (2.11 or 3.02). Overrides the configuration file."); - DEFINE_double(dll_bw_hz, 0.0, "If defined, bandwidth of the DLL low pass filter, in Hz (overrides the configuration file)."); DEFINE_double(pll_bw_hz, 0.0, "If defined, bandwidth of the PLL low pass filter, in Hz (overrides the configuration file)."); DEFINE_int32(carrier_smoothing_factor, DEFAULT_CARRIER_SMOOTHING_FACTOR, "Sets carrier smoothing factor M (overrides the configuration file)"); +DEFINE_string(RINEX_version, "-", "If defined, specifies the RINEX version (2.11 or 3.02). Overrides the configuration file."); + +DEFINE_string(RINEX_name, "-", "If defined, specifies the RINEX files base name"); + #if GFLAGS_GREATER_2_0 static bool ValidateC(const char* flagname, const std::string& value) diff --git a/src/algorithms/libs/gnss_sdr_flags.h b/src/algorithms/libs/gnss_sdr_flags.h index 6b22e5cbc..7b87f48a2 100644 --- a/src/algorithms/libs/gnss_sdr_flags.h +++ b/src/algorithms/libs/gnss_sdr_flags.h @@ -53,6 +53,6 @@ const int32_t DEFAULT_CARRIER_SMOOTHING_FACTOR = 200; // Declare flags for PVT DECLARE_string(RINEX_version); //!< If defined, specifies the RINEX version (2.11 or 3.02). Overrides the configuration file. - +DECLARE_string(RINEX_name); //!< If defined, specifies the RINEX files base name #endif