mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-06-27 07:32:57 +00:00
Improve readability
This commit is contained in:
parent
e74b72b9df
commit
471bb17b3c
@ -33,6 +33,7 @@
|
|||||||
#include "control_message_factory.h"
|
#include "control_message_factory.h"
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
|
|
||||||
|
using google::LogMessage;
|
||||||
|
|
||||||
ChannelFsm::ChannelFsm()
|
ChannelFsm::ChannelFsm()
|
||||||
{
|
{
|
||||||
@ -135,35 +136,41 @@ bool ChannelFsm::Event_failed_tracking_standby()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ChannelFsm::set_acquisition(std::shared_ptr<AcquisitionInterface> acquisition)
|
void ChannelFsm::set_acquisition(std::shared_ptr<AcquisitionInterface> acquisition)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lk(mx);
|
std::lock_guard<std::mutex> lk(mx);
|
||||||
acq_ = acquisition;
|
acq_ = acquisition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ChannelFsm::set_tracking(std::shared_ptr<TrackingInterface> tracking)
|
void ChannelFsm::set_tracking(std::shared_ptr<TrackingInterface> tracking)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lk(mx);
|
std::lock_guard<std::mutex> lk(mx);
|
||||||
trk_ = tracking;
|
trk_ = tracking;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ChannelFsm::set_queue(gr::msg_queue::sptr queue)
|
void ChannelFsm::set_queue(gr::msg_queue::sptr queue)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lk(mx);
|
std::lock_guard<std::mutex> lk(mx);
|
||||||
queue_ = queue;
|
queue_ = queue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ChannelFsm::set_channel(unsigned int channel)
|
void ChannelFsm::set_channel(unsigned int channel)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lk(mx);
|
std::lock_guard<std::mutex> lk(mx);
|
||||||
channel_ = channel;
|
channel_ = channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ChannelFsm::start_acquisition()
|
void ChannelFsm::start_acquisition()
|
||||||
{
|
{
|
||||||
acq_->reset();
|
acq_->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ChannelFsm::start_tracking()
|
void ChannelFsm::start_tracking()
|
||||||
{
|
{
|
||||||
trk_->start_tracking();
|
trk_->start_tracking();
|
||||||
@ -174,6 +181,7 @@ void ChannelFsm::start_tracking()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ChannelFsm::request_satellite()
|
void ChannelFsm::request_satellite()
|
||||||
{
|
{
|
||||||
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
|
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
|
||||||
@ -183,6 +191,7 @@ void ChannelFsm::request_satellite()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ChannelFsm::notify_stop_tracking()
|
void ChannelFsm::notify_stop_tracking()
|
||||||
{
|
{
|
||||||
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
|
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
|
||||||
|
@ -42,6 +42,7 @@ channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr<Channe
|
|||||||
return channel_msg_receiver_cc_sptr(new channel_msg_receiver_cc(channel_fsm, repeat));
|
return channel_msg_receiver_cc_sptr(new channel_msg_receiver_cc(channel_fsm, repeat));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void channel_msg_receiver_cc::msg_handler_events(pmt::pmt_t msg)
|
void channel_msg_receiver_cc::msg_handler_events(pmt::pmt_t msg)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
@ -50,10 +51,10 @@ void channel_msg_receiver_cc::msg_handler_events(pmt::pmt_t msg)
|
|||||||
long int message = pmt::to_long(msg);
|
long int message = pmt::to_long(msg);
|
||||||
switch (message)
|
switch (message)
|
||||||
{
|
{
|
||||||
case 1: //positive acquisition
|
case 1: // positive acquisition
|
||||||
result = d_channel_fsm->Event_valid_acquisition();
|
result = d_channel_fsm->Event_valid_acquisition();
|
||||||
break;
|
break;
|
||||||
case 2: //negative acquisition
|
case 2: // negative acquisition
|
||||||
if (d_repeat == true)
|
if (d_repeat == true)
|
||||||
{
|
{
|
||||||
result = d_channel_fsm->Event_failed_acquisition_repeat();
|
result = d_channel_fsm->Event_failed_acquisition_repeat();
|
||||||
|
@ -37,12 +37,15 @@ using google::LogMessage;
|
|||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
ArraySignalConditioner::ArraySignalConditioner(ConfigurationInterface *configuration,
|
ArraySignalConditioner::ArraySignalConditioner(ConfigurationInterface *configuration,
|
||||||
std::shared_ptr<GNSSBlockInterface> data_type_adapt, std::shared_ptr<GNSSBlockInterface> in_filt,
|
std::shared_ptr<GNSSBlockInterface> data_type_adapt,
|
||||||
std::shared_ptr<GNSSBlockInterface> res, std::string role, std::string implementation) : data_type_adapt_(data_type_adapt),
|
std::shared_ptr<GNSSBlockInterface> in_filt,
|
||||||
in_filt_(in_filt),
|
std::shared_ptr<GNSSBlockInterface> res,
|
||||||
res_(res),
|
std::string role,
|
||||||
role_(role),
|
std::string implementation) : data_type_adapt_(data_type_adapt),
|
||||||
implementation_(implementation)
|
in_filt_(in_filt),
|
||||||
|
res_(res),
|
||||||
|
role_(role),
|
||||||
|
implementation_(implementation)
|
||||||
{
|
{
|
||||||
connected_ = false;
|
connected_ = false;
|
||||||
if (configuration)
|
if (configuration)
|
||||||
|
@ -37,12 +37,15 @@ using google::LogMessage;
|
|||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
SignalConditioner::SignalConditioner(ConfigurationInterface *configuration,
|
SignalConditioner::SignalConditioner(ConfigurationInterface *configuration,
|
||||||
std::shared_ptr<GNSSBlockInterface> data_type_adapt, std::shared_ptr<GNSSBlockInterface> in_filt,
|
std::shared_ptr<GNSSBlockInterface> data_type_adapt,
|
||||||
std::shared_ptr<GNSSBlockInterface> res, std::string role, std::string implementation) : data_type_adapt_(data_type_adapt),
|
std::shared_ptr<GNSSBlockInterface> in_filt,
|
||||||
in_filt_(in_filt),
|
std::shared_ptr<GNSSBlockInterface> res,
|
||||||
res_(res),
|
std::string role,
|
||||||
role_(role),
|
std::string implementation) : data_type_adapt_(data_type_adapt),
|
||||||
implementation_(implementation)
|
in_filt_(in_filt),
|
||||||
|
res_(res),
|
||||||
|
role_(role),
|
||||||
|
implementation_(implementation)
|
||||||
{
|
{
|
||||||
connected_ = false;
|
connected_ = false;
|
||||||
if (configuration)
|
if (configuration)
|
||||||
@ -101,6 +104,7 @@ gr::basic_block_sptr SignalConditioner::get_left_block()
|
|||||||
return data_type_adapt_->get_left_block();
|
return data_type_adapt_->get_left_block();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
gr::basic_block_sptr SignalConditioner::get_right_block()
|
gr::basic_block_sptr SignalConditioner::get_right_block()
|
||||||
{
|
{
|
||||||
return res_->get_right_block();
|
return res_->get_right_block();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user