mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-15 04:30:33 +00:00
Miscelaneous code improvements
This commit is contained in:
parent
bdb912e9da
commit
7261bec2ad
@ -338,7 +338,7 @@ gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisition::get_left_block()
|
||||
{
|
||||
return acquisition_;
|
||||
}
|
||||
else if (item_type_ == "cbyte")
|
||||
if (item_type_ == "cbyte")
|
||||
{
|
||||
return cbyte_to_float_x2_;
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ gr::basic_block_sptr GlonassL1CaPcpsAcquisition::get_left_block()
|
||||
{
|
||||
return acquisition_;
|
||||
}
|
||||
else if (item_type_ == "cbyte")
|
||||
if (item_type_ == "cbyte")
|
||||
{
|
||||
return cbyte_to_float_x2_;
|
||||
}
|
||||
|
@ -322,7 +322,7 @@ gr::basic_block_sptr GlonassL2CaPcpsAcquisition::get_left_block()
|
||||
{
|
||||
return acquisition_;
|
||||
}
|
||||
else if (item_type_ == "cbyte")
|
||||
if (item_type_ == "cbyte")
|
||||
{
|
||||
return cbyte_to_float_x2_;
|
||||
}
|
||||
|
@ -311,7 +311,7 @@ gr::basic_block_sptr GpsL1CaPcpsAcquisition::get_left_block()
|
||||
{
|
||||
return acquisition_;
|
||||
}
|
||||
else if (item_type_ == "cbyte")
|
||||
if (item_type_ == "cbyte")
|
||||
{
|
||||
return cbyte_to_float_x2_;
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ gr::basic_block_sptr GpsL2MPcpsAcquisition::get_left_block()
|
||||
{
|
||||
return acquisition_;
|
||||
}
|
||||
else if (item_type_ == "cbyte")
|
||||
if (item_type_ == "cbyte")
|
||||
{
|
||||
return cbyte_to_float_x2_;
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ gr::basic_block_sptr GpsL5iPcpsAcquisition::get_left_block()
|
||||
{
|
||||
return acquisition_;
|
||||
}
|
||||
else if (item_type_ == "cbyte")
|
||||
if (item_type_ == "cbyte")
|
||||
{
|
||||
return cbyte_to_float_x2_;
|
||||
}
|
||||
|
@ -274,10 +274,7 @@ bool pcps_acquisition::is_fdma()
|
||||
LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_old_freq << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -287,7 +287,7 @@ gr::basic_block_sptr FirFilter::get_left_block()
|
||||
{
|
||||
return cshort_to_float_x2_;
|
||||
}
|
||||
else if ((taps_item_type_ == "float") && (input_item_type_ == "cbyte") && (output_item_type_ == "gr_complex"))
|
||||
if ((taps_item_type_ == "float") && (input_item_type_ == "cbyte") && (output_item_type_ == "gr_complex"))
|
||||
{
|
||||
return cbyte_to_float_x2_;
|
||||
}
|
||||
@ -317,7 +317,7 @@ gr::basic_block_sptr FirFilter::get_right_block()
|
||||
{
|
||||
return short_x2_to_cshort_;
|
||||
}
|
||||
else if ((taps_item_type_ == "float") && (input_item_type_ == "cbyte") && (output_item_type_ == "gr_complex"))
|
||||
if ((taps_item_type_ == "float") && (input_item_type_ == "cbyte") && (output_item_type_ == "gr_complex"))
|
||||
{
|
||||
return float_to_complex_;
|
||||
}
|
||||
|
@ -327,7 +327,7 @@ gr::basic_block_sptr FreqXlatingFirFilter::get_left_block()
|
||||
{
|
||||
return freq_xlating_fir_filter_fcf_;
|
||||
}
|
||||
else if ((taps_item_type_ == "float") && (input_item_type_ == "short") && (output_item_type_ == "gr_complex"))
|
||||
if ((taps_item_type_ == "float") && (input_item_type_ == "short") && (output_item_type_ == "gr_complex"))
|
||||
{
|
||||
return freq_xlating_fir_filter_scf_;
|
||||
}
|
||||
@ -361,7 +361,7 @@ gr::basic_block_sptr FreqXlatingFirFilter::get_right_block()
|
||||
{
|
||||
return freq_xlating_fir_filter_fcf_;
|
||||
}
|
||||
else if ((taps_item_type_ == "float") && (input_item_type_ == "short") && (output_item_type_ == "gr_complex"))
|
||||
if ((taps_item_type_ == "float") && (input_item_type_ == "short") && (output_item_type_ == "gr_complex"))
|
||||
{
|
||||
return freq_xlating_fir_filter_scf_;
|
||||
}
|
||||
|
@ -160,11 +160,8 @@ gr::basic_block_sptr PulseBlankingFilter::get_left_block()
|
||||
}
|
||||
return pulse_blanking_cc_;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << " Unknown input filter input/output item type conversion";
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -69,7 +69,7 @@ DEFINE_double(pll_bw_hz, 0.0, "If defined, bandwidth of the PLL low pass filter,
|
||||
|
||||
static bool ValidateC(const char* flagname, const std::string& value)
|
||||
{
|
||||
if (boost::filesystem::exists(value) or value.compare("-") == 0) // value is ok
|
||||
if (boost::filesystem::exists(value) or value == "-") // value is ok
|
||||
return true;
|
||||
std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist." << std::endl;
|
||||
std::cout << "GNSS-SDR program ended." << std::endl;
|
||||
@ -78,7 +78,7 @@ static bool ValidateC(const char* flagname, const std::string& value)
|
||||
|
||||
static bool ValidateConfigFile(const char* flagname, const std::string& value)
|
||||
{
|
||||
if (boost::filesystem::exists(value) or value.compare(std::string(GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/default.conf")) == 0) // value is ok
|
||||
if (boost::filesystem::exists(value) or value == std::string(GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/default.conf")) // value is ok
|
||||
return true;
|
||||
std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist." << std::endl;
|
||||
std::cout << "GNSS-SDR program ended." << std::endl;
|
||||
@ -87,7 +87,7 @@ static bool ValidateConfigFile(const char* flagname, const std::string& value)
|
||||
|
||||
static bool ValidateS(const char* flagname, const std::string& value)
|
||||
{
|
||||
if (boost::filesystem::exists(value) or value.compare("-") == 0) // value is ok
|
||||
if (boost::filesystem::exists(value) or value == "-") // value is ok
|
||||
return true;
|
||||
std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist." << std::endl;
|
||||
std::cout << "GNSS-SDR program ended." << std::endl;
|
||||
@ -96,7 +96,7 @@ static bool ValidateS(const char* flagname, const std::string& value)
|
||||
|
||||
static bool ValidateSignalSource(const char* flagname, const std::string& value)
|
||||
{
|
||||
if (boost::filesystem::exists(value) or value.compare("-") == 0) // value is ok
|
||||
if (boost::filesystem::exists(value) or value == "-") // value is ok
|
||||
return true;
|
||||
std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist." << std::endl;
|
||||
std::cout << "GNSS-SDR program ended." << std::endl;
|
||||
|
@ -153,7 +153,7 @@ gr::basic_block_sptr Pass_Through::get_left_block()
|
||||
{
|
||||
return conjugate_sc_;
|
||||
}
|
||||
else if (item_type_ == "cbyte")
|
||||
if (item_type_ == "cbyte")
|
||||
{
|
||||
return conjugate_ic_;
|
||||
}
|
||||
@ -180,7 +180,7 @@ gr::basic_block_sptr Pass_Through::get_right_block()
|
||||
{
|
||||
return conjugate_sc_;
|
||||
}
|
||||
else if (item_type_ == "cbyte")
|
||||
if (item_type_ == "cbyte")
|
||||
{
|
||||
return conjugate_ic_;
|
||||
}
|
||||
|
@ -411,18 +411,11 @@ bool hybrid_observables_cc::interp_trk_obs(Gnss_Synchro &interpolated_obs, const
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// std::cout << "ALERT: Channel " << ch << " interp buff idx " << nearest_element
|
||||
// << " ,diff: " << old_abs_diff << " samples (" << static_cast<double>(old_abs_diff) / static_cast<double>(d_gnss_synchro_history->at(ch, nearest_element).fs) << " s)\n";
|
||||
// usleep(1000);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -224,11 +224,8 @@ gr::basic_block_sptr GlonassL1CaDllPllCAidTracking::get_left_block()
|
||||
{
|
||||
return tracking_sc;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << item_type_ << " unknown tracking item type";
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -242,9 +239,8 @@ gr::basic_block_sptr GlonassL1CaDllPllCAidTracking::get_right_block()
|
||||
{
|
||||
return tracking_sc;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
LOG(WARNING) << item_type_ << " unknown tracking item type";
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -222,11 +222,8 @@ gr::basic_block_sptr GlonassL2CaDllPllCAidTracking::get_left_block()
|
||||
{
|
||||
return tracking_sc;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << item_type_ << " unknown tracking item type";
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -240,9 +237,6 @@ gr::basic_block_sptr GlonassL2CaDllPllCAidTracking::get_right_block()
|
||||
{
|
||||
return tracking_sc;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << item_type_ << " unknown tracking item type";
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -218,11 +218,8 @@ gr::basic_block_sptr GpsL1CaDllPllCAidTracking::get_left_block()
|
||||
{
|
||||
return tracking_sc;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << item_type_ << " unknown tracking item type";
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
gr::basic_block_sptr GpsL1CaDllPllCAidTracking::get_right_block()
|
||||
@ -235,9 +232,6 @@ gr::basic_block_sptr GpsL1CaDllPllCAidTracking::get_right_block()
|
||||
{
|
||||
return tracking_sc;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << item_type_ << " unknown tracking item type";
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -496,12 +496,8 @@ bool Galileo_Fnav_Message::have_new_ephemeris() // Check if we have a new ephem
|
||||
std::cout << "Batch number: " << IOD_ephemeris << std::endl;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -439,11 +439,7 @@ bool Galileo_Navigation_Message::have_new_ephemeris() // Check if we have a new
|
||||
std::cout << "Batch number: " << IOD_ephemeris << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -204,11 +204,9 @@ bool Glonass_Gnav_Navigation_Message::CRC_test(std::bitset<GLONASS_GNAV_STRING_B
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
||||
// All other conditions are assumed errors. TODO: Add correction for case B
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -337,12 +337,8 @@ bool Gps_CNAV_Navigation_Message::have_new_ephemeris() // Check if we have a ne
|
||||
b_flag_ephemeris_2 = false; // clear the flag
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -255,11 +255,8 @@ bool FrontEndCal::get_ephemeris()
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Trying to read ephemeris from SUPL server..." << std::endl;
|
||||
|
Loading…
Reference in New Issue
Block a user