Reduce number of warnings raised by bugprone-* clang-tidy checks

This commit is contained in:
Carles Fernandez 2020-07-10 00:37:55 +02:00
parent a597478b24
commit c04948fd02
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
135 changed files with 981 additions and 1533 deletions

View File

@ -48,10 +48,10 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration,
{ {
Pvt_Conf pvt_output_parameters = Pvt_Conf(); Pvt_Conf pvt_output_parameters = Pvt_Conf();
// dump parameters // dump parameters
std::string default_dump_filename = "./pvt.dat"; const std::string default_dump_filename("./pvt.dat");
std::string default_nmea_dump_filename = "./nmea_pvt.nmea"; const std::string default_nmea_dump_filename("./nmea_pvt.nmea");
std::string default_nmea_dump_devname = "/dev/tty1"; const std::string default_nmea_dump_devname("/dev/tty1");
std::string default_rtcm_dump_devname = "/dev/pts/1"; const std::string default_rtcm_dump_devname("/dev/pts/1");
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
pvt_output_parameters.dump = configuration->property(role + ".dump", false); pvt_output_parameters.dump = configuration->property(role + ".dump", false);
pvt_output_parameters.dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); pvt_output_parameters.dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
@ -73,27 +73,11 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration,
// RINEX version // RINEX version
pvt_output_parameters.rinex_version = configuration->property(role + ".rinex_version", 3); pvt_output_parameters.rinex_version = configuration->property(role + ".rinex_version", 3);
if (FLAGS_RINEX_version == "3.01") if (FLAGS_RINEX_version == "3.01" || FLAGS_RINEX_version == "3.02" || FLAGS_RINEX_version == "3")
{ {
pvt_output_parameters.rinex_version = 3; pvt_output_parameters.rinex_version = 3;
} }
else if (FLAGS_RINEX_version == "3.02") else if (FLAGS_RINEX_version == "2.10" || FLAGS_RINEX_version == "2.11" || FLAGS_RINEX_version == "2")
{
pvt_output_parameters.rinex_version = 3;
}
else if (FLAGS_RINEX_version == "3")
{
pvt_output_parameters.rinex_version = 3;
}
else if (FLAGS_RINEX_version == "2.11")
{
pvt_output_parameters.rinex_version = 2;
}
else if (FLAGS_RINEX_version == "2.10")
{
pvt_output_parameters.rinex_version = 2;
}
else if (FLAGS_RINEX_version == "2")
{ {
pvt_output_parameters.rinex_version = 2; pvt_output_parameters.rinex_version = 2;
} }

View File

@ -1090,17 +1090,11 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
switch (d_type_of_rx) switch (d_type_of_rx)
{ {
case 1: // GPS L1 C/A only case 1: // GPS L1 C/A only
d_rp->log_rinex_nav(d_rp->navFile, new_eph);
break;
case 8: // L1+L5 case 8: // L1+L5
d_rp->log_rinex_nav(d_rp->navFile, new_eph); d_rp->log_rinex_nav(d_rp->navFile, new_eph);
break; break;
case 9: // GPS L1 C/A + Galileo E1B case 9: // GPS L1 C/A + Galileo E1B
d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph);
break;
case 10: // GPS L1 C/A + Galileo E5a case 10: // GPS L1 C/A + Galileo E5a
d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph);
break;
case 11: // GPS L1 C/A + Galileo E5b case 11: // GPS L1 C/A + Galileo E5b
d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph);
break; break;
@ -1125,8 +1119,6 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
} }
break; break;
case 32: // L1+E1+L5+E5a case 32: // L1+E1+L5+E5a
d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph);
break;
case 33: // L1+E1+E5a case 33: // L1+E1+E5a
d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph);
break; break;
@ -1201,11 +1193,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
switch (d_type_of_rx) switch (d_type_of_rx)
{ {
case 2: // GPS L2C only case 2: // GPS L2C only
d_rp->log_rinex_nav(d_rp->navFile, new_cnav_eph);
break;
case 3: // GPS L5 only case 3: // GPS L5 only
d_rp->log_rinex_nav(d_rp->navFile, new_cnav_eph);
break;
case 7: // GPS L1 C/A + GPS L2C case 7: // GPS L1 C/A + GPS L2C
d_rp->log_rinex_nav(d_rp->navFile, new_cnav_eph); d_rp->log_rinex_nav(d_rp->navFile, new_cnav_eph);
break; break;
@ -1213,8 +1201,6 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
d_rp->log_rinex_nav(d_rp->navMixFile, new_cnav_eph, new_gal_eph); d_rp->log_rinex_nav(d_rp->navMixFile, new_cnav_eph, new_gal_eph);
break; break;
case 28: // GPS L2C + GLONASS L1 C/A case 28: // GPS L2C + GLONASS L1 C/A
d_rp->log_rinex_nav(d_rp->navMixFile, new_cnav_eph, new_glo_eph);
break;
case 31: // GPS L2C + GLONASS L2 C/A case 31: // GPS L2C + GLONASS L2 C/A
d_rp->log_rinex_nav(d_rp->navMixFile, new_cnav_eph, new_glo_eph); d_rp->log_rinex_nav(d_rp->navMixFile, new_cnav_eph, new_glo_eph);
break; break;
@ -1303,20 +1289,12 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
switch (d_type_of_rx) switch (d_type_of_rx)
{ {
case 4: // Galileo E1B only case 4: // Galileo E1B only
d_rp->log_rinex_nav(d_rp->navGalFile, new_gal_eph);
break;
case 5: // Galileo E5a only case 5: // Galileo E5a only
d_rp->log_rinex_nav(d_rp->navGalFile, new_gal_eph);
break;
case 6: // Galileo E5b only case 6: // Galileo E5b only
d_rp->log_rinex_nav(d_rp->navGalFile, new_gal_eph); d_rp->log_rinex_nav(d_rp->navGalFile, new_gal_eph);
break; break;
case 9: // GPS L1 C/A + Galileo E1B case 9: // GPS L1 C/A + Galileo E1B
d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph);
break;
case 10: // GPS L1 C/A + Galileo E5a case 10: // GPS L1 C/A + Galileo E5a
d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph);
break;
case 11: // GPS L1 C/A + Galileo E5b case 11: // GPS L1 C/A + Galileo E5b
d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph);
break; break;
@ -1327,17 +1305,11 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
d_rp->log_rinex_nav(d_rp->navGalFile, new_gal_eph); d_rp->log_rinex_nav(d_rp->navGalFile, new_gal_eph);
break; break;
case 27: // Galileo E1B + GLONASS L1 C/A case 27: // Galileo E1B + GLONASS L1 C/A
d_rp->log_rinex_nav(d_rp->navMixFile, new_gal_eph, new_glo_eph);
break;
case 30: // Galileo E1B + GLONASS L2 C/A case 30: // Galileo E1B + GLONASS L2 C/A
d_rp->log_rinex_nav(d_rp->navMixFile, new_gal_eph, new_glo_eph); d_rp->log_rinex_nav(d_rp->navMixFile, new_gal_eph, new_glo_eph);
break; break;
case 32: // L1+E1+L5+E5a case 32: // L1+E1+L5+E5a
d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); case 33: // L1+E1+E5a
break;
case 33: // L1+E1+E5a
d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph);
break;
case 1001: // L1+E1+L2+L5+E5a case 1001: // L1+E1+L2+L5+E5a
d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph);
break; break;
@ -1463,11 +1435,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
switch (d_type_of_rx) switch (d_type_of_rx)
{ {
case 23: // GLONASS L1 C/A case 23: // GLONASS L1 C/A
d_rp->log_rinex_nav(d_rp->navGloFile, new_glo_eph);
break;
case 24: // GLONASS L2 C/A case 24: // GLONASS L2 C/A
d_rp->log_rinex_nav(d_rp->navGloFile, new_glo_eph);
break;
case 25: // GLONASS L1 C/A + GLONASS L2 C/A case 25: // GLONASS L1 C/A + GLONASS L2 C/A
d_rp->log_rinex_nav(d_rp->navGloFile, new_glo_eph); d_rp->log_rinex_nav(d_rp->navGloFile, new_glo_eph);
break; break;
@ -1574,8 +1542,6 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
switch (d_type_of_rx) switch (d_type_of_rx)
{ {
case 500: // BDS B1I only case 500: // BDS B1I only
d_rp->log_rinex_nav(d_rp->navFile, new_bds_eph);
break;
case 600: // BDS B3I only case 600: // BDS B3I only
d_rp->log_rinex_nav(d_rp->navFile, new_bds_eph); d_rp->log_rinex_nav(d_rp->navFile, new_bds_eph);
break; break;
@ -1830,17 +1796,11 @@ void rtklib_pvt_gs::apply_rx_clock_offset(std::map<int, Gnss_Synchro>& observabl
switch (d_mapStringValues[observables_iter->second.Signal]) switch (d_mapStringValues[observables_iter->second.Signal])
{ {
case evGPS_1C: case evGPS_1C:
observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ1 * TWO_PI;
break;
case evGPS_L5:
observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ5 * TWO_PI;
break;
case evSBAS_1C: case evSBAS_1C:
observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ1 * TWO_PI;
break;
case evGAL_1B: case evGAL_1B:
observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ1 * TWO_PI; observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ1 * TWO_PI;
break; break;
case evGPS_L5:
case evGAL_5X: case evGAL_5X:
observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ5 * TWO_PI; observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ5 * TWO_PI;
break; break;
@ -1932,17 +1892,11 @@ void rtklib_pvt_gs::initialize_and_apply_carrier_phase_offset()
switch (d_mapStringValues[observables_iter->second.Signal]) switch (d_mapStringValues[observables_iter->second.Signal])
{ {
case evGPS_1C: case evGPS_1C:
wavelength_m = SPEED_OF_LIGHT_M_S / FREQ1;
break;
case evGPS_L5:
wavelength_m = SPEED_OF_LIGHT_M_S / FREQ5;
break;
case evSBAS_1C: case evSBAS_1C:
wavelength_m = SPEED_OF_LIGHT_M_S / FREQ1;
break;
case evGAL_1B: case evGAL_1B:
wavelength_m = SPEED_OF_LIGHT_M_S / FREQ1; wavelength_m = SPEED_OF_LIGHT_M_S / FREQ1;
break; break;
case evGPS_L5:
case evGAL_5X: case evGAL_5X:
wavelength_m = SPEED_OF_LIGHT_M_S / FREQ5; wavelength_m = SPEED_OF_LIGHT_M_S / FREQ5;
break; break;
@ -2688,35 +2642,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
break; break;
case 503: // BeiDou B1I + GLONASS L1 C/A case 503: // BeiDou B1I + GLONASS L1 C/A
if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend())
{
// d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1");
// d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model);
// d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map);
d_rinex_header_written = true; // do not write header anymore
}
break;
case 504: // BeiDou B1I + GPS L1 C/A + Galileo E1B case 504: // BeiDou B1I + GPS L1 C/A + Galileo E1B
if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend())
{
// d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1");
// d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model);
// d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map);
d_rinex_header_written = true; // do not write header anymore
}
break;
case 505: // BeiDou B1I + GPS L1 C/A + GLONASS L1 C/A + Galileo E1B case 505: // BeiDou B1I + GPS L1 C/A + GLONASS L1 C/A + Galileo E1B
if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend())
{
// d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1");
// d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model);
// d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map);
d_rinex_header_written = true; // do not write header anymore
}
break;
case 506: // BeiDou B1I + Beidou B3I case 506: // BeiDou B1I + Beidou B3I
if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend())
{ {
@ -2738,23 +2665,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
break; break;
case 601: // BeiDou B3I + GPS L2C case 601: // BeiDou B3I + GPS L2C
if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend())
{
d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B3");
// d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model);
d_rinex_header_written = true; // do not write header anymore
}
break;
case 602: // BeiDou B3I + GLONASS L2 C/A case 602: // BeiDou B3I + GLONASS L2 C/A
if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend())
{
d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B3");
// d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model);
d_rinex_header_written = true; // do not write header anymore
}
break;
case 603: // BeiDou B3I + GPS L2C + GLONASS L2 C/A case 603: // BeiDou B3I + GPS L2C + GLONASS L2 C/A
if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend())
{ {
@ -2818,17 +2729,6 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
} }
break; break;
case 2: // GPS L2C only case 2: // GPS L2C only
if (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())
{
d_rp->log_rinex_obs(d_rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map);
}
if (!d_rinex_header_updated and (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0))
{
d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model);
d_rp->update_nav_header(d_rp->navFile, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->gps_cnav_iono);
d_rinex_header_updated = true;
}
break;
case 3: // GPS L5 case 3: // GPS L5
if (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend()) if (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())
{ {

View File

@ -379,15 +379,10 @@ std::string Nmea_Printer::get_UTC_NMEA_time(boost::posix_time::ptime d_position_
std::stringstream sentence_str; std::stringstream sentence_str;
boost::posix_time::time_duration td = d_position_UTC_time.time_of_day(); boost::posix_time::time_duration td = d_position_UTC_time.time_of_day();
int utc_hours; int utc_hours = td.hours();
int utc_mins; int utc_mins = td.minutes();
int utc_seconds; int utc_seconds = td.seconds();
int utc_milliseconds; auto utc_milliseconds = static_cast<int>(td.total_milliseconds() - td.total_seconds() * 1000);
utc_hours = td.hours();
utc_mins = td.minutes();
utc_seconds = td.seconds();
utc_milliseconds = td.total_milliseconds() - td.total_seconds() * 1000;
if (utc_hours < 10) if (utc_hours < 10)
{ {

View File

@ -916,7 +916,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali
{ {
} // Avoid compiler warning } // Avoid compiler warning
// Avoid compiler warning, there is not time system correction between Galileo and GLONASS // Avoid compiler warning, there is not time system correction between Galileo and GLONASS
if (galileo_utc_model.A_0G_10) if (galileo_utc_model.A_0G_10 > 0.0)
{ {
} }
std::string line; std::string line;
@ -1884,7 +1884,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Beidou_Dnav_Iono&
// -------- Line 6 leap seconds // -------- Line 6 leap seconds
// For leap second information, see https://endruntechnologies.com/support/leap-seconds // For leap second information, see https://endruntechnologies.com/support/leap-seconds
line.clear(); line.clear();
line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DeltaT_LS), 6);
line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6);
line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6);
line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6);
@ -2282,7 +2282,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M
// -------- Line 6 leap seconds // -------- Line 6 leap seconds
// For leap second information, see https://endruntechnologies.com/support/leap-seconds // For leap second information, see https://endruntechnologies.com/support/leap-seconds
line.clear(); line.clear();
line += Rinex_Printer::rightJustify(std::to_string(bds_dnav_utc_model.d_DeltaT_LS), 6); line += Rinex_Printer::rightJustify(std::to_string(bds_dnav_utc_model.i_DeltaT_LS), 6);
line += Rinex_Printer::rightJustify(std::to_string(bds_dnav_utc_model.d_DeltaT_LSF), 6); line += Rinex_Printer::rightJustify(std::to_string(bds_dnav_utc_model.d_DeltaT_LSF), 6);
line += Rinex_Printer::rightJustify(std::to_string(bds_dnav_utc_model.i_WN_LSF), 6); line += Rinex_Printer::rightJustify(std::to_string(bds_dnav_utc_model.i_WN_LSF), 6);
line += Rinex_Printer::rightJustify(std::to_string(bds_dnav_utc_model.i_DN), 6); line += Rinex_Printer::rightJustify(std::to_string(bds_dnav_utc_model.i_DN), 6);
@ -3504,7 +3504,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal
{ {
} // Avoid compiler warning } // Avoid compiler warning
// Avoid compiler warning, there is not time system correction between Galileo and GLONASS // Avoid compiler warning, there is not time system correction between Galileo and GLONASS
if (galileo_utc_model.A_0G_10) if (galileo_utc_model.A_0G_10 > 0.0)
{ {
} }
std::vector<std::string> data; std::vector<std::string> data;
@ -3655,7 +3655,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Beidou_Dnav_Utc_M
} }
else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) else if (line_str.find("LEAP SECONDS", 59) != std::string::npos)
{ {
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DeltaT_LS), 6);
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6);
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6);
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6);
@ -4838,7 +4838,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int32_t, Bei
void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephemeris& eph, const double d_TOW_first_observation, const std::string& glonass_bands) void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephemeris& eph, const double d_TOW_first_observation, const std::string& glonass_bands)
{ {
if (eph.d_m) if (eph.d_m > 0.0)
{ {
} // Avoid compiler warning } // Avoid compiler warning
std::string line; std::string line;
@ -5171,7 +5171,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem
void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands) void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands)
{ {
if (glonass_gnav_eph.d_m) if (glonass_gnav_eph.d_m > 0.0)
{ {
} // avoid warning, not needed } // avoid warning, not needed
std::string line; std::string line;
@ -5527,7 +5527,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps
void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands) void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands)
{ {
if (glonass_gnav_eph.d_m) if (glonass_gnav_eph.d_m > 0.0)
{ {
} // avoid warning, not needed } // avoid warning, not needed
std::string line; std::string line;
@ -5847,7 +5847,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris
void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& galileo_bands, const std::string& glonass_bands) void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& galileo_bands, const std::string& glonass_bands)
{ {
if (glonass_gnav_eph.d_m) if (glonass_gnav_eph.d_m > 0.0)
{ {
} // avoid warning, not needed } // avoid warning, not needed
std::string line; std::string line;
@ -6679,7 +6679,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris
void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, const double d_TOW_first_observation, const std::string& gps_bands) void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, const double d_TOW_first_observation, const std::string& gps_bands)
{ {
if (eph_cnav.d_i_0) if (eph_cnav.d_i_0 > 0.0)
{ {
} // avoid warning, not needed } // avoid warning, not needed
std::string line; std::string line;
@ -7890,7 +7890,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris&
void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, const double d_TOW_first_observation, const std::string& galileo_bands) void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, const double d_TOW_first_observation, const std::string& galileo_bands)
{ {
if (galileo_eph.e_1) if (galileo_eph.e_1 > 0.0)
{ {
} // avoid warning, not needed } // avoid warning, not needed
std::string line; std::string line;
@ -8415,7 +8415,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Beidou_Dnav_Epheme
void Rinex_Printer::update_obs_header(std::fstream& out __attribute__((unused)), const Glonass_Gnav_Utc_Model& utc_model) void Rinex_Printer::update_obs_header(std::fstream& out __attribute__((unused)), const Glonass_Gnav_Utc_Model& utc_model)
{ {
if (utc_model.d_N_4) if (utc_model.d_N_4 > 0.0)
{ {
// do nothing // do nothing
} }
@ -8644,7 +8644,7 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Beidou_Dnav_Utc_M
if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos) if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos)
{ {
data.push_back(line_str); data.push_back(line_str);
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DeltaT_LS), 6);
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6);
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6);
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6);
@ -8940,7 +8940,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables) void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables)
{ {
if (glonass_gnav_eph.d_m) if (glonass_gnav_eph.d_m > 0.0)
{ {
} // avoid warning, not needed } // avoid warning, not needed
std::string line; std::string line;
@ -9285,7 +9285,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables) void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables)
{ {
if (glonass_gnav_eph.d_m) if (glonass_gnav_eph.d_m > 0.0)
{ {
} // avoid warning, not needed } // avoid warning, not needed
std::string line; std::string line;
@ -9543,7 +9543,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double galileo_obs_time, const std::map<int32_t, Gnss_Synchro>& observables) void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double galileo_obs_time, const std::map<int32_t, Gnss_Synchro>& observables)
{ {
if (glonass_gnav_eph.d_m) if (glonass_gnav_eph.d_m > 0.0)
{ {
} // avoid warning, not needed } // avoid warning, not needed
std::string line; std::string line;
@ -10176,7 +10176,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables, bool triple_band) void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables, bool triple_band)
{ {
if (eph_cnav.d_i_0) if (eph_cnav.d_i_0 > 0.0)
{ {
} // avoid warning, not needed } // avoid warning, not needed
// RINEX observations timestamps are GPS timestamps. // RINEX observations timestamps are GPS timestamps.
@ -10658,7 +10658,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables) void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables)
{ {
if (galileo_eph.e_1) if (galileo_eph.e_1 > 0.0)
{ {
} // avoid warning, not needed } // avoid warning, not needed
std::string line; std::string line;
@ -10930,7 +10930,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables) void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables)
{ {
if (galileo_eph.e_1) if (galileo_eph.e_1 > 0.0)
{ {
} // avoid warning, not needed } // avoid warning, not needed
std::string line; std::string line;
@ -11224,10 +11224,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables, bool triple_band) void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables, bool triple_band)
{ {
if (galileo_eph.e_1) if (galileo_eph.e_1 > 0.0)
{ {
} // avoid warning, not needed } // avoid warning, not needed
if (gps_cnav_eph.d_e_eccentricity) if (gps_cnav_eph.d_e_eccentricity > 0.0)
{ {
} // avoid warning, not needed } // avoid warning, not needed
std::string line; std::string line;

View File

@ -23,6 +23,9 @@
#include "GPS_L2C.h" #include "GPS_L2C.h"
#include "Galileo_E1.h" #include "Galileo_E1.h"
#include "Galileo_E5a.h" #include "Galileo_E5a.h"
#include "Galileo_E5b.h"
#include "Galileo_FNAV.h"
#include "Galileo_INAV.h"
#include <boost/algorithm/string.hpp> // for to_upper_copy #include <boost/algorithm/string.hpp> // for to_upper_copy
#include <boost/crc.hpp> #include <boost/crc.hpp>
#include <boost/date_time/gregorian/gregorian.hpp> #include <boost/date_time/gregorian/gregorian.hpp>
@ -1896,7 +1899,7 @@ int32_t Rtcm::read_MT1020(const std::string& message, Glonass_Gnav_Ephemeris& gl
glonass_gnav_eph.d_B_n = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 1))); glonass_gnav_eph.d_B_n = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 1)));
index += 1; index += 1;
glonass_gnav_eph.d_P_2 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 1))); glonass_gnav_eph.d_P_2 = static_cast<bool>(Rtcm::bin_to_uint(message_bin.substr(index, 1)));
index += 1; index += 1;
glonass_gnav_eph.d_t_b = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 7))) * 15 * 60.0; glonass_gnav_eph.d_t_b = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 7))) * 15 * 60.0;
@ -1930,7 +1933,7 @@ int32_t Rtcm::read_MT1020(const std::string& message, Glonass_Gnav_Ephemeris& gl
glonass_gnav_eph.d_AZn = static_cast<double>(Rtcm::bin_to_sint(message_bin.substr(index, 5))) * TWO_N30; glonass_gnav_eph.d_AZn = static_cast<double>(Rtcm::bin_to_sint(message_bin.substr(index, 5))) * TWO_N30;
index += 5; index += 5;
glonass_gnav_eph.d_P_3 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 1))); glonass_gnav_eph.d_P_3 = static_cast<bool>(Rtcm::bin_to_uint(message_bin.substr(index, 1)));
index += 1; index += 1;
glonass_gnav_eph.d_gamma_n = static_cast<double>(Rtcm::bin_to_sint(message_bin.substr(index, 11))) * TWO_N30; glonass_gnav_eph.d_gamma_n = static_cast<double>(Rtcm::bin_to_sint(message_bin.substr(index, 11))) * TWO_N30;
@ -1939,7 +1942,7 @@ int32_t Rtcm::read_MT1020(const std::string& message, Glonass_Gnav_Ephemeris& gl
glonass_gnav_eph.d_P = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 2))); glonass_gnav_eph.d_P = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 2)));
index += 2; index += 2;
glonass_gnav_eph.d_l3rd_n = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 1))); glonass_gnav_eph.d_l3rd_n = static_cast<bool>(Rtcm::bin_to_uint(message_bin.substr(index, 1)));
index += 1; index += 1;
glonass_gnav_eph.d_tau_n = static_cast<double>(Rtcm::bin_to_sint(message_bin.substr(index, 22))) * TWO_N30; glonass_gnav_eph.d_tau_n = static_cast<double>(Rtcm::bin_to_sint(message_bin.substr(index, 22))) * TWO_N30;
@ -1951,7 +1954,7 @@ int32_t Rtcm::read_MT1020(const std::string& message, Glonass_Gnav_Ephemeris& gl
glonass_gnav_eph.d_E_n = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 5))); glonass_gnav_eph.d_E_n = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 5)));
index += 5; index += 5;
glonass_gnav_eph.d_P_4 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 1))); glonass_gnav_eph.d_P_4 = static_cast<bool>(Rtcm::bin_to_uint(message_bin.substr(index, 1)));
index += 1; index += 1;
glonass_gnav_eph.d_F_T = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 4))); glonass_gnav_eph.d_F_T = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 4)));
@ -2007,12 +2010,7 @@ std::string Rtcm::print_MT1029(uint32_t ref_id, const Gps_Ephemeris& gps_eph, do
std::string text_binary; std::string text_binary;
for (char c : message) for (char c : message)
{ {
if (isgraph(c)) if (isgraph(c) || c == ' ')
{
i++;
first = true;
}
else if (c == ' ')
{ {
i++; i++;
first = true; first = true;
@ -4529,14 +4527,14 @@ int32_t Rtcm::set_DF107(const Glonass_Gnav_Ephemeris& glonass_gnav_eph)
int32_t Rtcm::set_DF108(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) int32_t Rtcm::set_DF108(const Glonass_Gnav_Ephemeris& glonass_gnav_eph)
{ {
DF108 = std::bitset<1>(glonass_gnav_eph.d_B_n); DF108 = std::bitset<1>(static_cast<bool>(glonass_gnav_eph.d_B_n));
return 0; return 0;
} }
int32_t Rtcm::set_DF109(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) int32_t Rtcm::set_DF109(const Glonass_Gnav_Ephemeris& glonass_gnav_eph)
{ {
DF109 = std::bitset<1>(glonass_gnav_eph.d_P_2); DF109 = std::bitset<1>(static_cast<bool>(glonass_gnav_eph.d_P_2));
return 0; return 0;
} }
@ -5289,11 +5287,7 @@ int32_t Rtcm::set_DF397(const Gnss_Synchro& gnss_synchro)
uint32_t int_ms = 0; uint32_t int_ms = 0;
if (rough_range_s == 0.0) if (rough_range_s == 0.0 || ((rough_range_s < 0.0) || (rough_range_s > meters_to_miliseconds * 255.0)))
{
int_ms = 255;
}
else if ((rough_range_s < 0.0) || (rough_range_s > meters_to_miliseconds * 255.0))
{ {
int_ms = 255; int_ms = 255;
} }
@ -5349,7 +5343,7 @@ int32_t Rtcm::set_DF399(const Gnss_Synchro& gnss_synchro)
} }
if (sig == "7X") if (sig == "7X")
{ {
lambda = SPEED_OF_LIGHT_M_S / 1.207140e9; // Galileo_E1b_FREQ_HZ; lambda = SPEED_OF_LIGHT_M_S / GALILEO_E5B_FREQ_HZ;
} }
double rough_phase_range_rate_ms = std::round(-gnss_synchro.Carrier_Doppler_hz * lambda); double rough_phase_range_rate_ms = std::round(-gnss_synchro.Carrier_Doppler_hz * lambda);
@ -5376,11 +5370,7 @@ int32_t Rtcm::set_DF400(const Gnss_Synchro& gnss_synchro)
psrng_s = gnss_synchro.Pseudorange_m - rough_range_m; psrng_s = gnss_synchro.Pseudorange_m - rough_range_m;
if (psrng_s == 0) if (psrng_s == 0 || (std::fabs(psrng_s) > 292.7))
{
fine_pseudorange = -16384;
}
else if (std::fabs(psrng_s) > 292.7)
{ {
fine_pseudorange = -16384; // 4000h: invalid value fine_pseudorange = -16384; // 4000h: invalid value
} }
@ -5424,7 +5414,7 @@ int32_t Rtcm::set_DF401(const Gnss_Synchro& gnss_synchro)
} }
if ((sig == "7X") && (sys == "E")) if ((sig == "7X") && (sys == "E"))
{ {
lambda = SPEED_OF_LIGHT_M_S / 1.207140e9; // Galileo_E1b_FREQ_HZ; lambda = SPEED_OF_LIGHT_M_S / GALILEO_E5B_FREQ_HZ;
} }
if ((sig == "1C") && (sys == "R")) if ((sig == "1C") && (sys == "R"))
{ {
@ -5447,11 +5437,7 @@ int32_t Rtcm::set_DF401(const Gnss_Synchro& gnss_synchro)
} }
phrng_m -= cp; phrng_m -= cp;
if (phrng_m == 0.0) if (phrng_m == 0.0 || (std::fabs(phrng_m) > 1171.0))
{
fine_phaserange = -2097152;
}
else if (std::fabs(phrng_m) > 1171.0)
{ {
fine_phaserange = -2097152; fine_phaserange = -2097152;
} }
@ -5484,11 +5470,7 @@ int32_t Rtcm::set_DF402(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& e
{ {
lock_time_period_s = Rtcm::lock_time(ephFNAV, obs_time, gnss_synchro); lock_time_period_s = Rtcm::lock_time(ephFNAV, obs_time, gnss_synchro);
} }
if ((sig_ == "1C") && (sys == "R")) if (((sig_ == "1C") && (sys == "R")) || ((sig_ == "2C") && (sys == "R")))
{
lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro);
}
if ((sig_ == "2C") && (sys == "R"))
{ {
lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro);
} }
@ -5533,7 +5515,7 @@ int32_t Rtcm::set_DF404(const Gnss_Synchro& gnss_synchro)
} }
if ((sig_ == "7X") && (sys_ == "E")) if ((sig_ == "7X") && (sys_ == "E"))
{ {
lambda = SPEED_OF_LIGHT_M_S / 1.207140e9; // Galileo_E1b_FREQ_HZ; lambda = SPEED_OF_LIGHT_M_S / GALILEO_E5B_FREQ_HZ;
} }
if ((sig_ == "1C") && (sys_ == "R")) if ((sig_ == "1C") && (sys_ == "R"))
{ {
@ -5547,11 +5529,7 @@ int32_t Rtcm::set_DF404(const Gnss_Synchro& gnss_synchro)
double rough_phase_range_rate = std::round(-gnss_synchro.Carrier_Doppler_hz * lambda); double rough_phase_range_rate = std::round(-gnss_synchro.Carrier_Doppler_hz * lambda);
double phrr = (-gnss_synchro.Carrier_Doppler_hz * lambda - rough_phase_range_rate); double phrr = (-gnss_synchro.Carrier_Doppler_hz * lambda - rough_phase_range_rate);
if (phrr == 0.0) if (phrr == 0.0 || (std::fabs(phrr) > 1.6384))
{
fine_phaserange_rate = -16384;
}
else if (std::fabs(phrr) > 1.6384)
{ {
fine_phaserange_rate = -16384; fine_phaserange_rate = -16384;
} }
@ -5574,11 +5552,7 @@ int32_t Rtcm::set_DF405(const Gnss_Synchro& gnss_synchro)
psrng_s = gnss_synchro.Pseudorange_m - rough_range_m; psrng_s = gnss_synchro.Pseudorange_m - rough_range_m;
if (psrng_s == 0.0) if (psrng_s == 0.0 || (std::fabs(psrng_s) > 292.7))
{
fine_pseudorange = -524288;
}
else if (std::fabs(psrng_s) > 292.7)
{ {
fine_pseudorange = -524288; fine_pseudorange = -524288;
} }
@ -5620,7 +5594,7 @@ int32_t Rtcm::set_DF406(const Gnss_Synchro& gnss_synchro)
} }
if ((sig_ == "7X") && (sys_ == "E")) if ((sig_ == "7X") && (sys_ == "E"))
{ {
lambda = SPEED_OF_LIGHT_M_S / 1.207140e9; // Galileo_E1b_FREQ_HZ; lambda = SPEED_OF_LIGHT_M_S / GALILEO_E5B_FREQ_HZ;
} }
if ((sig_ == "1C") && (sys_ == "R")) if ((sig_ == "1C") && (sys_ == "R"))
{ {
@ -5642,11 +5616,7 @@ int32_t Rtcm::set_DF406(const Gnss_Synchro& gnss_synchro)
} }
phrng_m -= cp; phrng_m -= cp;
if (phrng_m == 0.0) if (phrng_m == 0.0 || (std::fabs(phrng_m) > 1171.0))
{
fine_phaserange_ex = -8388608;
}
else if (std::fabs(phrng_m) > 1171.0)
{ {
fine_phaserange_ex = -8388608; fine_phaserange_ex = -8388608;
} }

