From d77448cd766c290c7b77852b0d6345550c55d878 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 7 Nov 2018 22:25:09 +0100 Subject: [PATCH 1/2] Improve data types for almanac parameters --- docs/xml-schemas/gal_almanac_map.xsd | 12 ++--- docs/xml-schemas/gps_almanac_map.xsd | 2 +- .../libs/rtklib/rtklib_conversions.cc | 10 ++-- src/core/libs/gnss_sdr_supl_client.cc | 2 +- src/core/system_parameters/galileo_almanac.cc | 12 ++--- src/core/system_parameters/galileo_almanac.h | 20 +++---- .../galileo_almanac_helper.cc | 45 ++++++++-------- .../galileo_almanac_helper.h | 22 ++++---- .../galileo_navigation_message.cc | 52 +++++++++---------- .../galileo_navigation_message.h | 24 ++++----- src/core/system_parameters/gps_almanac.cc | 2 +- src/core/system_parameters/gps_almanac.h | 4 +- .../gps_navigation_message.cc | 6 +-- .../gps_navigation_message.h | 4 +- 14 files changed, 108 insertions(+), 109 deletions(-) diff --git a/docs/xml-schemas/gal_almanac_map.xsd b/docs/xml-schemas/gal_almanac_map.xsd index 887caf064..390609c58 100644 --- a/docs/xml-schemas/gal_almanac_map.xsd +++ b/docs/xml-schemas/gal_almanac_map.xsd @@ -15,9 +15,9 @@ - - - + + + @@ -27,9 +27,9 @@ - - - + + + diff --git a/docs/xml-schemas/gps_almanac_map.xsd b/docs/xml-schemas/gps_almanac_map.xsd index 5e96b4af1..86b9d2a2d 100644 --- a/docs/xml-schemas/gps_almanac_map.xsd +++ b/docs/xml-schemas/gps_almanac_map.xsd @@ -16,7 +16,7 @@ - + diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.cc b/src/algorithms/libs/rtklib/rtklib_conversions.cc index 22b8af3b9..3106b6bc1 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.cc +++ b/src/algorithms/libs/rtklib/rtklib_conversions.cc @@ -302,7 +302,7 @@ alm_t alm_to_rtklib(const Gps_Almanac& gps_alm) rtklib_alm.svh = gps_alm.i_SV_health; rtklib_alm.svconf = gps_alm.i_AS_status; rtklib_alm.week = gps_alm.i_WNa; - rtklib_alm.toa = gpst2time(gps_alm.i_WNa, gps_alm.d_Toa); + rtklib_alm.toa = gpst2time(gps_alm.i_WNa, gps_alm.i_Toa); rtklib_alm.A = gps_alm.d_sqrt_A * gps_alm.d_sqrt_A; rtklib_alm.e = gps_alm.d_e_eccentricity; rtklib_alm.i0 = gps_alm.d_Delta_i + 0.3; @@ -312,7 +312,7 @@ alm_t alm_to_rtklib(const Gps_Almanac& gps_alm) rtklib_alm.M0 = gps_alm.d_M_0; rtklib_alm.f0 = gps_alm.d_A_f0; rtklib_alm.f1 = gps_alm.d_A_f1; - rtklib_alm.toas = gps_alm.d_Toa; + rtklib_alm.toas = gps_alm.i_Toa; return rtklib_alm; @@ -326,8 +326,8 @@ alm_t alm_to_rtklib(const Galileo_Almanac& gal_alm) rtklib_alm.sat = gal_alm.i_satellite_PRN; rtklib_alm.svh = gal_alm.E1B_HS; rtklib_alm.svconf = gal_alm.E1B_HS; - rtklib_alm.week = gal_alm.d_WNa; - rtklib_alm.toa = gpst2time(gal_alm.d_WNa, gal_alm.d_Toa); + rtklib_alm.week = gal_alm.i_WNa; + rtklib_alm.toa = gpst2time(gal_alm.i_WNa, gal_alm.i_Toa); rtklib_alm.A = 5440.588203494 + gal_alm.d_Delta_sqrt_A; rtklib_alm.A = rtklib_alm.A * rtklib_alm.A; rtklib_alm.e = gal_alm.d_e_eccentricity; @@ -338,7 +338,7 @@ alm_t alm_to_rtklib(const Galileo_Almanac& gal_alm) rtklib_alm.M0 = gal_alm.d_M_0; rtklib_alm.f0 = gal_alm.d_A_f0; rtklib_alm.f1 = gal_alm.d_A_f1; - rtklib_alm.toas = gal_alm.d_Toa; + rtklib_alm.toas = gal_alm.i_Toa; return rtklib_alm; diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index b95221856..7494d2f3f 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -267,7 +267,7 @@ void gnss_sdr_supl_client::read_supl_data() gps_almanac_iterator->second.d_OMEGA0 = static_cast(a->OMEGA_0) * pow(2.0, -23); gps_almanac_iterator->second.d_sqrt_A = static_cast(a->A_sqrt) * pow(2.0, -11); gps_almanac_iterator->second.d_OMEGA_DOT = static_cast(a->OMEGA_dot) * pow(2.0, -38); - gps_almanac_iterator->second.d_Toa = static_cast(a->toa) * pow(2.0, 12); + gps_almanac_iterator->second.i_Toa = static_cast(a->toa) * pow(2.0, 12); gps_almanac_iterator->second.d_e_eccentricity = static_cast(a->e) * pow(2.0, -21); gps_almanac_iterator->second.d_M_0 = static_cast(a->M0) * pow(2.0, -23); } diff --git a/src/core/system_parameters/galileo_almanac.cc b/src/core/system_parameters/galileo_almanac.cc index 27931f8b0..6dbc7b25e 100644 --- a/src/core/system_parameters/galileo_almanac.cc +++ b/src/core/system_parameters/galileo_almanac.cc @@ -34,9 +34,9 @@ Galileo_Almanac::Galileo_Almanac() { i_satellite_PRN = 0U; - d_Toa = 0.0; - d_WNa = 0.0; - d_IODa = 0.0; + i_Toa = 0; + i_WNa = 0; + i_IODa = 0; d_Delta_i = 0.0; d_M_0 = 0.0; d_e_eccentricity = 0.0; @@ -46,7 +46,7 @@ Galileo_Almanac::Galileo_Almanac() d_OMEGA_DOT = 0.0; d_A_f0 = 0.0; d_A_f1 = 0.0; - E5b_HS = 0.0; - E1B_HS = 0.0; - E5a_HS = 0.0; + E5b_HS = 0; + E1B_HS = 0; + E5a_HS = 0; } diff --git a/src/core/system_parameters/galileo_almanac.h b/src/core/system_parameters/galileo_almanac.h index 1529355ae..022d778be 100644 --- a/src/core/system_parameters/galileo_almanac.h +++ b/src/core/system_parameters/galileo_almanac.h @@ -42,10 +42,10 @@ class Galileo_Almanac { public: uint32_t i_satellite_PRN; //!< SV PRN NUMBER - double d_Toa; - double d_WNa; - double d_IODa; - double d_Delta_i; + int32_t i_Toa; + int32_t i_WNa; + int32_t i_IODa; + double d_Delta_i; //!< Inclination at reference time relative to i0 = 56ยบ [semi-circles] double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] double d_e_eccentricity; //!< Eccentricity [dimensionless] double d_Delta_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] @@ -54,9 +54,9 @@ public: double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] double d_A_f0; //!< Coefficient 0 of code phase offset model [s] double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - double E5b_HS; - double E1B_HS; - double E5a_HS; + int32_t E5b_HS; + int32_t E1B_HS; + int32_t E5a_HS; /*! * Default constructor @@ -71,9 +71,9 @@ public: { }; ar& BOOST_SERIALIZATION_NVP(i_satellite_PRN); - ar& BOOST_SERIALIZATION_NVP(d_Toa); - ar& BOOST_SERIALIZATION_NVP(d_WNa); - ar& BOOST_SERIALIZATION_NVP(d_IODa); + ar& BOOST_SERIALIZATION_NVP(i_Toa); + ar& BOOST_SERIALIZATION_NVP(i_WNa); + ar& BOOST_SERIALIZATION_NVP(i_IODa); ar& BOOST_SERIALIZATION_NVP(d_Delta_i); ar& BOOST_SERIALIZATION_NVP(d_M_0); ar& BOOST_SERIALIZATION_NVP(d_e_eccentricity); diff --git a/src/core/system_parameters/galileo_almanac_helper.cc b/src/core/system_parameters/galileo_almanac_helper.cc index 738ecc8dc..2fbd3e689 100644 --- a/src/core/system_parameters/galileo_almanac_helper.cc +++ b/src/core/system_parameters/galileo_almanac_helper.cc @@ -34,8 +34,8 @@ Galileo_Almanac_Helper::Galileo_Almanac_Helper() { // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number IOD_a_7 = 0; - WN_a_7 = 0.0; - t0a_7 = 0.0; + WN_a_7 = 0; + t0a_7 = 0; SVID1_7 = 0; DELTA_A_7 = 0.0; e_7 = 0.0; @@ -49,9 +49,9 @@ Galileo_Almanac_Helper::Galileo_Almanac_Helper() IOD_a_8 = 0; af0_8 = 0.0; af1_8 = 0.0; - E5b_HS_8 = 0.0; - E1B_HS_8 = 0.0; - E5a_HS_8 = 0.0; + E5b_HS_8 = 0; + E1B_HS_8 = 0; + E5a_HS_8 = 0; SVID2_8 = 0; DELTA_A_8 = 0.0; e_8 = 0.0; @@ -62,14 +62,14 @@ Galileo_Almanac_Helper::Galileo_Almanac_Helper() // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) IOD_a_9 = 0; - WN_a_9 = 0.0; - t0a_9 = 0.0; + WN_a_9 = 0; + t0a_9 = 0; M0_9 = 0.0; af0_9 = 0.0; af1_9 = 0.0; - E5b_HS_9 = 0.0; - E1B_HS_9 = 0.0; - E5a_HS_9 = 0.0; + E5b_HS_9 = 0; + E1B_HS_9 = 0; + E5a_HS_9 = 0; SVID3_9 = 0; DELTA_A_9 = 0.0; e_9 = 0.0; @@ -83,9 +83,9 @@ Galileo_Almanac_Helper::Galileo_Almanac_Helper() M0_10 = 0.0; af0_10 = 0.0; af1_10 = 0.0; - E5b_HS_10 = 0.0; - E1B_HS_10 = 0.0; - E5a_HS_10 = 0.0; + E5b_HS_10 = 0; + E1B_HS_10 = 0; + E5a_HS_10 = 0; } Galileo_Almanac Galileo_Almanac_Helper::get_almanac(int i) @@ -95,9 +95,9 @@ Galileo_Almanac Galileo_Almanac_Helper::get_almanac(int i) { case 1: galileo_almanac.i_satellite_PRN = this->SVID1_7; - galileo_almanac.d_Toa = this->t0a_7; - galileo_almanac.d_WNa = this->WN_a_7; - galileo_almanac.d_IODa = this->IOD_a_7; + galileo_almanac.i_Toa = this->t0a_7; + galileo_almanac.i_WNa = this->WN_a_7; + galileo_almanac.i_IODa = this->IOD_a_7; galileo_almanac.d_Delta_i = this->delta_i_7; galileo_almanac.d_M_0 = this->M0_7; galileo_almanac.d_e_eccentricity = this->e_7; @@ -114,9 +114,9 @@ Galileo_Almanac Galileo_Almanac_Helper::get_almanac(int i) case 2: galileo_almanac.i_satellite_PRN = this->SVID2_8; - galileo_almanac.d_Toa = this->t0a_9; - galileo_almanac.d_WNa = this->WN_a_9; - galileo_almanac.d_IODa = this->IOD_a_9; + galileo_almanac.i_Toa = this->t0a_9; + galileo_almanac.i_WNa = this->WN_a_9; + galileo_almanac.i_IODa = this->IOD_a_9; galileo_almanac.d_Delta_i = this->delta_i_8; galileo_almanac.d_M_0 = this->M0_9; galileo_almanac.d_e_eccentricity = this->e_8; @@ -126,16 +126,15 @@ Galileo_Almanac Galileo_Almanac_Helper::get_almanac(int i) galileo_almanac.d_OMEGA_DOT = this->Omega_dot_8; galileo_almanac.d_A_f0 = this->af0_9; galileo_almanac.d_A_f1 = this->af1_9; - galileo_almanac.E5b_HS = this->E5b_HS_9; galileo_almanac.E1B_HS = this->E1B_HS_9; galileo_almanac.E5a_HS = this->E5a_HS_9; break; case 3: galileo_almanac.i_satellite_PRN = this->SVID3_9; - galileo_almanac.d_Toa = this->t0a_9; - galileo_almanac.d_WNa = this->WN_a_9; - galileo_almanac.d_IODa = this->IOD_a_10; + galileo_almanac.i_Toa = this->t0a_9; + galileo_almanac.i_WNa = this->WN_a_9; + galileo_almanac.i_IODa = this->IOD_a_10; galileo_almanac.d_Delta_i = this->delta_i_9; galileo_almanac.d_M_0 = this->M0_10; galileo_almanac.d_e_eccentricity = this->e_9; diff --git a/src/core/system_parameters/galileo_almanac_helper.h b/src/core/system_parameters/galileo_almanac_helper.h index c0541a214..1b2e1b28e 100644 --- a/src/core/system_parameters/galileo_almanac_helper.h +++ b/src/core/system_parameters/galileo_almanac_helper.h @@ -44,7 +44,7 @@ class Galileo_Almanac_Helper public: // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number int32_t IOD_a_7; - double WN_a_7; + int32_t WN_a_7; double t0a_7; int32_t SVID1_7; double DELTA_A_7; @@ -59,9 +59,9 @@ public: int32_t IOD_a_8; double af0_8; double af1_8; - double E5b_HS_8; - double E1B_HS_8; - double E5a_HS_8; + int32_t E5b_HS_8; + int32_t E1B_HS_8; + int32_t E5a_HS_8; int32_t SVID2_8; double DELTA_A_8; double e_8; @@ -72,14 +72,14 @@ public: // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) int32_t IOD_a_9; - double WN_a_9; + int32_t WN_a_9; double t0a_9; double M0_9; double af0_9; double af1_9; - double E5b_HS_9; - double E1B_HS_9; - double E5a_HS_9; + int32_t E5b_HS_9; + int32_t E1B_HS_9; + int32_t E5a_HS_9; int32_t SVID3_9; double DELTA_A_9; double e_9; @@ -93,9 +93,9 @@ public: double M0_10; double af0_10; double af1_10; - double E5b_HS_10; - double E1B_HS_10; - double E5a_HS_10; + int32_t E5b_HS_10; + int32_t E1B_HS_10; + int32_t E5a_HS_10; Galileo_Almanac_Helper(); //!< Default constructor Galileo_Almanac get_almanac(int i); diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index 6d157aa46..4e72f62d3 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -123,10 +123,10 @@ void Galileo_Navigation_Message::reset() Region5_flag_5 = false; BGD_E1E5a_5 = 0.0; BGD_E1E5b_5 = 0.0; - E5b_HS_5 = 0.0; - E1B_HS_5 = 0.0; - E5b_DVS_5 = 0.0; - E1B_DVS_5 = 0.0; + E5b_HS_5 = 0; + E1B_HS_5 = 0; + E5b_DVS_5 = 0; + E1B_DVS_5 = 0; // GST WN_5 = 0.0; @@ -146,7 +146,7 @@ void Galileo_Navigation_Message::reset() // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number IOD_a_7 = 0; - WN_a_7 = 0.0; + WN_a_7 = 0; t0a_7 = 0.0; SVID1_7 = 0; DELTA_A_7 = 0.0; @@ -161,8 +161,8 @@ void Galileo_Navigation_Message::reset() IOD_a_8 = 0; af0_8 = 0.0; af1_8 = 0.0; - E5b_HS_8 = 0.0; - E1B_HS_8 = 0.0; + E5b_HS_8 = 0; + E1B_HS_8 = 0; SVID2_8 = 0; DELTA_A_8 = 0.0; e_8 = 0.0; @@ -173,13 +173,13 @@ void Galileo_Navigation_Message::reset() // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) IOD_a_9 = 0; - WN_a_9 = 0.0; + WN_a_9 = 0; t0a_9 = 0.0; M0_9 = 0.0; af0_9 = 0.0; af1_9 = 0.0; - E5b_HS_9 = 0.0; - E1B_HS_9 = 0.0; + E5b_HS_9 = 0; + E1B_HS_9 = 0; SVID3_9 = 0; DELTA_A_9 = 0.0; e_9 = 0.0; @@ -193,8 +193,8 @@ void Galileo_Navigation_Message::reset() M0_10 = 0.0; af0_10 = 0.0; af1_10 = 0.0; - E5b_HS_10 = 0.0; - E1B_HS_10 = 0.0; + E5b_HS_10 = 0; + E1B_HS_10 = 0; // GST-GPS A_0G_10 = 0.0; @@ -781,13 +781,13 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char *data_jk) BGD_E1E5b_5 = static_cast(read_navigation_signed(data_jk_bits, BGD_E1E5b_5_bit)); BGD_E1E5b_5 = BGD_E1E5b_5 * BGD_E1E5b_5_LSB; DLOG(INFO) << "BGD_E1E5b_5= " << BGD_E1E5b_5; - E5b_HS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_5_bit)); + E5b_HS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_5_bit)); DLOG(INFO) << "E5b_HS_5= " << E5b_HS_5; - E1B_HS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_5_bit)); + E1B_HS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_5_bit)); DLOG(INFO) << "E1B_HS_5= " << E1B_HS_5; - E5b_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_DVS_5_bit)); + E5b_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_DVS_5_bit)); DLOG(INFO) << "E5b_DVS_5= " << E5b_DVS_5; - E1B_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_DVS_5_bit)); + E1B_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_DVS_5_bit)); DLOG(INFO) << "E1B_DVS_5= " << E1B_DVS_5; // GST WN_5 = static_cast(read_navigation_unsigned(data_jk_bits, WN_5_bit)); @@ -833,7 +833,7 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char *data_jk) case 7: // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number IOD_a_7 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_a_7_bit)); DLOG(INFO) << "IOD_a_7= " << IOD_a_7; - WN_a_7 = static_cast(read_navigation_unsigned(data_jk_bits, WN_a_7_bit)); + WN_a_7 = static_cast(read_navigation_unsigned(data_jk_bits, WN_a_7_bit)); DLOG(INFO) << "WN_a_7= " << WN_a_7; t0a_7 = static_cast(read_navigation_unsigned(data_jk_bits, t0a_7_bit)); t0a_7 = t0a_7 * t0a_7_LSB; @@ -874,11 +874,11 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char *data_jk) af1_8 = static_cast(read_navigation_signed(data_jk_bits, af1_8_bit)); af1_8 = af1_8 * af1_8_LSB; DLOG(INFO) << "af1_8= " << af1_8; - E5b_HS_8 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_8_bit)); + E5b_HS_8 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_8_bit)); DLOG(INFO) << "E5b_HS_8= " << E5b_HS_8; - E1B_HS_8 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_8_bit)); + E1B_HS_8 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_8_bit)); DLOG(INFO) << "E1B_HS_8= " << E1B_HS_8; - SVID2_8 = static_cast(read_navigation_unsigned(data_jk_bits, SVID2_8_bit)); + SVID2_8 = static_cast(read_navigation_unsigned(data_jk_bits, SVID2_8_bit)); DLOG(INFO) << "SVID2_8= " << SVID2_8; DELTA_A_8 = static_cast(read_navigation_signed(data_jk_bits, DELTA_A_8_bit)); DELTA_A_8 = DELTA_A_8 * DELTA_A_8_LSB; @@ -905,7 +905,7 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char *data_jk) case 9: // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) IOD_a_9 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_a_9_bit)); DLOG(INFO) << "IOD_a_9= " << IOD_a_9; - WN_a_9 = static_cast(read_navigation_unsigned(data_jk_bits, WN_a_9_bit)); + WN_a_9 = static_cast(read_navigation_unsigned(data_jk_bits, WN_a_9_bit)); DLOG(INFO) << "WN_a_9= " << WN_a_9; t0a_9 = static_cast(read_navigation_unsigned(data_jk_bits, t0a_9_bit)); t0a_9 = t0a_9 * t0a_9_LSB; @@ -919,11 +919,11 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char *data_jk) af1_9 = static_cast(read_navigation_signed(data_jk_bits, af1_9_bit)); af1_9 = af1_9 * af1_9_LSB; DLOG(INFO) << "af1_9= " << af1_9; - E5b_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_9_bit)); + E5b_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_9_bit)); DLOG(INFO) << "E5b_HS_9= " << E5b_HS_9; - E1B_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_9_bit)); + E1B_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_9_bit)); DLOG(INFO) << "E1B_HS_9= " << E1B_HS_9; - SVID3_9 = static_cast(read_navigation_unsigned(data_jk_bits, SVID3_9_bit)); + SVID3_9 = static_cast(read_navigation_unsigned(data_jk_bits, SVID3_9_bit)); DLOG(INFO) << "SVID3_9= " << SVID3_9; DELTA_A_9 = static_cast(read_navigation_signed(data_jk_bits, DELTA_A_9_bit)); DELTA_A_9 = DELTA_A_9 * DELTA_A_9_LSB; @@ -959,9 +959,9 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char *data_jk) af1_10 = static_cast(read_navigation_signed(data_jk_bits, af1_10_bit)); af1_10 = af1_10 * af1_10_LSB; DLOG(INFO) << "af1_10= " << af1_10; - E5b_HS_10 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_10_bit)); + E5b_HS_10 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_10_bit)); DLOG(INFO) << "E5b_HS_10= " << E5b_HS_10; - E1B_HS_10 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_10_bit)); + E1B_HS_10 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_10_bit)); DLOG(INFO) << "E1B_HS_10= " << E1B_HS_10; A_0G_10 = static_cast(read_navigation_signed(data_jk_bits, A_0G_10_bit)); A_0G_10 = A_0G_10 * A_0G_10_LSB; diff --git a/src/core/system_parameters/galileo_navigation_message.h b/src/core/system_parameters/galileo_navigation_message.h index d54e1b980..1e71baafd 100644 --- a/src/core/system_parameters/galileo_navigation_message.h +++ b/src/core/system_parameters/galileo_navigation_message.h @@ -143,10 +143,10 @@ public: double BGD_E1E5a_5; //!< E1-E5a Broadcast Group Delay [s] double BGD_E1E5b_5; //!< E1-E5b Broadcast Group Delay [s] - double E5b_HS_5; //!< E5b Signal Health Status - double E1B_HS_5; //!< E1B Signal Health Status - double E5b_DVS_5; //!< E5b Data Validity Status - double E1B_DVS_5; //!< E1B Data Validity Status + int32_t E5b_HS_5; //!< E5b Signal Health Status + int32_t E1B_HS_5; //!< E1B Signal Health Status + int32_t E5b_DVS_5; //!< E5b Data Validity Status + int32_t E1B_DVS_5; //!< E1B Data Validity Status // GST double WN_5; @@ -166,7 +166,7 @@ public: // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number int32_t IOD_a_7; - double WN_a_7; + int32_t WN_a_7; double t0a_7; int32_t SVID1_7; double DELTA_A_7; @@ -181,8 +181,8 @@ public: int32_t IOD_a_8; double af0_8; double af1_8; - double E5b_HS_8; - double E1B_HS_8; + int32_t E5b_HS_8; + int32_t E1B_HS_8; int32_t SVID2_8; double DELTA_A_8; double e_8; @@ -193,13 +193,13 @@ public: // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) int32_t IOD_a_9; - double WN_a_9; + int32_t WN_a_9; double t0a_9; double M0_9; double af0_9; double af1_9; - double E5b_HS_9; - double E1B_HS_9; + int32_t E5b_HS_9; + int32_t E1B_HS_9; int32_t SVID3_9; double DELTA_A_9; double e_9; @@ -213,8 +213,8 @@ public: double M0_10; double af0_10; double af1_10; - double E5b_HS_10; - double E1B_HS_10; + int32_t E5b_HS_10; + int32_t E1B_HS_10; // GST-GPS conversion double A_0G_10; //!< Constant term of the offset Delta t systems diff --git a/src/core/system_parameters/gps_almanac.cc b/src/core/system_parameters/gps_almanac.cc index c2776dcce..987032668 100644 --- a/src/core/system_parameters/gps_almanac.cc +++ b/src/core/system_parameters/gps_almanac.cc @@ -36,7 +36,7 @@ Gps_Almanac::Gps_Almanac() { i_satellite_PRN = 0U; d_Delta_i = 0.0; - d_Toa = 0.0; + i_Toa = 0.0; i_WNa = 0; d_M_0 = 0.0; d_e_eccentricity = 0.0; diff --git a/src/core/system_parameters/gps_almanac.h b/src/core/system_parameters/gps_almanac.h index 57288d3db..71175a8bd 100644 --- a/src/core/system_parameters/gps_almanac.h +++ b/src/core/system_parameters/gps_almanac.h @@ -45,7 +45,7 @@ class Gps_Almanac public: uint32_t i_satellite_PRN; //!< SV PRN NUMBER double d_Delta_i; //!< Inclination Angle at Reference Time (relative to i_0 = 0.30 semi-circles) - double d_Toa; //!< Almanac data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] + int32_t i_Toa; //!< Almanac data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] int32_t i_WNa; //!< Almanac week number double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] double d_e_eccentricity; //!< Eccentricity [dimensionless] @@ -72,7 +72,7 @@ public: }; ar& BOOST_SERIALIZATION_NVP(i_satellite_PRN); ar& BOOST_SERIALIZATION_NVP(d_Delta_i); - ar& BOOST_SERIALIZATION_NVP(d_Toa); + ar& BOOST_SERIALIZATION_NVP(i_Toa); ar& BOOST_SERIALIZATION_NVP(i_WNa); ar& BOOST_SERIALIZATION_NVP(d_M_0); ar& BOOST_SERIALIZATION_NVP(d_e_eccentricity); diff --git a/src/core/system_parameters/gps_navigation_message.cc b/src/core/system_parameters/gps_navigation_message.cc index 742cfb19e..e77317ccd 100644 --- a/src/core/system_parameters/gps_navigation_message.cc +++ b/src/core/system_parameters/gps_navigation_message.cc @@ -125,7 +125,7 @@ void Gps_Navigation_Message::reset() d_DeltaT_LSF = 0.0; // Almanac - d_Toa = 0.0; + i_Toa = 0; i_WN_A = 0; for (int32_t i = 1; i < 32; i++) { @@ -433,8 +433,8 @@ int32_t Gps_Navigation_Message::subframe_decoder(char *subframe) } if (SV_page_5 == 51) // Page 25 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) { - d_Toa = static_cast(read_navigation_unsigned(subframe_bits, T_OA)); - d_Toa = d_Toa * T_OA_LSB; + i_Toa = static_cast(read_navigation_unsigned(subframe_bits, T_OA)); + i_Toa = i_Toa * T_OA_LSB; i_WN_A = static_cast(read_navigation_unsigned(subframe_bits, WN_A)); almanacHealth[1] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV1)); almanacHealth[2] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV2)); diff --git a/src/core/system_parameters/gps_navigation_message.h b/src/core/system_parameters/gps_navigation_message.h index 73e3c873b..595d74d30 100644 --- a/src/core/system_parameters/gps_navigation_message.h +++ b/src/core/system_parameters/gps_navigation_message.h @@ -109,8 +109,8 @@ public: double d_A_f2; //!< Coefficient 2 of code phase offset model [s/s^2] // Almanac - double d_Toa; //!< Almanac reference time [s] - int32_t i_WN_A; //!< Modulo 256 of the GPS week number to which the almanac reference time (d_Toa) is referenced + int32_t i_Toa; //!< Almanac reference time [s] + int32_t i_WN_A; //!< Modulo 256 of the GPS week number to which the almanac reference time (i_Toa) is referenced std::map almanacHealth; //!< Map that stores the health information stored in the almanac std::map satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus From 61d67a764286180ea64380cfcf1039ace6dfbcc6 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 7 Nov 2018 23:53:16 +0100 Subject: [PATCH 2/2] Make use of the more efficient switch statement for printers --- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 550 +++++++++--------- 1 file changed, 266 insertions(+), 284 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 762a36f1c..7f4d311db 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -1158,18 +1158,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); - - if (type_of_rx == 1) // GPS L1 C/A only + switch (type_of_rx) { + case 1: // GPS L1 C/A only if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, d_rx_time); rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 2) // GPS L2C only - { + break; + case 2: // GPS L2C only if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { std::string signal("2S"); @@ -1177,9 +1176,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 3) // GPS L5 only - { + break; + case 3: // GPS L5 only if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { std::string signal("L5"); @@ -1187,38 +1185,34 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 4) // Galileo E1B only - { + break; + case 4: // Galileo E1B only if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time); rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 5) // Galileo E5a only - { - std::string signal("5X"); + break; + case 5: // Galileo E5a only if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { + std::string signal("5X"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 6) // Galileo E5b only - { - std::string signal("7X"); + break; + case 6: // Galileo E5b only if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { + std::string signal("7X"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 7) // GPS L1 C/A + GPS L2C - { + break; + case 7: // GPS L1 C/A + GPS L2C if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { std::string signal("1C 2S"); @@ -1226,9 +1220,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 8) // GPS L1 + GPS L5 - { + break; + case 8: // GPS L1 + GPS L5 if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { std::string signal("1C L5"); @@ -1236,9 +1229,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B - { + break; + case 9: // GPS L1 C/A + Galileo E1B if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { std::string gal_signal("1B"); @@ -1246,9 +1238,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 10) // GPS L1 C/A + Galileo E5a - { + break; + case 10: // GPS L1 C/A + Galileo E5a if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { std::string gal_signal("5X"); @@ -1256,9 +1247,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 11) // GPS L1 C/A + Galileo E5b - { + break; + case 11: // GPS L1 C/A + Galileo E5b if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { std::string gal_signal("7X"); @@ -1266,9 +1256,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 13) // L5+E5a - { + break; + case 13: // L5+E5a if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { std::string gal_signal("5X"); @@ -1277,9 +1266,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 14) // Galileo E1B + Galileo E5a - { + break; + case 14: // Galileo E1B + Galileo E5a if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { std::string gal_signal("1B 5X"); @@ -1287,9 +1275,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 15) // Galileo E1B + Galileo E5b - { + break; + case 15: // Galileo E1B + Galileo E5b if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { std::string gal_signal("1B 7X"); @@ -1297,40 +1284,35 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 23) // GLONASS L1 C/A only - { - std::string signal("1G"); + break; + case 23: // GLONASS L1 C/A only if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { + std::string signal("1G"); rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 24) // GLONASS L2 C/A only - { - std::string signal("2G"); + break; + case 24: // GLONASS L2 C/A only if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { + std::string signal("2G"); rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 25) // GLONASS L1 C/A + GLONASS L2 C/A - { - std::string signal("1G 2G"); + break; + case 25: // GLONASS L1 C/A + GLONASS L2 C/A if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { + std::string signal("1G 2G"); rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); b_rinex_header_written = true; // do not write header anymore } - } - - if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A - { + break; + case 26: // GPS L1 C/A + GLONASS L1 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { std::string glo_signal("1G"); @@ -1344,9 +1326,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A - { + break; + case 27: // Galileo E1B + GLONASS L1 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { std::string glo_signal("1G"); @@ -1355,9 +1336,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A - { + break; + case 28: // GPS L2C + GLONASS L1 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { std::string glo_signal("1G"); @@ -1365,9 +1345,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A - { + break; + case 29: // GPS L1 C/A + GLONASS L2 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { std::string glo_signal("2G"); @@ -1381,9 +1360,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A - { + break; + case 30: // Galileo E1B + GLONASS L2 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { std::string glo_signal("2G"); @@ -1392,9 +1370,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A - { + break; + case 31: // GPS L2C + GLONASS L2 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { std::string glo_signal("2G"); @@ -1402,10 +1379,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_written = true; // do not write header anymore } - } - - if (type_of_rx == 32) // L1+E1+L5+E5a - { + break; + case 32: // L1+E1+L5+E5a if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) @@ -1416,55 +1391,55 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } + break; + default: + break; } } - if (b_rinex_header_written) // The header is already written, we can now log the navigation message data { if (flag_write_RINEX_nav_output) { - if (type_of_rx == 1) // GPS L1 C/A only + switch (type_of_rx) { + case 1: // GPS L1 C/A only rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); - } - if (type_of_rx == 2) // GPS L2C only - { + break; + case 2: // GPS L2C only rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); - } - if (type_of_rx == 3) // GPS L5 only - { + break; + case 3: // GPS L5 only rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); - } - if ((type_of_rx == 4) or (type_of_rx == 5) or (type_of_rx == 6)) // Galileo - { + break; + case 4: + case 5: + case 6: rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map); - } - if (type_of_rx == 7) // GPS L1 C/A + GPS L2C - { + break; + case 7: // GPS L1 C/A + GPS L2C rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); - } - if (type_of_rx == 8) // L1+L5 - { + break; + case 8: // L1+L5 rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); - } - if ((type_of_rx == 9) or (type_of_rx == 10) or (type_of_rx == 11)) // GPS L1 C/A + Galileo - { + break; + case 9: + case 10: + case 11: rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->galileo_ephemeris_map); - } - if (type_of_rx == 13) // L5+E5a - { + break; + case 13: // L5+E5a rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->galileo_ephemeris_map); - } - if ((type_of_rx == 14) or (type_of_rx == 15)) // Galileo E1B + Galileo E5a - { + break; + case 14: + case 15: rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map); - } - if ((type_of_rx == 23) or (type_of_rx == 24) or (type_of_rx == 25)) // GLONASS L1 C/A, GLONASS L2 C/A - { + break; + case 23: + case 24: + case 25: rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map); - } - if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A - { + break; + case 26: // GPS L1 C/A + GLONASS L1 C/A if (d_rinex_version == 3) rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); if (d_rinex_version == 2) @@ -1472,17 +1447,14 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map); } - } - if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A - { + break; + case 27: // Galileo E1B + GLONASS L1 C/A rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->galileo_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); - } - if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A - { + break; + case 28: // GPS L2C + GLONASS L1 C/A rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); - } - if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A - { + break; + case 29: // GPS L1 C/A + GLONASS L2 C/A if (d_rinex_version == 3) rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); if (d_rinex_version == 2) @@ -1490,18 +1462,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map); } - } - if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A - { + break; + case 30: // Galileo E1B + GLONASS L2 C/A rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->galileo_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); - } - if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A - { + break; + case 31: // GPS L2C + GLONASS L2 C/A rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); - } - if (type_of_rx == 32) // L1+E1+L5+E5a - { + break; + case 32: // L1+E1+L5+E5a rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->galileo_ephemeris_map); + break; + default: + break; } } galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); @@ -1512,8 +1484,9 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item // Log observables into the RINEX file if (flag_write_RINEX_obs_output) { - if (type_of_rx == 1) // GPS L1 C/A only + switch (type_of_rx) { + case 1: // GPS L1 C/A only if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1524,9 +1497,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono); b_rinex_header_updated = true; } - } - if (type_of_rx == 2) // GPS L2C only - { + break; + case 2: // GPS L2C only if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1537,9 +1509,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono); b_rinex_header_updated = true; } - } - if (type_of_rx == 3) // GPS L5 - { + break; + case 3: // GPS L5 if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1550,9 +1521,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono); b_rinex_header_updated = true; } - } - if (type_of_rx == 4) // Galileo E1B only - { + break; + case 4: // Galileo E1B only if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B"); @@ -1563,9 +1533,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; } - } - if (type_of_rx == 5) // Galileo E5a only - { + break; + case 5: // Galileo E5a only if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "5X"); @@ -1576,9 +1545,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; } - } - if (type_of_rx == 6) // Galileo E5b only - { + break; + case 6: // Galileo E5b only if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "7X"); @@ -1589,9 +1557,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; } - } - if (type_of_rx == 7) // GPS L1 C/A + GPS L2C - { + break; + case 7: // GPS L1 C/A + GPS L2C if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1602,9 +1569,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono); b_rinex_header_updated = true; } - } - if (type_of_rx == 8) // L1+L5 - { + break; + case 8: // L1+L5 if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1623,9 +1589,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } b_rinex_header_updated = true; } - } - if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B - { + break; + case 9: // GPS L1 C/A + Galileo E1B if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1636,9 +1601,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; } - } - if (type_of_rx == 13) // L5+E5a - { + break; + case 13: // L5+E5a if ((gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1649,9 +1613,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; // do not write header anymore } - } - if (type_of_rx == 14) // Galileo E1B + Galileo E5a - { + break; + case 14: // Galileo E1B + Galileo E5a if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 5X"); @@ -1662,9 +1625,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; } - } - if (type_of_rx == 15) // Galileo E1B + Galileo E5b - { + break; + case 15: // Galileo E1B + Galileo E5b if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 7X"); @@ -1675,9 +1637,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; } - } - if (type_of_rx == 23) // GLONASS L1 C/A only - { + break; + case 23: // GLONASS L1 C/A only if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C"); @@ -1688,9 +1649,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model); b_rinex_header_updated = true; } - } - if (type_of_rx == 24) // GLONASS L2 C/A only - { + break; + case 24: // GLONASS L2 C/A only if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "2C"); @@ -1701,9 +1661,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model); b_rinex_header_updated = true; } - } - if (type_of_rx == 25) // GLONASS L1 C/A + GLONASS L2 C/A - { + break; + case 25: // GLONASS L1 C/A + GLONASS L2 C/A if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C 2C"); @@ -1714,9 +1673,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model); b_rinex_header_updated = true; } - } - if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A - { + break; + case 26: // GPS L1 C/A + GLONASS L1 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1727,9 +1685,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } - } - if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A - { + break; + case 27: // Galileo E1B + GLONASS L1 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1740,9 +1697,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } - } - if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A - { + break; + case 28: // GPS L2C + GLONASS L1 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1753,9 +1709,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } - } - if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A - { + break; + case 29: // GPS L1 C/A + GLONASS L2 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1766,9 +1721,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } - } - if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A - { + break; + case 30: // Galileo E1B + GLONASS L2 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1779,9 +1733,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } - } - if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A - { + break; + case 31: // GPS L2C + GLONASS L2 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1792,9 +1745,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } - } - if (type_of_rx == 32) // L1+E1+L5+E5a - { + break; + case 32: // L1+E1+L5+E5a if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1813,6 +1765,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } b_rinex_header_updated = true; // do not write header anymore } + break; } } } @@ -1823,8 +1776,9 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (b_rtcm_writing_started and b_rtcm_enabled) { - if (type_of_rx == 1) // GPS L1 C/A + switch (type_of_rx) { + case 1: // GPS L1 C/A if (flag_write_RTCM_1019_output == true) { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -1840,9 +1794,10 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if ((type_of_rx == 4) || (type_of_rx == 5) || (type_of_rx == 6) || (type_of_rx == 14) || (type_of_rx == 15)) // Galileo - { + break; + case 4: + case 5: + case 6: if (flag_write_RTCM_1045_output == true) { for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) @@ -1858,9 +1813,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if (type_of_rx == 7) // GPS L1 C/A + GPS L2C - { + break; + case 7: // GPS L1 C/A + GPS L2C if (flag_write_RTCM_1019_output == true) { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -1877,9 +1831,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if (type_of_rx == 8) // L1+L5 - { + break; + case 8: // L1+L5 if (flag_write_RTCM_1019_output == true) { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -1896,9 +1849,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B - { + break; + case 9: // GPS L1 C/A + Galileo E1B if (flag_write_RTCM_1019_output == true) { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -1956,22 +1908,20 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if (type_of_rx == 13) // L5+E5a - { - std::map::const_iterator gal_eph_iter; - std::map::const_iterator gps_cnav_eph_iter; + break; + case 13: // L5+E5a if (flag_write_RTCM_1045_output == true) { - for (gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } } - gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); + if (flag_write_RTCM_MSM_output == true) { + std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + std::map::const_iterator gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); if (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); @@ -1981,9 +1931,28 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if ((type_of_rx == 23) || (type_of_rx == 24) || (type_of_rx == 25)) // GLONASS - { + break; + case 14: + case 15: + if (flag_write_RTCM_1045_output == true) + { + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + { + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + } + } + if (flag_write_RTCM_MSM_output == true) + { + std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + { + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + } + break; + case 23: + case 24: + case 25: if (flag_write_RTCM_1020_output == true) { for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) @@ -2000,13 +1969,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A - { - std::map::const_iterator gps_eph_iter; + break; + case 26: // GPS L1 C/A + GLONASS L1 C/A if (flag_write_RTCM_1019_output == true) { - for (gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } @@ -2062,9 +2029,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if (type_of_rx == 27) // GLONASS L1 C/A + Galileo E1B - { + break; + case 27: // GLONASS L1 C/A + Galileo E1B if (flag_write_RTCM_1020_output == true) { for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) @@ -2122,9 +2088,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A - { + break; + case 29: // GPS L1 C/A + GLONASS L2 C/A if (flag_write_RTCM_1019_output == true) { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -2182,9 +2147,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if (type_of_rx == 30) // GLONASS L2 C/A + Galileo E1B - { + break; + case 30: // GLONASS L2 C/A + Galileo E1B if (flag_write_RTCM_1020_output == true) { for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) @@ -2242,9 +2206,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if (type_of_rx == 32) // L1+E1+L5+E5a - { + break; + case 32: // L1+E1+L5+E5a if (flag_write_RTCM_1019_output == true) { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -2302,13 +2265,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } + break; + default: + break; } } if (!b_rtcm_writing_started and b_rtcm_enabled) // the first time { - if (type_of_rx == 1) // GPS L1 C/A + switch (type_of_rx) { + case 1: // GPS L1 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -2326,9 +2293,10 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if ((type_of_rx == 4) || (type_of_rx == 5) || (type_of_rx == 6) || (type_of_rx == 14) || (type_of_rx == 15)) // Galileo - { + break; + case 4: + case 5: + case 6: if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) @@ -2345,9 +2313,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if (type_of_rx == 7) // GPS L1 C/A + GPS L2C - { + break; + case 7: // GPS L1 C/A + GPS L2C if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -2365,9 +2332,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if (type_of_rx == 8) // L1+L5 - { + break; + case 8: // L1+L5 if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -2385,9 +2351,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B - { + break; + case 9: // GPS L1 C/A + Galileo E1B if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -2446,9 +2411,48 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if ((type_of_rx == 23) || (type_of_rx == 24) || (type_of_rx == 25)) // GLONASS - { + break; + + case 13: // L5+E5a + if (d_rtcm_MT1045_rate_ms != 0) + { + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + { + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + } + } + if (d_rtcm_MSM_rate_ms != 0) + { + std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) + { + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + } + b_rtcm_writing_started = true; + break; + case 14: + case 15: + if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 + { + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + { + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + } + } + if (d_rtcm_MSM_rate_ms != 0) + { + std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + { + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + } + b_rtcm_writing_started = true; + break; + case 23: + case 24: + case 25: if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) @@ -2465,29 +2469,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if (type_of_rx == 13) // L5+E5a - { - std::map::const_iterator gal_eph_iter; - if (d_rtcm_MT1045_rate_ms != 0) - { - for (gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) - { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); - } - } - if (d_rtcm_MSM_rate_ms != 0) - { - gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) - { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); - } - } - b_rtcm_writing_started = true; - } - if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A - { + break; + case 26: // GPS L1 C/A + GLONASS L1 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -2546,9 +2529,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if (type_of_rx == 27) // GLONASS L1 C/A + Galileo E1B - { + break; + case 27: // GLONASS L1 C/A + Galileo E1B if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) @@ -2607,9 +2589,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A - { + break; + case 29: // GPS L1 C/A + GLONASS L2 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -2669,9 +2650,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if (type_of_rx == 30) // GLONASS L2 C/A + Galileo E1B - { + break; + case 30: // GLONASS L2 C/A + Galileo E1B if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) @@ -2730,9 +2710,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if (type_of_rx == 32) // L1+E1+L5+E5a - { + break; + case 32: // L1+E1+L5+E5a if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -2791,6 +2770,9 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; + break; + default: + break; } } }