mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-18 21:23:02 +00:00
Prepare for boost::any to std::any transition
This commit is contained in:
parent
56d44335c2
commit
5ec7548886
@ -1968,7 +1968,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
|
||||
{
|
||||
if (pmt::any_ref(it.value).type().hash_code() == typeid(const std::shared_ptr<GnssTime>).hash_code())
|
||||
{
|
||||
const auto timetag = boost::any_cast<const std::shared_ptr<GnssTime>>(pmt::any_ref(it.value));
|
||||
const auto timetag = wht::any_cast<const std::shared_ptr<GnssTime>>(pmt::any_ref(it.value));
|
||||
// std::cout << "PVT timetag: " << timetag->rx_time << '\n';
|
||||
d_TimeChannelTagTimestamps.push(*timetag);
|
||||
}
|
||||
@ -1977,7 +1977,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
|
||||
std::cout << "hash code not match\n";
|
||||
}
|
||||
}
|
||||
catch (const boost::bad_any_cast& e)
|
||||
catch (const wht::bad_any_cast& e)
|
||||
{
|
||||
std::cout << "msg Bad any_cast: " << e.what();
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ target_link_libraries(obs_gr_blocks
|
||||
Gflags::gflags
|
||||
Glog::glog
|
||||
Matio::matio
|
||||
Gnuradio::pmt
|
||||
)
|
||||
|
||||
if(GNURADIO_USES_SPDLOG)
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <matio.h>
|
||||
#include <pmt/pmt.h>
|
||||
#include <algorithm> // for std::min
|
||||
#include <array>
|
||||
#include <cmath> // for round
|
||||
@ -694,7 +695,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused)
|
||||
{
|
||||
if (pmt::any_ref(it.value).type().hash_code() == typeid(const std::shared_ptr<GnssTime>).hash_code())
|
||||
{
|
||||
const auto timetag = boost::any_cast<const std::shared_ptr<GnssTime>>(pmt::any_ref(it.value));
|
||||
const auto timetag = wht::any_cast<const std::shared_ptr<GnssTime>>(pmt::any_ref(it.value));
|
||||
// std::cout << "[Time ch ] timetag: " << timetag->rx_time << "\n";
|
||||
d_TimeChannelTagTimestamps.push(*timetag);
|
||||
}
|
||||
@ -703,7 +704,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused)
|
||||
std::cout << "hash code not match\n";
|
||||
}
|
||||
}
|
||||
catch (const boost::bad_any_cast &e)
|
||||
catch (const wht::bad_any_cast &e)
|
||||
{
|
||||
std::cout << "msg Bad any_cast: " << e.what();
|
||||
}
|
||||
@ -725,7 +726,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused)
|
||||
// {
|
||||
// if (pmt::any_ref(it->value).type().hash_code() == typeid(const std::shared_ptr<GnssTime>).hash_code())
|
||||
// {
|
||||
// const std::shared_ptr<GnssTime> timetag = boost::any_cast<const std::shared_ptr<GnssTime>>(pmt::any_ref(it->value));
|
||||
// const std::shared_ptr<GnssTime> timetag = wht::any_cast<const std::shared_ptr<GnssTime>>(pmt::any_ref(it->value));
|
||||
// //std::cout << "[ch " << n << "] timetag: " << timetag->rx_time << "\n";
|
||||
// d_SourceTagTimestamps.at(n).push(*timetag);
|
||||
// }
|
||||
@ -734,7 +735,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused)
|
||||
// std::cout << "hash code not match\n";
|
||||
// }
|
||||
// }
|
||||
// catch (const boost::bad_any_cast &e)
|
||||
// catch (const wht::bad_any_cast &e)
|
||||
// {
|
||||
// std::cout << "msg Bad any_cast: " << e.what();
|
||||
// }
|
||||
|
@ -51,6 +51,13 @@ auto rotl = [](uint32_t x, uint32_t n) { return (((x) << (n)) ^ ((x) >> (32 - (n
|
||||
} // namespace my_rotl
|
||||
#endif
|
||||
|
||||
#if PMT_USES_BOOST_ANY
|
||||
#include <boost/any.hpp>
|
||||
namespace wht = boost;
|
||||
#else
|
||||
#include <any>
|
||||
namespace wht = std;
|
||||
#endif
|
||||
|
||||
gps_l1_ca_telemetry_decoder_gs_sptr
|
||||
gps_l1_ca_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, const Tlm_Conf &conf)
|
||||
@ -605,7 +612,7 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__
|
||||
{
|
||||
if (pmt::any_ref(it.value).type().hash_code() == typeid(const std::shared_ptr<GnssTime>).hash_code())
|
||||
{
|
||||
const auto timetag = boost::any_cast<const std::shared_ptr<GnssTime>>(pmt::any_ref(it.value));
|
||||
const auto timetag = wht::any_cast<const std::shared_ptr<GnssTime>>(pmt::any_ref(it.value));
|
||||
// std::cout << "[" << this->nitems_written(0) + 1 << "] TLM RX TimeTag Week: " << timetag->week << ", TOW: " << timetag->tow_ms << " [ms], TOW fraction: " << timetag->tow_ms_fraction
|
||||
// << " [ms], DELTA TLM TOW: " << static_cast<double>(timetag->tow_ms - current_symbol.TOW_at_current_symbol_ms) + timetag->tow_ms_fraction << " [ms] \n";
|
||||
add_item_tag(0, this->nitems_written(0) + 1, pmt::mp("timetag"), pmt::make_any(timetag));
|
||||
@ -615,12 +622,11 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__
|
||||
std::cout << "hash code not match\n";
|
||||
}
|
||||
}
|
||||
catch (const boost::bad_any_cast &e)
|
||||
catch (const wht::bad_any_cast &e)
|
||||
{
|
||||
std::cout << "msg Bad any_cast: " << e.what();
|
||||
}
|
||||
}
|
||||
|
||||
if (d_dump == true)
|
||||
{
|
||||
// MULTIPLEXED FILE RECORDING - Record results to file
|
||||
|
@ -2024,7 +2024,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)
|
||||
{
|
||||
// std::cout << "ch[" << d_acquisition_gnss_synchro->Channel_ID << "] tracking time tag with offset " << it->offset << " vs. counter " << d_sample_counter << " vs. nread " << this->nitems_read(0) << " containing ";
|
||||
// std::cout << "ch[" << d_acquisition_gnss_synchro->Channel_ID << "] tracking time tag with offset " << it->offset << " vs. nread " << this->nitems_read(0) << " containing ";
|
||||
const auto last_timetag = boost::any_cast<const std::shared_ptr<GnssTime>>(pmt::any_ref(it.value));
|
||||
const auto last_timetag = wht::any_cast<const std::shared_ptr<GnssTime>>(pmt::any_ref(it.value));
|
||||
d_last_timetag = *last_timetag;
|
||||
d_last_timetag_samplecounter = it.offset;
|
||||
d_timetag_waiting = true;
|
||||
@ -2034,7 +2034,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)
|
||||
std::cout << "hash code not match\n";
|
||||
}
|
||||
}
|
||||
catch (const boost::bad_any_cast &e)
|
||||
catch (const wht::bad_any_cast &e)
|
||||
{
|
||||
std::cout << "msg Bad any_cast: " << e.what();
|
||||
}
|
||||
|
@ -83,6 +83,7 @@ endif()
|
||||
|
||||
target_link_libraries(core_libs
|
||||
PUBLIC
|
||||
Boost::headers
|
||||
Gnuradio::blocks
|
||||
Gnuradio::runtime
|
||||
Gnuradio::pmt
|
||||
|
@ -27,6 +27,13 @@
|
||||
#include <string> // for string
|
||||
#include <vector>
|
||||
|
||||
#if PMT_USES_BOOST_ANY
|
||||
#include <boost/any.hpp>
|
||||
namespace wht = boost;
|
||||
#else
|
||||
#include <any>
|
||||
namespace wht = std;
|
||||
#endif
|
||||
|
||||
gnss_sdr_sample_counter::gnss_sdr_sample_counter(
|
||||
double _fs,
|
||||
@ -156,7 +163,7 @@ int gnss_sdr_sample_counter::work(int noutput_items __attribute__((unused)),
|
||||
{
|
||||
// recompute timestamp to match the last sample in the consumed samples in this batch
|
||||
int64_t diff_samplecount = uint64diff(out[0].Tracking_sample_counter, it.offset);
|
||||
const auto last_timetag = boost::any_cast<const std::shared_ptr<GnssTime>>(pmt::any_ref(it.value));
|
||||
const auto last_timetag = wht::any_cast<const std::shared_ptr<GnssTime>>(pmt::any_ref(it.value));
|
||||
double intpart;
|
||||
last_timetag->tow_ms_fraction += modf(1000.0 * static_cast<double>(diff_samplecount) / fs, &intpart);
|
||||
|
||||
@ -172,7 +179,7 @@ int gnss_sdr_sample_counter::work(int noutput_items __attribute__((unused)),
|
||||
std::cout << "hash code not match\n";
|
||||
}
|
||||
}
|
||||
catch (const boost::bad_any_cast &e)
|
||||
catch (const wht::bad_any_cast &e)
|
||||
{
|
||||
std::cout << "msg Bad any_cast: " << e.what();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user