View File

@ -890,7 +890,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
nav_data.utc_cmp[1] = beidou_dnav_utc_model.d_A1_UTC; nav_data.utc_cmp[1] = beidou_dnav_utc_model.d_A1_UTC;
nav_data.utc_cmp[2] = 0.0; // ?? nav_data.utc_cmp[2] = 0.0; // ??
nav_data.utc_cmp[3] = 0.0; // ?? nav_data.utc_cmp[3] = 0.0; // ??
nav_data.leaps = beidou_dnav_utc_model.d_DeltaT_LS; nav_data.leaps = beidou_dnav_utc_model.i_DeltaT_LS;
} }
/* update carrier wave length using native function call in RTKlib */ /* update carrier wave length using native function call in RTKlib */
@ -928,7 +928,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
std::vector<double> azel; std::vector<double> azel;
azel.reserve(used_sats * 2); azel.reserve(used_sats * 2);
unsigned int index_aux = 0; int index_aux = 0;
for (auto &i : rtk_.ssat) for (auto &i : rtk_.ssat)
{ {
if (i.vs == 1) if (i.vs == 1)

View File

@ -64,7 +64,7 @@ BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition(
num_codes_ = acq_parameters_.sampled_ms; num_codes_ = acq_parameters_.sampled_ms;
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (BEIDOU_B1I_CODE_RATE_CPS / BEIDOU_B1I_CODE_LENGTH_CHIPS))); code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (BEIDOU_B1I_CODE_RATE_CPS / BEIDOU_B1I_CODE_LENGTH_CHIPS)));
vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); vector_length_ = static_cast<unsigned int>(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0));
code_ = std::vector<std::complex<float>>(vector_length_); code_ = std::vector<std::complex<float>>(vector_length_);
acquisition_ = pcps_make_acquisition(acq_parameters_); acquisition_ = pcps_make_acquisition(acq_parameters_);
@ -172,11 +172,7 @@ void BeidouB1iPcpsAcquisition::set_state(int state)
void BeidouB1iPcpsAcquisition::connect(gr::top_block_sptr top_block) void BeidouB1iPcpsAcquisition::connect(gr::top_block_sptr top_block)
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
// nothing to connect
}
else if (item_type_ == "cshort")
{ {
// nothing to connect // nothing to connect
} }
@ -197,11 +193,7 @@ void BeidouB1iPcpsAcquisition::connect(gr::top_block_sptr top_block)
void BeidouB1iPcpsAcquisition::disconnect(gr::top_block_sptr top_block) void BeidouB1iPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
// nothing to disconnect
}
else if (item_type_ == "cshort")
{ {
// nothing to disconnect // nothing to disconnect
} }
@ -220,11 +212,7 @@ void BeidouB1iPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr BeidouB1iPcpsAcquisition::get_left_block() gr::basic_block_sptr BeidouB1iPcpsAcquisition::get_left_block()
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
return acquisition_;
}
if (item_type_ == "cshort")
{ {
return acquisition_; return acquisition_;
} }

View File

@ -62,7 +62,7 @@ BeidouB3iPcpsAcquisition::BeidouB3iPcpsAcquisition(
num_codes_ = acq_parameters_.sampled_ms; num_codes_ = acq_parameters_.sampled_ms;
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (BEIDOU_B3I_CODE_RATE_CPS / BEIDOU_B3I_CODE_LENGTH_CHIPS))); code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (BEIDOU_B3I_CODE_RATE_CPS / BEIDOU_B3I_CODE_LENGTH_CHIPS)));
vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); vector_length_ = static_cast<unsigned int>(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0));
code_ = std::vector<std::complex<float>>(vector_length_); code_ = std::vector<std::complex<float>>(vector_length_);
acquisition_ = pcps_make_acquisition(acq_parameters_); acquisition_ = pcps_make_acquisition(acq_parameters_);
@ -169,11 +169,7 @@ void BeidouB3iPcpsAcquisition::set_state(int state)
void BeidouB3iPcpsAcquisition::connect(gr::top_block_sptr top_block) void BeidouB3iPcpsAcquisition::connect(gr::top_block_sptr top_block)
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
// nothing to connect
}
else if (item_type_ == "cshort")
{ {
// nothing to connect // nothing to connect
} }
@ -194,11 +190,7 @@ void BeidouB3iPcpsAcquisition::connect(gr::top_block_sptr top_block)
void BeidouB3iPcpsAcquisition::disconnect(gr::top_block_sptr top_block) void BeidouB3iPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
// nothing to disconnect
}
else if (item_type_ == "cshort")
{ {
// nothing to disconnect // nothing to disconnect
} }
@ -217,11 +209,7 @@ void BeidouB3iPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr BeidouB3iPcpsAcquisition::get_left_block() gr::basic_block_sptr BeidouB3iPcpsAcquisition::get_left_block()
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
return acquisition_;
}
if (item_type_ == "cshort")
{ {
return acquisition_; return acquisition_;
} }

View File

@ -44,8 +44,8 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
out_streams_(out_streams) out_streams_(out_streams)
{ {
configuration_ = configuration; configuration_ = configuration;
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
std::string default_dump_filename = "../data/acquisition.dat"; const std::string default_dump_filename("../data/acquisition.dat");
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
@ -76,12 +76,12 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
default_dump_filename); default_dump_filename);
// -- Find number of samples per spreading code (4 ms) ----------------- // -- Find number of samples per spreading code (4 ms) -----------------
code_length_ = round( code_length_ = static_cast<unsigned int>(round(
fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)); fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4); vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);
int samples_per_ms = code_length_ / 4; auto samples_per_ms = static_cast<int>(code_length_) / 4;
code_ = std::vector<std::complex<float>>(vector_length_); code_ = std::vector<std::complex<float>>(vector_length_);
@ -127,11 +127,11 @@ void GalileoE1Pcps8msAmbiguousAcquisition::stop_acquisition()
void GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold) void GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold)
{ {
float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", static_cast<float>(0.0));
if (pfa == 0.0) if (pfa == 0.0)
{ {
pfa = configuration_->property(role_ + ".pfa", 0.0); pfa = configuration_->property(role_ + ".pfa", static_cast<float>(0.0));
} }
if (pfa == 0.0) if (pfa == 0.0)

View File

@ -62,7 +62,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
acquire_pilot_ = configuration->property(role + ".acquire_pilot", false); acquire_pilot_ = configuration->property(role + ".acquire_pilot", false);
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS))); code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); vector_length_ = static_cast<unsigned int>(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0));
code_ = std::vector<std::complex<float>>(vector_length_); code_ = std::vector<std::complex<float>>(vector_length_);
sampled_ms_ = acq_parameters_.sampled_ms; sampled_ms_ = acq_parameters_.sampled_ms;
@ -214,11 +214,7 @@ void GalileoE1PcpsAmbiguousAcquisition::set_state(int state)
void GalileoE1PcpsAmbiguousAcquisition::connect(gr::top_block_sptr top_block) void GalileoE1PcpsAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
// nothing to connect
}
else if (item_type_ == "cshort")
{ {
// nothing to connect // nothing to connect
} }
@ -239,11 +235,7 @@ void GalileoE1PcpsAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
void GalileoE1PcpsAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) void GalileoE1PcpsAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
// nothing to disconnect
}
else if (item_type_ == "cshort")
{ {
// nothing to disconnect // nothing to disconnect
} }
@ -262,11 +254,7 @@ void GalileoE1PcpsAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisition::get_left_block() gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisition::get_left_block()
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
return acquisition_;
}
if (item_type_ == "cshort")
{ {
return acquisition_; return acquisition_;
} }

