From ac690d9f3be1050d2b817831e32adf36c5fa8d38 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 15 Sep 2022 12:14:40 +0200 Subject: [PATCH 1/8] Fix RTCM messages for the GPS L1 + Gal E6 receiver --- src/algorithms/PVT/libs/rtcm_printer.cc | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index c96577a01..2c8adcff6 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -1471,10 +1471,8 @@ void Rtcm_Printer::Print_Rtcm_Messages(const Rtklib_Solver* pvt_solver, } if (rtcm_MSM_rate_ms != 0) { - auto gal_eph_iter = pvt_solver->galileo_ephemeris_map.cbegin(); auto gps_eph_iter = pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; - int gal_channel = 0; for (const auto& gnss_observables_iter : gnss_observables_map) { const std::string system(gnss_observables_iter.second.System, 1); @@ -1490,26 +1488,11 @@ void Rtcm_Printer::Print_Rtcm_Messages(const Rtklib_Solver* pvt_solver, } } } - if (gal_channel == 0) - { - if (system == "E") - { - gal_eph_iter = pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter.second.PRN); - if (gal_eph_iter != pvt_solver->galileo_ephemeris_map.cend()) - { - gal_channel = 1; - } - } - } } if (gps_eph_iter != pvt_solver->gps_ephemeris_map.cend()) { Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, rx_time, gnss_observables_map, enable_rx_clock_correction, 0, 0, false, false); } - if (gal_eph_iter != pvt_solver->galileo_ephemeris_map.cend()) - { - Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, rx_time, gnss_observables_map, enable_rx_clock_correction, 0, 0, false, false); - } } d_rtcm_writing_started = true; break; From b9f2a33fff223dd641c7521c8aceabfdb3ce197f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 15 Sep 2022 13:27:30 +0200 Subject: [PATCH 2/8] Fix RTCM messages for the GPS L1 + Gal E1 + Gal E6 receiver --- src/algorithms/PVT/libs/rtcm_printer.cc | 34 ------------------------- 1 file changed, 34 deletions(-) diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index 2c8adcff6..8df8cffe2 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -791,9 +791,7 @@ void Rtcm_Printer::Print_Rtcm_Messages(const Rtklib_Solver* pvt_solver, if (flag_write_RTCM_MSM_output == true) { auto gps_eph_iter = pvt_solver->gps_ephemeris_map.cbegin(); - auto gal_eph_iter = pvt_solver->galileo_ephemeris_map.cbegin(); int gps_channel = 0; - int gal_channel = 0; for (const auto& gnss_observables_iter : gnss_observables_map) { const std::string system(gnss_observables_iter.second.System, 1); @@ -809,26 +807,11 @@ void Rtcm_Printer::Print_Rtcm_Messages(const Rtklib_Solver* pvt_solver, } } } - if (gal_channel == 0) - { - if (system == "E") - { - gal_eph_iter = pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter.second.PRN); - if (gal_eph_iter != pvt_solver->galileo_ephemeris_map.cend()) - { - gal_channel = 1; - } - } - } } if (gps_eph_iter != pvt_solver->gps_ephemeris_map.cend()) { Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, rx_time, gnss_observables_map, enable_rx_clock_correction, 0, 0, false, false); } - if (gal_eph_iter != pvt_solver->galileo_ephemeris_map.cend()) - { - Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, rx_time, gnss_observables_map, enable_rx_clock_correction, 0, 0, false, false); - } } break; case 107: // GPS L1 C/A + Galileo E6B (print only GPS data) @@ -1419,10 +1402,8 @@ void Rtcm_Printer::Print_Rtcm_Messages(const Rtklib_Solver* pvt_solver, } if (rtcm_MSM_rate_ms != 0) { - auto gal_eph_iter = pvt_solver->galileo_ephemeris_map.cbegin(); auto gps_eph_iter = pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; - int gal_channel = 0; for (const auto& gnss_observables_iter : gnss_observables_map) { const std::string system(gnss_observables_iter.second.System, 1); @@ -1438,26 +1419,11 @@ void Rtcm_Printer::Print_Rtcm_Messages(const Rtklib_Solver* pvt_solver, } } } - if (gal_channel == 0) - { - if (system == "E") - { - gal_eph_iter = pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter.second.PRN); - if (gal_eph_iter != pvt_solver->galileo_ephemeris_map.cend()) - { - gal_channel = 1; - } - } - } } if (gps_eph_iter != pvt_solver->gps_ephemeris_map.cend()) { Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, rx_time, gnss_observables_map, enable_rx_clock_correction, 0, 0, false, false); } - if (gal_eph_iter != pvt_solver->galileo_ephemeris_map.cend()) - { - Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, rx_time, gnss_observables_map, enable_rx_clock_correction, 0, 0, false, false); - } } d_rtcm_writing_started = true; break; From 8a9c28f0a039439b088ebaf1d468692e5f42a913 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 16 Sep 2022 09:56:14 +0200 Subject: [PATCH 3/8] Fix RTCM messages for the GPS L1 + Gal E1 + Gal E6 receiver --- src/algorithms/PVT/libs/rtcm_printer.cc | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index 8df8cffe2..34459fd48 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -781,13 +781,6 @@ void Rtcm_Printer::Print_Rtcm_Messages(const Rtklib_Solver* pvt_solver, Print_Rtcm_MT1019(gps_eph_iter.second); } } - if (flag_write_RTCM_1045_output == true) - { - for (const auto& gal_eph_iter : pvt_solver->galileo_ephemeris_map) - { - Print_Rtcm_MT1045(gal_eph_iter.second); - } - } if (flag_write_RTCM_MSM_output == true) { auto gps_eph_iter = pvt_solver->gps_ephemeris_map.cbegin(); @@ -1393,13 +1386,6 @@ void Rtcm_Printer::Print_Rtcm_Messages(const Rtklib_Solver* pvt_solver, Print_Rtcm_MT1019(gps_eph_iter.second); } } - if (rtcm_MT1045_rate_ms != 0) - { - for (const auto& gal_eph_iter : pvt_solver->galileo_ephemeris_map) - { - Print_Rtcm_MT1045(gal_eph_iter.second); - } - } if (rtcm_MSM_rate_ms != 0) { auto gps_eph_iter = pvt_solver->gps_ephemeris_map.cbegin(); From 0d393dcc7e8464cc865dece4e71f258577382ebc Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 16 Sep 2022 11:27:56 +0200 Subject: [PATCH 4/8] Fix RTCM messages in the presence of E6 observables --- src/algorithms/PVT/libs/rtcm.cc | 2 + src/algorithms/PVT/libs/rtcm_printer.cc | 52 ++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/src/algorithms/PVT/libs/rtcm.cc b/src/algorithms/PVT/libs/rtcm.cc index f799f81ee..7f962d4f7 100644 --- a/src/algorithms/PVT/libs/rtcm.cc +++ b/src/algorithms/PVT/libs/rtcm.cc @@ -3994,6 +3994,8 @@ std::map Rtcm::galileo_signal_map = [] { galileo_signal_map_["5I"] = 22; galileo_signal_map_["5Q"] = 23; galileo_signal_map_["5X"] = 24; + + galileo_signal_map_["E6"] = 10; return galileo_signal_map_; }(); diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index 34459fd48..cb07b9eea 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -781,18 +781,38 @@ void Rtcm_Printer::Print_Rtcm_Messages(const Rtklib_Solver* pvt_solver, Print_Rtcm_MT1019(gps_eph_iter.second); } } + if (rtcm_MT1045_rate_ms != 0) + { + for (const auto& gal_eph_iter : pvt_solver->galileo_ephemeris_map) + { + Print_Rtcm_MT1045(gal_eph_iter.second); + } + } if (flag_write_RTCM_MSM_output == true) { + auto gal_eph_iter = pvt_solver->galileo_ephemeris_map.cbegin(); auto gps_eph_iter = pvt_solver->gps_ephemeris_map.cbegin(); + int gal_channel = 0; int gps_channel = 0; for (const auto& gnss_observables_iter : gnss_observables_map) { const std::string system(gnss_observables_iter.second.System, 1); + if (gal_channel == 0) + { + if (system == "E") + { + // This is a channel with valid GPS signal + gal_eph_iter = pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter.second.PRN); + if (gal_eph_iter != pvt_solver->galileo_ephemeris_map.cend()) + { + gal_channel = 1; + } + } + } if (gps_channel == 0) { if (system == "G") { - // This is a channel with valid GPS signal gps_eph_iter = pvt_solver->gps_ephemeris_map.find(gnss_observables_iter.second.PRN); if (gps_eph_iter != pvt_solver->gps_ephemeris_map.cend()) { @@ -805,6 +825,10 @@ void Rtcm_Printer::Print_Rtcm_Messages(const Rtklib_Solver* pvt_solver, { Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, rx_time, gnss_observables_map, enable_rx_clock_correction, 0, 0, false, false); } + if (gal_eph_iter != pvt_solver->galileo_ephemeris_map.cend()) + { + Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, rx_time, gnss_observables_map, enable_rx_clock_correction, 0, 0, false, false); + } } break; case 107: // GPS L1 C/A + Galileo E6B (print only GPS data) @@ -1386,18 +1410,38 @@ void Rtcm_Printer::Print_Rtcm_Messages(const Rtklib_Solver* pvt_solver, Print_Rtcm_MT1019(gps_eph_iter.second); } } + if (rtcm_MT1045_rate_ms != 0) + { + for (const auto& gal_eph_iter : pvt_solver->galileo_ephemeris_map) + { + Print_Rtcm_MT1045(gal_eph_iter.second); + } + } if (rtcm_MSM_rate_ms != 0) { + auto gal_eph_iter = pvt_solver->galileo_ephemeris_map.cbegin(); auto gps_eph_iter = pvt_solver->gps_ephemeris_map.cbegin(); + int gal_channel = 0; int gps_channel = 0; for (const auto& gnss_observables_iter : gnss_observables_map) { const std::string system(gnss_observables_iter.second.System, 1); + if (gal_channel == 0) + { + if (system == "E") + { + // This is a channel with valid GPS signal + gal_eph_iter = pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter.second.PRN); + if (gal_eph_iter != pvt_solver->galileo_ephemeris_map.cend()) + { + gal_channel = 1; + } + } + } if (gps_channel == 0) { if (system == "G") { - // This is a channel with valid GPS signal gps_eph_iter = pvt_solver->gps_ephemeris_map.find(gnss_observables_iter.second.PRN); if (gps_eph_iter != pvt_solver->gps_ephemeris_map.cend()) { @@ -1410,6 +1454,10 @@ void Rtcm_Printer::Print_Rtcm_Messages(const Rtklib_Solver* pvt_solver, { Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, rx_time, gnss_observables_map, enable_rx_clock_correction, 0, 0, false, false); } + if (gal_eph_iter != pvt_solver->galileo_ephemeris_map.cend()) + { + Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, rx_time, gnss_observables_map, enable_rx_clock_correction, 0, 0, false, false); + } } d_rtcm_writing_started = true; break; From 97cf4135e0086e6dcc3e58c165569bb5295c2e99 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 16 Sep 2022 12:39:01 +0200 Subject: [PATCH 5/8] Add E6 observables in RINEX observation header --- src/algorithms/PVT/libs/rinex_printer.cc | 91 +++++++++++++++++++++++- 1 file changed, 90 insertions(+), 1 deletion(-) diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index c7701d538..6df948d5b 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -7226,6 +7226,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& number_of_observations_gal = number_of_observations_gal + 4; } + signal_ = "E6"; + const std::size_t found_E6 = galileo_bands.find(signal_); + if (found_E6 != std::string::npos) + { + number_of_observations_gal = number_of_observations_gal + 4; + } line += satelliteSystem.find("Galileo")->second; line += std::string(2, ' '); @@ -7279,6 +7285,22 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line += observationCode["GALILEO_E5b_IQ"]; } + if (found_E6 != std::string::npos) + { + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GALILEO_E56_B"]; + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GALILEO_E56_B"]; + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GALILEO_E56_B"]; + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GALILEO_E56_B"]; + } + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); @@ -8441,6 +8463,13 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps { number_of_observations_gal = number_of_observations_gal + 4; } + + signal_ = "E6"; + const std::size_t found_E6 = galileo_bands.find(signal_); + if (found_E6 != std::string::npos) + { + number_of_observations_gal = number_of_observations_gal + 4; + } line += satelliteSystem.find("Galileo")->second; line += std::string(2, ' '); line += Rinex_Printer::rightJustify(std::to_string(number_of_observations_gal), 3); @@ -8489,6 +8518,21 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line += observationType["SIGNAL_STRENGTH"]; line += observationCode["GALILEO_E5b_IQ"]; } + if (found_E6 != std::string::npos) + { + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GALILEO_E56_B"]; + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GALILEO_E56_B"]; + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GALILEO_E56_B"]; + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GALILEO_E56_B"]; + } line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); @@ -8766,6 +8810,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris { number_of_observations_gal = number_of_observations_gal + 4; } + signal_ = "E6"; + const std::size_t found_E6 = galileo_bands.find(signal_); + if (found_E6 != std::string::npos) + { + number_of_observations_gal = number_of_observations_gal + 4; + } line += satelliteSystem.find("Galileo")->second; line += std::string(2, ' '); line += Rinex_Printer::rightJustify(std::to_string(number_of_observations_gal), 3); @@ -8814,6 +8864,22 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris line += observationType["SIGNAL_STRENGTH"]; line += observationCode["GALILEO_E5b_IQ"]; } + if (found_E6 != std::string::npos) + { + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GALILEO_E56_B"]; + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GALILEO_E56_B"]; + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GALILEO_E56_B"]; + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GALILEO_E56_B"]; + } + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); @@ -9348,7 +9414,6 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps number_of_observations_gal = number_of_observations_gal + 4; } - line.clear(); signal_ = "7X"; const std::size_t found_7X = galileo_bands.find(signal_); if (found_7X != std::string::npos) @@ -9356,6 +9421,14 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps number_of_observations_gal = number_of_observations_gal + 4; } + signal_ = "E6"; + const std::size_t found_E6 = galileo_bands.find(signal_); + if (found_E6 != std::string::npos) + { + number_of_observations_gal = number_of_observations_gal + 4; + } + + line.clear(); line += satelliteSystem.find("Galileo")->second; line += std::string(2, ' '); line += Rinex_Printer::rightJustify(std::to_string(number_of_observations_gal), 3); @@ -9408,6 +9481,22 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line += observationCode["GALILEO_E5b_IQ"]; } + if (found_E6 != std::string::npos) + { + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GALILEO_E56_B"]; + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GALILEO_E56_B"]; + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GALILEO_E56_B"]; + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GALILEO_E56_B"]; + } + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); From cf28f95f7050d87c4732879b80b994730724b7f7 Mon Sep 17 00:00:00 2001 From: Jim Melton Date: Tue, 20 Sep 2022 11:46:55 -0600 Subject: [PATCH 6/8] add missing include dependency --- src/algorithms/acquisition/libs/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/algorithms/acquisition/libs/CMakeLists.txt b/src/algorithms/acquisition/libs/CMakeLists.txt index 9d0894d62..c16dacab1 100644 --- a/src/algorithms/acquisition/libs/CMakeLists.txt +++ b/src/algorithms/acquisition/libs/CMakeLists.txt @@ -55,6 +55,7 @@ endif() set_property(TARGET acquisition_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ $ ) From 615b214b5583d2b9a9d8cea617e4d1d41a354e10 Mon Sep 17 00:00:00 2001 From: Jim Melton Date: Tue, 20 Sep 2022 15:27:08 -0600 Subject: [PATCH 7/8] fix typo --- src/algorithms/acquisition/libs/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/acquisition/libs/CMakeLists.txt b/src/algorithms/acquisition/libs/CMakeLists.txt index c16dacab1..65437c649 100644 --- a/src/algorithms/acquisition/libs/CMakeLists.txt +++ b/src/algorithms/acquisition/libs/CMakeLists.txt @@ -55,7 +55,7 @@ endif() set_property(TARGET acquisition_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES - $ + $ $ ) From 36a1e4c18dd0bc3c0b688bcd6478d8f9e83543b5 Mon Sep 17 00:00:00 2001 From: Jim Melton Date: Wed, 14 Sep 2022 11:57:48 -0600 Subject: [PATCH 8/8] convert from vector to stream --- .../adapters/zmq_signal_source.cc | 30 +++++++++++++++---- .../adapters/zmq_signal_source.h | 2 ++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/algorithms/signal_source/adapters/zmq_signal_source.cc b/src/algorithms/signal_source/adapters/zmq_signal_source.cc index a9cab6540..00a6f57e5 100644 --- a/src/algorithms/signal_source/adapters/zmq_signal_source.cc +++ b/src/algorithms/signal_source/adapters/zmq_signal_source.cc @@ -18,7 +18,6 @@ #include "configuration_interface.h" #include "gnss_sdr_string_literals.h" #include -#include using namespace std::string_literals; @@ -39,18 +38,23 @@ ZmqSignalSource::ZmqSignalSource(const ConfigurationInterface* configuration, auto property = role + ".endpoint"s; auto endpoint = configuration->property(property, ""s); - std::vector address(endpoint.c_str(), endpoint.c_str() + endpoint.size() + 1); if (!endpoint.empty()) { LOG(INFO) << "Connecting to ZMQ pub at " << endpoint; - d_source_block = gr::zeromq::sub_source::make(d_item_size, vlen, address.data(), timeout_ms, pass_tags, hwm); + // work around gnuradio interface deficiency + d_source_block = gr::zeromq::sub_source::make(d_item_size, vlen, const_cast(endpoint.data()), timeout_ms, pass_tags, hwm); } else { std::cerr << "For ZMQ_Signal_Source " << property << " must be defined" << std::endl; throw std::invalid_argument(property + ": undefined"); } + + if (vlen > 1) + { + d_vec_block = gr::blocks::vector_to_stream::make(item_size(), vlen); + } } @@ -59,10 +63,14 @@ auto ZmqSignalSource::item_size() -> size_t { return d_item_size; } auto ZmqSignalSource::connect(gr::top_block_sptr top_block) -> void { + if (d_vec_block) + { + top_block->connect(d_source_block, 0, d_vec_block, 0); + } if (d_dump) { d_dump_sink = gr::blocks::file_sink::make(item_size(), d_dump_filename.data()); - top_block->connect(d_source_block, 0, d_dump_sink, 0); + top_block->connect(get_right_block(), 0, d_dump_sink, 0); } } @@ -73,10 +81,22 @@ auto ZmqSignalSource::disconnect(gr::top_block_sptr top_block) -> void { top_block->disconnect(d_dump_sink); } + + if (d_vec_block) + { + top_block->disconnect(d_vec_block); + } } auto ZmqSignalSource::get_right_block() -> gr::basic_block_sptr { - return d_source_block; + auto result = gr::basic_block_sptr(); + + if (d_vec_block) + result = d_vec_block; // NOLINT + else + result = d_source_block; // NOLINT + + return result; } diff --git a/src/algorithms/signal_source/adapters/zmq_signal_source.h b/src/algorithms/signal_source/adapters/zmq_signal_source.h index 55b2d29b7..484b51eeb 100644 --- a/src/algorithms/signal_source/adapters/zmq_signal_source.h +++ b/src/algorithms/signal_source/adapters/zmq_signal_source.h @@ -21,6 +21,7 @@ // #include "concurrent_queue.h" #include // for dump +#include #include #include #include @@ -66,6 +67,7 @@ public: private: gr::zeromq::sub_source::sptr d_source_block; + gr::blocks::vector_to_stream::sptr d_vec_block; gr::blocks::file_sink::sptr d_dump_sink; size_t d_item_size;