diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index 50a00a172..7f1229c51 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -74,6 +74,7 @@ #include // for length_error #include // for IPC_CREAT #include // for msgctl +#include // for pair #if HAS_GENERIC_LAMBDA #else @@ -127,21 +128,21 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, // Send PVT status to gnss_flowgraph this->message_port_register_out(pmt::mp("status")); - mapStringValues_["1C"] = evGPS_1C; - mapStringValues_["2S"] = evGPS_2S; - mapStringValues_["L5"] = evGPS_L5; - mapStringValues_["1B"] = evGAL_1B; - mapStringValues_["5X"] = evGAL_5X; - mapStringValues_["1G"] = evGLO_1G; - mapStringValues_["2G"] = evGLO_2G; - mapStringValues_["B1"] = evBDS_B1; - mapStringValues_["B2"] = evBDS_B2; - mapStringValues_["B3"] = evBDS_B3; + d_mapStringValues["1C"] = evGPS_1C; + d_mapStringValues["2S"] = evGPS_2S; + d_mapStringValues["L5"] = evGPS_L5; + d_mapStringValues["1B"] = evGAL_1B; + d_mapStringValues["5X"] = evGAL_5X; + d_mapStringValues["1G"] = evGLO_1G; + d_mapStringValues["2G"] = evGLO_2G; + d_mapStringValues["B1"] = evBDS_B1; + d_mapStringValues["B2"] = evBDS_B2; + d_mapStringValues["B3"] = evBDS_B3; - initial_carrier_phase_offset_estimation_rads = std::vector(nchannels, 0.0); - channel_initialized = std::vector(nchannels, false); + d_initial_carrier_phase_offset_estimation_rads = std::vector(nchannels, 0.0); + d_channel_initialized = std::vector(nchannels, false); - max_obs_block_rx_clock_offset_ms = conf_.max_obs_block_rx_clock_offset_ms; + d_max_obs_block_rx_clock_offset_ms = conf_.max_obs_block_rx_clock_offset_ms; d_output_rate_ms = conf_.output_rate_ms; d_display_rate_ms = conf_.display_rate_ms; @@ -185,7 +186,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, d_nchannels = nchannels; - type_of_rx = conf_.type_of_receiver; + d_type_of_rx = conf_.type_of_receiver; // GPS Ephemeris data message port in this->message_port_register_in(pmt::mp("telemetry")); @@ -330,8 +331,8 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, d_rtcm_MT1097_rate_ms = bc::lcm(1000, d_output_rate_ms); // default value if not set d_rtcm_MSM_rate_ms = bc::lcm(1000, d_output_rate_ms); // default value if not set } - b_rtcm_writing_started = false; - b_rtcm_enabled = true; + d_rtcm_writing_started = false; + d_rtcm_enabled = true; } else { @@ -342,24 +343,24 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, d_rtcm_MT1087_rate_ms = 0; d_rtcm_MT1097_rate_ms = 0; d_rtcm_MSM_rate_ms = 0; - b_rtcm_enabled = false; - b_rtcm_writing_started = false; + d_rtcm_enabled = false; + d_rtcm_writing_started = false; d_rtcm_printer = nullptr; } // initialize RINEX printer - b_rinex_header_written = false; - b_rinex_header_updated = false; - b_rinex_output_enabled = conf_.rinex_output_enabled; + d_rinex_header_written = false; + d_rinex_header_updated = false; + d_rinex_output_enabled = conf_.rinex_output_enabled; d_rinex_version = conf_.rinex_version; - if (b_rinex_output_enabled) + if (d_rinex_output_enabled) { - rp = std::make_unique(d_rinex_version, conf_.rinex_output_path, conf_.rinex_name); - rp->set_pre_2009_file(conf_.pre_2009_file); + d_rp = std::make_unique(d_rinex_version, conf_.rinex_output_path, conf_.rinex_name); + d_rp->set_pre_2009_file(conf_.pre_2009_file); } else { - rp = nullptr; + d_rp = nullptr; } d_rinexobs_rate_ms = conf_.rinexobs_rate_ms; @@ -367,13 +368,13 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, d_xml_storage = conf_.xml_output_enabled; if (d_xml_storage) { - xml_base_path = conf_.xml_output_path; + d_xml_base_path = conf_.xml_output_path; fs::path full_path(fs::current_path()); - const fs::path p(xml_base_path); + const fs::path p(d_xml_base_path); if (!fs::exists(p)) { std::string new_folder; - for (auto& folder : fs::path(xml_base_path)) + for (auto& folder : fs::path(d_xml_base_path)) { new_folder += folder.string(); errorlib::error_code ec; @@ -382,7 +383,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; - xml_base_path = full_path.string(); + d_xml_base_path = full_path.string(); } } new_folder += fs::path::preferred_separator; @@ -390,40 +391,40 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, } else { - xml_base_path = p.string(); + d_xml_base_path = p.string(); } - if (xml_base_path != ".") + if (d_xml_base_path != ".") { - std::cout << "XML files will be stored at " << xml_base_path << std::endl; + std::cout << "XML files will be stored at " << d_xml_base_path << std::endl; } - xml_base_path = xml_base_path + fs::path::preferred_separator; + d_xml_base_path = d_xml_base_path + fs::path::preferred_separator; } d_rx_time = 0.0; d_last_status_print_seg = 0; // PVT MONITOR - flag_monitor_pvt_enabled = conf_.monitor_enabled; - if (flag_monitor_pvt_enabled) + d_flag_monitor_pvt_enabled = conf_.monitor_enabled; + if (d_flag_monitor_pvt_enabled) { std::string address_string = conf_.udp_addresses; std::vector udp_addr_vec = split_string(address_string, '_'); std::sort(udp_addr_vec.begin(), udp_addr_vec.end()); udp_addr_vec.erase(std::unique(udp_addr_vec.begin(), udp_addr_vec.end()), udp_addr_vec.end()); - udp_sink_ptr = std::make_unique(udp_addr_vec, conf_.udp_port, conf_.protobuf_enabled); + d_udp_sink_ptr = std::make_unique(udp_addr_vec, conf_.udp_port, conf_.protobuf_enabled); } else { - udp_sink_ptr = nullptr; + d_udp_sink_ptr = nullptr; } // Create Sys V message queue - first_fix = true; - sysv_msg_key = 1101; + d_first_fix = true; + d_sysv_msg_key = 1101; int msgflg = IPC_CREAT | 0666; - if ((sysv_msqid = msgget(sysv_msg_key, msgflg)) == -1) + 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; @@ -494,22 +495,22 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, d_user_pvt_solver = d_internal_pvt_solver; } - start = std::chrono::system_clock::now(); + d_start = std::chrono::system_clock::now(); } rtklib_pvt_gs::~rtklib_pvt_gs() { - if (sysv_msqid != -1) + if (d_sysv_msqid != -1) { - msgctl(sysv_msqid, IPC_RMID, nullptr); + msgctl(d_sysv_msqid, IPC_RMID, nullptr); } try { if (d_xml_storage) { // save GPS L2CM ephemeris to XML file - std::string file_name = xml_base_path + "gps_cnav_ephemeris.xml"; + std::string file_name = d_xml_base_path + "gps_cnav_ephemeris.xml"; if (d_internal_pvt_solver->gps_cnav_ephemeris_map.empty() == false) { std::ofstream ofs; @@ -535,7 +536,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs() } // save GPS L1 CA ephemeris to XML file - file_name = xml_base_path + "gps_ephemeris.xml"; + file_name = d_xml_base_path + "gps_ephemeris.xml"; if (d_internal_pvt_solver->gps_ephemeris_map.empty() == false) { std::ofstream ofs; @@ -561,7 +562,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs() } // save Galileo E1 ephemeris to XML file - file_name = xml_base_path + "gal_ephemeris.xml"; + file_name = d_xml_base_path + "gal_ephemeris.xml"; if (d_internal_pvt_solver->galileo_ephemeris_map.empty() == false) { std::ofstream ofs; @@ -591,7 +592,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs() } // save GLONASS GNAV ephemeris to XML file - file_name = xml_base_path + "eph_GLONASS_GNAV.xml"; + file_name = d_xml_base_path + "eph_GLONASS_GNAV.xml"; if (d_internal_pvt_solver->glonass_gnav_ephemeris_map.empty() == false) { std::ofstream ofs; @@ -621,7 +622,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs() } // Save GPS UTC model parameters - file_name = xml_base_path + "gps_utc_model.xml"; + file_name = d_xml_base_path + "gps_utc_model.xml"; if (d_internal_pvt_solver->gps_utc_model.valid) { std::ofstream ofs; @@ -651,7 +652,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs() } // Save Galileo UTC model parameters - file_name = xml_base_path + "gal_utc_model.xml"; + file_name = d_xml_base_path + "gal_utc_model.xml"; if (d_internal_pvt_solver->galileo_utc_model.Delta_tLS_6 != 0.0) { std::ofstream ofs; @@ -681,7 +682,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs() } // Save GPS iono parameters - file_name = xml_base_path + "gps_iono.xml"; + file_name = d_xml_base_path + "gps_iono.xml"; if (d_internal_pvt_solver->gps_iono.valid == true) { std::ofstream ofs; @@ -711,7 +712,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs() } // Save GPS CNAV iono parameters - file_name = xml_base_path + "gps_cnav_iono.xml"; + file_name = d_xml_base_path + "gps_cnav_iono.xml"; if (d_internal_pvt_solver->gps_cnav_iono.valid == true) { std::ofstream ofs; @@ -741,7 +742,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs() } // Save Galileo iono parameters - file_name = xml_base_path + "gal_iono.xml"; + file_name = d_xml_base_path + "gal_iono.xml"; if (d_internal_pvt_solver->galileo_iono.ai0_5 != 0.0) { std::ofstream ofs; @@ -771,7 +772,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs() } // save GPS almanac to XML file - file_name = xml_base_path + "gps_almanac.xml"; + file_name = d_xml_base_path + "gps_almanac.xml"; if (d_internal_pvt_solver->gps_almanac_map.empty() == false) { std::ofstream ofs; @@ -801,7 +802,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs() } // Save Galileo almanac - file_name = xml_base_path + "gal_almanac.xml"; + file_name = d_xml_base_path + "gal_almanac.xml"; if (d_internal_pvt_solver->galileo_almanac_map.empty() == false) { std::ofstream ofs; @@ -831,7 +832,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs() } // Save GPS CNAV UTC model parameters - file_name = xml_base_path + "gps_cnav_utc_model.xml"; + file_name = d_xml_base_path + "gps_cnav_utc_model.xml"; if (d_internal_pvt_solver->gps_cnav_utc_model.valid) { std::ofstream ofs; @@ -861,7 +862,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs() } // save GLONASS GNAV ephemeris to XML file - file_name = xml_base_path + "glo_gnav_ephemeris.xml"; + file_name = d_xml_base_path + "glo_gnav_ephemeris.xml"; if (d_internal_pvt_solver->glonass_gnav_ephemeris_map.empty() == false) { std::ofstream ofs; @@ -891,7 +892,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs() } // save GLONASS UTC model parameters to XML file - file_name = xml_base_path + "glo_utc_model.xml"; + file_name = d_xml_base_path + "glo_utc_model.xml"; if (d_internal_pvt_solver->glonass_gnav_utc_model.valid) { std::ofstream ofs; @@ -921,7 +922,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs() } // save BeiDou DNAV ephemeris to XML file - file_name = xml_base_path + "bds_dnav_ephemeris.xml"; + file_name = d_xml_base_path + "bds_dnav_ephemeris.xml"; if (d_internal_pvt_solver->beidou_dnav_ephemeris_map.empty() == false) { std::ofstream ofs; @@ -951,7 +952,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs() } // Save BeiDou DNAV iono parameters - file_name = xml_base_path + "bds_dnav_iono.xml"; + file_name = d_xml_base_path + "bds_dnav_iono.xml"; if (d_internal_pvt_solver->beidou_dnav_iono.valid) { std::ofstream ofs; @@ -981,7 +982,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs() } // save BeiDou DNAV almanac to XML file - file_name = xml_base_path + "bds_dnav_almanac.xml"; + file_name = d_xml_base_path + "bds_dnav_almanac.xml"; if (d_internal_pvt_solver->beidou_dnav_almanac_map.empty() == false) { std::ofstream ofs; @@ -1011,7 +1012,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs() } // Save BeiDou UTC model parameters - file_name = xml_base_path + "bds_dnav_utc_model.xml"; + file_name = d_xml_base_path + "bds_dnav_utc_model.xml"; if (d_internal_pvt_solver->beidou_dnav_utc_model.valid) { std::ofstream ofs; @@ -1064,7 +1065,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) << "inserted with Toe=" << gps_eph->d_Toe << " and GPS Week=" << gps_eph->i_GPS_week; // update/insert new ephemeris record to the global ephemeris map - if (b_rinex_header_written) // The header is already written, we can now log the navigation message data + if (d_rinex_header_written) // The header is already written, we can now log the navigation message data { bool new_annotation = false; if (d_internal_pvt_solver->gps_ephemeris_map.find(gps_eph->i_satellite_PRN) == d_internal_pvt_solver->gps_ephemeris_map.cend()) @@ -1085,54 +1086,54 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) std::map new_gal_eph; std::map new_glo_eph; new_eph[gps_eph->i_satellite_PRN] = *gps_eph; - switch (type_of_rx) + switch (d_type_of_rx) { case 1: // GPS L1 C/A only - rp->log_rinex_nav(rp->navFile, new_eph); + d_rp->log_rinex_nav(d_rp->navFile, new_eph); break; case 8: // L1+L5 - rp->log_rinex_nav(rp->navFile, new_eph); + d_rp->log_rinex_nav(d_rp->navFile, new_eph); break; case 9: // GPS L1 C/A + Galileo E1B - rp->log_rinex_nav(rp->navMixFile, new_eph, new_gal_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); break; case 10: // GPS L1 C/A + Galileo E5a - rp->log_rinex_nav(rp->navMixFile, new_eph, new_gal_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); break; case 11: // GPS L1 C/A + Galileo E5b - rp->log_rinex_nav(rp->navMixFile, new_eph, new_gal_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); break; case 26: // GPS L1 C/A + GLONASS L1 C/A if (d_rinex_version == 3) { - rp->log_rinex_nav(rp->navMixFile, new_eph, new_glo_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_glo_eph); } if (d_rinex_version == 2) { - rp->log_rinex_nav(rp->navFile, new_glo_eph); + d_rp->log_rinex_nav(d_rp->navFile, new_glo_eph); } break; case 29: // GPS L1 C/A + GLONASS L2 C/A if (d_rinex_version == 3) { - rp->log_rinex_nav(rp->navMixFile, new_eph, new_glo_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_glo_eph); } if (d_rinex_version == 2) { - rp->log_rinex_nav(rp->navFile, new_eph); + d_rp->log_rinex_nav(d_rp->navFile, new_eph); } break; case 32: // L1+E1+L5+E5a - rp->log_rinex_nav(rp->navMixFile, new_eph, new_gal_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); break; case 33: // L1+E1+E5a - rp->log_rinex_nav(rp->navMixFile, new_eph, new_gal_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); break; case 1000: // L1+L2+L5 - rp->log_rinex_nav(rp->navFile, new_eph); + d_rp->log_rinex_nav(d_rp->navFile, new_eph); break; case 1001: // L1+E1+L2+L5+E5a - rp->log_rinex_nav(rp->navMixFile, new_eph, new_gal_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); break; default: break; @@ -1175,7 +1176,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) std::shared_ptr gps_cnav_ephemeris; gps_cnav_ephemeris = boost::any_cast>(pmt::any_ref(msg)); // update/insert new ephemeris record to the global ephemeris map - if (b_rinex_header_written) // The header is already written, we can now log the navigation message data + if (d_rinex_header_written) // The header is already written, we can now log the navigation message data { bool new_annotation = false; if (d_internal_pvt_solver->gps_cnav_ephemeris_map.find(gps_cnav_ephemeris->i_satellite_PRN) == d_internal_pvt_solver->gps_cnav_ephemeris_map.cend()) @@ -1196,25 +1197,25 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) std::map new_cnav_eph; std::map new_glo_eph; new_cnav_eph[gps_cnav_ephemeris->i_satellite_PRN] = *gps_cnav_ephemeris; - switch (type_of_rx) + switch (d_type_of_rx) { case 2: // GPS L2C only - rp->log_rinex_nav(rp->navFile, new_cnav_eph); + d_rp->log_rinex_nav(d_rp->navFile, new_cnav_eph); break; case 3: // GPS L5 only - rp->log_rinex_nav(rp->navFile, new_cnav_eph); + d_rp->log_rinex_nav(d_rp->navFile, new_cnav_eph); break; case 7: // GPS L1 C/A + GPS L2C - rp->log_rinex_nav(rp->navFile, new_cnav_eph); + d_rp->log_rinex_nav(d_rp->navFile, new_cnav_eph); break; case 13: // L5+E5a - rp->log_rinex_nav(rp->navMixFile, new_cnav_eph, new_gal_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_cnav_eph, new_gal_eph); break; case 28: // GPS L2C + GLONASS L1 C/A - rp->log_rinex_nav(rp->navMixFile, new_cnav_eph, new_glo_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_cnav_eph, new_glo_eph); break; case 31: // GPS L2C + GLONASS L2 C/A - rp->log_rinex_nav(rp->navMixFile, new_cnav_eph, new_glo_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_cnav_eph, new_glo_eph); break; default: break; @@ -1276,7 +1277,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) << ", GALILEO Week Number =" << galileo_eph->WN_5 << " and Ephemeris IOD = " << galileo_eph->IOD_ephemeris; // update/insert new ephemeris record to the global ephemeris map - if (b_rinex_header_written) // The header is already written, we can now log the navigation message data + if (d_rinex_header_written) // The header is already written, we can now log the navigation message data { bool new_annotation = false; if (d_internal_pvt_solver->galileo_ephemeris_map.find(galileo_eph->i_satellite_PRN) == d_internal_pvt_solver->galileo_ephemeris_map.cend()) @@ -1298,46 +1299,46 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) std::map new_eph; std::map new_glo_eph; new_gal_eph[galileo_eph->i_satellite_PRN] = *galileo_eph; - switch (type_of_rx) + switch (d_type_of_rx) { case 4: // Galileo E1B only - rp->log_rinex_nav(rp->navGalFile, new_gal_eph); + d_rp->log_rinex_nav(d_rp->navGalFile, new_gal_eph); break; case 5: // Galileo E5a only - rp->log_rinex_nav(rp->navGalFile, new_gal_eph); + d_rp->log_rinex_nav(d_rp->navGalFile, new_gal_eph); break; case 6: // Galileo E5b only - rp->log_rinex_nav(rp->navGalFile, new_gal_eph); + d_rp->log_rinex_nav(d_rp->navGalFile, new_gal_eph); break; case 9: // GPS L1 C/A + Galileo E1B - rp->log_rinex_nav(rp->navMixFile, new_eph, new_gal_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); break; case 10: // GPS L1 C/A + Galileo E5a - rp->log_rinex_nav(rp->navMixFile, new_eph, new_gal_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); break; case 11: // GPS L1 C/A + Galileo E5b - rp->log_rinex_nav(rp->navMixFile, new_eph, new_gal_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); break; case 13: // L5+E5a - rp->log_rinex_nav(rp->navMixFile, new_cnav_eph, new_gal_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_cnav_eph, new_gal_eph); break; case 15: // Galileo E1B + Galileo E5b - rp->log_rinex_nav(rp->navGalFile, new_gal_eph); + d_rp->log_rinex_nav(d_rp->navGalFile, new_gal_eph); break; case 27: // Galileo E1B + GLONASS L1 C/A - rp->log_rinex_nav(rp->navMixFile, new_gal_eph, new_glo_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_gal_eph, new_glo_eph); break; case 30: // Galileo E1B + GLONASS L2 C/A - rp->log_rinex_nav(rp->navMixFile, new_gal_eph, new_glo_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_gal_eph, new_glo_eph); break; case 32: // L1+E1+L5+E5a - rp->log_rinex_nav(rp->navMixFile, new_eph, new_gal_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); break; case 33: // L1+E1+E5a - rp->log_rinex_nav(rp->navMixFile, new_eph, new_gal_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); break; case 1001: // L1+E1+L2+L5+E5a - rp->log_rinex_nav(rp->navMixFile, new_eph, new_gal_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); break; default: break; @@ -1436,7 +1437,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) << " and Ephemeris IOD in UTC = " << glonass_gnav_eph->compute_GLONASS_time(glonass_gnav_eph->d_t_b) << " from SV = " << glonass_gnav_eph->i_satellite_slot_number; // update/insert new ephemeris record to the global ephemeris map - if (b_rinex_header_written) // The header is already written, we can now log the navigation message data + if (d_rinex_header_written) // The header is already written, we can now log the navigation message data { bool new_annotation = false; if (d_internal_pvt_solver->glonass_gnav_ephemeris_map.find(glonass_gnav_eph->i_satellite_PRN) == d_internal_pvt_solver->glonass_gnav_ephemeris_map.cend()) @@ -1458,48 +1459,48 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) std::map new_eph; std::map new_glo_eph; new_glo_eph[glonass_gnav_eph->i_satellite_PRN] = *glonass_gnav_eph; - switch (type_of_rx) + switch (d_type_of_rx) { case 23: // GLONASS L1 C/A - rp->log_rinex_nav(rp->navGloFile, new_glo_eph); + d_rp->log_rinex_nav(d_rp->navGloFile, new_glo_eph); break; case 24: // GLONASS L2 C/A - rp->log_rinex_nav(rp->navGloFile, new_glo_eph); + d_rp->log_rinex_nav(d_rp->navGloFile, new_glo_eph); break; case 25: // GLONASS L1 C/A + GLONASS L2 C/A - rp->log_rinex_nav(rp->navGloFile, new_glo_eph); + d_rp->log_rinex_nav(d_rp->navGloFile, new_glo_eph); break; case 26: // GPS L1 C/A + GLONASS L1 C/A if (d_rinex_version == 3) { - rp->log_rinex_nav(rp->navMixFile, new_eph, new_glo_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_glo_eph); } if (d_rinex_version == 2) { - rp->log_rinex_nav(rp->navGloFile, new_glo_eph); + d_rp->log_rinex_nav(d_rp->navGloFile, new_glo_eph); } break; case 27: // Galileo E1B + GLONASS L1 C/A - rp->log_rinex_nav(rp->navMixFile, new_gal_eph, new_glo_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_gal_eph, new_glo_eph); break; case 28: // GPS L2C + GLONASS L1 C/A - rp->log_rinex_nav(rp->navMixFile, new_cnav_eph, new_glo_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_cnav_eph, new_glo_eph); break; case 29: // GPS L1 C/A + GLONASS L2 C/A if (d_rinex_version == 3) { - rp->log_rinex_nav(rp->navMixFile, new_eph, new_glo_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_glo_eph); } if (d_rinex_version == 2) { - rp->log_rinex_nav(rp->navGloFile, new_glo_eph); + d_rp->log_rinex_nav(d_rp->navGloFile, new_glo_eph); } break; case 30: // Galileo E1B + GLONASS L2 C/A - rp->log_rinex_nav(rp->navMixFile, new_gal_eph, new_glo_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_gal_eph, new_glo_eph); break; case 31: // GPS L2C + GLONASS L2 C/A - rp->log_rinex_nav(rp->navMixFile, new_cnav_eph, new_glo_eph); + d_rp->log_rinex_nav(d_rp->navMixFile, new_cnav_eph, new_glo_eph); break; default: break; @@ -1550,7 +1551,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) << "inserted with Toe=" << bds_dnav_eph->d_Toe << " and BDS Week=" << bds_dnav_eph->i_BEIDOU_week; // update/insert new ephemeris record to the global ephemeris map - if (b_rinex_header_written) // The header is already written, we can now log the navigation message data + if (d_rinex_header_written) // The header is already written, we can now log the navigation message data { bool new_annotation = false; if (d_internal_pvt_solver->beidou_dnav_ephemeris_map.find(bds_dnav_eph->i_satellite_PRN) == d_internal_pvt_solver->beidou_dnav_ephemeris_map.cend()) @@ -1569,13 +1570,13 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) // New record! std::map new_bds_eph; new_bds_eph[bds_dnav_eph->i_satellite_PRN] = *bds_dnav_eph; - switch (type_of_rx) + switch (d_type_of_rx) { case 500: // BDS B1I only - rp->log_rinex_nav(rp->navFile, new_bds_eph); + d_rp->log_rinex_nav(d_rp->navFile, new_bds_eph); break; case 600: // BDS B3I only - rp->log_rinex_nav(rp->navFile, new_bds_eph); + d_rp->log_rinex_nav(d_rp->navFile, new_bds_eph); break; default: break; @@ -1692,20 +1693,20 @@ void rtklib_pvt_gs::clear_ephemeris() } -bool rtklib_pvt_gs::send_sys_v_ttff_msg(ttff_msgbuf ttff) +bool rtklib_pvt_gs::send_sys_v_ttff_msg(d_ttff_msgbuf ttff) { - if (sysv_msqid != -1) + if (d_sysv_msqid != -1) { // Fill Sys V message structures int msgsend_size; - ttff_msgbuf msg; + d_ttff_msgbuf msg; msg.ttff = ttff.ttff; msgsend_size = sizeof(msg.ttff); msg.mtype = 1; // default message ID // SEND SOLUTION OVER A MESSAGE QUEUE // non-blocking Sys V message send - msgsnd(sysv_msqid, &msg, msgsend_size, IPC_NOWAIT); + msgsnd(d_sysv_msqid, &msg, msgsend_size, IPC_NOWAIT); return true; } return false; @@ -1714,14 +1715,14 @@ bool rtklib_pvt_gs::send_sys_v_ttff_msg(ttff_msgbuf ttff) bool rtklib_pvt_gs::save_gnss_synchro_map_xml(const std::string& file_name) { - if (gnss_observables_map.empty() == false) + if (d_gnss_observables_map.empty() == false) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gnss_synchro_map", gnss_observables_map); + xml << boost::serialization::make_nvp("GNSS-SDR_gnss_synchro_map", d_gnss_observables_map); LOG(INFO) << "Saved gnss_sychro map data"; } catch (const std::exception& e) @@ -1745,8 +1746,8 @@ bool rtklib_pvt_gs::load_gnss_synchro_map_xml(const std::string& file_name) { ifs.open(file_name.c_str(), std::ifstream::binary | std::ifstream::in); boost::archive::xml_iarchive xml(ifs); - gnss_observables_map.clear(); - xml >> boost::serialization::make_nvp("GNSS-SDR_gnss_synchro_map", gnss_observables_map); + 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; } catch (const std::exception& e) @@ -1825,7 +1826,7 @@ void rtklib_pvt_gs::apply_rx_clock_offset(std::map& observabl observables_iter->second.RX_time -= rx_clock_offset_s; observables_iter->second.Pseudorange_m -= rx_clock_offset_s * SPEED_OF_LIGHT; - switch (mapStringValues_[observables_iter->second.Signal]) + switch (d_mapStringValues[observables_iter->second.Signal]) { case evGPS_1C: observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ1 * PI_2; @@ -1867,8 +1868,8 @@ void rtklib_pvt_gs::apply_rx_clock_offset(std::map& observabl } -std::map rtklib_pvt_gs::interpolate_observables(std::map& observables_map_t0, - std::map& observables_map_t1, +std::map rtklib_pvt_gs::interpolate_observables(const std::map& observables_map_t0, + const std::map& observables_map_t1, double rx_time_s) { std::map interp_observables_map; @@ -1920,14 +1921,14 @@ void rtklib_pvt_gs::initialize_and_apply_carrier_phase_offset() { // we have a valid PVT. First check if we need to reset the initial carrier phase offsets to match their pseudoranges std::map::iterator observables_iter; - for (observables_iter = gnss_observables_map.begin(); observables_iter != gnss_observables_map.end(); observables_iter++) + for (observables_iter = d_gnss_observables_map.begin(); observables_iter != d_gnss_observables_map.end(); observables_iter++) { // check if an initialization is required (new satellite or loss of lock) // it is set to false by the work function if the gnss_synchro is not valid - if (channel_initialized.at(observables_iter->second.Channel_ID) == false) + if (d_channel_initialized.at(observables_iter->second.Channel_ID) == false) { double wavelength_m = 0; - switch (mapStringValues_[observables_iter->second.Signal]) + switch (d_mapStringValues[observables_iter->second.Signal]) { case evGPS_1C: wavelength_m = SPEED_OF_LIGHT / FREQ1; @@ -1966,12 +1967,12 @@ void rtklib_pvt_gs::initialize_and_apply_carrier_phase_offset() break; } double wrap_carrier_phase_rad = fmod(observables_iter->second.Carrier_phase_rads, PI_2); - initial_carrier_phase_offset_estimation_rads.at(observables_iter->second.Channel_ID) = PI_2 * round(observables_iter->second.Pseudorange_m / wavelength_m) - observables_iter->second.Carrier_phase_rads + wrap_carrier_phase_rad; - channel_initialized.at(observables_iter->second.Channel_ID) = true; + d_initial_carrier_phase_offset_estimation_rads.at(observables_iter->second.Channel_ID) = PI_2 * round(observables_iter->second.Pseudorange_m / wavelength_m) - observables_iter->second.Carrier_phase_rads + wrap_carrier_phase_rad; + d_channel_initialized.at(observables_iter->second.Channel_ID) = true; DLOG(INFO) << "initialized carrier phase at channel " << observables_iter->second.Channel_ID; } // apply the carrier phase offset to this satellite - observables_iter->second.Carrier_phase_rads = observables_iter->second.Carrier_phase_rads + initial_carrier_phase_offset_estimation_rads.at(observables_iter->second.Channel_ID); + observables_iter->second.Carrier_phase_rads = observables_iter->second.Carrier_phase_rads + d_initial_carrier_phase_offset_estimation_rads.at(observables_iter->second.Channel_ID); } } @@ -1989,7 +1990,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item bool flag_write_RTCM_MSM_output = false; bool flag_write_RINEX_obs_output = false; - gnss_observables_map.clear(); + d_gnss_observables_map.clear(); const auto** in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer // ############ 1. READ PSEUDORANGES #### for (uint32_t i = 0; i < d_nchannels; i++) @@ -2048,10 +2049,10 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (store_valid_observable) { // store valid observables in a map. - gnss_observables_map.insert(std::pair(i, in[i][epoch])); + d_gnss_observables_map.insert(std::pair(i, in[i][epoch])); } - if (b_rtcm_enabled) + if (d_rtcm_enabled) { try { @@ -2098,22 +2099,22 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } else { - channel_initialized.at(i) = false; // the current channel is not reporting valid observable + d_channel_initialized.at(i) = false; // the current channel is not reporting valid observable } } // ############ 2 COMPUTE THE PVT ################################ bool flag_pvt_valid = false; - if (gnss_observables_map.empty() == false) + if (d_gnss_observables_map.empty() == false) { - // LOG(INFO) << "diff raw obs time: " << gnss_observables_map.cbegin()->second.RX_time * 1000.0 - old_time_debug; - // old_time_debug = gnss_observables_map.cbegin()->second.RX_time * 1000.0; + // LOG(INFO) << "diff raw obs time: " << d_gnss_observables_map.cbegin()->second.RX_time * 1000.0 - old_time_debug; + // old_time_debug = d_gnss_observables_map.cbegin()->second.RX_time * 1000.0; uint32_t current_RX_time_ms = 0; // #### solve PVT and store the corrected observable set - if (d_internal_pvt_solver->get_PVT(gnss_observables_map, false)) + if (d_internal_pvt_solver->get_PVT(d_gnss_observables_map, false)) { double Rx_clock_offset_s = d_internal_pvt_solver->get_time_offset_s(); - if (fabs(Rx_clock_offset_s) * 1000.0 > max_obs_block_rx_clock_offset_ms) + if (fabs(Rx_clock_offset_s) * 1000.0 > d_max_obs_block_rx_clock_offset_ms) { if (!d_waiting_obs_block_rx_clock_offset_correction_msg) { @@ -2127,42 +2128,42 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (d_enable_rx_clock_correction == true) { d_waiting_obs_block_rx_clock_offset_correction_msg = false; - gnss_observables_map_t0 = gnss_observables_map_t1; - apply_rx_clock_offset(gnss_observables_map, Rx_clock_offset_s); - gnss_observables_map_t1 = gnss_observables_map; + d_gnss_observables_map_t0 = d_gnss_observables_map_t1; + apply_rx_clock_offset(d_gnss_observables_map, Rx_clock_offset_s); + d_gnss_observables_map_t1 = d_gnss_observables_map; // ### select the rx_time and interpolate observables at that time - if (!gnss_observables_map_t0.empty()) + if (!d_gnss_observables_map_t0.empty()) { - uint32_t t0_int_ms = static_cast(gnss_observables_map_t0.cbegin()->second.RX_time * 1000.0); + uint32_t t0_int_ms = static_cast(d_gnss_observables_map_t0.cbegin()->second.RX_time * 1000.0); uint32_t adjust_next_20ms = 20 - t0_int_ms % 20; current_RX_time_ms = t0_int_ms + adjust_next_20ms; if (current_RX_time_ms % d_output_rate_ms == 0) { d_rx_time = static_cast(current_RX_time_ms) / 1000.0; - // std::cout << " obs time t0: " << gnss_observables_map_t0.cbegin()->second.RX_time - // << " t1: " << gnss_observables_map_t1.cbegin()->second.RX_time + // 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; - gnss_observables_map = interpolate_observables(gnss_observables_map_t0, - gnss_observables_map_t1, + 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: " << 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 << std::endl; } } } else { - d_rx_time = gnss_observables_map.begin()->second.RX_time; + d_rx_time = d_gnss_observables_map.begin()->second.RX_time; current_RX_time_ms = static_cast(d_rx_time * 1000.0); if (current_RX_time_ms % d_output_rate_ms == 0) { flag_compute_pvt_output = true; // std::cout.precision(17); - // std::cout << "current_RX_time: " << current_RX_time << " map time: " << 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 << std::endl; } flag_pvt_valid = true; } @@ -2177,7 +2178,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item // compute on the fly PVT solution if (flag_compute_pvt_output == true) { - flag_pvt_valid = d_user_pvt_solver->get_PVT(gnss_observables_map, false); + flag_pvt_valid = d_user_pvt_solver->get_PVT(d_gnss_observables_map, false); } if (flag_pvt_valid == true) @@ -2257,7 +2258,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } } - if (first_fix == true) + if (d_first_fix == true) { if (d_show_local_time_zone) { @@ -2270,13 +2271,13 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } 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; - ttff_msgbuf ttff; + d_ttff_msgbuf ttff; ttff.mtype = 1; - end = std::chrono::system_clock::now(); - std::chrono::duration elapsed_seconds = end - start; + d_end = std::chrono::system_clock::now(); + std::chrono::duration elapsed_seconds = d_end - d_start; ttff.ttff = elapsed_seconds.count(); send_sys_v_ttff_msg(ttff); - first_fix = false; + d_first_fix = false; } if (d_kml_output_enabled) { @@ -2363,128 +2364,128 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item */ // ####################### RINEX FILES ################# - if (b_rinex_output_enabled) + if (d_rinex_output_enabled) { std::map::const_iterator galileo_ephemeris_iter; std::map::const_iterator gps_ephemeris_iter; std::map::const_iterator gps_cnav_ephemeris_iter; std::map::const_iterator glonass_gnav_ephemeris_iter; std::map::const_iterator beidou_dnav_ephemeris_iter; - if (!b_rinex_header_written) // & we have utc data in nav message! + if (!d_rinex_header_written) // & we have utc data in nav message! { galileo_ephemeris_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); gps_ephemeris_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); gps_cnav_ephemeris_iter = d_user_pvt_solver->gps_cnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); beidou_dnav_ephemeris_iter = d_user_pvt_solver->beidou_dnav_ephemeris_map.cbegin(); - switch (type_of_rx) + switch (d_type_of_rx) { case 1: // GPS L1 C/A only if (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, d_rx_time); - rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); - rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->gps_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, gps_ephemeris_iter->second, d_rx_time); + d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); + d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->gps_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 2: // GPS L2C only if (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend()) { std::string signal("2S"); - rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model); - rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->gps_cnav_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, signal); + d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model); + d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->gps_cnav_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 3: // GPS L5 only if (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend()) { std::string signal("L5"); - rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model); - rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->gps_cnav_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, signal); + d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model); + d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->gps_cnav_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 4: // Galileo E1B only if (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { - rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time); - rp->rinex_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - rp->log_rinex_nav(rp->navGalFile, d_user_pvt_solver->galileo_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, galileo_ephemeris_iter->second, d_rx_time); + d_rp->rinex_nav_header(d_rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->log_rinex_nav(d_rp->navGalFile, d_user_pvt_solver->galileo_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 5: // Galileo E5a only if (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { std::string signal("5X"); - rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - rp->log_rinex_nav(rp->navGalFile, d_user_pvt_solver->galileo_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); + d_rp->rinex_nav_header(d_rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->log_rinex_nav(d_rp->navGalFile, d_user_pvt_solver->galileo_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 6: // Galileo E5b only if (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { std::string signal("7X"); - rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - rp->log_rinex_nav(rp->navGalFile, d_user_pvt_solver->galileo_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); + d_rp->rinex_nav_header(d_rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->log_rinex_nav(d_rp->navGalFile, d_user_pvt_solver->galileo_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 7: // GPS L1 C/A + GPS L2C if ((gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { std::string signal("1C 2S"); - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); - rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->gps_cnav_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, signal); + d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); + d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->gps_cnav_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 8: // GPS L1 + GPS L5 if ((gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { std::string signal("1C L5"); - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); - rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->gps_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, signal); + d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); + d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->gps_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 9: // GPS L1 C/A + Galileo E1B if ((galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend())) { std::string gal_signal("1B"); - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->galileo_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); + d_rp->rinex_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->log_rinex_nav(d_rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->galileo_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 10: // GPS L1 C/A + Galileo E5a if ((galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend())) { std::string gal_signal("5X"); - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->galileo_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); + d_rp->rinex_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->log_rinex_nav(d_rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->galileo_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 11: // GPS L1 C/A + Galileo E5b if ((galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend())) { std::string gal_signal("7X"); - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->galileo_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); + d_rp->rinex_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->log_rinex_nav(d_rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->galileo_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 13: // L5+E5a @@ -2492,80 +2493,80 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { std::string gal_signal("5X"); std::string gps_signal("L5"); - rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gps_signal, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->gps_cnav_ephemeris_map, d_user_pvt_solver->galileo_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gps_signal, gal_signal); + d_rp->rinex_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->log_rinex_nav(d_rp->navMixFile, d_user_pvt_solver->gps_cnav_ephemeris_map, d_user_pvt_solver->galileo_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 14: // Galileo E1B + Galileo E5a if ((galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend())) { std::string gal_signal("1B 5X"); - rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - rp->log_rinex_nav(rp->navGalFile, d_user_pvt_solver->galileo_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal); + d_rp->rinex_nav_header(d_rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->log_rinex_nav(d_rp->navGalFile, d_user_pvt_solver->galileo_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 15: // Galileo E1B + Galileo E5b if ((galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend())) { std::string gal_signal("1B 7X"); - rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - rp->log_rinex_nav(rp->navGalFile, d_user_pvt_solver->galileo_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal); + d_rp->rinex_nav_header(d_rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->log_rinex_nav(d_rp->navGalFile, d_user_pvt_solver->galileo_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 23: // GLONASS L1 C/A only if (glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { std::string signal("1G"); - rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); - rp->log_rinex_nav(rp->navGloFile, d_user_pvt_solver->glonass_gnav_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); + d_rp->rinex_nav_header(d_rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + d_rp->log_rinex_nav(d_rp->navGloFile, d_user_pvt_solver->glonass_gnav_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 24: // GLONASS L2 C/A only if (glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { std::string signal("2G"); - rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); - rp->log_rinex_nav(rp->navGloFile, d_user_pvt_solver->glonass_gnav_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); + d_rp->rinex_nav_header(d_rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + d_rp->log_rinex_nav(d_rp->navGloFile, d_user_pvt_solver->glonass_gnav_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 25: // GLONASS L1 C/A + GLONASS L2 C/A if (glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { std::string signal("1G 2G"); - rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); - rp->log_rinex_nav(rp->navGloFile, d_user_pvt_solver->glonass_gnav_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); + d_rp->rinex_nav_header(d_rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + d_rp->log_rinex_nav(d_rp->navGloFile, d_user_pvt_solver->glonass_gnav_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 26: // GPS L1 C/A + GLONASS L1 C/A if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend())) { std::string glo_signal("1G"); - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); + d_rp->rinex_obs_header(d_rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); if (d_rinex_version == 3) { - rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); - rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->glonass_gnav_ephemeris_map); + d_rp->rinex_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + d_rp->log_rinex_nav(d_rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->glonass_gnav_ephemeris_map); } if (d_rinex_version == 2) { - rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); - rp->rinex_nav_header(rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); - rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->gps_ephemeris_map); - rp->log_rinex_nav(rp->navGloFile, d_user_pvt_solver->glonass_gnav_ephemeris_map); + d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); + d_rp->rinex_nav_header(d_rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->gps_ephemeris_map); + d_rp->log_rinex_nav(d_rp->navGloFile, d_user_pvt_solver->glonass_gnav_ephemeris_map); } - b_rinex_header_written = true; // do not write header anymore + d_rinex_header_written = true; // do not write header anymore } break; case 27: // Galileo E1B + GLONASS L1 C/A @@ -2573,40 +2574,40 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { std::string glo_signal("1G"); std::string gal_signal("1B"); - rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); - rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->galileo_ephemeris_map, d_user_pvt_solver->glonass_gnav_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal); + d_rp->rinex_nav_header(d_rp->navMixFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + d_rp->log_rinex_nav(d_rp->navMixFile, d_user_pvt_solver->galileo_ephemeris_map, d_user_pvt_solver->glonass_gnav_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 28: // GPS L2C + GLONASS L1 C/A if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { std::string glo_signal("1G"); - rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); - rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); - rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->gps_cnav_ephemeris_map, d_user_pvt_solver->glonass_gnav_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); + d_rp->rinex_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + d_rp->log_rinex_nav(d_rp->navMixFile, d_user_pvt_solver->gps_cnav_ephemeris_map, d_user_pvt_solver->glonass_gnav_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 29: // GPS L1 C/A + GLONASS L2 C/A if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend())) { std::string glo_signal("2G"); - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); + d_rp->rinex_obs_header(d_rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); if (d_rinex_version == 3) { - rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); - rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->glonass_gnav_ephemeris_map); + d_rp->rinex_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + d_rp->log_rinex_nav(d_rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->glonass_gnav_ephemeris_map); } if (d_rinex_version == 2) { - rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); - rp->rinex_nav_header(rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); - rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->gps_ephemeris_map); - rp->log_rinex_nav(rp->navGloFile, d_user_pvt_solver->glonass_gnav_ephemeris_map); + d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); + d_rp->rinex_nav_header(d_rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->gps_ephemeris_map); + d_rp->log_rinex_nav(d_rp->navGloFile, d_user_pvt_solver->glonass_gnav_ephemeris_map); } - b_rinex_header_written = true; // do not write header anymore + d_rinex_header_written = true; // do not write header anymore } break; case 30: // Galileo E1B + GLONASS L2 C/A @@ -2614,20 +2615,20 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { std::string glo_signal("2G"); std::string gal_signal("1B"); - rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); - rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->galileo_ephemeris_map, d_user_pvt_solver->glonass_gnav_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal); + d_rp->rinex_nav_header(d_rp->navMixFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + d_rp->log_rinex_nav(d_rp->navMixFile, d_user_pvt_solver->galileo_ephemeris_map, d_user_pvt_solver->glonass_gnav_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 31: // GPS L2C + GLONASS L2 C/A if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { std::string glo_signal("2G"); - rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); - rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); - rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->gps_cnav_ephemeris_map, d_user_pvt_solver->glonass_gnav_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); + d_rp->rinex_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + d_rp->log_rinex_nav(d_rp->navMixFile, d_user_pvt_solver->gps_cnav_ephemeris_map, d_user_pvt_solver->glonass_gnav_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 32: // L1+E1+L5+E5a @@ -2637,10 +2638,10 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { std::string gal_signal("1B 5X"); std::string gps_signal("1C L5"); - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gps_signal, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->galileo_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gps_signal, gal_signal); + d_rp->rinex_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->log_rinex_nav(d_rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->galileo_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 33: // L1+E1+E5a @@ -2648,19 +2649,19 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend())) { std::string gal_signal("1B 5X"); - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->galileo_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); + d_rp->rinex_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->log_rinex_nav(d_rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->galileo_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 500: // BDS B1I only if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { - rp->rinex_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); - rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); - rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); + d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); + d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; @@ -2668,9 +2669,9 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if ((gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend())) { std::string bds_signal("B1"); - // rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, beidou_dnav_ephemeris_iter->second, d_rx_time, bds_signal); - // rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); - b_rinex_header_written = true; // do not write header anymore + // d_rp->rinex_obs_header(d_rp->obsFile, gps_ephemeris_iter->second, beidou_dnav_ephemeris_iter->second, d_rx_time, bds_signal); + // d_rp->rinex_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); + d_rinex_header_written = true; // do not write header anymore } break; @@ -2679,86 +2680,86 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { std::string bds_signal("B1"); std::string gal_signal("1B"); - // rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, beidou_dnav_ephemeris_iter->second, d_rx_time, gal_signal, bds_signal); - // rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); - b_rinex_header_written = true; // do not write header anymore + // d_rp->rinex_obs_header(d_rp->obsFile, galileo_ephemeris_iter->second, beidou_dnav_ephemeris_iter->second, d_rx_time, gal_signal, bds_signal); + // d_rp->rinex_nav_header(d_rp->navMixFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); + d_rinex_header_written = true; // do not write header anymore } break; case 503: // BeiDou B1I + GLONASS L1 C/A if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { - // rp->rinex_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); - // rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); - // rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + // d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); + // d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); + // d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 504: // BeiDou B1I + GPS L1 C/A + Galileo E1B if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { - // rp->rinex_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); - // rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); - // rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + // d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); + // d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); + // d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 505: // BeiDou B1I + GPS L1 C/A + GLONASS L1 C/A + Galileo E1B if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { - // rp->rinex_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); - // rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); - // rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + // d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); + // d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); + // d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 506: // BeiDou B1I + Beidou B3I if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { - // rp->rinex_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); - // rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); - // rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + // d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); + // d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); + // d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 600: // BDS B3I only if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { - rp->rinex_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B3"); - rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); - rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B3"); + d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); + d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 601: // BeiDou B3I + GPS L2C if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { - rp->rinex_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B3"); - // rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B3"); + // d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); + d_rinex_header_written = true; // do not write header anymore } break; case 602: // BeiDou B3I + GLONASS L2 C/A if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { - rp->rinex_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B3"); - // rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B3"); + // d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); + d_rinex_header_written = true; // do not write header anymore } break; case 603: // BeiDou B3I + GPS L2C + GLONASS L2 C/A if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { - rp->rinex_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B3"); - // rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B3"); + // d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); + d_rinex_header_written = true; // do not write header anymore } break; @@ -2767,10 +2768,10 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { std::string gps_signal("1C 2S L5"); - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gps_signal); - rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); - rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->gps_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gps_signal); + d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); + d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->gps_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; case 1001: // GPS L1 C/A + Galileo E1B + GPS L2C + GPS L5 + Galileo E5a @@ -2780,17 +2781,17 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { std::string gal_signal("1B 5X"); std::string gps_signal("1C 2S L5"); - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gps_signal, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->galileo_ephemeris_map); - b_rinex_header_written = true; // do not write header anymore + d_rp->rinex_obs_header(d_rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gps_signal, gal_signal); + d_rp->rinex_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->log_rinex_nav(d_rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->galileo_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore } break; default: break; } } - if (b_rinex_header_written) // The header is already written, we can now log the navigation message data + if (d_rinex_header_written) // The header is already written, we can now log the navigation message data { galileo_ephemeris_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); gps_ephemeris_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); @@ -2801,335 +2802,335 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item // Log observables into the RINEX file if (flag_write_RINEX_obs_output) { - switch (type_of_rx) + switch (d_type_of_rx) { case 1: // GPS L1 C/A only if (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, d_rx_time, gnss_observables_map); - if (!b_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) + d_rp->log_rinex_obs(d_rp->obsFile, gps_ephemeris_iter->second, d_rx_time, d_gnss_observables_map); + if (!d_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_utc_model); - rp->update_nav_header(rp->navFile, d_user_pvt_solver->gps_utc_model, d_user_pvt_solver->gps_iono, gps_ephemeris_iter->second); - b_rinex_header_updated = true; + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_utc_model); + d_rp->update_nav_header(d_rp->navFile, d_user_pvt_solver->gps_utc_model, d_user_pvt_solver->gps_iono, gps_ephemeris_iter->second); + d_rinex_header_updated = true; } } break; case 2: // GPS L2C only if (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); + d_rp->log_rinex_obs(d_rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map); } - if (!b_rinex_header_updated and (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); - rp->update_nav_header(rp->navFile, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->gps_cnav_iono); - b_rinex_header_updated = true; + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); + d_rp->update_nav_header(d_rp->navFile, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->gps_cnav_iono); + d_rinex_header_updated = true; } break; case 3: // GPS L5 if (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); + d_rp->log_rinex_obs(d_rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map); } - if (!b_rinex_header_updated and (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); - rp->update_nav_header(rp->navFile, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->gps_cnav_iono); - b_rinex_header_updated = true; + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); + d_rp->update_nav_header(d_rp->navFile, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->gps_cnav_iono); + d_rinex_header_updated = true; } break; case 4: // Galileo E1B only if (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B"); + d_rp->log_rinex_obs(d_rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, d_gnss_observables_map, "1B"); } - if (!b_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->galileo_utc_model); - b_rinex_header_updated = true; + d_rp->update_nav_header(d_rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->galileo_utc_model); + d_rinex_header_updated = true; } break; case 5: // Galileo E5a only if (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "5X"); + d_rp->log_rinex_obs(d_rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, d_gnss_observables_map, "5X"); } - if (!b_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->galileo_utc_model); - b_rinex_header_updated = true; + d_rp->update_nav_header(d_rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->galileo_utc_model); + d_rinex_header_updated = true; } break; case 6: // Galileo E5b only if (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "7X"); + d_rp->log_rinex_obs(d_rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, d_gnss_observables_map, "7X"); } - if (!b_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->galileo_utc_model); - b_rinex_header_updated = true; + d_rp->update_nav_header(d_rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->galileo_utc_model); + d_rinex_header_updated = true; } break; case 7: // GPS L1 C/A + GPS L2C if ((gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); - if (!b_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) + d_rp->log_rinex_obs(d_rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map); + if (!d_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_utc_model); - rp->update_nav_header(rp->navFile, d_user_pvt_solver->gps_utc_model, d_user_pvt_solver->gps_iono, gps_ephemeris_iter->second); - b_rinex_header_updated = true; + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_utc_model); + d_rp->update_nav_header(d_rp->navFile, d_user_pvt_solver->gps_utc_model, d_user_pvt_solver->gps_iono, gps_ephemeris_iter->second); + d_rinex_header_updated = true; } } break; case 8: // L1+L5 if ((gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); - if (!b_rinex_header_updated and ((d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0) or (d_user_pvt_solver->gps_utc_model.d_A0 != 0))) + d_rp->log_rinex_obs(d_rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map); + if (!d_rinex_header_updated and ((d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0) or (d_user_pvt_solver->gps_utc_model.d_A0 != 0))) { if (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); - rp->update_nav_header(rp->navFile, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->gps_cnav_iono); + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); + d_rp->update_nav_header(d_rp->navFile, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->gps_cnav_iono); } else { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_utc_model); - rp->update_nav_header(rp->navFile, d_user_pvt_solver->gps_utc_model, d_user_pvt_solver->gps_iono, gps_ephemeris_iter->second); + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_utc_model); + d_rp->update_nav_header(d_rp->navFile, d_user_pvt_solver->gps_utc_model, d_user_pvt_solver->gps_iono, gps_ephemeris_iter->second); } - b_rinex_header_updated = true; + d_rinex_header_updated = true; } } break; case 9: // GPS L1 C/A + Galileo E1B if ((galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); - if (!b_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) + d_rp->log_rinex_obs(d_rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, d_gnss_observables_map); + if (!d_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - b_rinex_header_updated = true; + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_utc_model); + d_rp->update_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rinex_header_updated = true; } } break; case 13: // L5+E5a if ((gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); + d_rp->log_rinex_obs(d_rp->obsFile, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, d_gnss_observables_map); } - if (!b_rinex_header_updated and (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0) and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0) and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); - rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - b_rinex_header_updated = true; // do not write header anymore + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); + d_rp->update_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rinex_header_updated = true; // do not write header anymore } break; case 14: // Galileo E1B + Galileo E5a if (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 5X"); + d_rp->log_rinex_obs(d_rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, d_gnss_observables_map, "1B 5X"); } - if (!b_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->galileo_utc_model); - b_rinex_header_updated = true; + d_rp->update_nav_header(d_rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->galileo_utc_model); + d_rinex_header_updated = true; } break; case 15: // Galileo E1B + Galileo E5b if (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 7X"); + d_rp->log_rinex_obs(d_rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, d_gnss_observables_map, "1B 7X"); } - if (!b_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->galileo_utc_model); - b_rinex_header_updated = true; + d_rp->update_nav_header(d_rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->galileo_utc_model); + d_rinex_header_updated = true; } break; case 23: // GLONASS L1 C/A only if (glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C"); + d_rp->log_rinex_obs(d_rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map, "1C"); } - if (!b_rinex_header_updated and (d_user_pvt_solver->glonass_gnav_utc_model.d_tau_c != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->glonass_gnav_utc_model.d_tau_c != 0)) { - rp->update_nav_header(rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->glonass_gnav_utc_model); - b_rinex_header_updated = true; + d_rp->update_nav_header(d_rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->glonass_gnav_utc_model); + d_rinex_header_updated = true; } break; case 24: // GLONASS L2 C/A only if (glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "2C"); + d_rp->log_rinex_obs(d_rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map, "2C"); } - if (!b_rinex_header_updated and (d_user_pvt_solver->glonass_gnav_utc_model.d_tau_c != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->glonass_gnav_utc_model.d_tau_c != 0)) { - rp->update_nav_header(rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->glonass_gnav_utc_model); - b_rinex_header_updated = true; + d_rp->update_nav_header(d_rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->glonass_gnav_utc_model); + d_rinex_header_updated = true; } break; case 25: // GLONASS L1 C/A + GLONASS L2 C/A if (glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C 2C"); + d_rp->log_rinex_obs(d_rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map, "1C 2C"); } - if (!b_rinex_header_updated and (d_user_pvt_solver->glonass_gnav_utc_model.d_tau_c != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->glonass_gnav_utc_model.d_tau_c != 0)) { - rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->glonass_gnav_utc_model); - b_rinex_header_updated = true; + d_rp->update_nav_header(d_rp->navMixFile, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->glonass_gnav_utc_model); + d_rinex_header_updated = true; } break; case 26: // GPS L1 C/A + GLONASS L1 C/A if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); - if (!b_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) + d_rp->log_rinex_obs(d_rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map); + if (!d_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); - b_rinex_header_updated = true; // do not write header anymore + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_utc_model); + d_rp->update_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + d_rinex_header_updated = true; // do not write header anymore } } break; case 27: // Galileo E1B + GLONASS L1 C/A if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); + d_rp->log_rinex_obs(d_rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map); } - if (!b_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->galileo_utc_model); - rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); - b_rinex_header_updated = true; // do not write header anymore + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->galileo_utc_model); + d_rp->update_nav_header(d_rp->navMixFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + d_rinex_header_updated = true; // do not write header anymore } break; case 28: // GPS L2C + GLONASS L1 C/A if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); + d_rp->log_rinex_obs(d_rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map); } - if (!b_rinex_header_updated and (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); - rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); - b_rinex_header_updated = true; // do not write header anymore + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); + d_rp->update_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + d_rinex_header_updated = true; // do not write header anymore } break; case 29: // GPS L1 C/A + GLONASS L2 C/A if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); - if (!b_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) + d_rp->log_rinex_obs(d_rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map); + if (!d_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); - b_rinex_header_updated = true; // do not write header anymore + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_utc_model); + d_rp->update_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + d_rinex_header_updated = true; // do not write header anymore } } break; case 30: // Galileo E1B + GLONASS L2 C/A if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); + d_rp->log_rinex_obs(d_rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map); } - if (!b_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->galileo_utc_model); - rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); - b_rinex_header_updated = true; // do not write header anymore + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->galileo_utc_model); + d_rp->update_nav_header(d_rp->navMixFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + d_rinex_header_updated = true; // do not write header anymore } break; case 31: // GPS L2C + GLONASS L2 C/A if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); + d_rp->log_rinex_obs(d_rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map); } - if (!b_rinex_header_updated and (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); - rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); - b_rinex_header_updated = true; // do not write header anymore + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); + d_rp->update_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + d_rinex_header_updated = true; // do not write header anymore } break; case 32: // L1+E1+L5+E5a if ((gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); - if (!b_rinex_header_updated and ((d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0) or (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) + d_rp->log_rinex_obs(d_rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, d_gnss_observables_map); + if (!d_rinex_header_updated and ((d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0) or (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { if (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); - rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); + d_rp->update_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); } else { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_utc_model); + d_rp->update_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); } - b_rinex_header_updated = true; // do not write header anymore + d_rinex_header_updated = true; // do not write header anymore } } break; case 33: // L1+E1+E5a if ((gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); - if (!b_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0) and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) + d_rp->log_rinex_obs(d_rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, d_gnss_observables_map); + if (!d_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0) and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - b_rinex_header_updated = true; // do not write header anymore + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_utc_model); + d_rp->update_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rinex_header_updated = true; // do not write header anymore } } break; case 500: // BDS B1I only if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "B1"); + d_rp->log_rinex_obs(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map, "B1"); } - if (!b_rinex_header_updated and (d_user_pvt_solver->beidou_dnav_utc_model.d_A0_UTC != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->beidou_dnav_utc_model.d_A0_UTC != 0)) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->beidou_dnav_utc_model); - rp->update_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_utc_model, d_user_pvt_solver->beidou_dnav_iono); - b_rinex_header_updated = true; + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->beidou_dnav_utc_model); + d_rp->update_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_utc_model, d_user_pvt_solver->beidou_dnav_iono); + d_rinex_header_updated = true; } break; case 600: // BDS B3I only if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "B3"); + d_rp->log_rinex_obs(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map, "B3"); } - if (!b_rinex_header_updated and (d_user_pvt_solver->beidou_dnav_utc_model.d_A0_UTC != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->beidou_dnav_utc_model.d_A0_UTC != 0)) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->beidou_dnav_utc_model); - rp->update_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_utc_model, d_user_pvt_solver->beidou_dnav_iono); - b_rinex_header_updated = true; + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->beidou_dnav_utc_model); + d_rp->update_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_utc_model, d_user_pvt_solver->beidou_dnav_iono); + d_rinex_header_updated = true; } break; case 1000: // GPS L1 C/A + GPS L2C + GPS L5 if ((gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, true); + d_rp->log_rinex_obs(d_rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map, true); } - if (!b_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_utc_model); - rp->update_nav_header(rp->navFile, d_user_pvt_solver->gps_utc_model, d_user_pvt_solver->gps_iono, gps_ephemeris_iter->second); - b_rinex_header_updated = true; + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_utc_model); + d_rp->update_nav_header(d_rp->navFile, d_user_pvt_solver->gps_utc_model, d_user_pvt_solver->gps_iono, gps_ephemeris_iter->second); + d_rinex_header_updated = true; } break; case 1001: // GPS L1 C/A + Galileo E1B + GPS L2C + GPS L5 + Galileo E5a @@ -3137,13 +3138,13 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, true); + d_rp->log_rinex_obs(d_rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, d_gnss_observables_map, true); } - if (!b_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0) and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) + if (!d_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0) and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); - b_rinex_header_updated = true; + d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_utc_model); + d_rp->update_nav_header(d_rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + d_rinex_header_updated = true; } break; default: @@ -3156,9 +3157,9 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item // ####################### RTCM MESSAGES ################# try { - if (b_rtcm_writing_started and b_rtcm_enabled) + if (d_rtcm_writing_started and d_rtcm_enabled) { - switch (type_of_rx) + switch (d_type_of_rx) { case 1: // GPS L1 C/A if (flag_write_RTCM_1019_output == true) @@ -3173,7 +3174,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } break; @@ -3192,7 +3193,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } break; @@ -3210,7 +3211,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto gps_cnav_eph_iter = d_user_pvt_solver->gps_cnav_ephemeris_map.cbegin(); if ((gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } break; @@ -3228,7 +3229,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto gps_cnav_eph_iter = d_user_pvt_solver->gps_cnav_ephemeris_map.cbegin(); if ((gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } break; @@ -3254,7 +3255,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + for (gnss_observables_iter = d_gnss_observables_map.cbegin(); gnss_observables_iter != d_gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) @@ -3283,11 +3284,11 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } break; @@ -3307,7 +3308,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto gps_cnav_eph_iter = d_user_pvt_solver->gps_cnav_ephemeris_map.cbegin(); int gal_channel = 0; int gps_channel = 0; - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + for (gnss_observables_iter = d_gnss_observables_map.cbegin(); gnss_observables_iter != d_gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) @@ -3337,11 +3338,11 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } if (gps_cnav_eph_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend() and (d_rtcm_MT1077_rate_ms != 0)) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, gps_cnav_eph_iter->second, {}, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } break; @@ -3359,7 +3360,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } break; @@ -3378,10 +3379,10 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto glo_gnav_ephemeris_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); if (glo_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } - b_rtcm_writing_started = true; + d_rtcm_writing_started = true; break; case 26: // GPS L1 C/A + GLONASS L1 C/A if (flag_write_RTCM_1019_output == true) @@ -3405,7 +3406,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + for (gnss_observables_iter = d_gnss_observables_map.cbegin(); gnss_observables_iter != d_gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) @@ -3435,11 +3436,11 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } break; @@ -3465,7 +3466,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gal_channel = 0; int glo_channel = 0; - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + for (gnss_observables_iter = d_gnss_observables_map.cbegin(); gnss_observables_iter != d_gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); if (gal_channel == 0) @@ -3494,11 +3495,11 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } break; @@ -3524,7 +3525,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + for (gnss_observables_iter = d_gnss_observables_map.cbegin(); gnss_observables_iter != d_gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) @@ -3553,11 +3554,11 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } break; @@ -3583,7 +3584,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gal_channel = 0; int glo_channel = 0; - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + for (gnss_observables_iter = d_gnss_observables_map.cbegin(); gnss_observables_iter != d_gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); if (gal_channel == 0) @@ -3612,11 +3613,11 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } break; @@ -3642,7 +3643,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); int gal_channel = 0; int gps_channel = 0; - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + for (gnss_observables_iter = d_gnss_observables_map.cbegin(); gnss_observables_iter != d_gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); if (gal_channel == 0) @@ -3671,11 +3672,11 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } break; @@ -3684,9 +3685,9 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } } - if (!b_rtcm_writing_started and b_rtcm_enabled) // the first time + if (!d_rtcm_writing_started and d_rtcm_enabled) // the first time { - switch (type_of_rx) + switch (d_type_of_rx) { case 1: // GPS L1 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 @@ -3702,10 +3703,10 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } - b_rtcm_writing_started = true; + d_rtcm_writing_started = true; break; case 4: case 5: @@ -3722,10 +3723,10 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } - b_rtcm_writing_started = true; + d_rtcm_writing_started = true; break; case 7: // GPS L1 C/A + GPS L2C if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 @@ -3741,10 +3742,10 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto gps_cnav_eph_iter = d_user_pvt_solver->gps_cnav_ephemeris_map.cbegin(); if ((gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } - b_rtcm_writing_started = true; + d_rtcm_writing_started = true; break; case 8: // L1+L5 if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 @@ -3760,10 +3761,10 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto gps_cnav_eph_iter = d_user_pvt_solver->gps_cnav_ephemeris_map.cbegin(); if ((gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } - b_rtcm_writing_started = true; + d_rtcm_writing_started = true; break; case 9: // GPS L1 C/A + Galileo E1B if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 @@ -3787,7 +3788,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + for (gnss_observables_iter = d_gnss_observables_map.cbegin(); gnss_observables_iter != d_gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) @@ -3816,14 +3817,14 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } - b_rtcm_writing_started = true; + d_rtcm_writing_started = true; break; case 13: // L5+E5a @@ -3839,7 +3840,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item std::map::const_iterator gnss_observables_iter; auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); int gal_channel = 0; - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + for (gnss_observables_iter = d_gnss_observables_map.cbegin(); gnss_observables_iter != d_gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); if (gal_channel == 0) @@ -3857,10 +3858,10 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } - b_rtcm_writing_started = true; + d_rtcm_writing_started = true; break; case 14: case 15: @@ -3876,10 +3877,10 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } - b_rtcm_writing_started = true; + d_rtcm_writing_started = true; break; case 23: case 24: @@ -3896,10 +3897,10 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto glo_gnav_ephemeris_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); if (glo_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } - b_rtcm_writing_started = true; + d_rtcm_writing_started = true; break; case 26: // GPS L1 C/A + GLONASS L1 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 @@ -3923,7 +3924,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + for (gnss_observables_iter = d_gnss_observables_map.cbegin(); gnss_observables_iter != d_gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) @@ -3952,14 +3953,14 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } - b_rtcm_writing_started = true; + d_rtcm_writing_started = true; break; case 27: // GLONASS L1 C/A + Galileo E1B if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 @@ -3983,7 +3984,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item std::map::const_iterator gnss_observables_iter; auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + for (gnss_observables_iter = d_gnss_observables_map.cbegin(); gnss_observables_iter != d_gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); if (gal_channel == 0) @@ -4012,14 +4013,14 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } - b_rtcm_writing_started = true; + d_rtcm_writing_started = true; break; case 29: // GPS L1 C/A + GLONASS L2 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 @@ -4043,7 +4044,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item std::map::const_iterator gnss_observables_iter; int gps_channel = 0; int glo_channel = 0; - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + for (gnss_observables_iter = d_gnss_observables_map.cbegin(); gnss_observables_iter != d_gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) @@ -4072,15 +4073,15 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } - b_rtcm_writing_started = true; + d_rtcm_writing_started = true; break; case 30: // GLONASS L2 C/A + Galileo E1B if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 @@ -4104,7 +4105,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item std::map::const_iterator gnss_observables_iter; auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + for (gnss_observables_iter = d_gnss_observables_map.cbegin(); gnss_observables_iter != d_gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); if (gal_channel == 0) @@ -4133,14 +4134,14 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } - b_rtcm_writing_started = true; + d_rtcm_writing_started = true; break; case 32: // L1+E1+L5+E5a if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 @@ -4164,7 +4165,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + for (gnss_observables_iter = d_gnss_observables_map.cbegin(); gnss_observables_iter != d_gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) @@ -4193,14 +4194,14 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, d_gnss_observables_map, d_enable_rx_clock_correction, 0, 0, false, false); } } - b_rtcm_writing_started = true; + d_rtcm_writing_started = true; break; default: break; @@ -4286,9 +4287,9 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { this->message_port_pub(pmt::mp("status"), pmt::make_any(monitor_pvt)); } - if (flag_monitor_pvt_enabled) + if (d_flag_monitor_pvt_enabled) { - udp_sink_ptr->write_monitor_pvt(monitor_pvt.get()); + d_udp_sink_ptr->write_monitor_pvt(monitor_pvt.get()); } } } diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h index 66ee465c0..44936e7fe 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h @@ -34,7 +34,6 @@ #include // for shared_ptr, unique_ptr #include // for string #include // for key_t -#include // for pair #include // for vector #if GNURADIO_USES_STD_POINTERS #else @@ -133,9 +132,7 @@ private: const Pvt_Conf& conf_, const rtk_t& rtk); - void msg_handler_telemetry(const pmt::pmt_t& msg); - - enum StringValue + enum StringValue_ { evGPS_1C, evGPS_2S, @@ -150,25 +147,25 @@ private: evBDS_B3 }; - std::map mapStringValues_; - - void apply_rx_clock_offset(std::map& observables_map, - double rx_clock_offset_s); - - std::map interpolate_observables(std::map& observables_map_t0, - std::map& observables_map_t1, - double rx_time_s); - bool d_dump; bool d_dump_mat; - bool b_rinex_output_enabled; - bool b_rinex_header_written; - bool b_rinex_header_updated; - double d_rinex_version; - int32_t d_rinexobs_rate_ms; + bool d_rinex_output_enabled; + bool d_rinex_header_written; + bool d_rinex_header_updated; + bool d_geojson_output_enabled; + bool d_gpx_output_enabled; + bool d_kml_output_enabled; + bool d_nmea_output_file_enabled; + bool d_first_fix; + bool d_xml_storage; + bool d_flag_monitor_pvt_enabled; + bool d_show_local_time_zone; + bool d_waiting_obs_block_rx_clock_offset_correction_msg; + bool d_enable_rx_clock_correction; + bool d_rtcm_writing_started; + bool d_rtcm_enabled; - bool b_rtcm_writing_started; - bool b_rtcm_enabled; + int32_t d_rinexobs_rate_ms; int32_t d_rtcm_MT1045_rate_ms; // Galileo Broadcast Ephemeris int32_t d_rtcm_MT1019_rate_ms; // GPS Broadcast Ephemeris (orbits) int32_t d_rtcm_MT1020_rate_ms; // GLONASS Broadcast Ephemeris (orbits) @@ -176,79 +173,79 @@ private: int32_t d_rtcm_MT1087_rate_ms; // GLONASS MSM7. The type 7 Multiple Signal Message format for the Russian GLONASS system int32_t d_rtcm_MT1097_rate_ms; // Galileo MSM7. The type 7 Multiple Signal Message format for Europe’s Galileo system int32_t d_rtcm_MSM_rate_ms; - int32_t d_kml_rate_ms; int32_t d_gpx_rate_ms; int32_t d_geojson_rate_ms; int32_t d_nmea_rate_ms; - int32_t d_last_status_print_seg; // for status printer - - uint32_t d_nchannels; - std::string d_dump_filename; - int32_t d_output_rate_ms; int32_t d_display_rate_ms; int32_t d_report_rate_ms; + int32_t d_max_obs_block_rx_clock_offset_ms; - std::unique_ptr rp; + uint32_t d_nchannels; + uint32_t d_type_of_rx; + + double d_rinex_version; + double d_rx_time; + + std::unique_ptr d_rp; std::unique_ptr d_kml_dump; std::unique_ptr d_gpx_dump; std::unique_ptr d_nmea_printer; std::unique_ptr d_geojson_printer; std::unique_ptr d_rtcm_printer; - double d_rx_time; - - bool d_geojson_output_enabled; - bool d_gpx_output_enabled; - bool d_kml_output_enabled; - bool d_nmea_output_file_enabled; + std::unique_ptr d_udp_sink_ptr; std::shared_ptr d_internal_pvt_solver; std::shared_ptr d_user_pvt_solver; - int32_t max_obs_block_rx_clock_offset_ms; - bool d_waiting_obs_block_rx_clock_offset_correction_msg; - bool d_enable_rx_clock_correction; - std::map gnss_observables_map; - std::map gnss_observables_map_t0; - std::map gnss_observables_map_t1; + std::chrono::time_point d_start; + std::chrono::time_point d_end; - std::vector initial_carrier_phase_offset_estimation_rads; - std::vector channel_initialized; + std::string d_dump_filename; + std::string d_xml_base_path; + std::string d_local_time_str; - uint32_t type_of_rx; + std::vector d_channel_initialized; + std::vector d_initial_carrier_phase_offset_estimation_rads; - bool first_fix; - key_t sysv_msg_key; - int sysv_msqid; - typedef struct - { - long mtype; // NOLINT(google-runtime-int) required by SysV queue messaging - double ttff; - } ttff_msgbuf; - bool send_sys_v_ttff_msg(ttff_msgbuf ttff); - std::chrono::time_point start, end; + std::map d_gnss_observables_map; + std::map d_gnss_observables_map_t0; + std::map d_gnss_observables_map_t1; + std::map d_mapStringValues; + + boost::posix_time::time_duration d_utc_diff_time; + + void msg_handler_telemetry(const pmt::pmt_t& msg); void initialize_and_apply_carrier_phase_offset(); - bool save_gnss_synchro_map_xml(const std::string& file_name); // debug helper function - bool load_gnss_synchro_map_xml(const std::string& file_name); // debug helper function - bool d_xml_storage; - std::string xml_base_path; + void apply_rx_clock_offset(std::map& observables_map, + double rx_clock_offset_s); + + std::map interpolate_observables(const std::map& observables_map_t0, + const std::map& observables_map_t1, + double rx_time_s); inline std::time_t convert_to_time_t(const boost::posix_time::ptime pt) const { return (pt - boost::posix_time::ptime(boost::gregorian::date(1970, 1, 1))).total_seconds(); } - bool flag_monitor_pvt_enabled; - std::unique_ptr udp_sink_ptr; std::vector split_string(const std::string& s, char delim) const; - bool d_show_local_time_zone; - std::string d_local_time_str; - boost::posix_time::time_duration d_utc_diff_time; + key_t d_sysv_msg_key; + int d_sysv_msqid; + typedef struct + { + long mtype; // NOLINT(google-runtime-int) required by SysV queue messaging + double ttff; + } d_ttff_msgbuf; + bool send_sys_v_ttff_msg(d_ttff_msgbuf ttff); + + bool save_gnss_synchro_map_xml(const std::string& file_name); // debug helper function + bool load_gnss_synchro_map_xml(const std::string& file_name); // debug helper function }; #endif // GNSS_SDR_RTKLIB_PVT_GS_H