View File

@ -159,7 +159,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
acq_parameters.all_fft_codes = d_all_fft_codes_.data(); acq_parameters.all_fft_codes = d_all_fft_codes_.data();
acq_parameters.num_doppler_bins_step2 = configuration->property(role + ".second_nbins", 4); acq_parameters.num_doppler_bins_step2 = configuration->property(role + ".second_nbins", 4);
acq_parameters.doppler_step2 = configuration->property(role + ".second_doppler_step", 125.0); acq_parameters.doppler_step2 = configuration->property(role + ".second_doppler_step", static_cast<float>(125.0));
acq_parameters.make_2_steps = configuration->property(role + ".make_two_steps", false); acq_parameters.make_2_steps = configuration->property(role + ".make_two_steps", false);
acq_parameters.max_num_acqs = configuration->property(role + ".max_num_acqs", 2); acq_parameters.max_num_acqs = configuration->property(role + ".max_num_acqs", 2);
// reference for the FPGA FFT-IFFT attenuation factor // reference for the FPGA FFT-IFFT attenuation factor

View File

@ -36,8 +36,8 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
out_streams_(out_streams) out_streams_(out_streams)
{ {
configuration_ = configuration; configuration_ = configuration;
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
std::string default_dump_filename = "../data/acquisition.dat"; const std::string default_dump_filename("../data/acquisition.dat");
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
@ -68,12 +68,12 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
// -- Find number of samples per spreading code (4 ms) ----------------- // -- Find number of samples per spreading code (4 ms) -----------------
code_length_ = round( code_length_ = static_cast<unsigned int>(round(
fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)); fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4); vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);
int samples_per_ms = code_length_ / 4; auto samples_per_ms = static_cast<int>(code_length_) / 4;
code_data_ = std::vector<std::complex<float>>(vector_length_); code_data_ = std::vector<std::complex<float>>(vector_length_);
code_pilot_ = std::vector<std::complex<float>>(vector_length_); code_pilot_ = std::vector<std::complex<float>>(vector_length_);

View File

@ -44,8 +44,8 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
out_streams_(out_streams) out_streams_(out_streams)
{ {
configuration_ = configuration; configuration_ = configuration;
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
std::string default_dump_filename = "../data/acquisition.dat"; const std::string default_dump_filename("../data/acquisition.dat");
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
@ -63,10 +63,10 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 8); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 8);
/* --- Find number of samples per spreading code (4 ms) -----------------*/ /* --- Find number of samples per spreading code (4 ms) -----------------*/
code_length_ = round( code_length_ = static_cast<unsigned int>(round(
fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)); fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
int samples_per_ms = round(code_length_ / 4.0); auto samples_per_ms = static_cast<int>(round(code_length_ / 4.0));
/*Calculate the folding factor value based on the formula described in the paper. /*Calculate the folding factor value based on the formula described in the paper.
This may be a bug, but acquisition also work by variying the folding factor at va- This may be a bug, but acquisition also work by variying the folding factor at va-
@ -162,11 +162,11 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::stop_acquisition()
void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold) void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold)
{ {
float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", static_cast<float>(0.0));
if (pfa == 0.0) if (pfa == 0.0)
{ {
pfa = configuration_->property(role_ + ".pfa", 0.0); pfa = configuration_->property(role_ + ".pfa", static_cast<float>(0.0));
} }
if (pfa == 0.0) if (pfa == 0.0)

View File

@ -44,8 +44,8 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
out_streams_(out_streams) out_streams_(out_streams)
{ {
configuration_ = configuration; configuration_ = configuration;
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
std::string default_dump_filename = "../data/acquisition.dat"; const std::string default_dump_filename("../data/acquisition.dat");
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
@ -79,12 +79,12 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
// -- Find number of samples per spreading code (4 ms) ----------------- // -- Find number of samples per spreading code (4 ms) -----------------
code_length_ = round( code_length_ = static_cast<unsigned int>(round(
fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)); fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4); vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);
int samples_per_ms = code_length_ / 4; auto samples_per_ms = static_cast<int>(code_length_) / 4;
code_ = std::vector<std::complex<float>>(vector_length_); code_ = std::vector<std::complex<float>>(vector_length_);
@ -132,11 +132,11 @@ void GalileoE1PcpsTongAmbiguousAcquisition::stop_acquisition()
void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold) void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold)
{ {
float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", static_cast<float>(0.0));
if (pfa == 0.0) if (pfa == 0.0)
{ {
pfa = configuration_->property(role_ + ".pfa", 0.0); pfa = configuration_->property(role_ + ".pfa", static_cast<float>(0.0));
} }
if (pfa == 0.0) if (pfa == 0.0)

View File

@ -50,8 +50,8 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
out_streams_(out_streams) out_streams_(out_streams)
{ {
configuration_ = configuration; configuration_ = configuration;
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
std::string default_dump_filename = "../data/acquisition.dat"; const std::string default_dump_filename("../data/acquisition.dat");
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
@ -86,7 +86,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
// -- Find number of samples per spreading code (1ms)------------------------- // -- Find number of samples per spreading code (1ms)-------------------------
code_length_ = round(static_cast<double>(fs_in_) / GALILEO_E5A_CODE_CHIP_RATE_CPS * static_cast<double>(GALILEO_E5A_CODE_LENGTH_CHIPS)); code_length_ = static_cast<unsigned int>(round(static_cast<double>(fs_in_) / GALILEO_E5A_CODE_CHIP_RATE_CPS * static_cast<double>(GALILEO_E5A_CODE_LENGTH_CHIPS)));
vector_length_ = code_length_ * sampled_ms_; vector_length_ = code_length_ * sampled_ms_;
@ -137,11 +137,11 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::stop_acquisition()
void GalileoE5aNoncoherentIQAcquisitionCaf::set_threshold(float threshold) void GalileoE5aNoncoherentIQAcquisitionCaf::set_threshold(float threshold)
{ {
float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", static_cast<float>(0.0));
if (pfa == 0.0) if (pfa == 0.0)
{ {
pfa = configuration_->property(role_ + ".pfa", 0.0); pfa = configuration_->property(role_ + ".pfa", static_cast<float>(0.0));
} }
if (pfa == 0.0) if (pfa == 0.0)

View File

@ -66,7 +66,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(
} }
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GALILEO_E5A_CODE_CHIP_RATE_CPS / GALILEO_E5A_CODE_LENGTH_CHIPS))); code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GALILEO_E5A_CODE_CHIP_RATE_CPS / GALILEO_E5A_CODE_LENGTH_CHIPS)));
vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); vector_length_ = static_cast<unsigned int>(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0));
code_ = std::vector<std::complex<float>>(vector_length_); code_ = std::vector<std::complex<float>>(vector_length_);
sampled_ms_ = acq_parameters_.sampled_ms; sampled_ms_ = acq_parameters_.sampled_ms;
@ -198,11 +198,7 @@ void GalileoE5aPcpsAcquisition::set_state(int state)
void GalileoE5aPcpsAcquisition::connect(gr::top_block_sptr top_block __attribute__((unused))) void GalileoE5aPcpsAcquisition::connect(gr::top_block_sptr top_block __attribute__((unused)))
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
// nothing to connect
}
else if (item_type_ == "cshort")
{ {
// nothing to connect // nothing to connect
} }
@ -215,11 +211,7 @@ void GalileoE5aPcpsAcquisition::connect(gr::top_block_sptr top_block __attribute
void GalileoE5aPcpsAcquisition::disconnect(gr::top_block_sptr top_block __attribute__((unused))) void GalileoE5aPcpsAcquisition::disconnect(gr::top_block_sptr top_block __attribute__((unused)))
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
// nothing to disconnect
}
else if (item_type_ == "cshort")
{ {
// nothing to disconnect // nothing to disconnect
} }

View File

@ -42,7 +42,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(
out_streams_(out_streams) out_streams_(out_streams)
{ {
pcpsconf_fpga_t acq_parameters; pcpsconf_fpga_t acq_parameters;
std::string default_dump_filename = "../data/acquisition.dat"; const std::string default_dump_filename("../data/acquisition.dat");
DLOG(INFO) << "Role " << role; DLOG(INFO) << "Role " << role;
@ -166,7 +166,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(
acq_parameters.total_block_exp = configuration->property(role + ".total_block_exp", 13); acq_parameters.total_block_exp = configuration->property(role + ".total_block_exp", 13);
acq_parameters.num_doppler_bins_step2 = configuration->property(role + ".second_nbins", 4); acq_parameters.num_doppler_bins_step2 = configuration->property(role + ".second_nbins", 4);
acq_parameters.doppler_step2 = configuration->property(role + ".second_doppler_step", 125.0); acq_parameters.doppler_step2 = configuration->property(role + ".second_doppler_step", static_cast<float>(125.0));
acq_parameters.make_2_steps = configuration->property(role + ".make_two_steps", false); acq_parameters.make_2_steps = configuration->property(role + ".make_two_steps", false);
acq_parameters.max_num_acqs = configuration->property(role + ".max_num_acqs", 2); acq_parameters.max_num_acqs = configuration->property(role + ".max_num_acqs", 2);
acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters); acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters);

View File

@ -61,7 +61,7 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition(
fs_in_ = acq_parameters_.fs_in; fs_in_ = acq_parameters_.fs_in;
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GLONASS_L1_CA_CODE_RATE_CPS / GLONASS_L1_CA_CODE_LENGTH_CHIPS))); code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GLONASS_L1_CA_CODE_RATE_CPS / GLONASS_L1_CA_CODE_LENGTH_CHIPS)));
vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); vector_length_ = static_cast<unsigned int>(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0));
code_ = std::vector<std::complex<float>>(vector_length_); code_ = std::vector<std::complex<float>>(vector_length_);
sampled_ms_ = acq_parameters_.sampled_ms; sampled_ms_ = acq_parameters_.sampled_ms;
@ -173,11 +173,7 @@ void GlonassL1CaPcpsAcquisition::set_state(int state)
void GlonassL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) void GlonassL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block)
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
// nothing to connect
}
else if (item_type_ == "cshort")
{ {
// nothing to connect // nothing to connect
} }
@ -196,11 +192,7 @@ void GlonassL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block)
void GlonassL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) void GlonassL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
// nothing to disconnect
}
else if (item_type_ == "cshort")
{ {
// nothing to disconnect // nothing to disconnect
} }
@ -221,11 +213,7 @@ void GlonassL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GlonassL1CaPcpsAcquisition::get_left_block() gr::basic_block_sptr GlonassL1CaPcpsAcquisition::get_left_block()
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
return acquisition_;
}
if (item_type_ == "cshort")
{ {
return acquisition_; return acquisition_;
} }

View File

@ -60,7 +60,7 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition(
fs_in_ = acq_parameters_.fs_in; fs_in_ = acq_parameters_.fs_in;
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GLONASS_L2_CA_CODE_RATE_CPS / GLONASS_L2_CA_CODE_LENGTH_CHIPS))); code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GLONASS_L2_CA_CODE_RATE_CPS / GLONASS_L2_CA_CODE_LENGTH_CHIPS)));
vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); vector_length_ = static_cast<unsigned int>(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0));
code_ = std::vector<std::complex<float>>(vector_length_); code_ = std::vector<std::complex<float>>(vector_length_);
sampled_ms_ = acq_parameters_.sampled_ms; sampled_ms_ = acq_parameters_.sampled_ms;
@ -172,11 +172,7 @@ void GlonassL2CaPcpsAcquisition::set_state(int state)
void GlonassL2CaPcpsAcquisition::connect(gr::top_block_sptr top_block) void GlonassL2CaPcpsAcquisition::connect(gr::top_block_sptr top_block)
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
// nothing to connect
}
else if (item_type_ == "cshort")
{ {
// nothing to connect // nothing to connect
} }
@ -197,11 +193,7 @@ void GlonassL2CaPcpsAcquisition::connect(gr::top_block_sptr top_block)
void GlonassL2CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) void GlonassL2CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
// nothing to disconnect
}
else if (item_type_ == "cshort")
{ {
// nothing to disconnect // nothing to disconnect
} }
@ -220,11 +212,7 @@ void GlonassL2CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GlonassL2CaPcpsAcquisition::get_left_block() gr::basic_block_sptr GlonassL2CaPcpsAcquisition::get_left_block()
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
return acquisition_;
}
if (item_type_ == "cshort")
{ {
return acquisition_; return acquisition_;
} }

View File

@ -63,7 +63,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
item_size_ = acq_parameters_.it_size; item_size_ = acq_parameters_.it_size;
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS))); code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); vector_length_ = static_cast<unsigned int>(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0));
code_ = std::vector<std::complex<float>>(vector_length_); code_ = std::vector<std::complex<float>>(vector_length_);
sampled_ms_ = acq_parameters_.sampled_ms; sampled_ms_ = acq_parameters_.sampled_ms;
@ -187,11 +187,7 @@ void GpsL1CaPcpsAcquisition::set_state(int state)
void GpsL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) void GpsL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block)
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
// nothing to connect
}
else if (item_type_ == "cshort")
{ {
// nothing to connect // nothing to connect
} }
@ -212,11 +208,7 @@ void GpsL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block)
void GpsL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) void GpsL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
// nothing to disconnect
}
else if (item_type_ == "cshort")
{ {
// nothing to disconnect // nothing to disconnect
} }
@ -235,11 +227,7 @@ void GpsL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GpsL1CaPcpsAcquisition::get_left_block() gr::basic_block_sptr GpsL1CaPcpsAcquisition::get_left_block()
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
return acquisition_;
}
if (item_type_ == "cshort")
{ {
return acquisition_; return acquisition_;
} }

View File

@ -38,7 +38,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
in_streams_(in_streams), in_streams_(in_streams),
out_streams_(out_streams) out_streams_(out_streams)
{ {
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
std::string default_dump_filename = "./acquisition.mat"; std::string default_dump_filename = "./acquisition.mat";
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
@ -67,7 +67,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
acq_parameters.blocking_on_standby = configuration->property(role + ".blocking_on_standby", false); acq_parameters.blocking_on_standby = configuration->property(role + ".blocking_on_standby", false);
// -- Find number of samples per spreading code ------------------------- // -- Find number of samples per spreading code -------------------------
vector_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); vector_length_ = static_cast<unsigned int>(round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
acq_parameters.samples_per_ms = vector_length_; acq_parameters.samples_per_ms = vector_length_;
code_ = std::vector<std::complex<float>>(vector_length_); code_ = std::vector<std::complex<float>>(vector_length_);

View File

@ -141,7 +141,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
acq_parameters.total_block_exp = configuration->property(role + ".total_block_exp", 10); acq_parameters.total_block_exp = configuration->property(role + ".total_block_exp", 10);
acq_parameters.num_doppler_bins_step2 = configuration->property(role + ".second_nbins", 4); acq_parameters.num_doppler_bins_step2 = configuration->property(role + ".second_nbins", 4);
acq_parameters.doppler_step2 = configuration->property(role + ".second_doppler_step", 125.0); acq_parameters.doppler_step2 = configuration->property(role + ".second_doppler_step", static_cast<float>(125.0));
acq_parameters.make_2_steps = configuration->property(role + ".make_two_steps", false); acq_parameters.make_2_steps = configuration->property(role + ".make_two_steps", false);
acq_parameters.max_num_acqs = configuration->property(role + ".max_num_acqs", 2); acq_parameters.max_num_acqs = configuration->property(role + ".max_num_acqs", 2);
acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters); acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters);

View File

@ -37,7 +37,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
in_streams_(in_streams), in_streams_(in_streams),
out_streams_(out_streams) out_streams_(out_streams)
{ {
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
std::string default_dump_filename = "./data/acquisition.dat"; std::string default_dump_filename = "./data/acquisition.dat";
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
@ -57,7 +57,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
// --- Find number of samples per spreading code ------------------------- // --- Find number of samples per spreading code -------------------------
vector_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); vector_length_ = static_cast<unsigned int>(round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
code_.reserve(vector_length_); code_.reserve(vector_length_);

View File

@ -44,7 +44,7 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition(
out_streams_(out_streams) out_streams_(out_streams)
{ {
configuration_ = configuration; configuration_ = configuration;
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
std::string default_dump_filename = "./data/acquisition.dat"; std::string default_dump_filename = "./data/acquisition.dat";
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
@ -77,7 +77,7 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition(
default_dump_filename); default_dump_filename);
// -- Find number of samples per spreading code ------------------------- // -- Find number of samples per spreading code -------------------------
code_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); code_length_ = static_cast<unsigned int>(round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
vector_length_ = code_length_ * sampled_ms_; vector_length_ = code_length_ * sampled_ms_;
@ -126,11 +126,11 @@ void GpsL1CaPcpsOpenClAcquisition::stop_acquisition()
void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold) void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold)
{ {
float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", static_cast<float>(0.0));
if (pfa == 0.0) if (pfa == 0.0)
{ {
pfa = configuration_->property(role_ + ".pfa", 0.0); pfa = configuration_->property(role_ + ".pfa", static_cast<float>(0.0));
} }
if (pfa == 0.0) if (pfa == 0.0)
{ {

View File

@ -45,7 +45,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
out_streams_(out_streams) out_streams_(out_streams)
{ {
configuration_ = configuration; configuration_ = configuration;
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
std::string default_dump_filename = "./data/acquisition.dat"; std::string default_dump_filename = "./data/acquisition.dat";
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
@ -62,7 +62,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
// -- Find number of samples per spreading code ------------------------- // -- Find number of samples per spreading code -------------------------
code_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); code_length_ = static_cast<unsigned int>(round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
/* Calculate the folding factor value based on the calculations */ /* Calculate the folding factor value based on the calculations */
auto temp = static_cast<unsigned int>(ceil(sqrt(log2(code_length_)))); auto temp = static_cast<unsigned int>(ceil(sqrt(log2(code_length_))));
@ -155,11 +155,11 @@ void GpsL1CaPcpsQuickSyncAcquisition::stop_acquisition()
void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold) void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold)
{ {
float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", static_cast<float>(0.0));
if (pfa == 0.0) if (pfa == 0.0)
{ {
pfa = configuration_->property(role_ + ".pfa", 0.0); pfa = configuration_->property(role_ + ".pfa", static_cast<float>(0.0));
} }
if (pfa == 0.0) if (pfa == 0.0)
{ {

View File

@ -44,7 +44,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
out_streams_(out_streams) out_streams_(out_streams)
{ {
configuration_ = configuration; configuration_ = configuration;
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
std::string default_dump_filename = "./data/acquisition.dat"; std::string default_dump_filename = "./data/acquisition.dat";
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
@ -68,7 +68,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
// -- Find number of samples per spreading code ------------------------- // -- Find number of samples per spreading code -------------------------
code_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); code_length_ = static_cast<unsigned int>(round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
vector_length_ = code_length_ * sampled_ms_; vector_length_ = code_length_ * sampled_ms_;
@ -117,11 +117,11 @@ void GpsL1CaPcpsTongAcquisition::stop_acquisition()
void GpsL1CaPcpsTongAcquisition::set_threshold(float threshold) void GpsL1CaPcpsTongAcquisition::set_threshold(float threshold)
{ {
float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", static_cast<float>(0.0));
if (pfa == 0.0) if (pfa == 0.0)
{ {
pfa = configuration_->property(role_ + ".pfa", 0.0); pfa = configuration_->property(role_ + ".pfa", static_cast<float>(0.0));
} }
if (pfa == 0.0) if (pfa == 0.0)
{ {

View File

@ -61,7 +61,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
fs_in_ = acq_parameters_.fs_in; fs_in_ = acq_parameters_.fs_in;
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GPS_L2_M_CODE_RATE_CPS / GPS_L2_M_CODE_LENGTH_CHIPS))); code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GPS_L2_M_CODE_RATE_CPS / GPS_L2_M_CODE_LENGTH_CHIPS)));
vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); vector_length_ = static_cast<unsigned int>(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0));
code_ = std::vector<std::complex<float>>(vector_length_); code_ = std::vector<std::complex<float>>(vector_length_);
acquisition_ = pcps_make_acquisition(acq_parameters_); acquisition_ = pcps_make_acquisition(acq_parameters_);
@ -187,11 +187,7 @@ void GpsL2MPcpsAcquisition::set_state(int state)
void GpsL2MPcpsAcquisition::connect(gr::top_block_sptr top_block) void GpsL2MPcpsAcquisition::connect(gr::top_block_sptr top_block)
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
// nothing to connect
}
else if (item_type_ == "cshort")
{ {
// nothing to connect // nothing to connect
} }
@ -212,11 +208,7 @@ void GpsL2MPcpsAcquisition::connect(gr::top_block_sptr top_block)
void GpsL2MPcpsAcquisition::disconnect(gr::top_block_sptr top_block) void GpsL2MPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
// nothing to disconnect
}
else if (item_type_ == "cshort")
{ {
// nothing to disconnect // nothing to disconnect
} }
@ -235,11 +227,7 @@ void GpsL2MPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GpsL2MPcpsAcquisition::get_left_block() gr::basic_block_sptr GpsL2MPcpsAcquisition::get_left_block()
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
return acquisition_;
}
if (item_type_ == "cshort")
{ {
return acquisition_; return acquisition_;
} }

