mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-15 04:30:33 +00:00
Instantiate HAS message printer only if required
This commit is contained in:
parent
e8cc23276f
commit
ac250631a8
@ -397,7 +397,15 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initialize HAS simple printer
|
// Initialize HAS simple printer
|
||||||
d_has_simple_printer = std::make_unique<Has_Simple_Printer>();
|
d_enable_has_messages = (((d_type_of_rx >= 100) && (d_type_of_rx < 107)) && (conf_.output_enabled));
|
||||||
|
if (d_enable_has_messages)
|
||||||
|
{
|
||||||
|
d_has_simple_printer = std::make_unique<Has_Simple_Printer>();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
d_has_simple_printer = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
d_rx_time = 0.0;
|
d_rx_time = 0.0;
|
||||||
d_last_status_print_seg = 0;
|
d_last_status_print_seg = 0;
|
||||||
@ -1515,8 +1523,11 @@ void rtklib_pvt_gs::msg_handler_has_data(const pmt::pmt_t& msg) const
|
|||||||
const size_t msg_type_hash_code = pmt::any_ref(msg).type().hash_code();
|
const size_t msg_type_hash_code = pmt::any_ref(msg).type().hash_code();
|
||||||
if (msg_type_hash_code == d_galileo_has_data_sptr_type_hash_code)
|
if (msg_type_hash_code == d_galileo_has_data_sptr_type_hash_code)
|
||||||
{
|
{
|
||||||
const auto has_data = boost::any_cast<std::shared_ptr<Galileo_HAS_data>>(pmt::any_ref(msg));
|
if (d_enable_has_messages)
|
||||||
d_has_simple_printer->print_message(has_data.get());
|
{
|
||||||
|
const auto has_data = boost::any_cast<std::shared_ptr<Galileo_HAS_data>>(pmt::any_ref(msg));
|
||||||
|
d_has_simple_printer->print_message(has_data.get());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const boost::bad_any_cast& e)
|
catch (const boost::bad_any_cast& e)
|
||||||
|
@ -272,6 +272,7 @@ private:
|
|||||||
bool d_show_local_time_zone;
|
bool d_show_local_time_zone;
|
||||||
bool d_waiting_obs_block_rx_clock_offset_correction_msg;
|
bool d_waiting_obs_block_rx_clock_offset_correction_msg;
|
||||||
bool d_enable_rx_clock_correction;
|
bool d_enable_rx_clock_correction;
|
||||||
|
bool d_enable_has_messages;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user