mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-09-10 14:56:03 +00:00
Remove tabs from the source code
This commit is contained in:
@@ -2815,7 +2815,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
|
|||||||
// Add extra 0 if seconds are < 10
|
// Add extra 0 if seconds are < 10
|
||||||
if (seconds < 10)
|
if (seconds < 10)
|
||||||
{
|
{
|
||||||
line +=std::string(1, '0');
|
line += std::string(1, '0');
|
||||||
}
|
}
|
||||||
line += Rinex_Printer::asString(seconds, 7);
|
line += Rinex_Printer::asString(seconds, 7);
|
||||||
line += std::string(2, ' ');
|
line += std::string(2, ' ');
|
||||||
|
@@ -117,8 +117,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::~GalileoE1Pcps8msAmbiguousAcquisition()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1Pcps8msAmbiguousAcquisition::set_channel(unsigned int channel)
|
||||||
GalileoE1Pcps8msAmbiguousAcquisition::set_channel(unsigned int channel)
|
|
||||||
{
|
{
|
||||||
channel_ = channel;
|
channel_ = channel;
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
@@ -128,15 +127,13 @@ GalileoE1Pcps8msAmbiguousAcquisition::set_channel(unsigned int channel)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold)
|
||||||
GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
float pfa = configuration_->property(role_+ boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
float pfa = configuration_->property(role_+ boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||||
|
|
||||||
if(pfa==0.0) pfa = configuration_->property(role_+".pfa", 0.0);
|
if(pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||||
|
|
||||||
if(pfa==0.0)
|
if(pfa == 0.0)
|
||||||
{
|
{
|
||||||
threshold_ = threshold;
|
threshold_ = threshold;
|
||||||
}
|
}
|
||||||
@@ -145,7 +142,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold)
|
|||||||
threshold_ = calculate_threshold(pfa);
|
threshold_ = calculate_threshold(pfa);
|
||||||
}
|
}
|
||||||
|
|
||||||
DLOG(INFO) <<"Channel "<<channel_<<" Threshold = " << threshold_;
|
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
|
||||||
|
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
{
|
||||||
@@ -154,8 +151,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
|
||||||
GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
|
|
||||||
{
|
{
|
||||||
doppler_max_ = doppler_max;
|
doppler_max_ = doppler_max;
|
||||||
|
|
||||||
@@ -166,8 +162,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step)
|
||||||
GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step)
|
|
||||||
{
|
{
|
||||||
doppler_step_ = doppler_step;
|
doppler_step_ = doppler_step;
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
@@ -177,8 +172,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1Pcps8msAmbiguousAcquisition::set_gnss_synchro(
|
||||||
GalileoE1Pcps8msAmbiguousAcquisition::set_gnss_synchro(
|
|
||||||
Gnss_Synchro* gnss_synchro)
|
Gnss_Synchro* gnss_synchro)
|
||||||
{
|
{
|
||||||
gnss_synchro_ = gnss_synchro;
|
gnss_synchro_ = gnss_synchro;
|
||||||
@@ -189,8 +183,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::set_gnss_synchro(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
signed int
|
signed int GalileoE1Pcps8msAmbiguousAcquisition::mag()
|
||||||
GalileoE1Pcps8msAmbiguousAcquisition::mag()
|
|
||||||
{
|
{
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
{
|
||||||
@@ -203,16 +196,14 @@ GalileoE1Pcps8msAmbiguousAcquisition::mag()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1Pcps8msAmbiguousAcquisition::init()
|
||||||
GalileoE1Pcps8msAmbiguousAcquisition::init()
|
|
||||||
{
|
{
|
||||||
acquisition_cc_->init();
|
acquisition_cc_->init();
|
||||||
set_local_code();
|
set_local_code();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1Pcps8msAmbiguousAcquisition::set_local_code()
|
||||||
GalileoE1Pcps8msAmbiguousAcquisition::set_local_code()
|
|
||||||
{
|
{
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
{
|
||||||
@@ -238,8 +229,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::set_local_code()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1Pcps8msAmbiguousAcquisition::reset()
|
||||||
GalileoE1Pcps8msAmbiguousAcquisition::reset()
|
|
||||||
{
|
{
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
{
|
||||||
@@ -268,8 +258,7 @@ float GalileoE1Pcps8msAmbiguousAcquisition::calculate_threshold(float pfa)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1Pcps8msAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
|
||||||
GalileoE1Pcps8msAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
|
|
||||||
{
|
{
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
{
|
||||||
@@ -278,8 +267,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1Pcps8msAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
|
||||||
GalileoE1Pcps8msAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
|
|
||||||
{
|
{
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
{
|
||||||
|
@@ -51,8 +51,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
|
|||||||
|
|
||||||
DLOG(INFO) << "role " << role;
|
DLOG(INFO) << "role " << role;
|
||||||
|
|
||||||
item_type_ = configuration_->property(role + ".item_type",
|
item_type_ = configuration_->property(role + ".item_type", default_item_type);
|
||||||
default_item_type);
|
|
||||||
|
|
||||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
|
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
|
||||||
if_ = configuration_->property(role + ".ifreq", 0);
|
if_ = configuration_->property(role + ".ifreq", 0);
|
||||||
@@ -119,8 +118,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::~GalileoE1PcpsCccwsrAmbiguousAcquisitio
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_channel(unsigned int channel)
|
||||||
GalileoE1PcpsCccwsrAmbiguousAcquisition::set_channel(unsigned int channel)
|
|
||||||
{
|
{
|
||||||
channel_ = channel;
|
channel_ = channel;
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
@@ -130,22 +128,20 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::set_channel(unsigned int channel)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_threshold(float threshold)
|
||||||
GalileoE1PcpsCccwsrAmbiguousAcquisition::set_threshold(float threshold)
|
|
||||||
{
|
{
|
||||||
|
// float pfa = configuration_->property(role_+ boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||||
|
|
||||||
// float pfa = configuration_->property(role_+ boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
// if(pfa==0.0) pfa = configuration_->property(role_+".pfa", 0.0);
|
||||||
|
|
||||||
// if(pfa==0.0) pfa = configuration_->property(role_+".pfa", 0.0);
|
// if(pfa==0.0)
|
||||||
|
// {
|
||||||
// if(pfa==0.0)
|
// threshold_ = threshold;
|
||||||
// {
|
// }
|
||||||
// threshold_ = threshold;
|
// else
|
||||||
// }
|
// {
|
||||||
// else
|
// threshold_ = calculate_threshold(pfa);
|
||||||
// {
|
// }
|
||||||
// threshold_ = calculate_threshold(pfa);
|
|
||||||
// }
|
|
||||||
|
|
||||||
threshold_ = threshold;
|
threshold_ = threshold;
|
||||||
|
|
||||||
@@ -158,8 +154,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::set_threshold(float threshold)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
|
||||||
GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
|
|
||||||
{
|
{
|
||||||
doppler_max_ = doppler_max;
|
doppler_max_ = doppler_max;
|
||||||
|
|
||||||
@@ -170,8 +165,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_max(unsigned int doppler_ma
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step)
|
||||||
GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step)
|
|
||||||
{
|
{
|
||||||
doppler_step_ = doppler_step;
|
doppler_step_ = doppler_step;
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
@@ -180,8 +174,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_step(unsigned int doppler_s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_gnss_synchro(
|
||||||
GalileoE1PcpsCccwsrAmbiguousAcquisition::set_gnss_synchro(
|
|
||||||
Gnss_Synchro* gnss_synchro)
|
Gnss_Synchro* gnss_synchro)
|
||||||
{
|
{
|
||||||
gnss_synchro_ = gnss_synchro;
|
gnss_synchro_ = gnss_synchro;
|
||||||
@@ -192,8 +185,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::set_gnss_synchro(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
signed int
|
signed int GalileoE1PcpsCccwsrAmbiguousAcquisition::mag()
|
||||||
GalileoE1PcpsCccwsrAmbiguousAcquisition::mag()
|
|
||||||
{
|
{
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
{
|
||||||
@@ -206,16 +198,14 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::mag()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsCccwsrAmbiguousAcquisition::init()
|
||||||
GalileoE1PcpsCccwsrAmbiguousAcquisition::init()
|
|
||||||
{
|
{
|
||||||
acquisition_cc_->init();
|
acquisition_cc_->init();
|
||||||
set_local_code();
|
set_local_code();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_local_code()
|
||||||
GalileoE1PcpsCccwsrAmbiguousAcquisition::set_local_code()
|
|
||||||
{
|
{
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
{
|
||||||
@@ -240,8 +230,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::set_local_code()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsCccwsrAmbiguousAcquisition::reset()
|
||||||
GalileoE1PcpsCccwsrAmbiguousAcquisition::reset()
|
|
||||||
{
|
{
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
{
|
||||||
@@ -249,8 +238,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::reset()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_state(int state)
|
||||||
GalileoE1PcpsCccwsrAmbiguousAcquisition::set_state(int state)
|
|
||||||
{
|
{
|
||||||
acquisition_cc_->set_state(state);
|
acquisition_cc_->set_state(state);
|
||||||
}
|
}
|
||||||
@@ -264,8 +252,7 @@ float GalileoE1PcpsCccwsrAmbiguousAcquisition::calculate_threshold(float pfa)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsCccwsrAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
|
||||||
GalileoE1PcpsCccwsrAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
|
|
||||||
{
|
{
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
{
|
||||||
@@ -275,8 +262,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsCccwsrAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
|
||||||
GalileoE1PcpsCccwsrAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
|
|
||||||
{
|
{
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
{
|
||||||
|
@@ -121,8 +121,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::~GalileoE1PcpsTongAmbiguousAcquisition()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsTongAmbiguousAcquisition::set_channel(unsigned int channel)
|
||||||
GalileoE1PcpsTongAmbiguousAcquisition::set_channel(unsigned int channel)
|
|
||||||
{
|
{
|
||||||
channel_ = channel;
|
channel_ = channel;
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
@@ -132,8 +131,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::set_channel(unsigned int channel)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold)
|
||||||
GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
float pfa = configuration_->property(role_+ boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
float pfa = configuration_->property(role_+ boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||||
@@ -158,8 +156,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
|
||||||
GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
|
|
||||||
{
|
{
|
||||||
doppler_max_ = doppler_max;
|
doppler_max_ = doppler_max;
|
||||||
|
|
||||||
@@ -170,8 +167,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step)
|
||||||
GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step)
|
|
||||||
{
|
{
|
||||||
doppler_step_ = doppler_step;
|
doppler_step_ = doppler_step;
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
@@ -182,8 +178,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_step(unsigned int doppler_ste
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsTongAmbiguousAcquisition::set_gnss_synchro(
|
||||||
GalileoE1PcpsTongAmbiguousAcquisition::set_gnss_synchro(
|
|
||||||
Gnss_Synchro* gnss_synchro)
|
Gnss_Synchro* gnss_synchro)
|
||||||
{
|
{
|
||||||
gnss_synchro_ = gnss_synchro;
|
gnss_synchro_ = gnss_synchro;
|
||||||
@@ -194,8 +189,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::set_gnss_synchro(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
signed int
|
signed int GalileoE1PcpsTongAmbiguousAcquisition::mag()
|
||||||
GalileoE1PcpsTongAmbiguousAcquisition::mag()
|
|
||||||
{
|
{
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
{
|
||||||
@@ -208,16 +202,14 @@ GalileoE1PcpsTongAmbiguousAcquisition::mag()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsTongAmbiguousAcquisition::init()
|
||||||
GalileoE1PcpsTongAmbiguousAcquisition::init()
|
|
||||||
{
|
{
|
||||||
acquisition_cc_->init();
|
acquisition_cc_->init();
|
||||||
set_local_code();
|
set_local_code();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsTongAmbiguousAcquisition::set_local_code()
|
||||||
GalileoE1PcpsTongAmbiguousAcquisition::set_local_code()
|
|
||||||
{
|
{
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
{
|
||||||
@@ -243,8 +235,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::set_local_code()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsTongAmbiguousAcquisition::reset()
|
||||||
GalileoE1PcpsTongAmbiguousAcquisition::reset()
|
|
||||||
{
|
{
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
{
|
||||||
@@ -252,8 +243,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::reset()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsTongAmbiguousAcquisition::set_state(int state)
|
||||||
GalileoE1PcpsTongAmbiguousAcquisition::set_state(int state)
|
|
||||||
{
|
{
|
||||||
acquisition_cc_->set_state(state);
|
acquisition_cc_->set_state(state);
|
||||||
}
|
}
|
||||||
@@ -280,8 +270,7 @@ float GalileoE1PcpsTongAmbiguousAcquisition::calculate_threshold(float pfa)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsTongAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
|
||||||
GalileoE1PcpsTongAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
|
|
||||||
{
|
{
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
{
|
||||||
@@ -290,8 +279,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void GalileoE1PcpsTongAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
|
||||||
GalileoE1PcpsTongAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
|
|
||||||
{
|
{
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
{
|
||||||
|
@@ -142,7 +142,7 @@ void GpsL1CaPcpsMultithreadAcquisition::set_threshold(float threshold)
|
|||||||
threshold_ = calculate_threshold(pfa);
|
threshold_ = calculate_threshold(pfa);
|
||||||
}
|
}
|
||||||
|
|
||||||
DLOG(INFO) <<"Channel "<<channel_<<" Threshold = " << threshold_;
|
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
|
||||||
|
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
{
|
||||||
|
@@ -126,11 +126,11 @@ void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold)
|
|||||||
{
|
{
|
||||||
float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||||
|
|
||||||
if(pfa==0.0)
|
if(pfa == 0.0)
|
||||||
{
|
{
|
||||||
pfa = configuration_->property(role_+".pfa", 0.0);
|
pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||||
}
|
}
|
||||||
if(pfa==0.0)
|
if(pfa == 0.0)
|
||||||
{
|
{
|
||||||
threshold_ = threshold;
|
threshold_ = threshold;
|
||||||
}
|
}
|
||||||
@@ -139,7 +139,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold)
|
|||||||
threshold_ = calculate_threshold(pfa);
|
threshold_ = calculate_threshold(pfa);
|
||||||
}
|
}
|
||||||
|
|
||||||
DLOG(INFO) <<"Channel "<<channel_<<" Threshold = " << threshold_;
|
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
|
||||||
|
|
||||||
if (item_type_.compare("gr_complex") == 0)
|
if (item_type_.compare("gr_complex") == 0)
|
||||||
{
|
{
|
||||||
@@ -258,7 +258,6 @@ void GpsL1CaPcpsOpenClAcquisition::connect(gr::top_block_sptr top_block)
|
|||||||
{
|
{
|
||||||
top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0);
|
top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -76,7 +76,6 @@ private:
|
|||||||
void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift,
|
void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift,
|
||||||
int doppler_offset);
|
int doppler_offset);
|
||||||
|
|
||||||
|
|
||||||
long d_fs_in;
|
long d_fs_in;
|
||||||
long d_freq;
|
long d_freq;
|
||||||
int d_samples_per_ms;
|
int d_samples_per_ms;
|
||||||
|
@@ -98,7 +98,6 @@ private:
|
|||||||
int correlator_length_samples,
|
int correlator_length_samples,
|
||||||
float freq);
|
float freq);
|
||||||
|
|
||||||
|
|
||||||
long d_fs_in;
|
long d_fs_in;
|
||||||
long d_freq;
|
long d_freq;
|
||||||
int d_samples_per_ms;
|
int d_samples_per_ms;
|
||||||
|
@@ -50,7 +50,6 @@ pcps_assisted_acquisition_cc_sptr pcps_make_assisted_acquisition_cc(
|
|||||||
long fs_in, int samples_per_ms, boost::shared_ptr<gr::msg_queue> queue, bool dump,
|
long fs_in, int samples_per_ms, boost::shared_ptr<gr::msg_queue> queue, bool dump,
|
||||||
std::string dump_filename)
|
std::string dump_filename)
|
||||||
{
|
{
|
||||||
|
|
||||||
return pcps_assisted_acquisition_cc_sptr(
|
return pcps_assisted_acquisition_cc_sptr(
|
||||||
new pcps_assisted_acquisition_cc(max_dwells, sampled_ms, doppler_max, doppler_min, freq,
|
new pcps_assisted_acquisition_cc(max_dwells, sampled_ms, doppler_max, doppler_min, freq,
|
||||||
fs_in, samples_per_ms, queue, dump, dump_filename));
|
fs_in, samples_per_ms, queue, dump, dump_filename));
|
||||||
|
@@ -134,6 +134,7 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc(
|
|||||||
// DLOG(INFO) << "END CONSTRUCTOR";
|
// DLOG(INFO) << "END CONSTRUCTOR";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pcps_quicksync_acquisition_cc::~pcps_quicksync_acquisition_cc()
|
pcps_quicksync_acquisition_cc::~pcps_quicksync_acquisition_cc()
|
||||||
{
|
{
|
||||||
//DLOG(INFO) << "START DESTROYER";
|
//DLOG(INFO) << "START DESTROYER";
|
||||||
|
@@ -41,27 +41,29 @@ beamformer_sptr make_beamformer()
|
|||||||
return beamformer_sptr(new beamformer());
|
return beamformer_sptr(new beamformer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
beamformer::beamformer()
|
beamformer::beamformer()
|
||||||
: gr::sync_block("beamformer",
|
: gr::sync_block("beamformer",
|
||||||
gr::io_signature::make(GNSS_SDR_BEAMFORMER_CHANNELS, GNSS_SDR_BEAMFORMER_CHANNELS,sizeof(gr_complex)),
|
gr::io_signature::make(GNSS_SDR_BEAMFORMER_CHANNELS, GNSS_SDR_BEAMFORMER_CHANNELS,sizeof(gr_complex)),
|
||||||
gr::io_signature::make(1, 1,sizeof(gr_complex)))
|
gr::io_signature::make(1, 1,sizeof(gr_complex)))
|
||||||
{
|
{
|
||||||
|
|
||||||
//initialize weight vector
|
//initialize weight vector
|
||||||
|
|
||||||
if (posix_memalign((void**)&weight_vector, 16, GNSS_SDR_BEAMFORMER_CHANNELS * sizeof(gr_complex)) == 0){};
|
if (posix_memalign((void**)&weight_vector, 16, GNSS_SDR_BEAMFORMER_CHANNELS * sizeof(gr_complex)) == 0){};
|
||||||
|
|
||||||
for (int i=0;i<GNSS_SDR_BEAMFORMER_CHANNELS;i++)
|
for (int i = 0; i< GNSS_SDR_BEAMFORMER_CHANNELS; i++)
|
||||||
{
|
{
|
||||||
weight_vector[i]=gr_complex(1,0);
|
weight_vector[i]=gr_complex(1,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
beamformer::~beamformer()
|
beamformer::~beamformer()
|
||||||
{
|
{
|
||||||
free(weight_vector);
|
free(weight_vector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int beamformer::work(int noutput_items,gr_vector_const_void_star &input_items,
|
int beamformer::work(int noutput_items,gr_vector_const_void_star &input_items,
|
||||||
gr_vector_void_star &output_items)
|
gr_vector_void_star &output_items)
|
||||||
{
|
{
|
||||||
@@ -79,14 +81,14 @@ int beamformer::work(int noutput_items,gr_vector_const_void_star &input_items,
|
|||||||
// NON-VOLK beamforming operation
|
// NON-VOLK beamforming operation
|
||||||
//TODO: Implement VOLK SIMD-accelerated beamformer!
|
//TODO: Implement VOLK SIMD-accelerated beamformer!
|
||||||
gr_complex sum;
|
gr_complex sum;
|
||||||
for(int n=0;n<noutput_items;n++)
|
for(int n = 0; n < noutput_items; n++)
|
||||||
{
|
{
|
||||||
sum=gr_complex(0,0);
|
sum = gr_complex(0,0);
|
||||||
for (int i=0;i<GNSS_SDR_BEAMFORMER_CHANNELS;i++)
|
for (int i = 0; i < GNSS_SDR_BEAMFORMER_CHANNELS; i++)
|
||||||
{
|
{
|
||||||
sum=sum+((gr_complex *) input_items[i])[n]*weight_vector[i];
|
sum = sum + ((gr_complex*)input_items[i])[n] * weight_vector[i];
|
||||||
}
|
}
|
||||||
out[n]=sum;
|
out[n] = sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
return noutput_items;
|
return noutput_items;
|
||||||
|
@@ -44,10 +44,7 @@ gnss_sdr_valve::gnss_sdr_valve (size_t sizeof_stream_item,
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
boost::shared_ptr<gr::block> gnss_sdr_make_valve (size_t sizeof_stream_item, unsigned long long nitems, gr::msg_queue::sptr queue)
|
||||||
boost::shared_ptr<gr::block> gnss_sdr_make_valve (size_t sizeof_stream_item,
|
|
||||||
unsigned long long nitems,
|
|
||||||
gr::msg_queue::sptr queue)
|
|
||||||
{
|
{
|
||||||
boost::shared_ptr<gnss_sdr_valve> valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, queue));
|
boost::shared_ptr<gnss_sdr_valve> valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, queue));
|
||||||
return valve_;
|
return valve_;
|
||||||
@@ -61,7 +58,6 @@ int gnss_sdr_valve::work (int noutput_items,
|
|||||||
{
|
{
|
||||||
if (d_ncopied_items >= d_nitems)
|
if (d_ncopied_items >= d_nitems)
|
||||||
{
|
{
|
||||||
|
|
||||||
ControlMessageFactory* cmf = new ControlMessageFactory();
|
ControlMessageFactory* cmf = new ControlMessageFactory();
|
||||||
d_queue->handle(cmf->GetQueueMessage(200,0));
|
d_queue->handle(cmf->GetQueueMessage(200,0));
|
||||||
delete cmf;
|
delete cmf;
|
||||||
|
@@ -56,7 +56,6 @@ void gps_l1_ca_code_gen_complex(std::complex<float>* _dest, signed int _prn, uns
|
|||||||
if(120 <= _prn && _prn <= 138)
|
if(120 <= _prn && _prn <= 138)
|
||||||
{
|
{
|
||||||
prn_idx = _prn - 88; // SBAS PRNs are at array indices 31 to 50 (offset: -120+33-1 =-88)
|
prn_idx = _prn - 88; // SBAS PRNs are at array indices 31 to 50 (offset: -120+33-1 =-88)
|
||||||
//prn_idx = _prn - 87; // SBAS PRNs are at array indices 31 to 50 (offset: -120+33 =-87)
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -63,7 +63,6 @@ signal_generator_c::signal_generator_c (std::vector<std::string> signal1, std::v
|
|||||||
const std::vector<float> &CN0_dB, const std::vector<float> &doppler_Hz,
|
const std::vector<float> &CN0_dB, const std::vector<float> &doppler_Hz,
|
||||||
const std::vector<unsigned int> &delay_chips,const std::vector<unsigned int> &delay_sec ,bool data_flag, bool noise_flag,
|
const std::vector<unsigned int> &delay_chips,const std::vector<unsigned int> &delay_sec ,bool data_flag, bool noise_flag,
|
||||||
unsigned int fs_in, unsigned int vector_length, float BW_BB) :
|
unsigned int fs_in, unsigned int vector_length, float BW_BB) :
|
||||||
|
|
||||||
gr::block ("signal_gen_cc", gr::io_signature::make(0, 0, sizeof(gr_complex)),
|
gr::block ("signal_gen_cc", gr::io_signature::make(0, 0, sizeof(gr_complex)),
|
||||||
gr::io_signature::make(1, 1, sizeof(gr_complex) * vector_length)),
|
gr::io_signature::make(1, 1, sizeof(gr_complex) * vector_length)),
|
||||||
signal_(signal1),
|
signal_(signal1),
|
||||||
@@ -252,8 +251,8 @@ signal_generator_c::~signal_generator_c()
|
|||||||
|
|
||||||
int signal_generator_c::general_work (int noutput_items __attribute__((unused)),
|
int signal_generator_c::general_work (int noutput_items __attribute__((unused)),
|
||||||
gr_vector_int &ninput_items __attribute__((unused)),
|
gr_vector_int &ninput_items __attribute__((unused)),
|
||||||
gr_vector_const_void_star &input_items __attribute__((unused)),
|
gr_vector_const_void_star &input_items __attribute__((unused)),
|
||||||
gr_vector_void_star &output_items)
|
gr_vector_void_star &output_items)
|
||||||
{
|
{
|
||||||
gr_complex *out = (gr_complex *) output_items[0];
|
gr_complex *out = (gr_complex *) output_items[0];
|
||||||
|
|
||||||
|
@@ -124,7 +124,7 @@ private:
|
|||||||
unsigned int work_counter_;
|
unsigned int work_counter_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
~signal_generator_c (); // public destructor
|
~signal_generator_c(); // public destructor
|
||||||
|
|
||||||
// Where all the action really happens
|
// Where all the action really happens
|
||||||
|
|
||||||
|
@@ -50,7 +50,7 @@ RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration
|
|||||||
//dump_ = configuration->property(role + ".dump", false);
|
//dump_ = configuration->property(role + ".dump", false);
|
||||||
//dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
|
//dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
|
||||||
|
|
||||||
dump_=false;
|
dump_ = false;
|
||||||
|
|
||||||
std::string default_ethernet_dev = "eth0";
|
std::string default_ethernet_dev = "eth0";
|
||||||
eth_device_ = configuration->property(role + ".ethernet_dev", default_ethernet_dev);
|
eth_device_ = configuration->property(role + ".ethernet_dev", default_ethernet_dev);
|
||||||
|
@@ -145,43 +145,58 @@ RtlTcpSignalSource::~RtlTcpSignalSource()
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
void RtlTcpSignalSource::connect(gr::top_block_sptr top_block) {
|
void RtlTcpSignalSource::connect(gr::top_block_sptr top_block)
|
||||||
if ( samples_ ) {
|
{
|
||||||
|
if ( samples_ )
|
||||||
|
{
|
||||||
top_block->connect (signal_source_, 0, valve_, 0);
|
top_block->connect (signal_source_, 0, valve_, 0);
|
||||||
DLOG(INFO) << "connected rtl tcp source to valve";
|
DLOG(INFO) << "connected rtl tcp source to valve";
|
||||||
if ( dump_ ) {
|
if ( dump_ )
|
||||||
|
{
|
||||||
top_block->connect(valve_, 0, file_sink_, 0);
|
top_block->connect(valve_, 0, file_sink_, 0);
|
||||||
DLOG(INFO) << "connected valve to file sink";
|
DLOG(INFO) << "connected valve to file sink";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( dump_ ) {
|
else if ( dump_ )
|
||||||
|
{
|
||||||
top_block->connect(signal_source_, 0, file_sink_, 0);
|
top_block->connect(signal_source_, 0, file_sink_, 0);
|
||||||
DLOG(INFO) << "connected rtl tcp source to file sink";
|
DLOG(INFO) << "connected rtl tcp source to file sink";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RtlTcpSignalSource::disconnect(gr::top_block_sptr top_block) {
|
|
||||||
if ( samples_ ) {
|
void RtlTcpSignalSource::disconnect(gr::top_block_sptr top_block)
|
||||||
|
{
|
||||||
|
if ( samples_ )
|
||||||
|
{
|
||||||
top_block->disconnect (signal_source_, 0, valve_, 0);
|
top_block->disconnect (signal_source_, 0, valve_, 0);
|
||||||
if ( dump_ ) {
|
if ( dump_ )
|
||||||
|
{
|
||||||
top_block->disconnect(valve_, 0, file_sink_, 0);
|
top_block->disconnect(valve_, 0, file_sink_, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( dump_ ) {
|
else if ( dump_ )
|
||||||
|
{
|
||||||
top_block->disconnect(signal_source_, 0, file_sink_, 0);
|
top_block->disconnect(signal_source_, 0, file_sink_, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gr::basic_block_sptr RtlTcpSignalSource::get_left_block() {
|
|
||||||
|
gr::basic_block_sptr RtlTcpSignalSource::get_left_block()
|
||||||
|
{
|
||||||
LOG(WARNING) << "Trying to get signal source left block.";
|
LOG(WARNING) << "Trying to get signal source left block.";
|
||||||
return gr::basic_block_sptr();
|
return gr::basic_block_sptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
gr::basic_block_sptr RtlTcpSignalSource::get_right_block() {
|
|
||||||
if (samples_ != 0) {
|
gr::basic_block_sptr RtlTcpSignalSource::get_right_block()
|
||||||
|
{
|
||||||
|
if (samples_ != 0)
|
||||||
|
{
|
||||||
return valve_;
|
return valve_;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
return signal_source_;
|
return signal_source_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -172,14 +172,10 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TwoBitCpxFileSignalSource::~TwoBitCpxFileSignalSource()
|
TwoBitCpxFileSignalSource::~TwoBitCpxFileSignalSource()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void TwoBitCpxFileSignalSource::connect(gr::top_block_sptr top_block)
|
void TwoBitCpxFileSignalSource::connect(gr::top_block_sptr top_block)
|
||||||
{
|
{
|
||||||
if (samples_ > 0)
|
if (samples_ > 0)
|
||||||
@@ -302,9 +298,6 @@ void TwoBitCpxFileSignalSource::disconnect(gr::top_block_sptr top_block)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gr::basic_block_sptr TwoBitCpxFileSignalSource::get_left_block()
|
gr::basic_block_sptr TwoBitCpxFileSignalSource::get_left_block()
|
||||||
{
|
{
|
||||||
LOG(WARNING) << "Left block of a signal source should not be retrieved";
|
LOG(WARNING) << "Left block of a signal source should not be retrieved";
|
||||||
@@ -313,9 +306,6 @@ gr::basic_block_sptr TwoBitCpxFileSignalSource::get_left_block()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gr::basic_block_sptr TwoBitCpxFileSignalSource::get_right_block()
|
gr::basic_block_sptr TwoBitCpxFileSignalSource::get_right_block()
|
||||||
{
|
{
|
||||||
if (samples_ > 0)
|
if (samples_ > 0)
|
||||||
|
@@ -101,7 +101,6 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac
|
|||||||
item_size_ = sizeof(char);
|
item_size_ = sizeof(char);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if( sample_type_.compare("real") == 0 )
|
if( sample_type_.compare("real") == 0 )
|
||||||
{
|
{
|
||||||
is_complex_ = false;
|
is_complex_ = false;
|
||||||
@@ -236,14 +235,10 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TwoBitPackedFileSignalSource::~TwoBitPackedFileSignalSource()
|
TwoBitPackedFileSignalSource::~TwoBitPackedFileSignalSource()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void TwoBitPackedFileSignalSource::connect(gr::top_block_sptr top_block)
|
void TwoBitPackedFileSignalSource::connect(gr::top_block_sptr top_block)
|
||||||
{
|
{
|
||||||
gr::basic_block_sptr left_block = file_source_;
|
gr::basic_block_sptr left_block = file_source_;
|
||||||
@@ -276,10 +271,6 @@ void TwoBitPackedFileSignalSource::connect(gr::top_block_sptr top_block)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void TwoBitPackedFileSignalSource::disconnect(gr::top_block_sptr top_block)
|
void TwoBitPackedFileSignalSource::disconnect(gr::top_block_sptr top_block)
|
||||||
{
|
{
|
||||||
gr::basic_block_sptr left_block = file_source_;
|
gr::basic_block_sptr left_block = file_source_;
|
||||||
@@ -321,9 +312,6 @@ gr::basic_block_sptr TwoBitPackedFileSignalSource::get_left_block()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gr::basic_block_sptr TwoBitPackedFileSignalSource::get_right_block()
|
gr::basic_block_sptr TwoBitPackedFileSignalSource::get_right_block()
|
||||||
{
|
{
|
||||||
return valve_;
|
return valve_;
|
||||||
|
@@ -62,7 +62,7 @@ rtl_tcp_make_signal_source_c(const std::string &address,
|
|||||||
rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address,
|
rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address,
|
||||||
short port,
|
short port,
|
||||||
bool flip_iq)
|
bool flip_iq)
|
||||||
: gr::sync_block ("rtl_tcp_signal_source_c",
|
: gr::sync_block ("rtl_tcp_signal_source_c",
|
||||||
gr::io_signature::make(0, 0, 0),
|
gr::io_signature::make(0, 0, 0),
|
||||||
gr::io_signature::make(1, 1, sizeof(gr_complex))),
|
gr::io_signature::make(1, 1, sizeof(gr_complex))),
|
||||||
socket_ (io_service_),
|
socket_ (io_service_),
|
||||||
@@ -74,31 +74,36 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address,
|
|||||||
boost::system::error_code ec;
|
boost::system::error_code ec;
|
||||||
|
|
||||||
// 1. Setup lookup table
|
// 1. Setup lookup table
|
||||||
for (unsigned i = 0; i < 0xff; i++) {
|
for (unsigned i = 0; i < 0xff; i++)
|
||||||
|
{
|
||||||
lookup_[i] = ((float)(i & 0xff) - 127.4f) * (1.0f / 128.0f);
|
lookup_[i] = ((float)(i & 0xff) - 127.4f) * (1.0f / 128.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Set socket options
|
// 2. Set socket options
|
||||||
ip::address addr = ip::address::from_string (address, ec);
|
ip::address addr = ip::address::from_string (address, ec);
|
||||||
if (ec) {
|
if (ec)
|
||||||
|
{
|
||||||
std::cout << address << " is not an IP address" << std::endl;
|
std::cout << address << " is not an IP address" << std::endl;
|
||||||
LOG (ERROR) << address << " is not an IP address";
|
LOG (ERROR) << address << " is not an IP address";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ip::tcp::endpoint ep (addr, port);
|
ip::tcp::endpoint ep (addr, port);
|
||||||
socket_.open (ep.protocol( ), ec);
|
socket_.open (ep.protocol( ), ec);
|
||||||
if (ec) {
|
if (ec)
|
||||||
|
{
|
||||||
std::cout << "Failed to open socket." << std::endl;
|
std::cout << "Failed to open socket." << std::endl;
|
||||||
LOG (ERROR) << "Failed to open socket.";
|
LOG (ERROR) << "Failed to open socket.";
|
||||||
}
|
}
|
||||||
|
|
||||||
socket_.set_option (boost::asio::socket_base::reuse_address (true), ec);
|
socket_.set_option (boost::asio::socket_base::reuse_address (true), ec);
|
||||||
if (ec) {
|
if (ec)
|
||||||
|
{
|
||||||
std::cout << "Failed to set reuse address option: " << ec << std::endl;
|
std::cout << "Failed to set reuse address option: " << ec << std::endl;
|
||||||
LOG (WARNING) << "Failed to set reuse address option";
|
LOG (WARNING) << "Failed to set reuse address option";
|
||||||
}
|
}
|
||||||
socket_.set_option (boost::asio::socket_base::linger (true, 0), ec);
|
socket_.set_option (boost::asio::socket_base::linger (true, 0), ec);
|
||||||
if (ec) {
|
if (ec)
|
||||||
|
{
|
||||||
std::cout << "Failed to set linger option: " << ec << std::endl;
|
std::cout << "Failed to set linger option: " << ec << std::endl;
|
||||||
LOG (WARNING) << "Failed to set linger option";
|
LOG (WARNING) << "Failed to set linger option";
|
||||||
}
|
}
|
||||||
@@ -106,7 +111,8 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address,
|
|||||||
// 3. Connect socket
|
// 3. Connect socket
|
||||||
|
|
||||||
socket_.connect(ep, ec);
|
socket_.connect(ep, ec);
|
||||||
if (ec) {
|
if (ec)
|
||||||
|
{
|
||||||
std::cout << "Failed to connect to " << addr << ":" << port
|
std::cout << "Failed to connect to " << addr << ":" << port
|
||||||
<< "(" << ec << ")" << std::endl;
|
<< "(" << ec << ")" << std::endl;
|
||||||
LOG (ERROR) << "Failed to connect to " << addr << ":" << port
|
LOG (ERROR) << "Failed to connect to " << addr << ":" << port
|
||||||
@@ -118,18 +124,21 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address,
|
|||||||
|
|
||||||
// 4. Set nodelay
|
// 4. Set nodelay
|
||||||
socket_.set_option (tcp::no_delay (true), ec);
|
socket_.set_option (tcp::no_delay (true), ec);
|
||||||
if (ec) {
|
if (ec)
|
||||||
|
{
|
||||||
std::cout << "Failed to set no delay option." << std::endl;
|
std::cout << "Failed to set no delay option." << std::endl;
|
||||||
LOG (WARNING) << "Failed to set no delay option";
|
LOG (WARNING) << "Failed to set no delay option";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 5. Receive dongle info
|
// 5. Receive dongle info
|
||||||
ec = info_.read (socket_);
|
ec = info_.read (socket_);
|
||||||
if (ec) {
|
if (ec)
|
||||||
|
{
|
||||||
std::cout << "Failed to read dongle info." << std::endl;
|
std::cout << "Failed to read dongle info." << std::endl;
|
||||||
LOG (WARNING) << "Failed to read dongle info";
|
LOG (WARNING) << "Failed to read dongle info";
|
||||||
}
|
}
|
||||||
else if (info_.is_valid ()) {
|
else if (info_.is_valid ())
|
||||||
|
{
|
||||||
std::cout << "Found " << info_.get_type_name() << " tuner." << std::endl;
|
std::cout << "Found " << info_.get_type_name() << " tuner." << std::endl;
|
||||||
LOG (INFO) << "Found " << info_.get_type_name() << " tuner.";
|
LOG (INFO) << "Found " << info_.get_type_name() << " tuner.";
|
||||||
}
|
}
|
||||||
@@ -141,18 +150,21 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address,
|
|||||||
boost::thread (boost::bind (&boost::asio::io_service::run, &io_service_));
|
boost::thread (boost::bind (&boost::asio::io_service::run, &io_service_));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rtl_tcp_signal_source_c::~rtl_tcp_signal_source_c()
|
rtl_tcp_signal_source_c::~rtl_tcp_signal_source_c()
|
||||||
{
|
{
|
||||||
io_service_.stop ();
|
io_service_.stop ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int rtl_tcp_signal_source_c::work (int noutput_items,
|
int rtl_tcp_signal_source_c::work (int noutput_items,
|
||||||
gr_vector_const_void_star &/*input_items*/,
|
gr_vector_const_void_star &/*input_items*/,
|
||||||
gr_vector_void_star &output_items)
|
gr_vector_void_star &output_items)
|
||||||
{
|
{
|
||||||
gr_complex *out = reinterpret_cast <gr_complex *>( output_items[0] );
|
gr_complex *out = reinterpret_cast <gr_complex *>( output_items[0] );
|
||||||
int i = 0;
|
int i = 0;
|
||||||
if (io_service_.stopped ()) {
|
if (io_service_.stopped ())
|
||||||
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,13 +173,16 @@ int rtl_tcp_signal_source_c::work (int noutput_items,
|
|||||||
not_empty_.wait (lock, boost::bind (&rtl_tcp_signal_source_c::not_empty,
|
not_empty_.wait (lock, boost::bind (&rtl_tcp_signal_source_c::not_empty,
|
||||||
this));
|
this));
|
||||||
|
|
||||||
for ( ; i < noutput_items && unread_ > 1; i++ ) {
|
for ( ; i < noutput_items && unread_ > 1; i++ )
|
||||||
|
{
|
||||||
float re = buffer_[--unread_];
|
float re = buffer_[--unread_];
|
||||||
float im = buffer_[--unread_];
|
float im = buffer_[--unread_];
|
||||||
if (flip_iq_) {
|
if (flip_iq_)
|
||||||
|
{
|
||||||
out[i] = gr_complex (im, re);
|
out[i] = gr_complex (im, re);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
out[i] = gr_complex (re, im);
|
out[i] = gr_complex (re, im);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -177,56 +192,68 @@ int rtl_tcp_signal_source_c::work (int noutput_items,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void rtl_tcp_signal_source_c::set_frequency (int frequency) {
|
void rtl_tcp_signal_source_c::set_frequency (int frequency)
|
||||||
|
{
|
||||||
boost::system::error_code ec =
|
boost::system::error_code ec =
|
||||||
rtl_tcp_command (RTL_TCP_SET_FREQUENCY, frequency, socket_);
|
rtl_tcp_command (RTL_TCP_SET_FREQUENCY, frequency, socket_);
|
||||||
if (ec) {
|
if (ec)
|
||||||
|
{
|
||||||
std::cout << "Failed to set frequency" << std::endl;
|
std::cout << "Failed to set frequency" << std::endl;
|
||||||
LOG (WARNING) << "Failed to set frequency";
|
LOG (WARNING) << "Failed to set frequency";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void rtl_tcp_signal_source_c::set_sample_rate (int sample_rate) {
|
|
||||||
|
void rtl_tcp_signal_source_c::set_sample_rate (int sample_rate)
|
||||||
|
{
|
||||||
boost::system::error_code ec =
|
boost::system::error_code ec =
|
||||||
rtl_tcp_command (RTL_TCP_SET_SAMPLE_RATE, sample_rate, socket_);
|
rtl_tcp_command (RTL_TCP_SET_SAMPLE_RATE, sample_rate, socket_);
|
||||||
if (ec) {
|
if (ec)
|
||||||
|
{
|
||||||
std::cout << "Failed to set sample rate" << std::endl;
|
std::cout << "Failed to set sample rate" << std::endl;
|
||||||
LOG (WARNING) << "Failed to set sample rate";
|
LOG (WARNING) << "Failed to set sample rate";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void rtl_tcp_signal_source_c::set_agc_mode (bool agc) {
|
void rtl_tcp_signal_source_c::set_agc_mode (bool agc)
|
||||||
|
{
|
||||||
boost::system::error_code ec =
|
boost::system::error_code ec =
|
||||||
rtl_tcp_command (RTL_TCP_SET_GAIN_MODE, !agc, socket_);
|
rtl_tcp_command (RTL_TCP_SET_GAIN_MODE, !agc, socket_);
|
||||||
if (ec) {
|
if (ec)
|
||||||
|
{
|
||||||
std::cout << "Failed to set gain mode" << std::endl;
|
std::cout << "Failed to set gain mode" << std::endl;
|
||||||
LOG (WARNING) << "Failed to set gain mode";
|
LOG (WARNING) << "Failed to set gain mode";
|
||||||
}
|
}
|
||||||
ec =
|
ec = rtl_tcp_command (RTL_TCP_SET_AGC_MODE, agc, socket_);
|
||||||
rtl_tcp_command (RTL_TCP_SET_AGC_MODE, agc, socket_);
|
if (ec)
|
||||||
if (ec) {
|
{
|
||||||
std::cout << "Failed to set gain mode" << std::endl;
|
std::cout << "Failed to set gain mode" << std::endl;
|
||||||
LOG (WARNING) << "Failed to set gain mode";
|
LOG (WARNING) << "Failed to set gain mode";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void rtl_tcp_signal_source_c::set_gain (int gain) {
|
|
||||||
|
void rtl_tcp_signal_source_c::set_gain (int gain)
|
||||||
|
{
|
||||||
unsigned clipped = static_cast<unsigned> (info_.clip_gain (gain) * 10.0);
|
unsigned clipped = static_cast<unsigned> (info_.clip_gain (gain) * 10.0);
|
||||||
boost::system::error_code ec =
|
boost::system::error_code ec = rtl_tcp_command (RTL_TCP_SET_GAIN, clipped, socket_);
|
||||||
rtl_tcp_command (RTL_TCP_SET_GAIN, clipped, socket_);
|
if (ec)
|
||||||
if (ec) {
|
{
|
||||||
std::cout << "Failed to set gain" << std::endl;
|
std::cout << "Failed to set gain" << std::endl;
|
||||||
LOG (WARNING) << "Failed to set gain";
|
LOG (WARNING) << "Failed to set gain";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void rtl_tcp_signal_source_c::set_if_gain (int gain) {
|
|
||||||
|
void rtl_tcp_signal_source_c::set_if_gain (int gain)
|
||||||
|
{
|
||||||
// from gr-osmosdr
|
// from gr-osmosdr
|
||||||
struct range {
|
struct range {
|
||||||
double start, stop, step;
|
double start, stop, step;
|
||||||
};
|
};
|
||||||
if (info_.get_tuner_type () != rtl_tcp_dongle_info::TUNER_E4000) {
|
if (info_.get_tuner_type () != rtl_tcp_dongle_info::TUNER_E4000)
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,55 +267,66 @@ void rtl_tcp_signal_source_c::set_if_gain (int gain) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
std::map <int, double> gains;
|
std::map <int, double> gains;
|
||||||
for (int i = 0; i < static_cast<int>(ranges.size ()); i++) {
|
for (int i = 0; i < static_cast<int>(ranges.size ()); i++)
|
||||||
|
{
|
||||||
gains[i+1] = ranges[i].start;
|
gains[i+1] = ranges[i].start;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = ranges.size() - 1; i >= 0; i--) {
|
for (int i = ranges.size() - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
const range &r = ranges[i];
|
const range &r = ranges[i];
|
||||||
double error = gain;
|
double error = gain;
|
||||||
|
|
||||||
for (double g = r.start; g < r.stop; g += r.step) {
|
for (double g = r.start; g < r.stop; g += r.step)
|
||||||
|
{
|
||||||
double sum = 0;
|
double sum = 0;
|
||||||
for (int j = 0; j < static_cast<int> ( gains.size() ); j++) {
|
for (int j = 0; j < static_cast<int> ( gains.size() ); j++)
|
||||||
if (i == j) {
|
{
|
||||||
|
if (i == j)
|
||||||
|
{
|
||||||
sum += g;
|
sum += g;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
sum += gains[j + 1];
|
sum += gains[j + 1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
double err = std::abs (gain - sum);
|
double err = std::abs (gain - sum);
|
||||||
if (err < error) {
|
if (err < error)
|
||||||
|
{
|
||||||
error = err;
|
error = err;
|
||||||
gains[i+1] = g;
|
gains[i+1] = g;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (unsigned stage = 1; stage <= gains.size(); stage++) {
|
for (unsigned stage = 1; stage <= gains.size(); stage++)
|
||||||
|
{
|
||||||
int stage_gain = static_cast<int>( gains[stage] * 10 );
|
int stage_gain = static_cast<int>( gains[stage] * 10 );
|
||||||
unsigned param = (stage << 16) | (stage_gain & 0xffff);
|
unsigned param = (stage << 16) | (stage_gain & 0xffff);
|
||||||
boost::system::error_code ec =
|
boost::system::error_code ec = rtl_tcp_command (RTL_TCP_SET_IF_GAIN, param, socket_);
|
||||||
rtl_tcp_command (RTL_TCP_SET_IF_GAIN, param, socket_);
|
if (ec)
|
||||||
if (ec) {
|
{
|
||||||
std::cout << "Failed to set if gain" << std::endl;
|
std::cout << "Failed to set if gain" << std::endl;
|
||||||
LOG (WARNING) << "Failed to set if gain";
|
LOG (WARNING) << "Failed to set if gain";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
rtl_tcp_signal_source_c::handle_read (const boost::system::error_code &ec,
|
|
||||||
|
void rtl_tcp_signal_source_c::handle_read (const boost::system::error_code &ec,
|
||||||
size_t bytes_transferred)
|
size_t bytes_transferred)
|
||||||
{
|
{
|
||||||
if (ec) {
|
if (ec)
|
||||||
|
{
|
||||||
std::cout << "Error during read: " << ec << std::endl;
|
std::cout << "Error during read: " << ec << std::endl;
|
||||||
LOG (WARNING) << "Error during read: " << ec;
|
LOG (WARNING) << "Error during read: " << ec;
|
||||||
boost::mutex::scoped_lock lock (mutex_);
|
boost::mutex::scoped_lock lock (mutex_);
|
||||||
io_service_.stop ();
|
io_service_.stop ();
|
||||||
not_empty_.notify_one ();
|
not_empty_.notify_one ();
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
{
|
{
|
||||||
// Unpack read data
|
// Unpack read data
|
||||||
boost::mutex::scoped_lock lock (mutex_);
|
boost::mutex::scoped_lock lock (mutex_);
|
||||||
@@ -296,8 +334,10 @@ rtl_tcp_signal_source_c::handle_read (const boost::system::error_code &ec,
|
|||||||
boost::bind (&rtl_tcp_signal_source_c::not_full,
|
boost::bind (&rtl_tcp_signal_source_c::not_full,
|
||||||
this));
|
this));
|
||||||
|
|
||||||
for (size_t i = 0; i < bytes_transferred; i++) {
|
for (size_t i = 0; i < bytes_transferred; i++)
|
||||||
while (!not_full( )) {
|
{
|
||||||
|
while (!not_full( ))
|
||||||
|
{
|
||||||
// uh-oh, buffer overflow
|
// uh-oh, buffer overflow
|
||||||
// wait until there's space for more
|
// wait until there's space for more
|
||||||
not_empty_.notify_one (); // needed?
|
not_empty_.notify_one (); // needed?
|
||||||
|
@@ -117,7 +117,6 @@ private:
|
|||||||
inline bool not_empty ( ) const {
|
inline bool not_empty ( ) const {
|
||||||
return unread_ > 0 || io_service_.stopped ();
|
return unread_ > 0 || io_service_.stopped ();
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H
|
#endif //GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H
|
||||||
|
@@ -43,15 +43,18 @@ unpack_byte_2bit_samples_sptr make_unpack_byte_2bit_samples()
|
|||||||
return unpack_byte_2bit_samples_sptr(new unpack_byte_2bit_samples());
|
return unpack_byte_2bit_samples_sptr(new unpack_byte_2bit_samples());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unpack_byte_2bit_samples::unpack_byte_2bit_samples() : sync_interpolator("unpack_byte_2bit_samples",
|
unpack_byte_2bit_samples::unpack_byte_2bit_samples() : sync_interpolator("unpack_byte_2bit_samples",
|
||||||
gr::io_signature::make(1, 1, sizeof(signed char)),
|
gr::io_signature::make(1, 1, sizeof(signed char)),
|
||||||
gr::io_signature::make(1, 1, sizeof(float)),
|
gr::io_signature::make(1, 1, sizeof(float)),
|
||||||
4)
|
4)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
unpack_byte_2bit_samples::~unpack_byte_2bit_samples()
|
unpack_byte_2bit_samples::~unpack_byte_2bit_samples()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
int unpack_byte_2bit_samples::work(int noutput_items,
|
int unpack_byte_2bit_samples::work(int noutput_items,
|
||||||
gr_vector_const_void_star &input_items,
|
gr_vector_const_void_star &input_items,
|
||||||
gr_vector_void_star &output_items)
|
gr_vector_void_star &output_items)
|
||||||
|
@@ -39,15 +39,18 @@ unpack_intspir_1bit_samples_sptr make_unpack_intspir_1bit_samples()
|
|||||||
return unpack_intspir_1bit_samples_sptr(new unpack_intspir_1bit_samples());
|
return unpack_intspir_1bit_samples_sptr(new unpack_intspir_1bit_samples());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unpack_intspir_1bit_samples::unpack_intspir_1bit_samples() : sync_interpolator("unpack_intspir_1bit_samples",
|
unpack_intspir_1bit_samples::unpack_intspir_1bit_samples() : sync_interpolator("unpack_intspir_1bit_samples",
|
||||||
gr::io_signature::make(1, 1, sizeof(int)),
|
gr::io_signature::make(1, 1, sizeof(int)),
|
||||||
gr::io_signature::make(1, 1, sizeof(float)),
|
gr::io_signature::make(1, 1, sizeof(float)),
|
||||||
2)
|
2)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
unpack_intspir_1bit_samples::~unpack_intspir_1bit_samples()
|
unpack_intspir_1bit_samples::~unpack_intspir_1bit_samples()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
int unpack_intspir_1bit_samples::work(int noutput_items,
|
int unpack_intspir_1bit_samples::work(int noutput_items,
|
||||||
gr_vector_const_void_star &input_items,
|
gr_vector_const_void_star &input_items,
|
||||||
gr_vector_void_star &output_items)
|
gr_vector_void_star &output_items)
|
||||||
|
@@ -176,8 +176,6 @@ galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
galileo_e1b_telemetry_decoder_cc::~galileo_e1b_telemetry_decoder_cc()
|
galileo_e1b_telemetry_decoder_cc::~galileo_e1b_telemetry_decoder_cc()
|
||||||
{
|
{
|
||||||
delete d_preambles_symbols;
|
delete d_preambles_symbols;
|
||||||
@@ -185,8 +183,6 @@ galileo_e1b_telemetry_decoder_cc::~galileo_e1b_telemetry_decoder_cc()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols,int frame_length)
|
void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols,int frame_length)
|
||||||
{
|
{
|
||||||
double page_part_symbols_deint[frame_length];
|
double page_part_symbols_deint[frame_length];
|
||||||
@@ -439,7 +435,6 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut
|
|||||||
//this page has no timing information
|
//this page has no timing information
|
||||||
d_TOW_at_Preamble = d_TOW_at_Preamble + GALILEO_INAV_PAGE_SECONDS;
|
d_TOW_at_Preamble = d_TOW_at_Preamble + GALILEO_INAV_PAGE_SECONDS;
|
||||||
d_TOW_at_current_symbol = d_TOW_at_current_symbol + GALILEO_E1_CODE_PERIOD;// + GALILEO_INAV_PAGE_PART_SYMBOLS*GALILEO_E1_CODE_PERIOD;
|
d_TOW_at_current_symbol = d_TOW_at_current_symbol + GALILEO_E1_CODE_PERIOD;// + GALILEO_INAV_PAGE_PART_SYMBOLS*GALILEO_E1_CODE_PERIOD;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else //if there is not a new preamble, we define the TOW of the current symbol
|
else //if there is not a new preamble, we define the TOW of the current symbol
|
||||||
@@ -512,6 +507,7 @@ void galileo_e1b_telemetry_decoder_cc::set_decimation(int decimation)
|
|||||||
d_decimation_output_factor = decimation;
|
d_decimation_output_factor = decimation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void galileo_e1b_telemetry_decoder_cc::set_satellite(Gnss_Satellite satellite)
|
void galileo_e1b_telemetry_decoder_cc::set_satellite(Gnss_Satellite satellite)
|
||||||
{
|
{
|
||||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||||
|
@@ -130,7 +130,6 @@ private:
|
|||||||
|
|
||||||
std::string d_dump_filename;
|
std::string d_dump_filename;
|
||||||
std::ofstream d_dump_file;
|
std::ofstream d_dump_file;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -128,7 +128,7 @@ int gps_l2_m_telemetry_decoder_cc::general_work (int noutput_items __attribute__
|
|||||||
{
|
{
|
||||||
if (in[0].Flag_valid_symbol_output == false) // check if the tracking is locked
|
if (in[0].Flag_valid_symbol_output == false) // check if the tracking is locked
|
||||||
{
|
{
|
||||||
LOG(INFO)<< "Discarting channel "<<d_channel<<" tracking not ready!"<<std::endl;
|
LOG(INFO) << "Discarting channel " << d_channel << " tracking not ready!" << std::endl;
|
||||||
d_flag_valid_word = false;
|
d_flag_valid_word = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -100,7 +100,8 @@ GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking(
|
|||||||
extend_correlation_ms,
|
extend_correlation_ms,
|
||||||
early_late_space_chips);
|
early_late_space_chips);
|
||||||
DLOG(INFO) << "tracking(" << tracking_cc->unique_id() << ")";
|
DLOG(INFO) << "tracking(" << tracking_cc->unique_id() << ")";
|
||||||
}else if(item_type_.compare("cshort") == 0)
|
}
|
||||||
|
else if(item_type_.compare("cshort") == 0)
|
||||||
{
|
{
|
||||||
item_size_ = sizeof(lv_16sc_t);
|
item_size_ = sizeof(lv_16sc_t);
|
||||||
tracking_sc = gps_l1_ca_dll_pll_c_aid_make_tracking_sc(
|
tracking_sc = gps_l1_ca_dll_pll_c_aid_make_tracking_sc(
|
||||||
@@ -116,7 +117,8 @@ GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking(
|
|||||||
dll_bw_narrow_hz,
|
dll_bw_narrow_hz,
|
||||||
early_late_space_chips);
|
early_late_space_chips);
|
||||||
DLOG(INFO) << "tracking(" << tracking_sc->unique_id() << ")";
|
DLOG(INFO) << "tracking(" << tracking_sc->unique_id() << ")";
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
item_size_ = sizeof(gr_complex);
|
item_size_ = sizeof(gr_complex);
|
||||||
LOG(WARNING) << item_type_ << " unknown tracking item type.";
|
LOG(WARNING) << item_type_ << " unknown tracking item type.";
|
||||||
|
@@ -324,7 +324,7 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::acquire_secondary()
|
|||||||
int sec_code_signed[Galileo_E5a_Q_SECONDARY_CODE_LENGTH];
|
int sec_code_signed[Galileo_E5a_Q_SECONDARY_CODE_LENGTH];
|
||||||
for (unsigned int i = 0; i < Galileo_E5a_Q_SECONDARY_CODE_LENGTH; i++)
|
for (unsigned int i = 0; i < Galileo_E5a_Q_SECONDARY_CODE_LENGTH; i++)
|
||||||
{
|
{
|
||||||
if (Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN-1].at(i) == '0')
|
if (Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1].at(i) == '0')
|
||||||
{
|
{
|
||||||
sec_code_signed[i] = 1;
|
sec_code_signed[i] = 1;
|
||||||
}
|
}
|
||||||
@@ -355,7 +355,7 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::acquire_secondary()
|
|||||||
for (unsigned int j = 0; j < CN0_ESTIMATION_SAMPLES; j++)
|
for (unsigned int j = 0; j < CN0_ESTIMATION_SAMPLES; j++)
|
||||||
{
|
{
|
||||||
//reverse replica sign since i*i=-1 (conjugated complex)
|
//reverse replica sign since i*i=-1 (conjugated complex)
|
||||||
out_corr += in_corr[j] * -sec_code_signed[(j+i) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH];
|
out_corr += in_corr[j] * -sec_code_signed[(j + i) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH];
|
||||||
}
|
}
|
||||||
if (abs(out_corr) > current_best_)
|
if (abs(out_corr) > current_best_)
|
||||||
{
|
{
|
||||||
|
@@ -310,7 +310,6 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu
|
|||||||
double old_d_rem_code_phase_samples;
|
double old_d_rem_code_phase_samples;
|
||||||
if (d_enable_tracking == true)
|
if (d_enable_tracking == true)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Fill the acquisition data
|
// Fill the acquisition data
|
||||||
current_synchro_data = *d_acquisition_gnss_synchro;
|
current_synchro_data = *d_acquisition_gnss_synchro;
|
||||||
// Receiver signal alignment
|
// Receiver signal alignment
|
||||||
@@ -388,7 +387,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu
|
|||||||
d_rem_code_phase_samples = K_blk_samples - static_cast<double>(d_correlation_length_samples); //rounding error < 1 sample
|
d_rem_code_phase_samples = K_blk_samples - static_cast<double>(d_correlation_length_samples); //rounding error < 1 sample
|
||||||
|
|
||||||
// UPDATE REMNANT CARRIER PHASE
|
// UPDATE REMNANT CARRIER PHASE
|
||||||
CORRECTED_INTEGRATION_TIME_S=(static_cast<double>(d_correlation_length_samples)/static_cast<double>(d_fs_in));
|
CORRECTED_INTEGRATION_TIME_S = (static_cast<double>(d_correlation_length_samples)/static_cast<double>(d_fs_in));
|
||||||
//remnant carrier phase [rad]
|
//remnant carrier phase [rad]
|
||||||
d_rem_carrier_phase_rad = fmod(d_rem_carrier_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * CORRECTED_INTEGRATION_TIME_S, GPS_TWO_PI);
|
d_rem_carrier_phase_rad = fmod(d_rem_carrier_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * CORRECTED_INTEGRATION_TIME_S, GPS_TWO_PI);
|
||||||
// UPDATE CARRIER PHASE ACCUULATOR
|
// UPDATE CARRIER PHASE ACCUULATOR
|
||||||
|
@@ -61,8 +61,7 @@ cpu_multicorrelator::~cpu_multicorrelator()
|
|||||||
|
|
||||||
bool cpu_multicorrelator::init(
|
bool cpu_multicorrelator::init(
|
||||||
int max_signal_length_samples,
|
int max_signal_length_samples,
|
||||||
int n_correlators
|
int n_correlators)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
// ALLOCATE MEMORY FOR INTERNAL vectors
|
// ALLOCATE MEMORY FOR INTERNAL vectors
|
||||||
size_t size = max_signal_length_samples * sizeof(std::complex<float>);
|
size_t size = max_signal_length_samples * sizeof(std::complex<float>);
|
||||||
@@ -81,10 +80,8 @@ bool cpu_multicorrelator::init(
|
|||||||
bool cpu_multicorrelator::set_local_code_and_taps(
|
bool cpu_multicorrelator::set_local_code_and_taps(
|
||||||
int code_length_chips,
|
int code_length_chips,
|
||||||
const std::complex<float>* local_code_in,
|
const std::complex<float>* local_code_in,
|
||||||
float *shifts_chips
|
float *shifts_chips)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
d_local_code_in = local_code_in;
|
d_local_code_in = local_code_in;
|
||||||
d_shifts_chips = shifts_chips;
|
d_shifts_chips = shifts_chips;
|
||||||
d_code_length_chips = code_length_chips;
|
d_code_length_chips = code_length_chips;
|
||||||
@@ -111,7 +108,6 @@ void cpu_multicorrelator::update_local_code(int correlator_length_samples, float
|
|||||||
d_code_length_chips,
|
d_code_length_chips,
|
||||||
d_n_correlators,
|
d_n_correlators,
|
||||||
correlator_length_samples);
|
correlator_length_samples);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -40,12 +40,10 @@ tcp_communication::tcp_communication() : tcp_socket_(io_service_)
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tcp_communication::~tcp_communication()
|
tcp_communication::~tcp_communication()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int tcp_communication::listen_tcp_connection(size_t d_port_, size_t d_port_ch0_)
|
int tcp_communication::listen_tcp_connection(size_t d_port_, size_t d_port_ch0_)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -78,7 +76,6 @@ int tcp_communication::listen_tcp_connection(size_t d_port_, size_t d_port_ch0_)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void tcp_communication::send_receive_tcp_packet_galileo_e1(boost::array<float, NUM_TX_VARIABLES_GALILEO_E1> buf, tcp_packet_data *tcp_data_)
|
void tcp_communication::send_receive_tcp_packet_galileo_e1(boost::array<float, NUM_TX_VARIABLES_GALILEO_E1> buf, tcp_packet_data *tcp_data_)
|
||||||
{
|
{
|
||||||
int controlc = 0;
|
int controlc = 0;
|
||||||
@@ -113,6 +110,7 @@ void tcp_communication::send_receive_tcp_packet_galileo_e1(boost::array<float, N
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void tcp_communication::send_receive_tcp_packet_gps_l1_ca(boost::array<float, NUM_TX_VARIABLES_GPS_L1_CA> buf, tcp_packet_data *tcp_data_)
|
void tcp_communication::send_receive_tcp_packet_gps_l1_ca(boost::array<float, NUM_TX_VARIABLES_GPS_L1_CA> buf, tcp_packet_data *tcp_data_)
|
||||||
{
|
{
|
||||||
int controlc = 0;
|
int controlc = 0;
|
||||||
@@ -147,6 +145,7 @@ void tcp_communication::send_receive_tcp_packet_gps_l1_ca(boost::array<float, NU
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void tcp_communication::close_tcp_connection(size_t d_port_)
|
void tcp_communication::close_tcp_connection(size_t d_port_)
|
||||||
{
|
{
|
||||||
// Close the TCP connection
|
// Close the TCP connection
|
||||||
|
@@ -39,8 +39,8 @@ void Tracking_FLL_PLL_filter::set_params(float fll_bw_hz, float pll_bw_hz, int o
|
|||||||
/*
|
/*
|
||||||
* Filter design (Kaplan 2nd ed., Pag. 181 Fig. 181)
|
* Filter design (Kaplan 2nd ed., Pag. 181 Fig. 181)
|
||||||
*/
|
*/
|
||||||
d_order=order;
|
d_order = order;
|
||||||
if (d_order==3)
|
if (d_order == 3)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* 3rd order PLL with 2nd order FLL assist
|
* 3rd order PLL with 2nd order FLL assist
|
||||||
@@ -73,7 +73,7 @@ void Tracking_FLL_PLL_filter::set_params(float fll_bw_hz, float pll_bw_hz, int o
|
|||||||
|
|
||||||
void Tracking_FLL_PLL_filter::initialize(float d_acq_carrier_doppler_hz)
|
void Tracking_FLL_PLL_filter::initialize(float d_acq_carrier_doppler_hz)
|
||||||
{
|
{
|
||||||
if (d_order==3)
|
if (d_order == 3)
|
||||||
{
|
{
|
||||||
d_pll_x = 2.0 * d_acq_carrier_doppler_hz;
|
d_pll_x = 2.0 * d_acq_carrier_doppler_hz;
|
||||||
d_pll_w = 0;
|
d_pll_w = 0;
|
||||||
@@ -92,7 +92,7 @@ void Tracking_FLL_PLL_filter::initialize(float d_acq_carrier_doppler_hz)
|
|||||||
float Tracking_FLL_PLL_filter::get_carrier_error(float FLL_discriminator, float PLL_discriminator, float correlation_time_s)
|
float Tracking_FLL_PLL_filter::get_carrier_error(float FLL_discriminator, float PLL_discriminator, float correlation_time_s)
|
||||||
{
|
{
|
||||||
float carrier_error_hz;
|
float carrier_error_hz;
|
||||||
if (d_order==3)
|
if (d_order == 3)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* 3rd order PLL with 2nd order FLL assist
|
* 3rd order PLL with 2nd order FLL assist
|
||||||
@@ -122,7 +122,6 @@ float Tracking_FLL_PLL_filter::get_carrier_error(float FLL_discriminator, float
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Tracking_FLL_PLL_filter::Tracking_FLL_PLL_filter ()
|
Tracking_FLL_PLL_filter::Tracking_FLL_PLL_filter ()
|
||||||
{
|
{
|
||||||
d_order = 0;
|
d_order = 0;
|
||||||
@@ -138,6 +137,7 @@ Tracking_FLL_PLL_filter::Tracking_FLL_PLL_filter ()
|
|||||||
d_pll_w0p = 0;
|
d_pll_w0p = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Tracking_FLL_PLL_filter::~Tracking_FLL_PLL_filter ()
|
Tracking_FLL_PLL_filter::~Tracking_FLL_PLL_filter ()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@@ -186,6 +186,7 @@ int gnss_sdr_supl_client::get_assistance(int i_mcc, int i_mns, int i_lac, int i_
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void gnss_sdr_supl_client::read_supl_data()
|
void gnss_sdr_supl_client::read_supl_data()
|
||||||
{
|
{
|
||||||
// READ REFERENCE LOCATION
|
// READ REFERENCE LOCATION
|
||||||
|
@@ -322,7 +322,7 @@ void GNSSFlowgraph::connect()
|
|||||||
for (unsigned int i = 0; i < channels_count_; i++)
|
for (unsigned int i = 0; i < channels_count_; i++)
|
||||||
{
|
{
|
||||||
top_block_->connect(observables_->get_right_block(), i, pvt_->get_left_block(), i);
|
top_block_->connect(observables_->get_right_block(), i, pvt_->get_left_block(), i);
|
||||||
top_block_->msg_connect(channels_.at(i)->get_right_block(),pmt::mp("telemetry"),pvt_->get_left_block(),pmt::mp("telemetry"));
|
top_block_->msg_connect(channels_.at(i)->get_right_block(), pmt::mp("telemetry"), pvt_->get_left_block(), pmt::mp("telemetry"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
|
@@ -121,7 +121,7 @@ double Galileo_Ephemeris::Galileo_System_Time(double WN, double TOW)
|
|||||||
double t = 0;
|
double t = 0;
|
||||||
double sec_in_day = 86400;
|
double sec_in_day = 86400;
|
||||||
double day_in_week = 7;
|
double day_in_week = 7;
|
||||||
t = WN*sec_in_day*day_in_week + TOW; // second from the origin of the Galileo time
|
t = WN * sec_in_day * day_in_week + TOW; // second from the origin of the Galileo time
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -178,6 +178,7 @@ Galileo_Fnav_Message::Galileo_Fnav_Message()
|
|||||||
{
|
{
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
//int Galileo_Fnav_Message::toInt(std::string bitString)
|
//int Galileo_Fnav_Message::toInt(std::string bitString)
|
||||||
//{
|
//{
|
||||||
// int tempInt;
|
// int tempInt;
|
||||||
@@ -190,6 +191,7 @@ Galileo_Fnav_Message::Galileo_Fnav_Message()
|
|||||||
//
|
//
|
||||||
// return num;
|
// return num;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
void Galileo_Fnav_Message::split_page(std::string page_string)
|
void Galileo_Fnav_Message::split_page(std::string page_string)
|
||||||
{
|
{
|
||||||
std::string message_word = page_string.substr(0, 214);
|
std::string message_word = page_string.substr(0, 214);
|
||||||
@@ -208,6 +210,7 @@ void Galileo_Fnav_Message::split_page(std::string page_string)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Galileo_Fnav_Message::_CRC_test(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, boost::uint32_t checksum)
|
bool Galileo_Fnav_Message::_CRC_test(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, boost::uint32_t checksum)
|
||||||
{
|
{
|
||||||
CRC_Galileo_FNAV_type CRC_Galileo;
|
CRC_Galileo_FNAV_type CRC_Galileo;
|
||||||
@@ -237,6 +240,8 @@ bool Galileo_Fnav_Message::_CRC_test(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> b
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Galileo_Fnav_Message::decode_page(std::string data)
|
void Galileo_Fnav_Message::decode_page(std::string data)
|
||||||
{
|
{
|
||||||
std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> data_bits(data);
|
std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> data_bits(data);
|
||||||
@@ -442,9 +447,9 @@ void Galileo_Fnav_Message::decode_page(std::string data)
|
|||||||
flag_almanac_2 = true;
|
flag_almanac_2 = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned long int Galileo_Fnav_Message::read_navigation_unsigned(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int,int>> parameter)
|
unsigned long int Galileo_Fnav_Message::read_navigation_unsigned(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int,int>> parameter)
|
||||||
{
|
{
|
||||||
unsigned long int value = 0;
|
unsigned long int value = 0;
|
||||||
@@ -601,10 +606,10 @@ Galileo_Ephemeris Galileo_Fnav_Message::get_ephemeris()
|
|||||||
ephemeris.SV_ID_PRN_4 = FNAV_SV_ID_PRN_1;
|
ephemeris.SV_ID_PRN_4 = FNAV_SV_ID_PRN_1;
|
||||||
ephemeris.i_satellite_PRN = FNAV_SV_ID_PRN_1;
|
ephemeris.i_satellite_PRN = FNAV_SV_ID_PRN_1;
|
||||||
ephemeris.M0_1 = FNAV_M0_2; // Mean anomaly at reference time [semi-circles]
|
ephemeris.M0_1 = FNAV_M0_2; // Mean anomaly at reference time [semi-circles]
|
||||||
ephemeris.delta_n_3 = FNAV_deltan_3;// Mean motion difference from computed value [semi-circles/sec]
|
ephemeris.delta_n_3 = FNAV_deltan_3; // Mean motion difference from computed value [semi-circles/sec]
|
||||||
ephemeris.e_1 = FNAV_e_2; // Eccentricity
|
ephemeris.e_1 = FNAV_e_2; // Eccentricity
|
||||||
ephemeris.A_1 = FNAV_a12_2; // Square root of the semi-major axis [metres^1/2]
|
ephemeris.A_1 = FNAV_a12_2; // Square root of the semi-major axis [metres^1/2]
|
||||||
ephemeris.OMEGA_0_2 = FNAV_omega0_2;// Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
|
ephemeris.OMEGA_0_2 = FNAV_omega0_2; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
|
||||||
ephemeris.i_0_2 = FNAV_i0_3; // Inclination angle at reference time [semi-circles]
|
ephemeris.i_0_2 = FNAV_i0_3; // Inclination angle at reference time [semi-circles]
|
||||||
ephemeris.omega_2 = FNAV_w_3; // Argument of perigee [semi-circles]
|
ephemeris.omega_2 = FNAV_w_3; // Argument of perigee [semi-circles]
|
||||||
ephemeris.OMEGA_dot_3 = FNAV_omegadot_2; // Rate of right ascension [semi-circles/sec]
|
ephemeris.OMEGA_dot_3 = FNAV_omegadot_2; // Rate of right ascension [semi-circles/sec]
|
||||||
|
Reference in New Issue
Block a user