View File

@ -63,7 +63,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
} }
acq_parameters.doppler_max = doppler_max_; acq_parameters.doppler_max = doppler_max_;
unsigned int code_length = std::round(static_cast<double>(fs_in_) / (GPS_L2_M_CODE_RATE_CPS / static_cast<double>(GPS_L2_M_CODE_LENGTH_CHIPS))); auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in_) / (GPS_L2_M_CODE_RATE_CPS / static_cast<double>(GPS_L2_M_CODE_LENGTH_CHIPS))));
acq_parameters.code_length = code_length; acq_parameters.code_length = code_length;
// The FPGA can only use FFT lengths that are a power of two. // The FPGA can only use FFT lengths that are a power of two.
float nbits = ceilf(log2f(static_cast<float>(code_length))); float nbits = ceilf(log2f(static_cast<float>(code_length)));

View File

@ -60,7 +60,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition(
item_size_ = acq_parameters_.it_size; item_size_ = acq_parameters_.it_size;
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GPS_L5I_CODE_RATE_CPS / GPS_L5I_CODE_LENGTH_CHIPS))); code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GPS_L5I_CODE_RATE_CPS / GPS_L5I_CODE_LENGTH_CHIPS)));
vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); vector_length_ = static_cast<unsigned int>(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0));
code_ = std::vector<std::complex<float>>(vector_length_); code_ = std::vector<std::complex<float>>(vector_length_);
fs_in_ = acq_parameters_.fs_in; fs_in_ = acq_parameters_.fs_in;
@ -188,11 +188,7 @@ void GpsL5iPcpsAcquisition::set_state(int state)
void GpsL5iPcpsAcquisition::connect(gr::top_block_sptr top_block) void GpsL5iPcpsAcquisition::connect(gr::top_block_sptr top_block)
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
// nothing to connect
}
else if (item_type_ == "cshort")
{ {
// nothing to connect // nothing to connect
} }
@ -213,11 +209,7 @@ void GpsL5iPcpsAcquisition::connect(gr::top_block_sptr top_block)
void GpsL5iPcpsAcquisition::disconnect(gr::top_block_sptr top_block) void GpsL5iPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
// nothing to disconnect
}
else if (item_type_ == "cshort")
{ {
// nothing to disconnect // nothing to disconnect
} }
@ -236,11 +228,7 @@ void GpsL5iPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GpsL5iPcpsAcquisition::get_left_block() gr::basic_block_sptr GpsL5iPcpsAcquisition::get_left_block()
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex" || item_type_ == "cshort")
{
return acquisition_;
}
if (item_type_ == "cshort")
{ {
return acquisition_; return acquisition_;
} }

View File

@ -144,7 +144,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
acq_parameters.total_block_exp = configuration->property(role + ".total_block_exp", 13); acq_parameters.total_block_exp = configuration->property(role + ".total_block_exp", 13);
acq_parameters.num_doppler_bins_step2 = configuration->property(role + ".second_nbins", 4); acq_parameters.num_doppler_bins_step2 = configuration->property(role + ".second_nbins", 4);
acq_parameters.doppler_step2 = configuration->property(role + ".second_doppler_step", 125.0); acq_parameters.doppler_step2 = configuration->property(role + ".second_doppler_step", static_cast<float>(125.0));
acq_parameters.make_2_steps = configuration->property(role + ".make_two_steps", false); acq_parameters.make_2_steps = configuration->property(role + ".make_two_steps", false);
acq_parameters.max_num_acqs = configuration->property(role + ".max_num_acqs", 2); acq_parameters.max_num_acqs = configuration->property(role + ".max_num_acqs", 2);
acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters); acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters);

View File

@ -240,7 +240,7 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::init()
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
{ {
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index; int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
float phase_step_rad = TWO_PI * doppler / static_cast<float>(d_fs_in); float phase_step_rad = static_cast<float>(TWO_PI) * doppler / static_cast<float>(d_fs_in);
std::array<float, 1> _phase{}; std::array<float, 1> _phase{};
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index].data(), -phase_step_rad, _phase.data(), d_fft_size); volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index].data(), -phase_step_rad, _phase.data(), d_fft_size);
} }

View File

@ -82,7 +82,7 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu
d_state = 0; d_state = 0;
d_doppler_bias = 0; d_doppler_bias = 0;
d_num_noncoherent_integrations_counter = 0U; d_num_noncoherent_integrations_counter = 0U;
d_consumed_samples = d_acq_parameters.sampled_ms * d_acq_parameters.samples_per_ms * (d_acq_parameters.bit_transition_flag ? 2 : 1); d_consumed_samples = d_acq_parameters.sampled_ms * d_acq_parameters.samples_per_ms * (d_acq_parameters.bit_transition_flag ? 2.0 : 1.0);
if (d_acq_parameters.sampled_ms == d_acq_parameters.ms_per_code) if (d_acq_parameters.sampled_ms == d_acq_parameters.ms_per_code)
{ {
d_fft_size = d_consumed_samples; d_fft_size = d_consumed_samples;
@ -258,11 +258,11 @@ void pcps_acquisition::update_local_carrier(own::span<gr_complex> carrier_vector
float phase_step_rad; float phase_step_rad;
if (d_acq_parameters.use_automatic_resampler) if (d_acq_parameters.use_automatic_resampler)
{ {
phase_step_rad = TWO_PI * freq / static_cast<float>(d_acq_parameters.resampled_fs); phase_step_rad = static_cast<float>(TWO_PI) * freq / static_cast<float>(d_acq_parameters.resampled_fs);
} }
else else
{ {
phase_step_rad = TWO_PI * freq / static_cast<float>(d_acq_parameters.fs_in); phase_step_rad = static_cast<float>(TWO_PI) * freq / static_cast<float>(d_acq_parameters.fs_in);
} }
std::array<float, 1> _phase{}; std::array<float, 1> _phase{};
volk_gnsssdr_s32f_sincos_32fc(carrier_vector.data(), -phase_step_rad, _phase.data(), carrier_vector.size()); volk_gnsssdr_s32f_sincos_32fc(carrier_vector.data(), -phase_step_rad, _phase.data(), carrier_vector.size());
@ -531,8 +531,8 @@ float pcps_acquisition::max_to_input_power_statistic(uint32_t& indext, int32_t&
indext = index_time; indext = index_time;
if (!d_step_two) if (!d_step_two)
{ {
int index_opp = (index_doppler + d_num_doppler_bins / 2) % d_num_doppler_bins; auto index_opp = (index_doppler + d_num_doppler_bins / 2) % d_num_doppler_bins;
d_input_power = std::accumulate(d_magnitude_grid[index_opp].data(), d_magnitude_grid[index_opp].data() + effective_fft_size, 0.0) / effective_fft_size / 2.0 / d_num_noncoherent_integrations_counter; d_input_power = std::accumulate(d_magnitude_grid[index_opp].data(), d_magnitude_grid[index_opp].data() + effective_fft_size, static_cast<float>(0.0)) / static_cast<float>(effective_fft_size / 2.0 / d_num_noncoherent_integrations_counter);
doppler = -static_cast<int32_t>(doppler_max) + d_doppler_center + doppler_step * static_cast<int32_t>(index_doppler); doppler = -static_cast<int32_t>(doppler_max) + d_doppler_center + doppler_step * static_cast<int32_t>(index_doppler);
} }
else else
@ -891,12 +891,12 @@ void pcps_acquisition::calculate_threshold()
return; return;
} }
int effective_fft_size = (d_acq_parameters.bit_transition_flag ? (d_fft_size / 2) : d_fft_size); auto effective_fft_size = static_cast<int>(d_acq_parameters.bit_transition_flag ? (d_fft_size / 2) : d_fft_size);
int num_doppler_bins = (d_step_two ? d_num_doppler_bins_step2 : d_num_doppler_bins); int num_doppler_bins = (d_step_two ? d_num_doppler_bins_step2 : d_num_doppler_bins);
int num_bins = effective_fft_size * num_doppler_bins; int num_bins = effective_fft_size * num_doppler_bins;
d_threshold = 2.0 * boost::math::gamma_p_inv(2.0 * d_acq_parameters.max_dwells, std::pow(1.0 - pfa, 1.0 / static_cast<float>(num_bins))); d_threshold = static_cast<float>(2.0 * boost::math::gamma_p_inv(2.0 * d_acq_parameters.max_dwells, std::pow(1.0 - pfa, 1.0 / static_cast<float>(num_bins))));
} }

View File

@ -175,7 +175,7 @@ void pcps_cccwsr_acquisition_cc::init()
for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
{ {
int32_t doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index; int32_t doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index;
float phase_step_rad = TWO_PI * doppler / static_cast<float>(d_fs_in); float phase_step_rad = static_cast<float>(TWO_PI) * doppler / static_cast<float>(d_fs_in);
std::array<float, 1> _phase{}; std::array<float, 1> _phase{};
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index].data(), -phase_step_rad, _phase.data(), d_fft_size); volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index].data(), -phase_step_rad, _phase.data(), d_fft_size);
} }

View File

@ -195,7 +195,7 @@ void pcps_quicksync_acquisition_cc::init()
for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
{ {
int32_t doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index; int32_t doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index;
float phase_step_rad = TWO_PI * doppler / static_cast<float>(d_fs_in); float phase_step_rad = static_cast<float>(TWO_PI) * doppler / static_cast<float>(d_fs_in);
std::array<float, 1> _phase{}; std::array<float, 1> _phase{};
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index].data(), -phase_step_rad, _phase.data(), d_samples_per_code * d_folding_factor); volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index].data(), -phase_step_rad, _phase.data(), d_samples_per_code * d_folding_factor);
} }

View File

@ -182,7 +182,7 @@ void pcps_tong_acquisition_cc::init()
for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
{ {
int32_t doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index; int32_t doppler = -static_cast<int32_t>(d_doppler_max) + d_doppler_step * doppler_index;
float phase_step_rad = TWO_PI * doppler / static_cast<float>(d_fs_in); float phase_step_rad = static_cast<float>(TWO_PI) * doppler / static_cast<float>(d_fs_in);
std::array<float, 1> _phase{}; std::array<float, 1> _phase{};
volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index].data(), -phase_step_rad, _phase.data(), d_fft_size); volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index].data(), -phase_step_rad, _phase.data(), d_fft_size);
} }

View File

@ -148,7 +148,7 @@ void Acq_Conf::ConfigureAutomaticResampler(double opt_freq)
void Acq_Conf::SetDerivedParams() void Acq_Conf::SetDerivedParams()
{ {
samples_per_ms = static_cast<float>(resampled_fs) * 0.001; samples_per_ms = static_cast<float>(resampled_fs) * 0.001F;
samples_per_chip = static_cast<unsigned int>(std::ceil(static_cast<float>(resampled_fs) / chips_per_second)); samples_per_chip = static_cast<unsigned int>(std::ceil(static_cast<float>(resampled_fs) / chips_per_second));
samples_per_code = samples_per_ms * ms_per_code; samples_per_code = samples_per_ms * ms_per_code;
} }

View File

@ -79,10 +79,10 @@ Channel::Channel(const ConfigurationInterface* configuration, uint32_t channel,
acq_->set_doppler_step(doppler_step); acq_->set_doppler_step(doppler_step);
float threshold = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".threshold", 0.0); float threshold = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".threshold", static_cast<float>(0.0));
if (threshold == 0.0) if (threshold == 0.0)
{ {
threshold = configuration->property("Acquisition_" + implementation_ + ".threshold", 0.0); threshold = configuration->property("Acquisition_" + implementation_ + ".threshold", static_cast<float>(0.0));
} }
acq_->set_threshold(threshold); acq_->set_threshold(threshold);

View File

@ -78,9 +78,9 @@ public:
void assist_acquisition_doppler(double Carrier_Doppler_hz) override; void assist_acquisition_doppler(double Carrier_Doppler_hz) override;
inline std::shared_ptr<AcquisitionInterface> acquisition() { return acq_; } inline std::shared_ptr<AcquisitionInterface> acquisition() const { return acq_; }
inline std::shared_ptr<TrackingInterface> tracking() { return trk_; } inline std::shared_ptr<TrackingInterface> tracking() const { return trk_; }
inline std::shared_ptr<TelemetryDecoderInterface> telemetry() { return nav_; } inline std::shared_ptr<TelemetryDecoderInterface> telemetry() const { return nav_; }
void msg_handler_events(pmt::pmt_t msg); void msg_handler_events(pmt::pmt_t msg);
private: private:

View File

