1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 12:10:34 +00:00

Save some static casts

This commit is contained in:
Carles Fernandez 2020-12-22 10:59:13 +01:00
parent 3bcac95964
commit 303de4c9cf
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
3 changed files with 9 additions and 9 deletions

View File

@ -84,16 +84,16 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
{ {
case 1: // INAV case 1: // INAV
{ {
d_PRN_code_period_ms = static_cast<uint32_t>(GALILEO_E1_CODE_PERIOD_MS); // for Galileo E5b is also 4 ms d_PRN_code_period_ms = GALILEO_E1_CODE_PERIOD_MS; // for Galileo E5b is also 4 ms
d_bits_per_preamble = GALILEO_INAV_PREAMBLE_LENGTH_BITS; d_bits_per_preamble = GALILEO_INAV_PREAMBLE_LENGTH_BITS;
// set the preamble // set the preamble
d_samples_per_preamble = GALILEO_INAV_PREAMBLE_LENGTH_BITS; d_samples_per_preamble = GALILEO_INAV_PREAMBLE_LENGTH_BITS;
d_preamble_period_symbols = GALILEO_INAV_PREAMBLE_PERIOD_SYMBOLS; d_preamble_period_symbols = GALILEO_INAV_PREAMBLE_PERIOD_SYMBOLS;
d_required_symbols = static_cast<uint32_t>(GALILEO_INAV_PAGE_SYMBOLS) + d_samples_per_preamble; d_required_symbols = GALILEO_INAV_PAGE_SYMBOLS + d_samples_per_preamble;
// preamble bits to sampled symbols // preamble bits to sampled symbols
d_preamble_samples.reserve(d_samples_per_preamble); d_preamble_samples.reserve(d_samples_per_preamble);
d_frame_length_symbols = GALILEO_INAV_PAGE_PART_SYMBOLS - GALILEO_INAV_PREAMBLE_LENGTH_BITS; d_frame_length_symbols = GALILEO_INAV_PAGE_PART_SYMBOLS - GALILEO_INAV_PREAMBLE_LENGTH_BITS;
d_codelength = GALILEO_INAV_PAGE_PART_SYMBOLS - GALILEO_INAV_PREAMBLE_LENGTH_BITS; d_codelength = static_cast<int32_t>(d_frame_length_symbols);
d_datalength = (d_codelength / d_nn) - d_mm; d_datalength = (d_codelength / d_nn) - d_mm;
d_max_symbols_without_valid_frame = GALILEO_INAV_PAGE_SYMBOLS * 30; // rise alarm 60 seconds without valid tlm d_max_symbols_without_valid_frame = GALILEO_INAV_PAGE_SYMBOLS * 30; // rise alarm 60 seconds without valid tlm
@ -110,21 +110,21 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
// preamble bits to sampled symbols // preamble bits to sampled symbols
d_preamble_samples.reserve(d_samples_per_preamble); d_preamble_samples.reserve(d_samples_per_preamble);
d_frame_length_symbols = GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS; d_frame_length_symbols = GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS;
d_codelength = GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS; d_codelength = static_cast<int32_t>(d_frame_length_symbols);
d_datalength = (d_codelength / d_nn) - d_mm; d_datalength = (d_codelength / d_nn) - d_mm;
d_max_symbols_without_valid_frame = GALILEO_FNAV_SYMBOLS_PER_PAGE * 5; // rise alarm 100 seconds without valid tlm d_max_symbols_without_valid_frame = GALILEO_FNAV_SYMBOLS_PER_PAGE * 5; // rise alarm 100 seconds without valid tlm
break; break;
} }
case 3: // CNAV case 3: // CNAV
{ {
d_PRN_code_period_ms = static_cast<uint32_t>(GALILEO_E6_CODE_PERIOD_MS); d_PRN_code_period_ms = GALILEO_E6_CODE_PERIOD_MS;
d_bits_per_preamble = GALILEO_CNAV_PREAMBLE_LENGTH_BITS; d_bits_per_preamble = GALILEO_CNAV_PREAMBLE_LENGTH_BITS;
d_samples_per_preamble = GALILEO_CNAV_PREAMBLE_LENGTH_BITS; d_samples_per_preamble = GALILEO_CNAV_PREAMBLE_LENGTH_BITS;
d_preamble_period_symbols = GALILEO_CNAV_SYMBOLS_PER_PAGE; d_preamble_period_symbols = GALILEO_CNAV_SYMBOLS_PER_PAGE;
d_required_symbols = static_cast<uint32_t>(GALILEO_CNAV_SYMBOLS_PER_PAGE) + d_samples_per_preamble; d_required_symbols = static_cast<uint32_t>(GALILEO_CNAV_SYMBOLS_PER_PAGE) + d_samples_per_preamble;
d_preamble_samples.reserve(d_samples_per_preamble); d_preamble_samples.reserve(d_samples_per_preamble);
d_frame_length_symbols = GALILEO_CNAV_SYMBOLS_PER_PAGE - GALILEO_CNAV_PREAMBLE_LENGTH_BITS; d_frame_length_symbols = GALILEO_CNAV_SYMBOLS_PER_PAGE - GALILEO_CNAV_PREAMBLE_LENGTH_BITS;
d_codelength = GALILEO_CNAV_SYMBOLS_PER_PAGE - GALILEO_CNAV_PREAMBLE_LENGTH_BITS; d_codelength = static_cast<int32_t>(d_frame_length_symbols);
d_datalength = (d_codelength / d_nn) - d_mm; d_datalength = (d_codelength / d_nn) - d_mm;
d_max_symbols_without_valid_frame = GALILEO_CNAV_SYMBOLS_PER_PAGE * 60; d_max_symbols_without_valid_frame = GALILEO_CNAV_SYMBOLS_PER_PAGE * 60;
break; break;
@ -804,7 +804,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
else else
{ {
// this page has no timing information // this page has no timing information
d_TOW_at_current_symbol_ms += static_cast<uint32_t>(d_PRN_code_period_ms); // + GALILEO_INAV_PAGE_PART_SYMBOLS*GALILEO_E1_CODE_PERIOD_S; d_TOW_at_current_symbol_ms += d_PRN_code_period_ms;
} }
} }
break; break;

View File

@ -41,7 +41,7 @@ constexpr double GALILEO_E1_SUB_CARRIER_A_RATE_HZ = 1.023e6; //!< Galileo E1 su
constexpr double GALILEO_E1_SUB_CARRIER_B_RATE_HZ = 6.138e6; //!< Galileo E1 sub-carrier 'b' rate [Hz] constexpr double GALILEO_E1_SUB_CARRIER_B_RATE_HZ = 6.138e6; //!< Galileo E1 sub-carrier 'b' rate [Hz]
constexpr double GALILEO_E1_B_CODE_LENGTH_CHIPS = 4092.0; //!< Galileo E1-B code length [chips] constexpr double GALILEO_E1_B_CODE_LENGTH_CHIPS = 4092.0; //!< Galileo E1-B code length [chips]
constexpr double GALILEO_E1_B_SYMBOL_RATE_BPS = 250.0; //!< Galileo E1-B symbol rate [bits/second] constexpr double GALILEO_E1_B_SYMBOL_RATE_BPS = 250.0; //!< Galileo E1-B symbol rate [bits/second]
constexpr int32_t GALILEO_E1_CODE_PERIOD_MS = 4; //!< Galileo E1 code period [ms] constexpr uint32_t GALILEO_E1_CODE_PERIOD_MS = 4; //!< Galileo E1 code period [ms]
constexpr int32_t GALILEO_E1_B_SAMPLES_PER_SYMBOL = 1; //!< (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS) / Galileo_E1_B_SYMBOL_RATE_BPS constexpr int32_t GALILEO_E1_B_SAMPLES_PER_SYMBOL = 1; //!< (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS) / Galileo_E1_B_SYMBOL_RATE_BPS
constexpr int32_t GALILEO_E1_C_SECONDARY_CODE_LENGTH = 25; //!< Galileo E1-C secondary code length [chips] constexpr int32_t GALILEO_E1_C_SECONDARY_CODE_LENGTH = 25; //!< Galileo E1-C secondary code length [chips]
constexpr int32_t GALILEO_E1_NUMBER_OF_CODES = 50; constexpr int32_t GALILEO_E1_NUMBER_OF_CODES = 50;

View File

@ -38,7 +38,7 @@ constexpr double GALILEO_E6_CODE_PERIOD_S = 0.001; //!< Galileo E6 cod
constexpr double GALILEO_E6_B_CODE_LENGTH_CHIPS = 5115.0; //!< Galileo E6 B code length [chips] constexpr double GALILEO_E6_B_CODE_LENGTH_CHIPS = 5115.0; //!< Galileo E6 B code length [chips]
constexpr double GALILEO_E6_C_CODE_LENGTH_CHIPS = 5115.0; //!< Galileo E6 C code length [chips] constexpr double GALILEO_E6_C_CODE_LENGTH_CHIPS = 5115.0; //!< Galileo E6 C code length [chips]
constexpr double GALILEO_E6_C_SECONDARY_CODE_LENGTH_CHIPS = 100.0; //!< Galileo E6 C secondary code length [chips] constexpr double GALILEO_E6_C_SECONDARY_CODE_LENGTH_CHIPS = 100.0; //!< Galileo E6 C secondary code length [chips]
constexpr int32_t GALILEO_E6_CODE_PERIOD_MS = 1; //!< Galileo E& B/C code period [ms] constexpr uint32_t GALILEO_E6_CODE_PERIOD_MS = 1; //!< Galileo E& B/C code period [ms]
constexpr int32_t GALILEO_E6_NUMBER_OF_CODES = 50; constexpr int32_t GALILEO_E6_NUMBER_OF_CODES = 50;