@ -26,9 +26,9 @@
ByteToShort::ByteToShort(const ConfigurationInterface* configuration, std::string role, ByteToShort::ByteToShort(const ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) unsigned int in_streams, unsigned int out_streams) : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams)
{ {
std::string default_input_item_type = "byte"; const std::string default_input_item_type("byte");
std::string default_output_item_type = "short"; const std::string default_output_item_type("short");
std::string default_dump_filename = "../data/input_filter.dat"; const std::string default_dump_filename("../data/input_filter.dat");
DLOG(INFO) << "role " << role_; DLOG(INFO) << "role " << role_;

View File

@ -27,9 +27,9 @@
IbyteToCbyte::IbyteToCbyte(const ConfigurationInterface* configuration, const std::string& role, IbyteToCbyte::IbyteToCbyte(const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
{ {
std::string default_input_item_type = "byte"; const std::string default_input_item_type("byte");
std::string default_output_item_type = "lv_8sc_t"; const std::string default_output_item_type("lv_8sc_t");
std::string default_dump_filename = "../data/input_filter.dat"; const std::string default_dump_filename("../data/input_filter.dat");
DLOG(INFO) << "role " << role_; DLOG(INFO) << "role " << role_;

View File

@ -25,9 +25,9 @@
IbyteToComplex::IbyteToComplex(const ConfigurationInterface* configuration, const std::string& role, IbyteToComplex::IbyteToComplex(const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
{ {
std::string default_input_item_type = "byte"; const std::string default_input_item_type("byte");
std::string default_output_item_type = "gr_complex"; const std::string default_output_item_type("gr_complex");
std::string default_dump_filename = "../data/input_filter.dat"; const std::string default_dump_filename("../data/input_filter.dat");
DLOG(INFO) << "role " << role_; DLOG(INFO) << "role " << role_;

View File

@ -27,9 +27,9 @@
IbyteToCshort::IbyteToCshort(const ConfigurationInterface* configuration, const std::string& role, IbyteToCshort::IbyteToCshort(const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
{ {
std::string default_input_item_type = "byte"; const std::string default_input_item_type("byte");
std::string default_output_item_type = "cshort"; const std::string default_output_item_type("cshort");
std::string default_dump_filename = "../data/input_filter.dat"; const std::string default_dump_filename("../data/input_filter.dat");
DLOG(INFO) << "role " << role_; DLOG(INFO) << "role " << role_;

View File

@ -25,9 +25,9 @@
IshortToComplex::IshortToComplex(const ConfigurationInterface* configuration, const std::string& role, IshortToComplex::IshortToComplex(const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
{ {
std::string default_input_item_type = "short"; const std::string default_input_item_type("short");
std::string default_output_item_type = "gr_complex"; const std::string default_output_item_type("gr_complex");
std::string default_dump_filename = "../data/input_filter.dat"; const std::string default_dump_filename("../data/input_filter.dat");
DLOG(INFO) << "role " << role_; DLOG(INFO) << "role " << role_;

View File

@ -27,9 +27,9 @@
IshortToCshort::IshortToCshort(const ConfigurationInterface* configuration, const std::string& role, IshortToCshort::IshortToCshort(const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
{ {
std::string default_input_item_type = "short"; const std::string default_input_item_type("short");
std::string default_output_item_type = "cshort"; const std::string default_output_item_type("cshort");
std::string default_dump_filename = "../data/input_filter.dat"; const std::string default_dump_filename("../data/input_filter.dat");
DLOG(INFO) << "role " << role_; DLOG(INFO) << "role " << role_;

View File

@ -35,7 +35,7 @@ interleaved_byte_to_complex_byte::interleaved_byte_to_complex_byte() : sync_deci
gr::io_signature::make(1, 1, sizeof(lv_8sc_t)), // lv_8sc_t is a Volk's typedef for std::complex<signed char> gr::io_signature::make(1, 1, sizeof(lv_8sc_t)), // lv_8sc_t is a Volk's typedef for std::complex<signed char>
2) 2)
{ {
const int alignment_multiple = volk_get_alignment() / sizeof(lv_8sc_t); const auto alignment_multiple = static_cast<int>(volk_get_alignment() / sizeof(lv_8sc_t));
set_alignment(std::max(1, alignment_multiple)); set_alignment(std::max(1, alignment_multiple));
} }

View File

@ -35,7 +35,7 @@ interleaved_byte_to_complex_short::interleaved_byte_to_complex_short() : sync_de
gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), // lv_16sc_t is a Volk's typedef for std::complex<short int> gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), // lv_16sc_t is a Volk's typedef for std::complex<short int>
2) 2)
{ {
const int alignment_multiple = volk_get_alignment() / sizeof(lv_16sc_t); const auto alignment_multiple = static_cast<int>(volk_get_alignment() / sizeof(lv_16sc_t));
set_alignment(std::max(1, alignment_multiple)); set_alignment(std::max(1, alignment_multiple));
} }

View File

@ -35,7 +35,7 @@ interleaved_short_to_complex_short::interleaved_short_to_complex_short() : sync_
gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), // lv_16sc_t is a Volk's typedef for std::complex<short int> gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), // lv_16sc_t is a Volk's typedef for std::complex<short int>
2) 2)
{ {
const int alignment_multiple = volk_get_alignment() / sizeof(lv_16sc_t); const auto alignment_multiple = static_cast<int>(volk_get_alignment() / sizeof(lv_16sc_t));
set_alignment(std::max(1, alignment_multiple)); set_alignment(std::max(1, alignment_multiple));
} }

View File

@ -28,8 +28,8 @@ BeamformerFilter::BeamformerFilter(
const ConfigurationInterface* configuration, const std::string& role, const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_stream, unsigned int out_stream) : role_(role), in_stream_(in_stream), out_stream_(out_stream) unsigned int in_stream, unsigned int out_stream) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
{ {
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
std::string default_dump_file = "./data/input_filter.dat"; const std::string default_dump_file("./data/input_filter.dat");
item_type_ = configuration->property(role + ".item_type", default_item_type); item_type_ = configuration->property(role + ".item_type", default_item_type);
dump_ = configuration->property(role + ".dump", false); dump_ = configuration->property(role + ".dump", false);
DLOG(INFO) << "dump_ is " << dump_; DLOG(INFO) << "dump_ is " << dump_;

View File

@ -132,17 +132,17 @@ FirFilter::FirFilter(const ConfigurationInterface* configuration, std::string ro
void FirFilter::init() void FirFilter::init()
{ {
std::string default_input_item_type = "gr_complex"; const std::string default_input_item_type("gr_complex");
std::string default_output_item_type = "gr_complex"; const std::string default_output_item_type("gr_complex");
std::string default_taps_item_type = "float"; const std::string default_taps_item_type("float");
std::string default_dump_filename = "../data/input_filter.dat"; const std::string default_dump_filename("../data/input_filter.dat");
int default_number_of_taps = 6; const int default_number_of_taps = 6;
unsigned int default_number_of_bands = 2; const unsigned int default_number_of_bands = 2;
std::vector<double> default_bands = {0.0, 0.4, 0.6, 1.0}; const std::vector<double> default_bands = {0.0, 0.4, 0.6, 1.0};
std::vector<double> default_ampl = {1.0, 1.0, 0.0, 0.0}; const std::vector<double> default_ampl = {1.0, 1.0, 0.0, 0.0};
std::vector<double> default_error_w = {1.0, 1.0}; const std::vector<double> default_error_w = {1.0, 1.0};
std::string default_filter_type = "bandpass"; const std::string default_filter_type("bandpass");
int default_grid_density = 16; const int default_grid_density = 16;
DLOG(INFO) << "role " << role_; DLOG(INFO) << "role " << role_;

View File

@ -31,20 +31,20 @@
FreqXlatingFirFilter::FreqXlatingFirFilter(const ConfigurationInterface* configuration, std::string role, FreqXlatingFirFilter::FreqXlatingFirFilter(const ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) unsigned int in_streams, unsigned int out_streams) : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams)
{ {
std::string default_input_item_type = "gr_complex"; const std::string default_input_item_type("gr_complex");
std::string default_output_item_type = "gr_complex"; const std::string default_output_item_type("gr_complex");
std::string default_taps_item_type = "float"; const std::string default_taps_item_type("float");
std::string default_dump_filename = "../data/input_filter.dat"; const std::string default_dump_filename("../data/input_filter.dat");
double default_intermediate_freq = 0.0; const double default_intermediate_freq = 0.0;
double default_sampling_freq = 4000000.0; const double default_sampling_freq = 4000000.0;
int default_number_of_taps = 6; const int default_number_of_taps = 6;
unsigned int default_number_of_bands = 2; const unsigned int default_number_of_bands = 2;
std::vector<double> default_bands = {0.0, 0.4, 0.6, 1.0}; const std::vector<double> default_bands = {0.0, 0.4, 0.6, 1.0};
std::vector<double> default_ampl = {1.0, 1.0, 0.0, 0.0}; const std::vector<double> default_ampl = {1.0, 1.0, 0.0, 0.0};
std::vector<double> default_error_w = {1.0, 1.0}; const std::vector<double> default_error_w = {1.0, 1.0};
std::string default_filter_type = "bandpass"; const std::string default_filter_type("bandpass");
int default_grid_density = 16; const int default_grid_density = 16;
int default_decimation_factor = 1; const int default_decimation_factor = 1;
DLOG(INFO) << "role " << role_; DLOG(INFO) << "role " << role_;

View File

@ -28,27 +28,22 @@
NotchFilter::NotchFilter(const ConfigurationInterface* configuration, const std::string& role, NotchFilter::NotchFilter(const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
{ {
float pfa; const float default_pfa = 0.001;
float default_pfa = 0.001; const float default_p_c_factor = 0.9;
float p_c_factor; const int default_length_ = 32;
float default_p_c_factor = 0.9; const int default_n_segments_est = 12500;
int length_; const int default_n_segments_reset = 5000000;
int default_length_ = 32; const std::string default_item_type("gr_complex");
int n_segments_est; const std::string default_dump_file("./data/input_filter.dat");
int default_n_segments_est = 12500;
int n_segments_reset;
int default_n_segments_reset = 5000000;
std::string default_item_type = "gr_complex";
std::string default_dump_file = "./data/input_filter.dat";
item_type_ = configuration->property(role + ".item_type", default_item_type); item_type_ = configuration->property(role + ".item_type", default_item_type);
dump_ = configuration->property(role + ".dump", false); dump_ = configuration->property(role + ".dump", false);
DLOG(INFO) << "dump_ is " << dump_; DLOG(INFO) << "dump_ is " << dump_;
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
pfa = configuration->property(role + ".pfa", default_pfa); float pfa = configuration->property(role + ".pfa", default_pfa);
p_c_factor = configuration->property(role + ".p_c_factor", default_p_c_factor); float p_c_factor = configuration->property(role + ".p_c_factor", default_p_c_factor);
length_ = configuration->property(role + ".length", default_length_); int length_ = configuration->property(role + ".length", default_length_);
n_segments_est = configuration->property(role + ".segments_est", default_n_segments_est); int n_segments_est = configuration->property(role + ".segments_est", default_n_segments_est);
n_segments_reset = configuration->property(role + ".segments_reset", default_n_segments_reset); int n_segments_reset = configuration->property(role + ".segments_reset", default_n_segments_reset);
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex")
{ {
item_size_ = sizeof(gr_complex); item_size_ = sizeof(gr_complex);

View File

@ -29,32 +29,26 @@
NotchFilterLite::NotchFilterLite(const ConfigurationInterface* configuration, const std::string& role, NotchFilterLite::NotchFilterLite(const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
{ {
float p_c_factor; const float default_p_c_factor = 0.9;
float default_p_c_factor = 0.9; const float default_pfa = 0.001;
float pfa; const int default_length_ = 32;
float default_pfa = 0.001; const int default_n_segments_est = 12500;
int length_; const int default_n_segments_reset = 5000000;
int default_length_ = 32; const float default_samp_freq = 4000000;
int n_segments_est; const std::string default_item_type("gr_complex");
int default_n_segments_est = 12500; const std::string default_dump_file("./data/input_filter.dat");
int n_segments_reset;
int default_n_segments_reset = 5000000;
float default_samp_freq = 4000000;
float samp_freq = configuration->property("SignalSource.sampling_frequency", default_samp_freq); float samp_freq = configuration->property("SignalSource.sampling_frequency", default_samp_freq);
float default_coeff_rate = samp_freq * 0.1; float default_coeff_rate = samp_freq * 0.1F;
float coeff_rate;
std::string default_item_type = "gr_complex";
std::string default_dump_file = "./data/input_filter.dat";
item_type_ = configuration->property(role + ".item_type", default_item_type); item_type_ = configuration->property(role + ".item_type", default_item_type);
dump_ = configuration->property(role + ".dump", false); dump_ = configuration->property(role + ".dump", false);
DLOG(INFO) << "dump_ is " << dump_; DLOG(INFO) << "dump_ is " << dump_;
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
p_c_factor = configuration->property(role + ".p_c_factor", default_p_c_factor); float p_c_factor = configuration->property(role + ".p_c_factor", default_p_c_factor);
pfa = configuration->property(role + ".pfa", default_pfa); float pfa = configuration->property(role + ".pfa", default_pfa);
coeff_rate = configuration->property(role + ".coeff_rate", default_coeff_rate); float coeff_rate = configuration->property(role + ".coeff_rate", default_coeff_rate);
length_ = configuration->property(role + ".length", default_length_); int length_ = configuration->property(role + ".length", default_length_);
n_segments_est = configuration->property(role + ".segments_est", default_n_segments_est); int n_segments_est = configuration->property(role + ".segments_est", default_n_segments_est);
n_segments_reset = configuration->property(role + ".segments_reset", default_n_segments_reset); int n_segments_reset = configuration->property(role + ".segments_reset", default_n_segments_reset);
int n_segments_coeff = static_cast<int>((samp_freq / coeff_rate) / static_cast<float>(length_)); int n_segments_coeff = static_cast<int>((samp_freq / coeff_rate) / static_cast<float>(length_));
n_segments_coeff = std::max(1, n_segments_coeff); n_segments_coeff = std::max(1, n_segments_coeff);
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex")

View File

@ -32,9 +32,9 @@ PulseBlankingFilter::PulseBlankingFilter(const ConfigurationInterface* configura
{ {
size_t item_size; size_t item_size;
xlat_ = false; xlat_ = false;
std::string default_input_item_type = "gr_complex"; const std::string default_input_item_type("gr_complex");
std::string default_output_item_type = "gr_complex"; const std::string default_output_item_type("gr_complex");
std::string default_dump_filename = "../data/input_filter.dat"; const std::string default_dump_filename("../data/input_filter.dat");
DLOG(INFO) << "role " << role_; DLOG(INFO) << "role " << role_;
@ -42,13 +42,13 @@ PulseBlankingFilter::PulseBlankingFilter(const ConfigurationInterface* configura
output_item_type_ = configuration->property(role_ + ".output_item_type", default_output_item_type); output_item_type_ = configuration->property(role_ + ".output_item_type", default_output_item_type);
dump_ = configuration->property(role_ + ".dump", false); dump_ = configuration->property(role_ + ".dump", false);
dump_filename_ = configuration->property(role_ + ".dump_filename", default_dump_filename); dump_filename_ = configuration->property(role_ + ".dump_filename", default_dump_filename);
float default_pfa_ = 0.04; const float default_pfa_ = 0.04;
float pfa = configuration->property(role_ + ".pfa", default_pfa_); float pfa = configuration->property(role_ + ".pfa", default_pfa_);
int default_length_ = 32; const int default_length_ = 32;
int length_ = configuration->property(role_ + ".length", default_length_); int length_ = configuration->property(role_ + ".length", default_length_);
int default_n_segments_est = 12500; const int default_n_segments_est = 12500;
int n_segments_est = configuration->property(role_ + ".segments_est", default_n_segments_est); int n_segments_est = configuration->property(role_ + ".segments_est", default_n_segments_est);
int default_n_segments_reset = 5000000; const int default_n_segments_reset = 5000000;
int n_segments_reset = configuration->property(role_ + ".segments_reset", default_n_segments_reset); int n_segments_reset = configuration->property(role_ + ".segments_reset", default_n_segments_reset);
if (input_item_type_ == "gr_complex") if (input_item_type_ == "gr_complex")
{ {
@ -62,17 +62,17 @@ PulseBlankingFilter::PulseBlankingFilter(const ConfigurationInterface* configura
item_size = sizeof(gr_complex); // avoids uninitialization item_size = sizeof(gr_complex); // avoids uninitialization
input_size_ = sizeof(gr_complex); // avoids uninitialization input_size_ = sizeof(gr_complex); // avoids uninitialization
} }
double default_if = 0.0; const double default_if = 0.0;
double if_aux = configuration->property(role_ + ".if", default_if); double if_aux = configuration->property(role_ + ".if", default_if);
double if_ = configuration->property(role_ + ".IF", if_aux); double if_ = configuration->property(role_ + ".IF", if_aux);
if (std::abs(if_) > 1.0) if (std::abs(if_) > 1.0)
{ {
xlat_ = true; xlat_ = true;
double default_sampling_freq = 4000000.0; const double default_sampling_freq = 4000000.0;
double sampling_freq_ = configuration->property(role_ + ".sampling_frequency", default_sampling_freq); double sampling_freq_ = configuration->property(role_ + ".sampling_frequency", default_sampling_freq);
double default_bw = 2000000.0; const double default_bw = 2000000.0;
double bw_ = configuration->property(role_ + ".bw", default_bw); double bw_ = configuration->property(role_ + ".bw", default_bw);
double default_tw = bw_ / 10.0; const double default_tw = bw_ / 10.0;
double tw_ = configuration->property(role_ + ".tw", default_tw); double tw_ = configuration->property(role_ + ".tw", default_tw);
const std::vector<float> taps = gr::filter::firdes::low_pass(1.0, sampling_freq_, bw_, tw_); const std::vector<float> taps = gr::filter::firdes::low_pass(1.0, sampling_freq_, bw_, tw_);
freq_xlating_ = gr::filter::freq_xlating_fir_filter_ccf::make(1, taps, if_, sampling_freq_); freq_xlating_ = gr::filter::freq_xlating_fir_filter_ccf::make(1, taps, if_, sampling_freq_);

View File

@ -23,6 +23,7 @@
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <algorithm> #include <algorithm>
#include <cmath>
#include <cstring> #include <cstring>
@ -91,7 +92,7 @@ int Notch::general_work(int noutput_items, gr_vector_int &ninput_items __attribu
d_fft->execute(); d_fft->execute();
volk_32fc_s32f_power_spectrum_32f(power_spect.data(), d_fft->get_outbuf(), 1.0, length_); volk_32fc_s32f_power_spectrum_32f(power_spect.data(), d_fft->get_outbuf(), 1.0, length_);
volk_32f_s32f_calc_spectral_noise_floor_32f(&sig2dB, power_spect.data(), 15.0, length_); volk_32f_s32f_calc_spectral_noise_floor_32f(&sig2dB, power_spect.data(), 15.0, length_);
sig2lin = std::pow(10.0, (sig2dB / 10.0)) / (static_cast<float>(n_deg_fred)); sig2lin = std::pow(10.0F, (sig2dB / 10.0F)) / (static_cast<float>(n_deg_fred));
noise_pow_est = (static_cast<float>(n_segments) * noise_pow_est + sig2lin) / (static_cast<float>(n_segments + 1)); noise_pow_est = (static_cast<float>(n_segments) * noise_pow_est + sig2lin) / (static_cast<float>(n_segments + 1));
memcpy(out, in, sizeof(gr_complex) * length_); memcpy(out, in, sizeof(gr_complex) * length_);
} }
@ -103,13 +104,13 @@ int Notch::general_work(int noutput_items, gr_vector_int &ninput_items __attribu
if (filter_state_ == false) if (filter_state_ == false)
{ {
filter_state_ = true; filter_state_ = true;
last_out = gr_complex(0, 0); last_out = gr_complex(0.0, 0.0);
} }
volk_32fc_x2_multiply_conjugate_32fc(c_samples.data(), in, (in - 1), length_); volk_32fc_x2_multiply_conjugate_32fc(c_samples.data(), in, (in - 1), length_);
volk_32fc_s32f_atan2_32f(angle_.data(), c_samples.data(), static_cast<float>(1.0), length_); volk_32fc_s32f_atan2_32f(angle_.data(), c_samples.data(), static_cast<float>(1.0), length_);
for (int32_t aux = 0; aux < length_; aux++) for (int32_t aux = 0; aux < length_; aux++)
{ {
z_0 = std::exp(gr_complex(0, 1) * (*(angle_.data() + aux))); z_0 = std::exp(gr_complex(0.0, 1.0) * (*(angle_.data() + aux)));
*(out + aux) = *(in + aux) - z_0 * (*(in + aux - 1)) + p_c_factor * z_0 * last_out; *(out + aux) = *(in + aux) - z_0 * (*(in + aux - 1)) + p_c_factor * z_0 * last_out;
last_out = *(out + aux); last_out = *(out + aux);
} }

View File

@ -23,6 +23,7 @@
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <algorithm> #include <algorithm>
#include <cmath>
#include <cstring> #include <cstring>
@ -96,7 +97,7 @@ int NotchLite::general_work(int noutput_items, gr_vector_int &ninput_items __att
d_fft->execute(); d_fft->execute();
volk_32fc_s32f_power_spectrum_32f(power_spect.data(), d_fft->get_outbuf(), 1.0, length_); volk_32fc_s32f_power_spectrum_32f(power_spect.data(), d_fft->get_outbuf(), 1.0, length_);
volk_32f_s32f_calc_spectral_noise_floor_32f(&sig2dB, power_spect.data(), 15.0, length_); volk_32f_s32f_calc_spectral_noise_floor_32f(&sig2dB, power_spect.data(), 15.0, length_);
sig2lin = std::pow(10.0, (sig2dB / 10.0)) / static_cast<float>(n_deg_fred); sig2lin = std::pow(10.0F, (sig2dB / 10.0F)) / static_cast<float>(n_deg_fred);
noise_pow_est = (static_cast<float>(n_segments) * noise_pow_est + sig2lin) / static_cast<float>(n_segments + 1); noise_pow_est = (static_cast<float>(n_segments) * noise_pow_est + sig2lin) / static_cast<float>(n_segments + 1);
memcpy(out, in, sizeof(gr_complex) * length_); memcpy(out, in, sizeof(gr_complex) * length_);
} }
@ -117,7 +118,7 @@ int NotchLite::general_work(int noutput_items, gr_vector_int &ninput_items __att
volk_32fc_s32f_atan2_32f(&angle1, &c_samples1, static_cast<float>(1.0), 1); volk_32fc_s32f_atan2_32f(&angle1, &c_samples1, static_cast<float>(1.0), 1);
volk_32fc_x2_multiply_conjugate_32fc(&c_samples2, (in + length_ - 1), (in + length_ - 2), 1); volk_32fc_x2_multiply_conjugate_32fc(&c_samples2, (in + length_ - 1), (in + length_ - 2), 1);
volk_32fc_s32f_atan2_32f(&angle2, &c_samples2, static_cast<float>(1.0), 1); volk_32fc_s32f_atan2_32f(&angle2, &c_samples2, static_cast<float>(1.0), 1);
float angle_ = (angle1 + angle2) / 2.0; float angle_ = (angle1 + angle2) / 2.0F;
z_0 = std::exp(gr_complex(0, 1) * angle_); z_0 = std::exp(gr_complex(0, 1) * angle_);
} }
for (int32_t aux = 0; aux < length_; aux++) for (int32_t aux = 0; aux < length_; aux++)

View File

@ -34,7 +34,7 @@ cshort_to_float_x2::cshort_to_float_x2() : sync_block("cshort_to_float_x2",
gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), // lv_8sc_t is a Volk's typedef for std::complex<signed char> gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), // lv_8sc_t is a Volk's typedef for std::complex<signed char>
gr::io_signature::make(2, 2, sizeof(float))) gr::io_signature::make(2, 2, sizeof(float)))
{ {
const int alignment_multiple = volk_get_alignment() / sizeof(lv_16sc_t); const auto alignment_multiple = static_cast<int>(volk_get_alignment() / sizeof(lv_16sc_t));
set_alignment(std::max(1, alignment_multiple)); set_alignment(std::max(1, alignment_multiple));
} }

View File

@ -34,7 +34,7 @@ Pass_Through::Pass_Through(const ConfigurationInterface* configuration, const st
in_streams_(in_streams), in_streams_(in_streams),
out_streams_(out_streams) out_streams_(out_streams)
{ {
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
std::string input_type = configuration->property(role + ".input_item_type", default_item_type); std::string input_type = configuration->property(role + ".input_item_type", default_item_type);
std::string output_type = configuration->property(role + ".output_item_type", default_item_type); std::string output_type = configuration->property(role + ".output_item_type", default_item_type);
if (input_type != output_type) if (input_type != output_type)

View File

@ -128,7 +128,7 @@ obsd_t insert_obs_to_rtklib(obsd_t& rtklib_obs, const Gnss_Synchro& gnss_synchro
geph_t eph_to_rtklib(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const Glonass_Gnav_Utc_Model& gnav_clock_model) geph_t eph_to_rtklib(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const Glonass_Gnav_Utc_Model& gnav_clock_model)
{ {
double week; int week;
double sec; double sec;
int adj_week; int adj_week;
geph_t rtklib_sat = {0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, 0.0, 0.0, 0.0}; geph_t rtklib_sat = {0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, 0.0, 0.0, 0.0};

View File

@ -555,17 +555,11 @@ void hybrid_observables_gs::smooth_pseudoranges(std::vector<Gnss_Synchro> &data)
switch (d_mapStringValues[it->Signal]) switch (d_mapStringValues[it->Signal])
{ {
case evGPS_1C: case evGPS_1C:
wavelength_m = SPEED_OF_LIGHT_M_S / FREQ1;
break;
case evGPS_L5:
wavelength_m = SPEED_OF_LIGHT_M_S / FREQ5;
break;
case evSBAS_1C: case evSBAS_1C:
wavelength_m = SPEED_OF_LIGHT_M_S / FREQ1;
break;
case evGAL_1B: case evGAL_1B:
wavelength_m = SPEED_OF_LIGHT_M_S / FREQ1; wavelength_m = SPEED_OF_LIGHT_M_S / FREQ1;
break; break;
case evGPS_L5:
case evGAL_5X: case evGAL_5X:
wavelength_m = SPEED_OF_LIGHT_M_S / FREQ5; wavelength_m = SPEED_OF_LIGHT_M_S / FREQ5;
break; break;
@ -626,7 +620,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused)
{ {
d_Rx_clock_buffer.push_back(in[d_nchannels_in - 1][0].Tracking_sample_counter); d_Rx_clock_buffer.push_back(in[d_nchannels_in - 1][0].Tracking_sample_counter);
// Consume one item from the clock channel (last of the input channels) // Consume one item from the clock channel (last of the input channels)
consume(d_nchannels_in - 1, 1); consume(static_cast<int32_t>(d_nchannels_in) - 1, 1);
} }
// Push the tracking observables into buffers to allow the observable interpolation at the desired Rx clock // Push the tracking observables into buffers to allow the observable interpolation at the desired Rx clock

View File

@ -35,12 +35,10 @@ DirectResamplerConditioner::DirectResamplerConditioner(
const ConfigurationInterface* configuration, const std::string& role, const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_stream, unsigned int out_stream) : role_(role), in_stream_(in_stream), out_stream_(out_stream) unsigned int in_stream, unsigned int out_stream) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
{ {
std::string default_item_type = "short"; const std::string default_item_type("short");
std::string default_dump_file = "./data/signal_conditioner.dat"; const std::string default_dump_file("./data/signal_conditioner.dat");
double fs_in_deprecated; double fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0);
double fs_in; double fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", 4000000.0); sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", 4000000.0);
sample_freq_out_ = configuration->property(role_ + ".sample_freq_out", fs_in); sample_freq_out_ = configuration->property(role_ + ".sample_freq_out", fs_in);
if (std::fabs(fs_in - sample_freq_out_) > std::numeric_limits<double>::epsilon()) if (std::fabs(fs_in - sample_freq_out_) > std::numeric_limits<double>::epsilon())

View File

@ -30,12 +30,10 @@ MmseResamplerConditioner::MmseResamplerConditioner(
const ConfigurationInterface* configuration, const std::string& role, const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_stream, unsigned int out_stream) : role_(role), in_stream_(in_stream), out_stream_(out_stream) unsigned int in_stream, unsigned int out_stream) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
{ {
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
std::string default_dump_file = "./data/signal_conditioner.dat"; const std::string default_dump_file("./data/signal_conditioner.dat");
double fs_in_deprecated; double fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0);
double fs_in; double fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", 4000000.0); sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", 4000000.0);
sample_freq_out_ = configuration->property(role_ + ".sample_freq_out", fs_in); sample_freq_out_ = configuration->property(role_ + ".sample_freq_out", fs_in);
if (std::fabs(fs_in - sample_freq_out_) > std::numeric_limits<double>::epsilon()) if (std::fabs(fs_in - sample_freq_out_) > std::numeric_limits<double>::epsilon())
@ -63,9 +61,9 @@ MmseResamplerConditioner::MmseResamplerConditioner(
fir_filter_ccf_ = gr::filter::fir_filter_ccf::make(1, taps); fir_filter_ccf_ = gr::filter::fir_filter_ccf::make(1, taps);
#ifdef GR_GREATER_38 #ifdef GR_GREATER_38
resampler_ = gr::filter::mmse_resampler_cc::make(0.0, sample_freq_in_ / sample_freq_out_); resampler_ = gr::filter::mmse_resampler_cc::make(0.0, static_cast<float>(sample_freq_in_ / sample_freq_out_));
#else #else
resampler_ = gr::filter::fractional_resampler_cc::make(0.0, sample_freq_in_ / sample_freq_out_); resampler_ = gr::filter::fractional_resampler_cc::make(0.0, static_cast<float>(sample_freq_in_ / sample_freq_out_));
#endif #endif
DLOG(INFO) << "sample_freq_in " << sample_freq_in_; DLOG(INFO) << "sample_freq_in " << sample_freq_in_;
DLOG(INFO) << "sample_freq_out" << sample_freq_out_; DLOG(INFO) << "sample_freq_out" << sample_freq_out_;

View File

@ -36,7 +36,7 @@ SignalGenerator::SignalGenerator(const ConfigurationInterface* configuration,
unsigned int out_stream, unsigned int out_stream,
Concurrent_Queue<pmt::pmt_t>* queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream) Concurrent_Queue<pmt::pmt_t>* queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
{ {
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
std::string default_dump_file = "./data/gen_source.dat"; std::string default_dump_file = "./data/gen_source.dat";
std::string default_system = "G"; std::string default_system = "G";
std::string default_signal = "1C"; std::string default_signal = "1C";

View File

@ -75,8 +75,8 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con
{ {
filter_source_ = configuration->property(role + ".filter_source", std::string("Off")); filter_source_ = configuration->property(role + ".filter_source", std::string("Off"));
} }
Fpass_ = configuration->property(role + ".Fpass", 0.0); Fpass_ = configuration->property(role + ".Fpass", static_cast<float>(0.0));
Fstop_ = configuration->property(role + ".Fstop", 0.0); Fstop_ = configuration->property(role + ".Fstop", static_cast<float>(0.0));
enable_dds_lo_ = configuration->property(role + ".enable_dds_lo", false); enable_dds_lo_ = configuration->property(role + ".enable_dds_lo", false);
freq_dds_tx_hz_ = configuration->property(role + ".freq_dds_tx_hz", static_cast<uint64_t>(10000)); freq_dds_tx_hz_ = configuration->property(role + ".freq_dds_tx_hz", static_cast<uint64_t>(10000));
freq_rf_tx_hz_ = configuration->property(role + ".freq_rf_tx_hz", static_cast<uint64_t>(GPS_L1_FREQ_HZ - GPS_L5_FREQ_HZ - freq_dds_tx_hz_)); freq_rf_tx_hz_ = configuration->property(role + ".freq_rf_tx_hz", static_cast<uint64_t>(GPS_L1_FREQ_HZ - GPS_L5_FREQ_HZ - freq_dds_tx_hz_));

View File

@ -32,16 +32,15 @@ CustomUDPSignalSource::CustomUDPSignalSource(const ConfigurationInterface* confi
Concurrent_Queue<pmt::pmt_t>* queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream) Concurrent_Queue<pmt::pmt_t>* queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
{ {
// DUMP PARAMETERS // DUMP PARAMETERS
std::string empty = ""; const std::string default_dump_file("./data/signal_source.dat");
std::string default_dump_file = "./data/signal_source.dat"; const std::string default_item_type("gr_complex");
std::string default_item_type = "gr_complex";
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);
// network PARAMETERS // network PARAMETERS
std::string default_capture_device = "eth0"; const std::string default_capture_device("eth0");
std::string default_address = "127.0.0.1"; const std::string default_address("127.0.0.1");
int default_port = 1234; const int default_port = 1234;
std::string address = configuration->property(role + ".origin_address", default_address); std::string address = configuration->property(role + ".origin_address", default_address);
std::string capture_device = configuration->property(role + ".capture_device", default_capture_device); std::string capture_device = configuration->property(role + ".capture_device", default_capture_device);
int port = configuration->property(role + ".port", default_port); int port = configuration->property(role + ".port", default_port);
@ -51,7 +50,7 @@ CustomUDPSignalSource::CustomUDPSignalSource(const ConfigurationInterface* confi
channels_in_udp_ = configuration->property(role + ".channels_in_udp", 1); channels_in_udp_ = configuration->property(role + ".channels_in_udp", 1);
IQ_swap_ = configuration->property(role + ".IQ_swap", false); IQ_swap_ = configuration->property(role + ".IQ_swap", false);
std::string default_sample_type = "cbyte"; const std::string default_sample_type("cbyte");
std::string sample_type = configuration->property(role + ".sample_type", default_sample_type); std::string sample_type = configuration->property(role + ".sample_type", default_sample_type);
item_type_ = configuration->property(role + ".item_type", default_item_type); item_type_ = configuration->property(role + ".item_type", default_item_type);
// output item size is always gr_complex // output item size is always gr_complex

View File

@ -37,8 +37,8 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(const ConfigurationInterface *configu
const std::string &role, unsigned int in_stream, unsigned int out_stream, const std::string &role, unsigned int in_stream, unsigned int out_stream,
Concurrent_Queue<pmt::pmt_t> *queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) Concurrent_Queue<pmt::pmt_t> *queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
{ {
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
std::string default_dump_file = "./data/signal_source.dat"; const std::string default_dump_file("./data/signal_source.dat");
std::string default_gain_mode("slow_attack"); std::string default_gain_mode("slow_attack");
double default_tx_attenuation_db = -10.0; double default_tx_attenuation_db = -10.0;
uri_ = configuration->property(role + ".device_address", std::string("192.168.2.1")); uri_ = configuration->property(role + ".device_address", std::string("192.168.2.1"));

View File

@ -28,7 +28,7 @@
LabsatSignalSource::LabsatSignalSource(const ConfigurationInterface* configuration, LabsatSignalSource::LabsatSignalSource(const ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) const std::string& role, unsigned int in_stream, unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
{ {
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
std::string default_dump_file = "./labsat_output.dat"; std::string default_dump_file = "./labsat_output.dat";
item_type_ = configuration->property(role + ".item_type", default_item_type); item_type_ = configuration->property(role + ".item_type", default_item_type);
dump_ = configuration->property(role + ".dump", false); dump_ = configuration->property(role + ".dump", false);

View File

@ -44,7 +44,7 @@ MultichannelFileSignalSource::MultichannelFileSignalSource(const ConfigurationIn
sampling_frequency_ = configuration->property(role + ".sampling_frequency", static_cast<int64_t>(0)); sampling_frequency_ = configuration->property(role + ".sampling_frequency", static_cast<int64_t>(0));
n_channels_ = configuration->property(role + ".total_channels", 1); n_channels_ = configuration->property(role + ".total_channels", 1);
for (unsigned int n = 0; n < n_channels_; n++) for (int32_t n = 0; n < n_channels_; n++)
{ {
filename_vec_.push_back(configuration->property(role + ".filename" + std::to_string(n), default_filename)); filename_vec_.push_back(configuration->property(role + ".filename" + std::to_string(n), default_filename));
} }
@ -93,7 +93,7 @@ MultichannelFileSignalSource::MultichannelFileSignalSource(const ConfigurationIn
} }
try try
{ {
for (unsigned int n = 0; n < n_channels_; n++) for (int32_t n = 0; n < n_channels_; n++)
{ {
file_source_vec_.push_back(gr::blocks::file_source::make(item_size_, filename_vec_.at(n).c_str(), repeat_)); file_source_vec_.push_back(gr::blocks::file_source::make(item_size_, filename_vec_.at(n).c_str(), repeat_));
@ -210,13 +210,13 @@ MultichannelFileSignalSource::MultichannelFileSignalSource(const ConfigurationIn
if (enable_throttle_control_) if (enable_throttle_control_)
{ {
for (unsigned int n = 0; n < n_channels_; n++) for (int32_t n = 0; n < n_channels_; n++)
{ {
throttle_vec_.push_back(gr::blocks::throttle::make(item_size_, sampling_frequency_)); throttle_vec_.push_back(gr::blocks::throttle::make(item_size_, sampling_frequency_));
} }
} }
for (unsigned int n = 0; n < n_channels_; n++) for (int32_t n = 0; n < n_channels_; n++)
{ {
LOG(INFO) << "Multichanne File source filename #" << n << filename_vec_.at(n); LOG(INFO) << "Multichanne File source filename #" << n << filename_vec_.at(n);
} }
@ -242,7 +242,7 @@ void MultichannelFileSignalSource::connect(gr::top_block_sptr top_block)
{ {
if (enable_throttle_control_ == true) if (enable_throttle_control_ == true)
{ {
for (unsigned int n = 0; n < n_channels_; n++) for (int32_t n = 0; n < n_channels_; n++)
{ {
top_block->connect(file_source_vec_.at(n), 0, throttle_vec_.at(n), 0); top_block->connect(file_source_vec_.at(n), 0, throttle_vec_.at(n), 0);
DLOG(INFO) << "connected file_source #" << n << " to throttle"; DLOG(INFO) << "connected file_source #" << n << " to throttle";
@ -252,7 +252,7 @@ void MultichannelFileSignalSource::connect(gr::top_block_sptr top_block)
} }
else else
{ {
for (unsigned int n = 0; n < n_channels_; n++) for (int32_t n = 0; n < n_channels_; n++)
{ {
top_block->connect(file_source_vec_.at(n), 0, valve_, n); top_block->connect(file_source_vec_.at(n), 0, valve_, n);
DLOG(INFO) << "connected file_source #" << n << " to valve_"; DLOG(INFO) << "connected file_source #" << n << " to valve_";
@ -265,7 +265,7 @@ void MultichannelFileSignalSource::disconnect(gr::top_block_sptr top_block)
{ {
if (enable_throttle_control_ == true) if (enable_throttle_control_ == true)
{ {
for (unsigned int n = 0; n < n_channels_; n++) for (int32_t n = 0; n < n_channels_; n++)
{ {
top_block->disconnect(file_source_vec_.at(n), 0, throttle_vec_.at(n), 0); top_block->disconnect(file_source_vec_.at(n), 0, throttle_vec_.at(n), 0);
DLOG(INFO) << "disconnected file_source #" << n << " to throttle"; DLOG(INFO) << "disconnected file_source #" << n << " to throttle";
@ -275,7 +275,7 @@ void MultichannelFileSignalSource::disconnect(gr::top_block_sptr top_block)
} }
else else
{ {
for (unsigned int n = 0; n < n_channels_; n++) for (int32_t n = 0; n < n_channels_; n++)
{ {
top_block->disconnect(file_source_vec_.at(n), 0, valve_, n); top_block->disconnect(file_source_vec_.at(n), 0, valve_, n);
DLOG(INFO) << "disconnected file_source #" << n << " to valve_"; DLOG(INFO) << "disconnected file_source #" << n << " to valve_";

View File

@ -118,7 +118,7 @@ private:
uint64_t samples_; uint64_t samples_;
int64_t sampling_frequency_; int64_t sampling_frequency_;
size_t item_size_; size_t item_size_;
uint32_t n_channels_; int32_t n_channels_;
uint32_t in_streams_; uint32_t in_streams_;
uint32_t out_streams_; uint32_t out_streams_;
bool repeat_; bool repeat_;

View File

@ -34,9 +34,9 @@ OsmosdrSignalSource::OsmosdrSignalSource(const ConfigurationInterface* configura
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
{ {
// DUMP PARAMETERS // DUMP PARAMETERS
std::string empty = ""; std::string empty;
std::string default_dump_file = "./data/signal_source.dat"; const std::string default_dump_file("./data/signal_source.dat");
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
samples_ = configuration->property(role + ".samples", static_cast<int64_t>(0)); samples_ = configuration->property(role + ".samples", static_cast<int64_t>(0));
dump_ = configuration->property(role + ".dump", false); dump_ = configuration->property(role + ".dump", false);
dump_filename_ = configuration->property(role + ".dump_filename", dump_filename_ = configuration->property(role + ".dump_filename",

View File

@ -31,8 +31,8 @@ PlutosdrSignalSource::PlutosdrSignalSource(const ConfigurationInterface* configu
const std::string& role, unsigned int in_stream, unsigned int out_stream, const std::string& role, unsigned int in_stream, unsigned int out_stream,
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
{ {
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
std::string default_dump_file = "./data/signal_source.dat"; const std::string default_dump_file("./data/signal_source.dat");
std::string default_gain_mode("slow_attack"); std::string default_gain_mode("slow_attack");
uri_ = configuration->property(role + ".device_address", std::string("192.168.2.1")); uri_ = configuration->property(role + ".device_address", std::string("192.168.2.1"));
freq_ = configuration->property(role + ".freq", static_cast<uint64_t>(GPS_L1_FREQ_HZ)); freq_ = configuration->property(role + ".freq", static_cast<uint64_t>(GPS_L1_FREQ_HZ));

View File

@ -29,7 +29,7 @@
RawArraySignalSource::RawArraySignalSource(const ConfigurationInterface* configuration, RawArraySignalSource::RawArraySignalSource(const ConfigurationInterface* configuration,
std::string role, unsigned int in_stream, unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) std::string role, unsigned int in_stream, unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
{ {
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
std::string default_dump_file = "./data/raw_array_source.dat"; std::string default_dump_file = "./data/raw_array_source.dat";
item_type_ = configuration->property(role + ".item_type", default_item_type); item_type_ = configuration->property(role + ".item_type", default_item_type);

View File

@ -39,23 +39,22 @@ RtlTcpSignalSource::RtlTcpSignalSource(const ConfigurationInterface* configurati
out_stream_(out_stream) out_stream_(out_stream)
{ {
// DUMP PARAMETERS // DUMP PARAMETERS
std::string empty = ""; const std::string default_dump_file("./data/signal_source.dat");
std::string default_dump_file = "./data/signal_source.dat"; const std::string default_item_type("gr_complex");
std::string default_item_type = "gr_complex";
samples_ = configuration->property(role + ".samples", static_cast<uint64_t>(0)); samples_ = configuration->property(role + ".samples", static_cast<uint64_t>(0));
dump_ = configuration->property(role + ".dump", false); dump_ = configuration->property(role + ".dump", false);
dump_filename_ = configuration->property(role + ".dump_filename", dump_filename_ = configuration->property(role + ".dump_filename",
default_dump_file); default_dump_file);
// rtl_tcp PARAMETERS // rtl_tcp PARAMETERS
std::string default_address = "127.0.0.1"; const std::string default_address("127.0.0.1");
int16_t default_port = 1234; const int16_t default_port = 1234;
AGC_enabled_ = configuration->property(role + ".AGC_enabled", true); AGC_enabled_ = configuration->property(role + ".AGC_enabled", true);
freq_ = configuration->property(role + ".freq", GPS_L1_FREQ_HZ); freq_ = configuration->property(role + ".freq", static_cast<int>(GPS_L1_FREQ_HZ));
gain_ = configuration->property(role + ".gain", 40.0); gain_ = configuration->property(role + ".gain", 40);
rf_gain_ = configuration->property(role + ".rf_gain", 40.0); rf_gain_ = configuration->property(role + ".rf_gain", 40.0);
if_gain_ = configuration->property(role + ".if_gain", 40.0); if_gain_ = configuration->property(role + ".if_gain", 40);
sample_rate_ = configuration->property(role + ".sampling_frequency", 2.0e6); sample_rate_ = configuration->property(role + ".sampling_frequency", 2000000);
item_type_ = configuration->property(role + ".item_type", default_item_type); item_type_ = configuration->property(role + ".item_type", default_item_type);
address_ = configuration->property(role + ".address", default_address); address_ = configuration->property(role + ".address", default_address);
port_ = configuration->property(role + ".port", default_port); port_ = configuration->property(role + ".port", default_port);

View File

@ -98,10 +98,10 @@ private:
std::string address_; std::string address_;
size_t item_size_; size_t item_size_;
uint64_t samples_; uint64_t samples_;
double sample_rate_; int sample_rate_;
double freq_; int freq_;
double gain_; int gain_;
double if_gain_; int if_gain_;
double rf_gain_; double rf_gain_;
unsigned int in_stream_; unsigned int in_stream_;
unsigned int out_stream_; unsigned int out_stream_;

View File

@ -56,7 +56,7 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(const ConfigurationInte
} }
if (n_channels_ > 1) if (n_channels_ > 1)
{ {
for (uint32_t i = 0; i < n_channels_; i++) for (int32_t i = 0; i < n_channels_; i++)
{ {
null_sinks_.push_back(gr::blocks::null_sink::make(sizeof(gr_complex))); null_sinks_.push_back(gr::blocks::null_sink::make(sizeof(gr_complex)));
unpack_spir_vec_.push_back(make_unpack_spir_gss6450_samples(adc_bits_)); unpack_spir_vec_.push_back(make_unpack_spir_gss6450_samples(adc_bits_));
@ -135,7 +135,7 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(const ConfigurationInte
LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]\n"; std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]\n";
for (uint32_t i = 0; i < (n_channels_); i++) for (int32_t i = 0; i < n_channels_; i++)
{ {
valve_vec_.emplace_back(gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue)); valve_vec_.emplace_back(gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue));
if (dump_) if (dump_)
@ -187,7 +187,7 @@ void SpirGSS6450FileSignalSource::connect(gr::top_block_sptr top_block)
if (n_channels_ > 1) if (n_channels_ > 1)
{ {
uint32_t aux = 0; uint32_t aux = 0;
for (uint32_t i = 0; i < n_channels_; i++) for (int32_t i = 0; i < n_channels_; i++)
{ {
if (i != (sel_ch_ - 1)) if (i != (sel_ch_ - 1))
{ {
@ -205,7 +205,7 @@ void SpirGSS6450FileSignalSource::connect(gr::top_block_sptr top_block)
} }
} }
} }
for (uint32_t i = 0; i < n_channels_; i++) for (int32_t i = 0; i < n_channels_; i++)
{ {
if (enable_throttle_control_) if (enable_throttle_control_)
{ {
@ -248,7 +248,7 @@ void SpirGSS6450FileSignalSource::disconnect(gr::top_block_sptr top_block)
if (n_channels_ > 1) if (n_channels_ > 1)
{ {
uint32_t aux = 0; uint32_t aux = 0;
for (uint32_t i = 0; i < n_channels_; i++) for (int32_t i = 0; i < n_channels_; i++)
{ {
if (i != (sel_ch_ - 1)) if (i != (sel_ch_ - 1))
{ {
@ -267,7 +267,7 @@ void SpirGSS6450FileSignalSource::disconnect(gr::top_block_sptr top_block)
} }
} }
for (uint32_t i = 0; i < (n_channels_); i++) for (int32_t i = 0; i < (n_channels_); i++)
{ {
if (enable_throttle_control_) if (enable_throttle_control_)
{ {

View File

@ -125,8 +125,8 @@ private:
uint32_t in_streams_; uint32_t in_streams_;
uint32_t out_streams_; uint32_t out_streams_;
uint32_t adc_bits_; uint32_t adc_bits_;
uint32_t n_channels_; int32_t n_channels_;
uint32_t sel_ch_; int32_t sel_ch_;
bool repeat_; bool repeat_;
bool dump_; // Enables dumping the gr_complex sample output bool dump_; // Enables dumping the gr_complex sample output
bool enable_throttle_control_; bool enable_throttle_control_;

View File

@ -34,8 +34,8 @@ UhdSignalSource::UhdSignalSource(const ConfigurationInterface* configuration,
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
{ {
// DUMP PARAMETERS // DUMP PARAMETERS
std::string empty = ""; std::string empty;
std::string default_dump_file = "./data/signal_source.dat"; const std::string default_dump_file("./data/signal_source.dat");
std::string default_item_type = "cshort"; std::string default_item_type = "cshort";
// UHD COMMON PARAMETERS // UHD COMMON PARAMETERS

View File

@ -406,16 +406,6 @@ int Gr_Complex_Ip_Packet_Source::work(int noutput_items,
switch (d_wire_sample_type) switch (d_wire_sample_type)
{ {
case 1: // complex byte samples case 1: // complex byte samples
bytes_requested = noutput_items * d_bytes_per_sample;
if (bytes_requested < fifo_items)
{
num_samples_readed = noutput_items; // read all
}
else
{
num_samples_readed = fifo_items / d_bytes_per_sample; // read what we have
}
break;
case 2: // complex 4 bits samples case 2: // complex 4 bits samples
bytes_requested = noutput_items * d_bytes_per_sample; bytes_requested = noutput_items * d_bytes_per_sample;
if (bytes_requested < fifo_items) if (bytes_requested < fifo_items)

View File

@ -418,7 +418,7 @@ int labsat23_source::general_work(int noutput_items,
{ {
std::vector<int16_t> memblock(n_int16_to_read); std::vector<int16_t> memblock(n_int16_to_read);
binary_input_file.read(reinterpret_cast<char *>(memblock.data()), n_int16_to_read * 2); binary_input_file.read(reinterpret_cast<char *>(memblock.data()), n_int16_to_read * 2);
n_int16_to_read = binary_input_file.gcount() / 2; // from bytes to int16 n_int16_to_read = static_cast<int>(binary_input_file.gcount()) / 2; // from bytes to int16
if (n_int16_to_read > 0) if (n_int16_to_read > 0)
{ {
int output_pointer = 0; int output_pointer = 0;
@ -476,7 +476,7 @@ int labsat23_source::general_work(int noutput_items,
{ {
std::vector<int16_t> memblock(n_int16_to_read); std::vector<int16_t> memblock(n_int16_to_read);
binary_input_file.read(reinterpret_cast<char *>(memblock.data()), n_int16_to_read * 2); binary_input_file.read(reinterpret_cast<char *>(memblock.data()), n_int16_to_read * 2);
n_int16_to_read = binary_input_file.gcount() / 2; // from bytes to int16 n_int16_to_read = static_cast<int>(binary_input_file.gcount()) / 2; // from bytes to int16
if (n_int16_to_read > 0) if (n_int16_to_read > 0)
{ {
int output_pointer = 0; int output_pointer = 0;

View File

@ -235,12 +235,12 @@ void rtl_tcp_signal_source_c::set_if_gain(int gain)
{3, 15, 3}}; {3, 15, 3}};
std::map<int, double> gains; std::map<int, double> gains;
for (int i = 0; i < static_cast<int>(ranges.size()); i++) for (size_t i = 0; i < 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 (size_t i = ranges.size() - 1; i > 0; i--)
{ {
const range &r = ranges[i]; const range &r = ranges[i];
double error = gain; double error = gain;
@ -248,7 +248,7 @@ void rtl_tcp_signal_source_c::set_if_gain(int gain)
while (g < r.stop) while (g < r.stop)
{ {
double sum = 0; double sum = 0;
for (int j = 0; j < static_cast<int>(gains.size()); j++) for (size_t j = 0; j < gains.size(); j++)
{ {
if (i == j) if (i == j)
{ {

View File

@ -23,15 +23,15 @@
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <cmath> #include <cmath>
unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples(unsigned int adc_nbit_) unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples(int adc_nbit_)
{ {
return unpack_spir_gss6450_samples_sptr(new unpack_spir_gss6450_samples(adc_nbit_)); return unpack_spir_gss6450_samples_sptr(new unpack_spir_gss6450_samples(adc_nbit_));
} }
unpack_spir_gss6450_samples::unpack_spir_gss6450_samples(unsigned int adc_nbit) : gr::sync_interpolator("unpack_spir_gss6450_samples", unpack_spir_gss6450_samples::unpack_spir_gss6450_samples(int adc_nbit) : gr::sync_interpolator("unpack_spir_gss6450_samples",
gr::io_signature::make(1, 1, sizeof(int32_t)), gr::io_signature::make(1, 1, sizeof(int32_t)),
gr::io_signature::make(1, 1, sizeof(gr_complex)), 16 / adc_nbit) gr::io_signature::make(1, 1, sizeof(gr_complex)), 16 / adc_nbit)
{ {
adc_bits = adc_nbit; adc_bits = adc_nbit;
samples_per_int = 16 / adc_bits; samples_per_int = 16 / adc_bits;
@ -53,21 +53,21 @@ void unpack_spir_gss6450_samples::decode_4bits_word(uint32_t input_uint32, gr_co
if (tmp_char >= 2) if (tmp_char >= 2)
{ {
I = (tmp_char - 4); I = static_cast<float>(tmp_char - 4);
} }
else else
{ {
I = tmp_char; I = static_cast<float>(tmp_char);
} }
input_uint32 = input_uint32 >> 2; input_uint32 = input_uint32 >> 2;
tmp_char = input_uint32 & 3; tmp_char = input_uint32 & 3;
if (tmp_char >= 2) if (tmp_char >= 2)
{ {
Q = (tmp_char - 4); Q = static_cast<float>(tmp_char - 4);
} }
else else
{ {
Q = tmp_char; Q = static_cast<float>(tmp_char);
} }
input_uint32 = input_uint32 >> 2; input_uint32 = input_uint32 >> 2;
@ -82,21 +82,21 @@ void unpack_spir_gss6450_samples::decode_4bits_word(uint32_t input_uint32, gr_co
if (tmp_char >= 8) if (tmp_char >= 8)
{ {
I = (tmp_char - 16); I = static_cast<float>(tmp_char - 16);
} }
else else
{ {
I = tmp_char; I = static_cast<float>(tmp_char);
} }
input_uint32 = input_uint32 >> 4; input_uint32 = input_uint32 >> 4;
tmp_char = input_uint32 & 0x0F; tmp_char = input_uint32 & 0x0F;
if (tmp_char >= 8) if (tmp_char >= 8)
{ {
Q = (tmp_char - 16); Q = static_cast<float>(tmp_char - 16);
} }
else else
{ {
Q = tmp_char; Q = static_cast<float>(tmp_char);
} }
input_uint32 = input_uint32 >> 4; input_uint32 = input_uint32 >> 4;

View File

@ -36,22 +36,22 @@ using unpack_spir_gss6450_samples_sptr = std::shared_ptr<unpack_spir_gss6450_sam
using unpack_spir_gss6450_samples_sptr = boost::shared_ptr<unpack_spir_gss6450_samples>; using unpack_spir_gss6450_samples_sptr = boost::shared_ptr<unpack_spir_gss6450_samples>;
#endif #endif
unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples(unsigned int adc_nbit_); unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples(int adc_nbit_);
class unpack_spir_gss6450_samples : public gr::sync_interpolator class unpack_spir_gss6450_samples : public gr::sync_interpolator
{ {
public: public:
explicit unpack_spir_gss6450_samples(unsigned int adc_nbit); explicit unpack_spir_gss6450_samples(int adc_nbit);
~unpack_spir_gss6450_samples() = default; ~unpack_spir_gss6450_samples() = default;
void decode_4bits_word(uint32_t input_uint32, gr_complex *out, int adc_bits_); void decode_4bits_word(uint32_t input_uint32, gr_complex *out, int adc_bits_);
int work(int noutput_items, int work(int noutput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
private: private:
friend unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples_sptr(unsigned int adc_nbit); friend unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples_sptr(int adc_nbit);
unsigned int adc_bits; int adc_bits;
unsigned int samples_per_int; int samples_per_int;
}; };
#endif // GNSS_SDR_UNPACK_SPIR_GSS6450_SAMPLES_H #endif // GNSS_SDR_UNPACK_SPIR_GSS6450_SAMPLES_H

View File

@ -302,7 +302,6 @@ bool gps_l1_ca_telemetry_decoder_gs::decode_subframe()
case 5: case 5:
// get almanac (if available) // get almanac (if available)
// TODO: implement almanac reader in navigation_message // TODO: implement almanac reader in navigation_message
break;
default: default:
break; break;
} }

View File

@ -40,8 +40,8 @@ Viterbi_Decoder::Viterbi_Decoder(const int g_encoder[], const int KK, const int
// derived code properties // derived code properties
d_mm = d_KK - 1; d_mm = d_KK - 1;
d_states = 1U << d_mm; /* 2^mm */ d_states = static_cast<int>(1U << d_mm); /* 2^mm */
d_number_symbols = 1U << d_nn; /* 2^nn */ d_number_symbols = static_cast<int>(1U << d_nn); /* 2^nn */
/* create appropriate transition matrices (trellis) */ /* create appropriate transition matrices (trellis) */
d_out0.reserve(d_states); d_out0.reserve(d_states);
@ -197,7 +197,7 @@ int Viterbi_Decoder::do_acs(const double sym[], int nbits)
int next_state_if_1 = d_state1[state_at_t]; int next_state_if_1 = d_state1[state_at_t];
/* hypothesis: info bit is a zero */ /* hypothesis: info bit is a zero */
int bm_0 = d_metric_c[d_out0[state_at_t]]; float bm_0 = d_metric_c[d_out0[state_at_t]];
metric = d_pm_t[state_at_t] + bm_0; // path metric + zerobranch metric metric = d_pm_t[state_at_t] + bm_0; // path metric + zerobranch metric
/* store new metric if more than metric in storage */ /* store new metric if more than metric in storage */
@ -210,7 +210,7 @@ int Viterbi_Decoder::do_acs(const double sym[], int nbits)
} }
/* hypothesis: info bit is a one */ /* hypothesis: info bit is a one */
int bm_1 = d_metric_c[d_out1[state_at_t]]; float bm_1 = d_metric_c[d_out1[state_at_t]];
metric = d_pm_t[state_at_t] + bm_1; // path metric + onebranch metric metric = d_pm_t[state_at_t] + bm_1; // path metric + onebranch metric
/* store new metric if more than metric in storage */ /* store new metric if more than metric in storage */
@ -280,7 +280,7 @@ int Viterbi_Decoder::do_tb_and_decode(int traceback_length, int requested_decodi
VLOG(FLOW) << "do_tb_and_decode(): requested_decoding_length=" << requested_decoding_length; VLOG(FLOW) << "do_tb_and_decode(): requested_decoding_length=" << requested_decoding_length;
// decode only decode_length bits -> overstep newer bits which are too much // decode only decode_length bits -> overstep newer bits which are too much
decoding_length_mismatch = d_trellis_paths.size() - (traceback_length + requested_decoding_length); decoding_length_mismatch = static_cast<int>(d_trellis_paths.size()) - (traceback_length + requested_decoding_length);
VLOG(BLOCK) << "decoding_length_mismatch=" << decoding_length_mismatch; VLOG(BLOCK) << "decoding_length_mismatch=" << decoding_length_mismatch;
overstep_length = decoding_length_mismatch >= 0 ? decoding_length_mismatch : 0; overstep_length = decoding_length_mismatch >= 0 ? decoding_length_mismatch : 0;
VLOG(BLOCK) << "overstep_length=" << overstep_length; VLOG(BLOCK) << "overstep_length=" << overstep_length;
@ -290,7 +290,7 @@ int Viterbi_Decoder::do_tb_and_decode(int traceback_length, int requested_decodi
{ {
state = it->get_anchestor_state_of_current_state(state); state = it->get_anchestor_state_of_current_state(state);
} }
t_out = d_trellis_paths.end() - (d_trellis_paths.begin() + traceback_length + overstep_length) - 1; // requested_decoding_length-1; t_out = static_cast<int>(d_trellis_paths.end() - (d_trellis_paths.begin() + traceback_length + overstep_length) - 1); // requested_decoding_length-1;
indicator_metric = 0; indicator_metric = 0;
for (it = d_trellis_paths.begin() + traceback_length + overstep_length; it < d_trellis_paths.end(); ++it) for (it = d_trellis_paths.begin() + traceback_length + overstep_length; it < d_trellis_paths.end(); ++it)
{ {
@ -306,7 +306,7 @@ int Viterbi_Decoder::do_tb_and_decode(int traceback_length, int requested_decodi
} }
if (n_im > 0) if (n_im > 0)
{ {
indicator_metric /= n_im; indicator_metric /= static_cast<float>(n_im);
} }
VLOG(BLOCK) << "indicator metric: " << indicator_metric; VLOG(BLOCK) << "indicator metric: " << indicator_metric;
@ -348,7 +348,7 @@ float Viterbi_Decoder::gamma(const float rec_array[], int symbol, int nn)
} }
// rm = rm > 50 ? rm : -1000; // rm = rm > 50 ? rm : -1000;
return (rm); return rm;
} }
@ -359,7 +359,7 @@ void Viterbi_Decoder::nsc_transit(int output_p[], int trans_p[], int input, cons
int nextstate[1]; int nextstate[1];
int state; int state;
int states; int states;
states = (1U << (KK - 1)); /* The number of states: 2^mm */ states = static_cast<int>(1U << (KK - 1)); /* The number of states: 2^mm */
/* Determine the output and next state for each possible starting state */ /* Determine the output and next state for each possible starting state */
for (state = 0; state < states; state++) for (state = 0; state < states; state++)
@ -432,7 +432,7 @@ int Viterbi_Decoder::parity_counter(int symbol, int length)
temp_parity = temp_parity ^ (symbol & 1U); temp_parity = temp_parity ^ (symbol & 1U);
symbol = symbol >> 1U; symbol = symbol >> 1U;
} }
return (temp_parity); return static_cast<int>(temp_parity);
} }

View File

@ -41,7 +41,7 @@ BeidouB1iDllPllTracking::BeidouB1iDllPllTracking(
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
trk_params.SetFromConfiguration(configuration, role); trk_params.SetFromConfiguration(configuration, role);
int vector_length = std::round(trk_params.fs_in / (BEIDOU_B1I_CODE_RATE_CPS / BEIDOU_B1I_CODE_LENGTH_CHIPS)); auto vector_length = static_cast<int>(std::round(trk_params.fs_in / (BEIDOU_B1I_CODE_RATE_CPS / BEIDOU_B1I_CODE_LENGTH_CHIPS)));
trk_params.vector_length = vector_length; trk_params.vector_length = vector_length;
if (trk_params.extend_correlation_symbols < 1) if (trk_params.extend_correlation_symbols < 1)
{ {

View File

@ -42,7 +42,7 @@ BeidouB3iDllPllTracking::BeidouB3iDllPllTracking(
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
trk_params.SetFromConfiguration(configuration, role); trk_params.SetFromConfiguration(configuration, role);
int vector_length = std::round(static_cast<double>(trk_params.fs_in) / (BEIDOU_B3I_CODE_RATE_CPS / BEIDOU_B3I_CODE_LENGTH_CHIPS)); auto vector_length = static_cast<int>(std::round(static_cast<double>(trk_params.fs_in) / (BEIDOU_B3I_CODE_RATE_CPS / BEIDOU_B3I_CODE_LENGTH_CHIPS)));
trk_params.vector_length = vector_length; trk_params.vector_length = vector_length;
trk_params.track_pilot = configuration->property(role + ".track_pilot", false); trk_params.track_pilot = configuration->property(role + ".track_pilot", false);
if (trk_params.extend_correlation_symbols < 1) if (trk_params.extend_correlation_symbols < 1)

View File

@ -54,7 +54,7 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
{ {
std::cout << TEXT_RED << "WARNING: Galileo E1. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n'; std::cout << TEXT_RED << "WARNING: Galileo E1. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n';
} }
int vector_length = std::round(trk_params.fs_in / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)); auto vector_length = static_cast<int>(std::round(trk_params.fs_in / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
trk_params.vector_length = vector_length; trk_params.vector_length = vector_length;
trk_params.system = 'E'; trk_params.system = 'E';
std::array<char, 3> sig_{'1', 'B', '\0'}; std::array<char, 3> sig_{'1', 'B', '\0'};

View File

@ -57,7 +57,7 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
std::cout << TEXT_RED << "WARNING: Galileo E1. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n'; std::cout << TEXT_RED << "WARNING: Galileo E1. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n';
} }
d_track_pilot = trk_params_fpga.track_pilot; d_track_pilot = trk_params_fpga.track_pilot;
int32_t vector_length = std::round(trk_params_fpga.fs_in / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)); auto vector_length = static_cast<int32_t>(std::round(trk_params_fpga.fs_in / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
trk_params_fpga.vector_length = vector_length; trk_params_fpga.vector_length = vector_length;
trk_params_fpga.system = 'E'; trk_params_fpga.system = 'E';
std::array<char, 3> sig_{'1', 'B', '\0'}; std::array<char, 3> sig_{'1', 'B', '\0'};

View File

@ -38,37 +38,27 @@ GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking(
{ {
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
// ################# CONFIGURATION PARAMETERS ######################## // ################# CONFIGURATION PARAMETERS ########################
int fs_in; const std::string default_item_type("gr_complex");
int vector_length; std::string item_type = configuration->property(role + ".item_type", default_item_type);
bool dump;
std::string dump_filename;
std::string item_type;
std::string default_item_type = "gr_complex";
float pll_bw_hz;
float dll_bw_hz;
float early_late_space_chips;
float very_early_late_space_chips;
size_t port_ch0;
item_type = configuration->property(role + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump = configuration->property(role + ".dump", false); bool dump = configuration->property(role + ".dump", false);
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); float pll_bw_hz = configuration->property(role + ".pll_bw_hz", static_cast<float>(50.0));
if (FLAGS_pll_bw_hz != 0.0) if (FLAGS_pll_bw_hz != 0.0)
{ {
pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz); pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
} }
dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); float dll_bw_hz = configuration->property(role + ".dll_bw_hz", static_cast<float>(2.0));
if (FLAGS_dll_bw_hz != 0.0) if (FLAGS_dll_bw_hz != 0.0)
{ {
dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz); dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
} }
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.15); float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast<float>(0.15));
very_early_late_space_chips = configuration->property(role + ".very_early_late_space_chips", 0.5); float very_early_late_space_chips = configuration->property(role + ".very_early_late_space_chips", static_cast<float>(0.5));
port_ch0 = configuration->property(role + ".port_ch0", 2060); size_t port_ch0 = configuration->property(role + ".port_ch0", 2060);
std::string default_dump_filename = "./track_ch"; const std::string default_dump_filename("./track_ch");
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
vector_length = std::round(fs_in / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)); auto vector_length = static_cast<int>(std::round(fs_in / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
// ################# MAKE TRACKING GNURadio object ################### // ################# MAKE TRACKING GNURadio object ###################
if (item_type == "gr_complex") if (item_type == "gr_complex")

View File

@ -39,7 +39,7 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking(
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
trk_params.SetFromConfiguration(configuration, role); trk_params.SetFromConfiguration(configuration, role);
int vector_length = std::round(trk_params.fs_in / (GALILEO_E5A_CODE_CHIP_RATE_CPS / GALILEO_E5A_CODE_LENGTH_CHIPS)); auto vector_length = static_cast<int>(std::round(trk_params.fs_in / (GALILEO_E5A_CODE_CHIP_RATE_CPS / GALILEO_E5A_CODE_LENGTH_CHIPS)));
trk_params.vector_length = vector_length; trk_params.vector_length = vector_length;
if (trk_params.extend_correlation_symbols < 1) if (trk_params.extend_correlation_symbols < 1)
{ {

View File

@ -37,7 +37,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
trk_params_fpga.SetFromConfiguration(configuration, role); trk_params_fpga.SetFromConfiguration(configuration, role);
int32_t vector_length = std::round(trk_params_fpga.fs_in / (GALILEO_E5A_CODE_CHIP_RATE_CPS / GALILEO_E5A_CODE_LENGTH_CHIPS)); auto vector_length = static_cast<int32_t>(std::round(trk_params_fpga.fs_in / (GALILEO_E5A_CODE_CHIP_RATE_CPS / GALILEO_E5A_CODE_LENGTH_CHIPS)));
trk_params_fpga.vector_length = vector_length; trk_params_fpga.vector_length = vector_length;
d_track_pilot = trk_params_fpga.track_pilot; d_track_pilot = trk_params_fpga.track_pilot;
if (trk_params_fpga.extend_correlation_symbols < 1) if (trk_params_fpga.extend_correlation_symbols < 1)

View File

@ -39,39 +39,29 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking(
{ {
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
// ################# CONFIGURATION PARAMETERS ######################## // ################# CONFIGURATION PARAMETERS ########################
int fs_in; const std::string default_item_type("gr_complex");
int vector_length;
bool dump;
std::string dump_filename;
std::string default_item_type = "gr_complex";
float pll_bw_hz;
float pll_bw_narrow_hz;
float dll_bw_hz;
float dll_bw_narrow_hz;
float early_late_space_chips;
item_type_ = configuration->property(role + ".item_type", default_item_type); item_type_ = configuration->property(role + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump = configuration->property(role + ".dump", false); bool dump = configuration->property(role + ".dump", false);
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); float pll_bw_hz = configuration->property(role + ".pll_bw_hz", static_cast<float>(50.0));
if (FLAGS_pll_bw_hz != 0.0) if (FLAGS_pll_bw_hz != 0.0)
{ {
pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz); pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
} }
dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); float dll_bw_hz = configuration->property(role + ".dll_bw_hz", static_cast<float>(2.0));
if (FLAGS_dll_bw_hz != 0.0) if (FLAGS_dll_bw_hz != 0.0)
{ {
dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz); dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
} }
pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 20.0); float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", static_cast<float>(20.0));
dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0); float dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", static_cast<float>(2.0));
int extend_correlation_ms; int extend_correlation_ms = configuration->property(role + ".extend_correlation_ms", 1);
extend_correlation_ms = configuration->property(role + ".extend_correlation_ms", 1);
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast<float>(0.5));
std::string default_dump_filename = "./track_ch"; const std::string default_dump_filename("./track_ch");
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
vector_length = std::round(fs_in / (GLONASS_L1_CA_CODE_RATE_CPS / GLONASS_L1_CA_CODE_LENGTH_CHIPS)); auto vector_length = static_cast<int>(std::round(fs_in / (GLONASS_L1_CA_CODE_RATE_CPS / GLONASS_L1_CA_CODE_LENGTH_CHIPS)));
// ################# MAKE TRACKING GNURadio object ################### // ################# MAKE TRACKING GNURadio object ###################
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex")

View File

@ -38,33 +38,25 @@ GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking(
{ {
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
// ################# CONFIGURATION PARAMETERS ######################## // ################# CONFIGURATION PARAMETERS ########################
int fs_in; const std::string default_item_type("gr_complex");
int vector_length; std::string item_type = configuration->property(role + ".item_type", default_item_type);
bool dump;
std::string dump_filename;
std::string item_type;
std::string default_item_type = "gr_complex";
float pll_bw_hz;
float dll_bw_hz;
float early_late_space_chips;
item_type = configuration->property(role + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump = configuration->property(role + ".dump", false); bool dump = configuration->property(role + ".dump", false);
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); float pll_bw_hz = configuration->property(role + ".pll_bw_hz", static_cast<float>(50.0));
if (FLAGS_pll_bw_hz != 0.0) if (FLAGS_pll_bw_hz != 0.0)
{ {
pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz); pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
} }
dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); float dll_bw_hz = configuration->property(role + ".dll_bw_hz", static_cast<float>(2.0));
if (FLAGS_dll_bw_hz != 0.0) if (FLAGS_dll_bw_hz != 0.0)
{ {
dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz); dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
} }
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast<float>(0.5));
std::string default_dump_filename = "./track_ch"; const std::string default_dump_filename("./track_ch");
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
vector_length = std::round(fs_in / (GLONASS_L1_CA_CODE_RATE_CPS / GLONASS_L1_CA_CODE_LENGTH_CHIPS)); auto vector_length = static_cast<int>(std::round(fs_in / (GLONASS_L1_CA_CODE_RATE_CPS / GLONASS_L1_CA_CODE_LENGTH_CHIPS)));
// ################# MAKE TRACKING GNURadio object ################### // ################# MAKE TRACKING GNURadio object ###################
if (item_type == "gr_complex") if (item_type == "gr_complex")

View File

@ -37,39 +37,29 @@ GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking(
{ {
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
// ################# CONFIGURATION PARAMETERS ######################## // ################# CONFIGURATION PARAMETERS ########################
int fs_in; const std::string default_item_type("gr_complex");
int vector_length;
bool dump;
std::string dump_filename;
std::string default_item_type = "gr_complex";
float pll_bw_hz;
float pll_bw_narrow_hz;
float dll_bw_hz;
float dll_bw_narrow_hz;
float early_late_space_chips;
item_type_ = configuration->property(role + ".item_type", default_item_type); item_type_ = configuration->property(role + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump = configuration->property(role + ".dump", false); bool dump = configuration->property(role + ".dump", false);
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); float pll_bw_hz = configuration->property(role + ".pll_bw_hz", static_cast<float>(50.0));
if (FLAGS_pll_bw_hz != 0.0) if (FLAGS_pll_bw_hz != 0.0)
{ {
pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz); pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
} }
dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); float dll_bw_hz = configuration->property(role + ".dll_bw_hz", static_cast<float>(2.0));
if (FLAGS_dll_bw_hz != 0.0) if (FLAGS_dll_bw_hz != 0.0)
{ {
dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz); dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
} }
pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 20.0); float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", static_cast<float>(20.0));
dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0); float dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", static_cast<float>(2.0));
int extend_correlation_ms; int extend_correlation_ms = configuration->property(role + ".extend_correlation_ms", 1);
extend_correlation_ms = configuration->property(role + ".extend_correlation_ms", 1);
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast<float>(0.5));
std::string default_dump_filename = "./track_ch"; const std::string default_dump_filename("./track_ch");
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
vector_length = std::round(fs_in / (GLONASS_L2_CA_CODE_RATE_CPS / GLONASS_L2_CA_CODE_LENGTH_CHIPS)); auto vector_length = static_cast<int>(std::round(fs_in / (GLONASS_L2_CA_CODE_RATE_CPS / GLONASS_L2_CA_CODE_LENGTH_CHIPS)));
// ################# MAKE TRACKING GNURadio object ################### // ################# MAKE TRACKING GNURadio object ###################
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex")

View File

@ -36,33 +36,25 @@ GlonassL2CaDllPllTracking::GlonassL2CaDllPllTracking(
{ {
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
// ################# CONFIGURATION PARAMETERS ######################## // ################# CONFIGURATION PARAMETERS ########################
int fs_in; const std::string default_item_type("gr_complex");
int vector_length; std::string item_type = configuration->property(role + ".item_type", default_item_type);
bool dump;
std::string dump_filename;
std::string item_type;
std::string default_item_type = "gr_complex";
float pll_bw_hz;
float dll_bw_hz;
float early_late_space_chips;
item_type = configuration->property(role + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump = configuration->property(role + ".dump", false); bool dump = configuration->property(role + ".dump", false);
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); float pll_bw_hz = configuration->property(role + ".pll_bw_hz", static_cast<float>(50.0));
if (FLAGS_pll_bw_hz != 0.0) if (FLAGS_pll_bw_hz != 0.0)
{ {
pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz); pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
} }
dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); float dll_bw_hz = configuration->property(role + ".dll_bw_hz", static_cast<float>(2.0));
if (FLAGS_dll_bw_hz != 0.0) if (FLAGS_dll_bw_hz != 0.0)
{ {
dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz); dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
} }
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast<float>(0.5));
std::string default_dump_filename = "./track_ch"; const std::string default_dump_filename("./track_ch");
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
vector_length = std::round(fs_in / (GLONASS_L2_CA_CODE_RATE_CPS / GLONASS_L2_CA_CODE_LENGTH_CHIPS)); auto vector_length = static_cast<int>(std::round(fs_in / (GLONASS_L2_CA_CODE_RATE_CPS / GLONASS_L2_CA_CODE_LENGTH_CHIPS)));
// ################# MAKE TRACKING GNURadio object ################### // ################# MAKE TRACKING GNURadio object ###################
if (item_type == "gr_complex") if (item_type == "gr_complex")

View File

@ -41,7 +41,7 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
trk_params.SetFromConfiguration(configuration, role); trk_params.SetFromConfiguration(configuration, role);
int vector_length = std::round(trk_params.fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); auto vector_length = static_cast<int>(std::round(trk_params.fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
trk_params.vector_length = vector_length; trk_params.vector_length = vector_length;
if (trk_params.extend_correlation_symbols < 1) if (trk_params.extend_correlation_symbols < 1)
{ {

View File

@ -42,7 +42,7 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
trk_params_fpga.SetFromConfiguration(configuration, role); trk_params_fpga.SetFromConfiguration(configuration, role);
int32_t vector_length = std::round(trk_params_fpga.fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); auto vector_length = static_cast<int32_t>(std::round(trk_params_fpga.fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
trk_params_fpga.vector_length = vector_length; trk_params_fpga.vector_length = vector_length;
if (trk_params_fpga.extend_correlation_symbols < 1) if (trk_params_fpga.extend_correlation_symbols < 1)
{ {

View File

@ -42,7 +42,7 @@ GpsL1CaDllPllTrackingGPU::GpsL1CaDllPllTrackingGPU(
bool dump; bool dump;
std::string dump_filename; std::string dump_filename;
std::string item_type; std::string item_type;
std::string default_item_type = "gr_complex"; const std::string default_item_type("gr_complex");
float pll_bw_hz; float pll_bw_hz;
float dll_bw_hz; float dll_bw_hz;
float early_late_space_chips; float early_late_space_chips;
@ -56,7 +56,7 @@ GpsL1CaDllPllTrackingGPU::GpsL1CaDllPllTrackingGPU(
dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0);
if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz); if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
std::string default_dump_filename = "./track_ch"; const std::string default_dump_filename("./track_ch");
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS));

View File

@ -40,43 +40,28 @@ GpsL1CaKfTracking::GpsL1CaKfTracking(
{ {
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
// ################# CONFIGURATION PARAMETERS ######################## // ################# CONFIGURATION PARAMETERS ########################
int order; const std::string default_item_type("gr_complex");
int fs_in; std::string item_type = configuration->property(role + ".item_type", default_item_type);
int vector_length; int order = configuration->property(role + ".order", 2);
int f_if;
bool dump;
std::string dump_filename;
std::string item_type;
std::string default_item_type = "gr_complex";
float dll_bw_hz;
float early_late_space_chips;
bool bce_run;
unsigned int bce_ptrans;
unsigned int bce_strans;
int bce_nu;
int bce_kappa;
item_type = configuration->property(role + ".item_type", default_item_type);
order = configuration->property(role + ".order", 2);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
f_if = configuration->property(role + ".if", 0); int f_if = configuration->property(role + ".if", 0);
dump = configuration->property(role + ".dump", false); bool dump = configuration->property(role + ".dump", false);
dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); float dll_bw_hz = configuration->property(role + ".dll_bw_hz", static_cast<float>(2.0));
if (FLAGS_dll_bw_hz != 0.0) if (FLAGS_dll_bw_hz != 0.0)
{ {
dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz); dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
} }
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast<float>(0.5));
std::string default_dump_filename = "./track_ch"; const std::string default_dump_filename("./track_ch");
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); auto vector_length = static_cast<int>(std::round(fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
bce_run = configuration->property(role + ".bce_run", false); bool bce_run = configuration->property(role + ".bce_run", false);
bce_ptrans = configuration->property(role + ".p_transient", 0); unsigned int bce_ptrans = configuration->property(role + ".p_transient", 0);
bce_strans = configuration->property(role + ".s_transient", 0); unsigned int bce_strans = configuration->property(role + ".s_transient", 0);
bce_nu = configuration->property(role + ".bce_nu", 0); int bce_nu = configuration->property(role + ".bce_nu", 0);
bce_kappa = configuration->property(role + ".bce_kappa", 0); int bce_kappa = configuration->property(role + ".bce_kappa", 0);
// ################# MAKE TRACKING GNURadio object ################### // ################# MAKE TRACKING GNURadio object ###################
if (item_type == "gr_complex") if (item_type == "gr_complex")

View File

@ -37,24 +37,17 @@ GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking(
{ {
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
//################# CONFIGURATION PARAMETERS ######################## //################# CONFIGURATION PARAMETERS ########################
int fs_in; const std::string default_item_type("gr_complex");
int vector_length; std::string item_type = configuration->property(role + ".item_type", default_item_type);
bool dump;
std::string dump_filename;
std::string item_type;
std::string default_item_type = "gr_complex";
float early_late_space_chips;
size_t port_ch0;
item_type = configuration->property(role + ".item_type", default_item_type);
// vector_length = configuration->property(role + ".vector_length", 2048); // vector_length = configuration->property(role + ".vector_length", 2048);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump = configuration->property(role + ".dump", false); bool dump = configuration->property(role + ".dump", false);
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast<float>(0.5));
port_ch0 = configuration->property(role + ".port_ch0", 2060); size_t port_ch0 = configuration->property(role + ".port_ch0", 2060);
std::string default_dump_filename = "./track_ch"; const std::string default_dump_filename("./track_ch");
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); auto vector_length = static_cast<int>(std::round(fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
// ################# MAKE TRACKING GNURadio object ################### // ################# MAKE TRACKING GNURadio object ###################
if (item_type == "gr_complex") if (item_type == "gr_complex")

View File

@ -40,7 +40,7 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking(
DLOG(INFO) << "role " << role; DLOG(INFO) << "role " << role;
trk_params.SetFromConfiguration(configuration, role); trk_params.SetFromConfiguration(configuration, role);
int vector_length = std::round(static_cast<double>(trk_params.fs_in) / (static_cast<double>(GPS_L2_M_CODE_RATE_CPS) / static_cast<double>(GPS_L2_M_CODE_LENGTH_CHIPS))); auto vector_length = static_cast<int>(std::round(static_cast<double>(trk_params.fs_in) / (static_cast<double>(GPS_L2_M_CODE_RATE_CPS) / static_cast<double>(GPS_L2_M_CODE_LENGTH_CHIPS))));
trk_params.vector_length = vector_length; trk_params.vector_length = vector_length;
if (trk_params.extend_correlation_symbols != 1) if (trk_params.extend_correlation_symbols != 1)
{ {

Some files were not shown because too many files have changed in this diff Show More