1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 12:40:35 +00:00

Replace unsigned long int by uint64_t and long int by int64_t. Fixes #199

This commit is contained in:
Carles Fernandez 2018-08-10 20:34:03 +02:00
parent 2517e7bb31
commit 6b1611b3a9
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
74 changed files with 682 additions and 672 deletions

View File

@ -48,7 +48,7 @@ using google::LogMessage;
galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_make_acquisition_caf_cc( galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(
unsigned int sampled_ms, unsigned int sampled_ms,
unsigned int max_dwells, unsigned int max_dwells,
unsigned int doppler_max, long fs_in, unsigned int doppler_max, int64_t fs_in,
int samples_per_ms, int samples_per_code, int samples_per_ms, int samples_per_code,
bool bit_transition_flag, bool bit_transition_flag,
bool dump, bool dump,
@ -67,7 +67,7 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit
unsigned int sampled_ms, unsigned int sampled_ms,
unsigned int max_dwells, unsigned int max_dwells,
unsigned int doppler_max, unsigned int doppler_max,
long fs_in, int64_t fs_in,
int samples_per_ms, int samples_per_ms,
int samples_per_code, int samples_per_code,
bool bit_transition_flag, bool bit_transition_flag,

View File

@ -52,7 +52,7 @@ typedef boost::shared_ptr<galileo_e5a_noncoherentIQ_acquisition_caf_cc> galileo_
galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr
galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(unsigned int sampled_ms, galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(unsigned int sampled_ms,
unsigned int max_dwells, unsigned int max_dwells,
unsigned int doppler_max, long fs_in, unsigned int doppler_max, int64_t fs_in,
int samples_per_ms, int samples_per_code, int samples_per_ms, int samples_per_code,
bool bit_transition_flag, bool bit_transition_flag,
bool dump, bool dump,
@ -74,7 +74,7 @@ private:
galileo_e5a_noncoherentIQ_make_acquisition_caf_cc( galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(
unsigned int sampled_ms, unsigned int sampled_ms,
unsigned int max_dwells, unsigned int max_dwells,
unsigned int doppler_max, long fs_in, unsigned int doppler_max, int64_t fs_in,
int samples_per_ms, int samples_per_code, int samples_per_ms, int samples_per_code,
bool bit_transition_flag, bool bit_transition_flag,
bool dump, bool dump,
@ -86,7 +86,7 @@ private:
galileo_e5a_noncoherentIQ_acquisition_caf_cc( galileo_e5a_noncoherentIQ_acquisition_caf_cc(
unsigned int sampled_ms, unsigned int sampled_ms,
unsigned int max_dwells, unsigned int max_dwells,
unsigned int doppler_max, long fs_in, unsigned int doppler_max, int64_t fs_in,
int samples_per_ms, int samples_per_code, int samples_per_ms, int samples_per_code,
bool bit_transition_flag, bool bit_transition_flag,
bool dump, bool dump,
@ -99,7 +99,7 @@ private:
int doppler_offset); int doppler_offset);
float estimate_input_power(gr_complex* in); float estimate_input_power(gr_complex* in);
long d_fs_in; int64_t d_fs_in;
int d_samples_per_ms; int d_samples_per_ms;
int d_sampled_ms; int d_sampled_ms;
int d_samples_per_code; int d_samples_per_code;
@ -111,7 +111,7 @@ private:
unsigned int d_max_dwells; unsigned int d_max_dwells;
unsigned int d_well_count; unsigned int d_well_count;
unsigned int d_fft_size; unsigned int d_fft_size;
unsigned long int d_sample_counter; uint64_t d_sample_counter;
gr_complex** d_grid_doppler_wipeoffs; gr_complex** d_grid_doppler_wipeoffs;
unsigned int d_num_doppler_bins; unsigned int d_num_doppler_bins;
gr_complex* d_fft_code_I_A; gr_complex* d_fft_code_I_A;

View File

@ -83,7 +83,7 @@ private:
unsigned int d_max_dwells; unsigned int d_max_dwells;
unsigned int d_well_count; unsigned int d_well_count;
unsigned int d_fft_size; unsigned int d_fft_size;
unsigned long int d_sample_counter; uint64_t d_sample_counter;
gr_complex** d_grid_doppler_wipeoffs; gr_complex** d_grid_doppler_wipeoffs;
unsigned int d_num_doppler_bins; unsigned int d_num_doppler_bins;
gr_complex* d_fft_code_A; gr_complex* d_fft_code_A;

View File

@ -156,7 +156,7 @@ pcps_acquisition::~pcps_acquisition()
{ {
if (d_num_doppler_bins > 0) if (d_num_doppler_bins > 0)
{ {
for (unsigned int i = 0; i < d_num_doppler_bins; i++) for (uint32_t i = 0; i < d_num_doppler_bins; i++)
{ {
volk_gnsssdr_free(d_grid_doppler_wipeoffs[i]); volk_gnsssdr_free(d_grid_doppler_wipeoffs[i]);
volk_gnsssdr_free(d_magnitude_grid[i]); volk_gnsssdr_free(d_magnitude_grid[i]);
@ -166,7 +166,7 @@ pcps_acquisition::~pcps_acquisition()
} }
if (acq_parameters.make_2_steps) if (acq_parameters.make_2_steps)
{ {
for (unsigned int i = 0; i < d_num_doppler_bins_step2; i++) for (uint32_t i = 0; i < d_num_doppler_bins_step2; i++)
{ {
volk_gnsssdr_free(d_grid_doppler_wipeoffs_step_two[i]); volk_gnsssdr_free(d_grid_doppler_wipeoffs_step_two[i]);
} }
@ -202,7 +202,7 @@ void pcps_acquisition::set_local_code(std::complex<float>* code)
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
if (acq_parameters.bit_transition_flag) if (acq_parameters.bit_transition_flag)
{ {
int offset = d_fft_size / 2; int32_t offset = d_fft_size / 2;
std::fill_n(d_fft_if->get_inbuf(), offset, gr_complex(0.0, 0.0)); std::fill_n(d_fft_if->get_inbuf(), offset, gr_complex(0.0, 0.0));
memcpy(d_fft_if->get_inbuf() + offset, code, sizeof(gr_complex) * offset); memcpy(d_fft_if->get_inbuf() + offset, code, sizeof(gr_complex) * offset);
} }
@ -246,7 +246,7 @@ bool pcps_acquisition::is_fdma()
} }
void pcps_acquisition::update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq) void pcps_acquisition::update_local_carrier(gr_complex* carrier_vector, int32_t correlator_length_samples, float freq)
{ {
float phase_step_rad = GPS_TWO_PI * freq / static_cast<float>(acq_parameters.fs_in); float phase_step_rad = GPS_TWO_PI * freq / static_cast<float>(acq_parameters.fs_in);
float _phase[1]; float _phase[1];
@ -268,29 +268,29 @@ void pcps_acquisition::init()
d_mag = 0.0; d_mag = 0.0;
d_input_power = 0.0; d_input_power = 0.0;
d_num_doppler_bins = static_cast<unsigned int>(std::ceil(static_cast<double>(static_cast<int>(acq_parameters.doppler_max) - static_cast<int>(-acq_parameters.doppler_max)) / static_cast<double>(d_doppler_step))); d_num_doppler_bins = static_cast<uint32_t>(std::ceil(static_cast<double>(static_cast<int>(acq_parameters.doppler_max) - static_cast<int>(-acq_parameters.doppler_max)) / static_cast<double>(d_doppler_step)));
// Create the carrier Doppler wipeoff signals // Create the carrier Doppler wipeoff signals
d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins];
if (acq_parameters.make_2_steps) if (acq_parameters.make_2_steps)
{ {
d_grid_doppler_wipeoffs_step_two = new gr_complex*[d_num_doppler_bins_step2]; d_grid_doppler_wipeoffs_step_two = new gr_complex*[d_num_doppler_bins_step2];
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins_step2; doppler_index++) for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins_step2; doppler_index++)
{ {
d_grid_doppler_wipeoffs_step_two[doppler_index] = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); d_grid_doppler_wipeoffs_step_two[doppler_index] = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
} }
} }
d_magnitude_grid = new float*[d_num_doppler_bins]; d_magnitude_grid = new float*[d_num_doppler_bins];
for (unsigned int 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++)
{ {
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
d_magnitude_grid[doppler_index] = static_cast<float*>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment())); d_magnitude_grid[doppler_index] = static_cast<float*>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment()));
for (unsigned k = 0; k < d_fft_size; k++) for (uint32_t k = 0; k < d_fft_size; k++)
{ {
d_magnitude_grid[doppler_index][k] = 0.0; d_magnitude_grid[doppler_index][k] = 0.0;
} }
int doppler = -static_cast<int>(acq_parameters.doppler_max) + d_doppler_step * doppler_index; int32_t doppler = -static_cast<int>(acq_parameters.doppler_max) + d_doppler_step * doppler_index;
update_local_carrier(d_grid_doppler_wipeoffs[doppler_index], d_fft_size, d_old_freq + doppler); update_local_carrier(d_grid_doppler_wipeoffs[doppler_index], d_fft_size, d_old_freq + doppler);
} }
@ -298,7 +298,7 @@ void pcps_acquisition::init()
if (acq_parameters.dump) if (acq_parameters.dump)
{ {
unsigned int effective_fft_size = (acq_parameters.bit_transition_flag ? (d_fft_size / 2) : d_fft_size); uint32_t effective_fft_size = (acq_parameters.bit_transition_flag ? (d_fft_size / 2) : d_fft_size);
grid_ = arma::fmat(effective_fft_size, d_num_doppler_bins, arma::fill::zeros); grid_ = arma::fmat(effective_fft_size, d_num_doppler_bins, arma::fill::zeros);
narrow_grid_ = arma::fmat(effective_fft_size, d_num_doppler_bins_step2, arma::fill::zeros); narrow_grid_ = arma::fmat(effective_fft_size, d_num_doppler_bins_step2, arma::fill::zeros);
} }
@ -307,9 +307,9 @@ void pcps_acquisition::init()
void pcps_acquisition::update_grid_doppler_wipeoffs() void pcps_acquisition::update_grid_doppler_wipeoffs()
{ {
for (unsigned int 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++)
{ {
int doppler = -static_cast<int>(acq_parameters.doppler_max) + d_doppler_step * doppler_index; int32_t doppler = -static_cast<int>(acq_parameters.doppler_max) + d_doppler_step * doppler_index;
update_local_carrier(d_grid_doppler_wipeoffs[doppler_index], d_fft_size, d_old_freq + doppler); update_local_carrier(d_grid_doppler_wipeoffs[doppler_index], d_fft_size, d_old_freq + doppler);
} }
} }
@ -317,7 +317,7 @@ void pcps_acquisition::update_grid_doppler_wipeoffs()
void pcps_acquisition::update_grid_doppler_wipeoffs_step2() void pcps_acquisition::update_grid_doppler_wipeoffs_step2()
{ {
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins_step2; doppler_index++) for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins_step2; doppler_index++)
{ {
float doppler = (static_cast<float>(doppler_index) - static_cast<float>(floor(d_num_doppler_bins_step2 / 2.0))) * acq_parameters.doppler_step2; float doppler = (static_cast<float>(doppler_index) - static_cast<float>(floor(d_num_doppler_bins_step2 / 2.0))) * acq_parameters.doppler_step2;
update_local_carrier(d_grid_doppler_wipeoffs_step_two[doppler_index], d_fft_size, d_doppler_center_step_two + doppler); update_local_carrier(d_grid_doppler_wipeoffs_step_two[doppler_index], d_fft_size, d_doppler_center_step_two + doppler);
@ -325,7 +325,7 @@ void pcps_acquisition::update_grid_doppler_wipeoffs_step2()
} }
void pcps_acquisition::set_state(int state) void pcps_acquisition::set_state(int32_t state)
{ {
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
d_state = state; d_state = state;
@ -385,7 +385,7 @@ void pcps_acquisition::send_negative_acquisition()
} }
void pcps_acquisition::dump_results(int effective_fft_size) void pcps_acquisition::dump_results(int32_t effective_fft_size)
{ {
d_dump_number++; d_dump_number++;
std::string filename = acq_parameters.dump_filename; std::string filename = acq_parameters.dump_filename;
@ -488,16 +488,16 @@ void pcps_acquisition::dump_results(int effective_fft_size)
} }
float pcps_acquisition::max_to_input_power_statistic(uint32_t& indext, int& doppler, float input_power, unsigned int num_doppler_bins, int doppler_max, int doppler_step) float pcps_acquisition::max_to_input_power_statistic(uint32_t& indext, int32_t& doppler, float input_power, uint32_t num_doppler_bins, int32_t doppler_max, int32_t doppler_step)
{ {
float grid_maximum = 0.0; float grid_maximum = 0.0;
unsigned int index_doppler = 0; uint32_t index_doppler = 0;
uint32_t tmp_intex_t = 0; uint32_t tmp_intex_t = 0;
uint32_t index_time = 0; uint32_t index_time = 0;
float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size); float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
// Find the correlation peak and the carrier frequency // Find the correlation peak and the carrier frequency
for (unsigned int i = 0; i < num_doppler_bins; i++) for (uint32_t i = 0; i < num_doppler_bins; i++)
{ {
volk_gnsssdr_32f_index_max_32u(&tmp_intex_t, d_magnitude_grid[i], d_fft_size); volk_gnsssdr_32f_index_max_32u(&tmp_intex_t, d_magnitude_grid[i], d_fft_size);
if (d_magnitude_grid[i][tmp_intex_t] > grid_maximum) if (d_magnitude_grid[i][tmp_intex_t] > grid_maximum)
@ -522,19 +522,19 @@ float pcps_acquisition::max_to_input_power_statistic(uint32_t& indext, int& dopp
} }
float pcps_acquisition::first_vs_second_peak_statistic(uint32_t& indext, int& doppler, unsigned int num_doppler_bins, int doppler_max, int doppler_step) float pcps_acquisition::first_vs_second_peak_statistic(uint32_t& indext, int32_t& doppler, uint32_t num_doppler_bins, int32_t doppler_max, int32_t doppler_step)
{ {
// Look for correlation peaks in the results // Look for correlation peaks in the results
// Find the highest peak and compare it to the second highest peak // Find the highest peak and compare it to the second highest peak
// The second peak is chosen not closer than 1 chip to the highest peak // The second peak is chosen not closer than 1 chip to the highest peak
float firstPeak = 0.0; float firstPeak = 0.0;
unsigned int index_doppler = 0; uint32_t index_doppler = 0;
uint32_t tmp_intex_t = 0; uint32_t tmp_intex_t = 0;
uint32_t index_time = 0; uint32_t index_time = 0;
// Find the correlation peak and the carrier frequency // Find the correlation peak and the carrier frequency
for (unsigned int i = 0; i < num_doppler_bins; i++) for (uint32_t i = 0; i < num_doppler_bins; i++)
{ {
volk_gnsssdr_32f_index_max_32u(&tmp_intex_t, d_magnitude_grid[i], d_fft_size); volk_gnsssdr_32f_index_max_32u(&tmp_intex_t, d_magnitude_grid[i], d_fft_size);
if (d_magnitude_grid[i][tmp_intex_t] > firstPeak) if (d_magnitude_grid[i][tmp_intex_t] > firstPeak)
@ -588,14 +588,14 @@ float pcps_acquisition::first_vs_second_peak_statistic(uint32_t& indext, int& do
} }
void pcps_acquisition::acquisition_core(unsigned long int samp_count) void pcps_acquisition::acquisition_core(uint64_t samp_count)
{ {
gr::thread::scoped_lock lk(d_setlock); gr::thread::scoped_lock lk(d_setlock);
// Initialize acquisition algorithm // Initialize acquisition algorithm
int doppler = 0; int32_t doppler = 0;
uint32_t indext = 0; uint32_t indext = 0;
int effective_fft_size = (acq_parameters.bit_transition_flag ? d_fft_size / 2 : d_fft_size); int32_t effective_fft_size = (acq_parameters.bit_transition_flag ? d_fft_size / 2 : d_fft_size);
if (d_cshort) if (d_cshort)
{ {
volk_gnsssdr_16ic_convert_32fc(d_data_buffer, d_data_buffer_sc, d_consumed_samples); volk_gnsssdr_16ic_convert_32fc(d_data_buffer, d_data_buffer_sc, d_consumed_samples);
@ -603,7 +603,7 @@ void pcps_acquisition::acquisition_core(unsigned long int samp_count)
memcpy(d_input_signal, d_data_buffer, d_consumed_samples * sizeof(gr_complex)); memcpy(d_input_signal, d_data_buffer, d_consumed_samples * sizeof(gr_complex));
if (d_fft_size > d_consumed_samples) if (d_fft_size > d_consumed_samples)
{ {
for (unsigned int i = d_consumed_samples; i < d_fft_size; i++) for (uint32_t i = d_consumed_samples; i < d_fft_size; i++)
{ {
d_input_signal[i] = gr_complex(0.0, 0.0); d_input_signal[i] = gr_complex(0.0, 0.0);
} }
@ -634,7 +634,7 @@ void pcps_acquisition::acquisition_core(unsigned long int samp_count)
// Doppler frequency grid loop // Doppler frequency grid loop
if (!d_step_two) if (!d_step_two)
{ {
for (unsigned int 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++)
{ {
// Remove Doppler // Remove Doppler
volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, d_grid_doppler_wipeoffs[doppler_index], d_fft_size); volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, d_grid_doppler_wipeoffs[doppler_index], d_fft_size);
@ -682,7 +682,7 @@ void pcps_acquisition::acquisition_core(unsigned long int samp_count)
} }
else else
{ {
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins_step2; doppler_index++) for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins_step2; doppler_index++)
{ {
volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, d_grid_doppler_wipeoffs_step_two[doppler_index], d_fft_size); volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, d_grid_doppler_wipeoffs_step_two[doppler_index], d_fft_size);
@ -814,9 +814,9 @@ void pcps_acquisition::acquisition_core(unsigned long int samp_count)
d_num_noncoherent_integrations_counter = 0; d_num_noncoherent_integrations_counter = 0;
d_positive_acq = 0; d_positive_acq = 0;
// Reset grid // Reset grid
for (unsigned int i = 0; i < d_num_doppler_bins; i++) for (uint32_t i = 0; i < d_num_doppler_bins; i++)
{ {
for (unsigned k = 0; k < d_fft_size; k++) for (uint32_t k = 0; k < d_fft_size; k++)
{ {
d_magnitude_grid[i][k] = 0.0; d_magnitude_grid[i][k] = 0.0;
} }
@ -879,7 +879,7 @@ int pcps_acquisition::general_work(int noutput_items __attribute__((unused)),
} }
case 1: case 1:
{ {
unsigned int buff_increment; uint32_t buff_increment;
if (d_cshort) if (d_cshort)
{ {
const lv_16sc_t* in = reinterpret_cast<const lv_16sc_t*>(input_items[0]); // Get the input samples pointer const lv_16sc_t* in = reinterpret_cast<const lv_16sc_t*>(input_items[0]); // Get the input samples pointer

View File

@ -82,21 +82,21 @@ private:
pcps_acquisition(const Acq_Conf& conf_); pcps_acquisition(const Acq_Conf& conf_);
void update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq); void update_local_carrier(gr_complex* carrier_vector, int32_t correlator_length_samples, float freq);
void update_grid_doppler_wipeoffs(); void update_grid_doppler_wipeoffs();
void update_grid_doppler_wipeoffs_step2(); void update_grid_doppler_wipeoffs_step2();
bool is_fdma(); bool is_fdma();
void acquisition_core(unsigned long int samp_count); void acquisition_core(uint64_t samp_count);
void send_negative_acquisition(); void send_negative_acquisition();
void send_positive_acquisition(); void send_positive_acquisition();
void dump_results(int effective_fft_size); void dump_results(int32_t effective_fft_size);
float first_vs_second_peak_statistic(uint32_t& indext, int& doppler, unsigned int num_doppler_bins, int doppler_max, int doppler_step); float first_vs_second_peak_statistic(uint32_t& indext, int32_t& doppler, uint32_t num_doppler_bins, int32_t doppler_max, int32_t doppler_step);
float max_to_input_power_statistic(uint32_t& indext, int& doppler, float input_power, unsigned int num_doppler_bins, int doppler_max, int doppler_step); float max_to_input_power_statistic(uint32_t& indext, int32_t& doppler, float input_power, uint32_t num_doppler_bins, int32_t doppler_max, int32_t doppler_step);
Acq_Conf acq_parameters; Acq_Conf acq_parameters;
bool d_active; bool d_active;
@ -104,7 +104,7 @@ private:
bool d_cshort; bool d_cshort;
bool d_step_two; bool d_step_two;
bool d_use_CFAR_algorithm_flag; bool d_use_CFAR_algorithm_flag;
int d_positive_acq; int32_t d_positive_acq;
float d_threshold; float d_threshold;
float d_mag; float d_mag;
float d_input_power; float d_input_power;
@ -114,16 +114,16 @@ private:
float* d_tmp_buffer; float* d_tmp_buffer;
gr_complex* d_input_signal; gr_complex* d_input_signal;
uint32_t d_samplesPerChip; uint32_t d_samplesPerChip;
long d_old_freq; int64_t d_old_freq;
int d_state; int32_t d_state;
unsigned int d_channel; uint32_t d_channel;
unsigned int d_doppler_step; uint32_t d_doppler_step;
float d_doppler_center_step_two; float d_doppler_center_step_two;
unsigned int d_num_noncoherent_integrations_counter; uint32_t d_num_noncoherent_integrations_counter;
unsigned int d_fft_size; uint32_t d_fft_size;
unsigned int d_consumed_samples; uint32_t d_consumed_samples;
unsigned int d_num_doppler_bins; uint32_t d_num_doppler_bins;
unsigned long int d_sample_counter; uint64_t d_sample_counter;
gr_complex** d_grid_doppler_wipeoffs; gr_complex** d_grid_doppler_wipeoffs;
gr_complex** d_grid_doppler_wipeoffs_step_two; gr_complex** d_grid_doppler_wipeoffs_step_two;
gr_complex* d_fft_codes; gr_complex* d_fft_codes;
@ -134,10 +134,10 @@ private:
Gnss_Synchro* d_gnss_synchro; Gnss_Synchro* d_gnss_synchro;
arma::fmat grid_; arma::fmat grid_;
arma::fmat narrow_grid_; arma::fmat narrow_grid_;
unsigned int d_num_doppler_bins_step2; uint32_t d_num_doppler_bins_step2;
long int d_dump_number; int64_t d_dump_number;
unsigned int d_dump_channel; uint32_t d_dump_channel;
unsigned int d_buffer_count; uint32_t d_buffer_count;
public: public:
~pcps_acquisition(); ~pcps_acquisition();
@ -156,7 +156,7 @@ public:
/*! /*!
* \brief Returns the maximum peak of grid search. * \brief Returns the maximum peak of grid search.
*/ */
inline unsigned int mag() const inline uint32_t mag() const
{ {
return d_mag; return d_mag;
} }
@ -188,13 +188,13 @@ public:
* first available sample. * first available sample.
* \param state - int=1 forces start of acquisition * \param state - int=1 forces start of acquisition
*/ */
void set_state(int state); void set_state(int32_t state);
/*! /*!
* \brief Set acquisition channel unique ID * \brief Set acquisition channel unique ID
* \param channel - receiver channel. * \param channel - receiver channel.
*/ */
inline void set_channel(unsigned int channel) inline void set_channel(uint32_t channel)
{ {
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
d_channel = channel; d_channel = channel;
@ -215,7 +215,7 @@ public:
* \brief Set maximum Doppler grid search * \brief Set maximum Doppler grid search
* \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
*/ */
inline void set_doppler_max(unsigned int doppler_max) inline void set_doppler_max(uint32_t doppler_max)
{ {
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
acq_parameters.doppler_max = doppler_max; acq_parameters.doppler_max = doppler_max;
@ -225,7 +225,7 @@ public:
* \brief Set Doppler steps for the grid search * \brief Set Doppler steps for the grid search
* \param doppler_step - Frequency bin of the search grid [Hz]. * \param doppler_step - Frequency bin of the search grid [Hz].
*/ */
inline void set_doppler_step(unsigned int doppler_step) inline void set_doppler_step(uint32_t doppler_step)
{ {
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
d_doppler_step = doppler_step; d_doppler_step = doppler_step;

View File

@ -98,7 +98,7 @@ private:
int d_num_doppler_points; int d_num_doppler_points;
int d_doppler_step; int d_doppler_step;
unsigned int d_fft_size; unsigned int d_fft_size;
unsigned long int d_sample_counter; uint64_t d_sample_counter;
gr_complex* d_carrier; gr_complex* d_carrier;
gr_complex* d_fft_codes; gr_complex* d_fft_codes;
gr_complex* d_10_ms_buffer; gr_complex* d_10_ms_buffer;
@ -125,7 +125,7 @@ private:
std::string d_dump_filename; std::string d_dump_filename;
arma ::fmat grid_; arma ::fmat grid_;
long int d_dump_number; int64_t d_dump_number;
unsigned int d_dump_channel; unsigned int d_dump_channel;
public: public:

View File

@ -113,7 +113,7 @@ private:
unsigned int d_doppler_step; unsigned int d_doppler_step;
unsigned int d_fft_size; unsigned int d_fft_size;
unsigned int d_num_doppler_bins; unsigned int d_num_doppler_bins;
unsigned long int d_sample_counter; uint64_t d_sample_counter;
Gnss_Synchro* d_gnss_synchro; Gnss_Synchro* d_gnss_synchro;
std::shared_ptr<fpga_acquisition> acquisition_fpga; std::shared_ptr<fpga_acquisition> acquisition_fpga;

View File

@ -112,7 +112,7 @@ private:
int d_doppler_step; int d_doppler_step;
unsigned int d_sampled_ms; unsigned int d_sampled_ms;
unsigned int d_fft_size; unsigned int d_fft_size;
unsigned long int d_sample_counter; uint64_t d_sample_counter;
gr_complex* d_carrier; gr_complex* d_carrier;
gr_complex* d_fft_codes; gr_complex* d_fft_codes;

View File

@ -88,7 +88,7 @@ private:
unsigned int d_max_dwells; unsigned int d_max_dwells;
unsigned int d_well_count; unsigned int d_well_count;
unsigned int d_fft_size; unsigned int d_fft_size;
unsigned long int d_sample_counter; uint64_t d_sample_counter;
gr_complex** d_grid_doppler_wipeoffs; gr_complex** d_grid_doppler_wipeoffs;
unsigned int d_num_doppler_bins; unsigned int d_num_doppler_bins;
gr_complex* d_fft_code_data; gr_complex* d_fft_code_data;

View File

@ -387,7 +387,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_volk()
float magt = 0.0; float magt = 0.0;
float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size); float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
gr_complex *in = d_in_buffer[d_well_count]; gr_complex *in = d_in_buffer[d_well_count];
unsigned long int samplestamp = d_sample_counter_buffer[d_well_count]; uint64_t samplestamp = d_sample_counter_buffer[d_well_count];
d_input_power = 0.0; d_input_power = 0.0;
d_mag = 0.0; d_mag = 0.0;
@ -510,7 +510,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl()
float magt = 0.0; float magt = 0.0;
float fft_normalization_factor = (static_cast<float>(d_fft_size_pow2) * static_cast<float>(d_fft_size)); //This works, but I am not sure why. float fft_normalization_factor = (static_cast<float>(d_fft_size_pow2) * static_cast<float>(d_fft_size)); //This works, but I am not sure why.
gr_complex *in = d_in_buffer[d_well_count]; gr_complex *in = d_in_buffer[d_well_count];
unsigned long int samplestamp = d_sample_counter_buffer[d_well_count]; uint64_t samplestamp = d_sample_counter_buffer[d_well_count];
d_input_power = 0.0; d_input_power = 0.0;
d_mag = 0.0; d_mag = 0.0;

View File

@ -121,7 +121,7 @@ private:
unsigned int d_fft_size; unsigned int d_fft_size;
unsigned int d_fft_size_pow2; unsigned int d_fft_size_pow2;
int* d_max_doppler_indexs; int* d_max_doppler_indexs;
unsigned long int d_sample_counter; uint64_t d_sample_counter;
gr_complex** d_grid_doppler_wipeoffs; gr_complex** d_grid_doppler_wipeoffs;
unsigned int d_num_doppler_bins; unsigned int d_num_doppler_bins;
gr_complex* d_fft_codes; gr_complex* d_fft_codes;
@ -144,7 +144,7 @@ private:
std::string d_dump_filename; std::string d_dump_filename;
gr_complex* d_zero_vector; gr_complex* d_zero_vector;
gr_complex** d_in_buffer; gr_complex** d_in_buffer;
std::vector<unsigned long int> d_sample_counter_buffer; std::vector<uint64_t> d_sample_counter_buffer;
unsigned int d_in_dwell_count; unsigned int d_in_dwell_count;
cl::Platform d_cl_platform; cl::Platform d_cl_platform;

View File

@ -127,7 +127,7 @@ private:
unsigned int d_max_dwells; unsigned int d_max_dwells;
unsigned int d_well_count; unsigned int d_well_count;
unsigned int d_fft_size; unsigned int d_fft_size;
unsigned long int d_sample_counter; uint64_t d_sample_counter;
gr_complex** d_grid_doppler_wipeoffs; gr_complex** d_grid_doppler_wipeoffs;
unsigned int d_num_doppler_bins; unsigned int d_num_doppler_bins;
gr_complex* d_fft_codes; gr_complex* d_fft_codes;

View File

@ -108,7 +108,7 @@ private:
unsigned int d_tong_max_val; unsigned int d_tong_max_val;
unsigned int d_tong_max_dwells; unsigned int d_tong_max_dwells;
unsigned int d_fft_size; unsigned int d_fft_size;
unsigned long int d_sample_counter; uint64_t d_sample_counter;
gr_complex** d_grid_doppler_wipeoffs; gr_complex** d_grid_doppler_wipeoffs;
unsigned int d_num_doppler_bins; unsigned int d_num_doppler_bins;
gr_complex* d_fft_codes; gr_complex* d_fft_codes;

View File

@ -34,7 +34,7 @@
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#include <cstdint>
using google::LogMessage; using google::LogMessage;
@ -66,7 +66,7 @@ Channel::Channel(ConfigurationInterface* configuration, unsigned int channel,
// Provide a warning to the user about the change of parameter name // Provide a warning to the user about the change of parameter name
if (channel_ == 0) if (channel_ == 0)
{ {
long int deprecation_warning = configuration->property("GNSS-SDR.internal_fs_hz", 0); int64_t deprecation_warning = configuration->property("GNSS-SDR.internal_fs_hz", 0);
if (deprecation_warning != 0) if (deprecation_warning != 0)
{ {
std::cout << "WARNING: The global parameter name GNSS-SDR.internal_fs_hz has been DEPRECATED." << std::endl; std::cout << "WARNING: The global parameter name GNSS-SDR.internal_fs_hz has been DEPRECATED." << std::endl;

View File

@ -33,6 +33,7 @@
#include <gnuradio/gr_complex.h> #include <gnuradio/gr_complex.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <glog/logging.h> #include <glog/logging.h>
#include <cstdint>
using google::LogMessage; using google::LogMessage;
@ -48,7 +49,7 @@ void channel_msg_receiver_cc::msg_handler_events(pmt::pmt_t msg)
bool result = false; bool result = false;
try try
{ {
long int message = pmt::to_long(msg); int64_t message = pmt::to_long(msg);
switch (message) switch (message)
{ {
case 1: // positive acquisition case 1: // positive acquisition

View File

@ -36,7 +36,7 @@
#include <iostream> #include <iostream>
#include <string> #include <string>
gnss_sdr_fpga_sample_counter::gnss_sdr_fpga_sample_counter(double _fs, int _interval_ms) : gr::block("fpga_fpga_sample_counter", gnss_sdr_fpga_sample_counter::gnss_sdr_fpga_sample_counter(double _fs, int32_t _interval_ms) : gr::block("fpga_fpga_sample_counter",
gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0),
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)))
{ {
@ -64,7 +64,7 @@ gnss_sdr_fpga_sample_counter::gnss_sdr_fpga_sample_counter(double _fs, int _inte
} }
gnss_sdr_fpga_sample_counter_sptr gnss_sdr_make_fpga_sample_counter(double _fs, int _interval_ms) gnss_sdr_fpga_sample_counter_sptr gnss_sdr_make_fpga_sample_counter(double _fs, int32_t _interval_ms)
{ {
gnss_sdr_fpga_sample_counter_sptr fpga_sample_counter_(new gnss_sdr_fpga_sample_counter(_fs, _interval_ms)); gnss_sdr_fpga_sample_counter_sptr fpga_sample_counter_(new gnss_sdr_fpga_sample_counter(_fs, _interval_ms));
return fpga_sample_counter_; return fpga_sample_counter_;
@ -79,6 +79,7 @@ bool gnss_sdr_fpga_sample_counter::start()
return true; return true;
} }
// Called by GNURadio to disable drivers, etc for i/o devices. // Called by GNURadio to disable drivers, etc for i/o devices.
bool gnss_sdr_fpga_sample_counter::stop() bool gnss_sdr_fpga_sample_counter::stop()
{ {
@ -100,7 +101,6 @@ int gnss_sdr_fpga_sample_counter::general_work(int noutput_items __attribute__((
// Possible problem: what happen if the PS is overloaded and gnuradio does not call this function // Possible problem: what happen if the PS is overloaded and gnuradio does not call this function
// with the sufficient rate to catch all the interrupts in the counter. To be evaluated later. // with the sufficient rate to catch all the interrupts in the counter. To be evaluated later.
Gnss_Synchro *out = reinterpret_cast<Gnss_Synchro *>(output_items[0]); Gnss_Synchro *out = reinterpret_cast<Gnss_Synchro *>(output_items[0]);
out[0] = Gnss_Synchro(); out[0] = Gnss_Synchro();
out[0].Flag_valid_symbol_output = false; out[0].Flag_valid_symbol_output = false;

View File

@ -33,37 +33,37 @@
#include <gnuradio/block.h> #include <gnuradio/block.h>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <cstdint>
class gnss_sdr_fpga_sample_counter; class gnss_sdr_fpga_sample_counter;
typedef boost::shared_ptr<gnss_sdr_fpga_sample_counter> gnss_sdr_fpga_sample_counter_sptr; typedef boost::shared_ptr<gnss_sdr_fpga_sample_counter> gnss_sdr_fpga_sample_counter_sptr;
gnss_sdr_fpga_sample_counter_sptr gnss_sdr_make_fpga_sample_counter(double _fs, int _interval_ms); gnss_sdr_fpga_sample_counter_sptr gnss_sdr_make_fpga_sample_counter(double _fs, int32_t _interval_ms);
class gnss_sdr_fpga_sample_counter : public gr::block class gnss_sdr_fpga_sample_counter : public gr::block
{ {
private: private:
gnss_sdr_fpga_sample_counter(double _fs, int _interval_ms); gnss_sdr_fpga_sample_counter(double _fs, int32_t _interval_ms);
bool start(); bool start();
bool stop(); bool stop();
unsigned int samples_per_output; uint32_t samples_per_output;
double fs; double fs;
unsigned long long int sample_counter; uint64_t sample_counter;
int interval_ms; int32_t interval_ms;
long long int current_T_rx_ms; // Receiver time in ms since the beginning of the run int64_t current_T_rx_ms; // Receiver time in ms since the beginning of the run
unsigned int current_s; // Receiver time in seconds, modulo 60 uint32_t current_s; // Receiver time in seconds, modulo 60
bool flag_m; // True if the receiver has been running for at least 1 minute bool flag_m; // True if the receiver has been running for at least 1 minute
unsigned int current_m; // Receiver time in minutes, modulo 60 uint32_t current_m; // Receiver time in minutes, modulo 60
bool flag_h; // True if the receiver has been running for at least 1 hour bool flag_h; // True if the receiver has been running for at least 1 hour
unsigned int current_h; // Receiver time in hours, modulo 24 uint32_t current_h; // Receiver time in hours, modulo 24
bool flag_days; // True if the receiver has been running for at least 1 day bool flag_days; // True if the receiver has been running for at least 1 day
unsigned int current_days; // Receiver time in days since the beginning of the run uint32_t current_days; // Receiver time in days since the beginning of the run
int report_interval_ms; int32_t report_interval_ms;
bool flag_enable_send_msg; bool flag_enable_send_msg;
public: public:
friend gnss_sdr_fpga_sample_counter_sptr gnss_sdr_make_fpga_sample_counter(double _fs, int _interval_ms); friend gnss_sdr_fpga_sample_counter_sptr gnss_sdr_make_fpga_sample_counter(double _fs, int32_t _interval_ms);
int general_work(int noutput_items, int general_work(int noutput_items,
gr_vector_int &ninput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_const_void_star &input_items,

View File

@ -36,10 +36,10 @@
#include <iostream> #include <iostream>
#include <string> #include <string>
gnss_sdr_sample_counter::gnss_sdr_sample_counter(double _fs, int _interval_ms, size_t _size) : gr::sync_decimator("sample_counter", gnss_sdr_sample_counter::gnss_sdr_sample_counter(double _fs, int32_t _interval_ms, size_t _size) : gr::sync_decimator("sample_counter",
gr::io_signature::make(1, 1, _size), gr::io_signature::make(1, 1, _size),
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
static_cast<unsigned int>(std::round(_fs * static_cast<double>(_interval_ms) / 1e3))) static_cast<uint32_t>(std::round(_fs * static_cast<double>(_interval_ms) / 1e3)))
{ {
message_port_register_out(pmt::mp("sample_counter")); message_port_register_out(pmt::mp("sample_counter"));
set_max_noutput_items(1); set_max_noutput_items(1);
@ -60,7 +60,7 @@ gnss_sdr_sample_counter::gnss_sdr_sample_counter(double _fs, int _interval_ms, s
} }
gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter(double _fs, int _interval_ms, size_t _size) gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter(double _fs, int32_t _interval_ms, size_t _size)
{ {
gnss_sdr_sample_counter_sptr sample_counter_(new gnss_sdr_sample_counter(_fs, _interval_ms, _size)); gnss_sdr_sample_counter_sptr sample_counter_(new gnss_sdr_sample_counter(_fs, _interval_ms, _size));
return sample_counter_; return sample_counter_;

View File

@ -33,35 +33,36 @@
#include <gnuradio/sync_decimator.h> #include <gnuradio/sync_decimator.h>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <cstdint>
class gnss_sdr_sample_counter; class gnss_sdr_sample_counter;
typedef boost::shared_ptr<gnss_sdr_sample_counter> gnss_sdr_sample_counter_sptr; typedef boost::shared_ptr<gnss_sdr_sample_counter> gnss_sdr_sample_counter_sptr;
gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter(double _fs, int _interval_ms, size_t _size); gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter(double _fs, int32_t _interval_ms, size_t _size);
class gnss_sdr_sample_counter : public gr::sync_decimator class gnss_sdr_sample_counter : public gr::sync_decimator
{ {
private: private:
gnss_sdr_sample_counter(double _fs, int _interval_ms, size_t _size); gnss_sdr_sample_counter(double _fs, int32_t _interval_ms, size_t _size);
unsigned int samples_per_output; uint32_t samples_per_output;
double fs; double fs;
unsigned long long int sample_counter; uint64_t sample_counter;
int interval_ms; int32_t interval_ms;
long long int current_T_rx_ms; // Receiver time in ms since the beginning of the run int64_t current_T_rx_ms; // Receiver time in ms since the beginning of the run
unsigned int current_s; // Receiver time in seconds, modulo 60 uint32_t current_s; // Receiver time in seconds, modulo 60
bool flag_m; // True if the receiver has been running for at least 1 minute bool flag_m; // True if the receiver has been running for at least 1 minute
unsigned int current_m; // Receiver time in minutes, modulo 60 uint32_t current_m; // Receiver time in minutes, modulo 60
bool flag_h; // True if the receiver has been running for at least 1 hour bool flag_h; // True if the receiver has been running for at least 1 hour
unsigned int current_h; // Receiver time in hours, modulo 24 uint32_t current_h; // Receiver time in hours, modulo 24
bool flag_days; // True if the receiver has been running for at least 1 day bool flag_days; // True if the receiver has been running for at least 1 day
unsigned int current_days; // Receiver time in days since the beginning of the run uint32_t current_days; // Receiver time in days since the beginning of the run
int report_interval_ms; int32_t report_interval_ms;
bool flag_enable_send_msg; bool flag_enable_send_msg;
public: public:
friend gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter(double _fs, int _interval_ms, size_t _size); friend gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter(double _fs, int32_t _interval_ms, size_t _size);
int work(int noutput_items, int work(int noutput_items,
gr_vector_const_void_star &input_items, gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items); gr_vector_void_star &output_items);

View File

@ -33,7 +33,7 @@
#include <gnuradio/block.h> #include <gnuradio/block.h>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <cstdint>
class gnss_sdr_time_counter; class gnss_sdr_time_counter;
@ -45,15 +45,15 @@ class gnss_sdr_time_counter : public gr::block
{ {
private: private:
gnss_sdr_time_counter(); gnss_sdr_time_counter();
long long int current_T_rx_ms; // Receiver time in ms since the beginning of the run int64_t current_T_rx_ms; // Receiver time in ms since the beginning of the run
unsigned int current_s; // Receiver time in seconds, modulo 60 uint32_t current_s; // Receiver time in seconds, modulo 60
bool flag_m; // True if the receiver has been running for at least 1 minute bool flag_m; // True if the receiver has been running for at least 1 minute
unsigned int current_m; // Receiver time in minutes, modulo 60 uint32_t current_m; // Receiver time in minutes, modulo 60
bool flag_h; // True if the receiver has been running for at least 1 hour bool flag_h; // True if the receiver has been running for at least 1 hour
unsigned int current_h; // Receiver time in hours, modulo 24 uint32_t current_h; // Receiver time in hours, modulo 24
bool flag_days; // True if the receiver has been running for at least 1 day bool flag_days; // True if the receiver has been running for at least 1 day
unsigned int current_days; // Receiver time in days since the beginning of the run uint32_t current_days; // Receiver time in days since the beginning of the run
int report_interval_ms; int32_t report_interval_ms;
public: public:
friend gnss_sdr_time_counter_sptr gnss_sdr_make_time_counter(); friend gnss_sdr_time_counter_sptr gnss_sdr_make_time_counter();

View File

@ -134,11 +134,11 @@ int hybrid_observables_cc::save_matfile()
return 1; return 1;
} }
// count number of epochs and rewind // count number of epochs and rewind
long int num_epoch = 0; int64_t num_epoch = 0;
if (dump_file.is_open()) if (dump_file.is_open())
{ {
size = dump_file.tellg(); size = dump_file.tellg();
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes); num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
dump_file.seekg(0, std::ios::beg); dump_file.seekg(0, std::ios::beg);
} }
else else
@ -168,7 +168,7 @@ int hybrid_observables_cc::save_matfile()
{ {
if (dump_file.is_open()) if (dump_file.is_open())
{ {
for (long int i = 0; i < num_epoch; i++) for (int64_t i = 0; i < num_epoch; i++)
{ {
for (unsigned int chan = 0; chan < d_nchannels_out; chan++) for (unsigned int chan = 0; chan < d_nchannels_out; chan++)
{ {
@ -216,7 +216,7 @@ int hybrid_observables_cc::save_matfile()
double *PRN_aux = new double[d_nchannels_out * num_epoch]; double *PRN_aux = new double[d_nchannels_out * num_epoch];
double *Flag_valid_pseudorange_aux = new double[d_nchannels_out * num_epoch]; double *Flag_valid_pseudorange_aux = new double[d_nchannels_out * num_epoch];
unsigned int k = 0; unsigned int k = 0;
for (long int j = 0; j < num_epoch; j++) for (int64_t j = 0; j < num_epoch; j++)
{ {
for (unsigned int i = 0; i < d_nchannels_out; i++) for (unsigned int i = 0; i < d_nchannels_out; i++)
{ {
@ -241,7 +241,7 @@ int hybrid_observables_cc::save_matfile()
} }
filename.append(".mat"); filename.append(".mat");
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
if (reinterpret_cast<long *>(matfp) != NULL) if (reinterpret_cast<int64_t *>(matfp) != NULL)
{ {
size_t dims[2] = {static_cast<size_t>(d_nchannels_out), static_cast<size_t>(num_epoch)}; size_t dims[2] = {static_cast<size_t>(d_nchannels_out), static_cast<size_t>(num_epoch)};
matvar = Mat_VarCreate("RX_time", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, RX_time_aux, MAT_F_DONT_COPY_DATA); matvar = Mat_VarCreate("RX_time", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, RX_time_aux, MAT_F_DONT_COPY_DATA);
@ -308,14 +308,14 @@ double hybrid_observables_cc::compute_T_rx_s(const Gnss_Synchro &a)
return ((static_cast<double>(a.Tracking_sample_counter) + a.Code_phase_samples) / static_cast<double>(a.fs)); return ((static_cast<double>(a.Tracking_sample_counter) + a.Code_phase_samples) / static_cast<double>(a.fs));
} }
bool hybrid_observables_cc::interp_trk_obs(Gnss_Synchro &interpolated_obs, const unsigned int &ch, const unsigned long int &rx_clock) bool hybrid_observables_cc::interp_trk_obs(Gnss_Synchro &interpolated_obs, const unsigned int &ch, const uint64_t &rx_clock)
{ {
int nearest_element = -1; int nearest_element = -1;
long int abs_diff; int64_t abs_diff;
long int old_abs_diff = std::numeric_limits<long int>::max(); int64_t old_abs_diff = std::numeric_limits<int64_t>::max();
for (unsigned int i = 0; i < d_gnss_synchro_history->size(ch); i++) for (unsigned int i = 0; i < d_gnss_synchro_history->size(ch); i++)
{ {
abs_diff = labs(static_cast<long int>(rx_clock) - static_cast<long int>(d_gnss_synchro_history->at(ch, i).Tracking_sample_counter)); abs_diff = labs(static_cast<int64_t>(rx_clock) - static_cast<int64_t>(d_gnss_synchro_history->at(ch, i).Tracking_sample_counter));
if (old_abs_diff > abs_diff) if (old_abs_diff > abs_diff)
{ {
old_abs_diff = abs_diff; old_abs_diff = abs_diff;

View File

@ -66,14 +66,14 @@ private:
hybrid_make_observables_cc(unsigned int nchannels_in, unsigned int nchannels_out, bool dump, std::string dump_filename); hybrid_make_observables_cc(unsigned int nchannels_in, unsigned int nchannels_out, bool dump, std::string dump_filename);
hybrid_observables_cc(unsigned int nchannels_in, unsigned int nchannels_out, bool dump, std::string dump_filename); hybrid_observables_cc(unsigned int nchannels_in, unsigned int nchannels_out, bool dump, std::string dump_filename);
bool interpolate_data(Gnss_Synchro& out, const unsigned int& ch, const double& ti); bool interpolate_data(Gnss_Synchro& out, const unsigned int& ch, const double& ti);
bool interp_trk_obs(Gnss_Synchro& interpolated_obs, const unsigned int& ch, const unsigned long int& rx_clock); bool interp_trk_obs(Gnss_Synchro& interpolated_obs, const unsigned int& ch, const uint64_t& rx_clock);
double compute_T_rx_s(const Gnss_Synchro& a); double compute_T_rx_s(const Gnss_Synchro& a);
void compute_pranges(std::vector<Gnss_Synchro>& data); void compute_pranges(std::vector<Gnss_Synchro>& data);
void update_TOW(std::vector<Gnss_Synchro>& data); void update_TOW(std::vector<Gnss_Synchro>& data);
int save_matfile(); int save_matfile();
//time history //time history
boost::circular_buffer<unsigned long int> d_Rx_clock_buffer; boost::circular_buffer<uint64_t> d_Rx_clock_buffer;
//Tracking observable history //Tracking observable history
Gnss_circular_deque<Gnss_Synchro>* d_gnss_synchro_history; Gnss_circular_deque<Gnss_Synchro>* d_gnss_synchro_history;
unsigned int T_rx_clock_step_samples; unsigned int T_rx_clock_step_samples;

View File

@ -474,11 +474,11 @@ int galileo_e1b_telemetry_decoder_cc::general_work(int noutput_items __attribute
try try
{ {
double tmp_double; double tmp_double;
unsigned long int tmp_ulong_int; uint64_t tmp_ulong_int;
tmp_double = static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0; tmp_double = static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0;
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double)); d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
tmp_ulong_int = current_symbol.Tracking_sample_counter; tmp_ulong_int = current_symbol.Tracking_sample_counter;
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(uint64_t));
tmp_double = static_cast<double>(d_TOW_at_Preamble_ms) / 1000.0; tmp_double = static_cast<double>(d_TOW_at_Preamble_ms) / 1000.0;
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double)); d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
} }

View File

@ -89,8 +89,8 @@ private:
std::deque<Gnss_Synchro> d_symbol_history; std::deque<Gnss_Synchro> d_symbol_history;
long unsigned int d_sample_counter; uint64_t d_sample_counter;
long unsigned int d_preamble_index; uint64_t d_preamble_index;
unsigned int d_stat; unsigned int d_stat;
bool d_flag_frame_sync; bool d_flag_frame_sync;

View File

@ -487,11 +487,11 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute
try try
{ {
double tmp_double; double tmp_double;
unsigned long int tmp_ulong_int; uint64_t tmp_ulong_int;
tmp_double = static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0; tmp_double = static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0;
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double)); d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
tmp_ulong_int = current_sample.Tracking_sample_counter; tmp_ulong_int = current_sample.Tracking_sample_counter;
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(uint64_t));
tmp_double = static_cast<double>(d_TOW_at_Preamble_ms) / 1000.0; tmp_double = static_cast<double>(d_TOW_at_Preamble_ms) / 1000.0;
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double)); d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
} }

View File

@ -94,8 +94,8 @@ private:
int d_symbol_counter; int d_symbol_counter;
int corr_value; int corr_value;
unsigned int required_symbols; unsigned int required_symbols;
long unsigned int d_sample_counter; uint64_t d_sample_counter;
long unsigned int d_preamble_index; uint64_t d_preamble_index;
bool d_flag_frame_sync; bool d_flag_frame_sync;
bool d_flag_preamble; bool d_flag_preamble;
bool d_dump; bool d_dump;

View File

@ -423,11 +423,11 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribu
try try
{ {
double tmp_double; double tmp_double;
unsigned long int tmp_ulong_int; uint64_t tmp_ulong_int;
tmp_double = d_TOW_at_current_symbol; tmp_double = d_TOW_at_current_symbol;
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double)); d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
tmp_ulong_int = current_symbol.Tracking_sample_counter; tmp_ulong_int = current_symbol.Tracking_sample_counter;
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(uint64_t));
tmp_double = 0; tmp_double = 0;
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double)); d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
} }

View File

@ -91,8 +91,8 @@ private:
std::deque<Gnss_Synchro> d_symbol_history; std::deque<Gnss_Synchro> d_symbol_history;
//!< Variables for internal functionality //!< Variables for internal functionality
long unsigned int d_sample_counter; //!< Sample counter as an index (1,2,3,..etc) indicating number of samples processed uint64_t d_sample_counter; //!< Sample counter as an index (1,2,3,..etc) indicating number of samples processed
long unsigned int d_preamble_index; //!< Index of sample number where preamble was found uint64_t d_preamble_index; //!< Index of sample number where preamble was found
unsigned int d_stat; //!< Status of decoder unsigned int d_stat; //!< Status of decoder
bool d_flag_frame_sync; //!< Indicate when a frame sync is achieved bool d_flag_frame_sync; //!< Indicate when a frame sync is achieved
bool d_flag_parity; //!< Flag indicating when parity check was achieved (crc check) bool d_flag_parity; //!< Flag indicating when parity check was achieved (crc check)

View File

@ -423,11 +423,11 @@ int glonass_l2_ca_telemetry_decoder_cc::general_work(int noutput_items __attribu
try try
{ {
double tmp_double; double tmp_double;
unsigned long int tmp_ulong_int; uint64_t tmp_ulong_int;
tmp_double = d_TOW_at_current_symbol; tmp_double = d_TOW_at_current_symbol;
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double)); d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
tmp_ulong_int = current_symbol.Tracking_sample_counter; tmp_ulong_int = current_symbol.Tracking_sample_counter;
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(uint64_t));
tmp_double = 0; tmp_double = 0;
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double)); d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
} }

View File

@ -89,8 +89,8 @@ private:
std::deque<Gnss_Synchro> d_symbol_history; std::deque<Gnss_Synchro> d_symbol_history;
//!< Variables for internal functionality //!< Variables for internal functionality
long unsigned int d_sample_counter; //!< Sample counter as an index (1,2,3,..etc) indicating number of samples processed uint64_t d_sample_counter; //!< Sample counter as an index (1,2,3,..etc) indicating number of samples processed
long unsigned int d_preamble_index; //!< Index of sample number where preamble was found uint64_t d_preamble_index; //!< Index of sample number where preamble was found
unsigned int d_stat; //!< Status of decoder unsigned int d_stat; //!< Status of decoder
bool d_flag_frame_sync; //!< Indicate when a frame sync is achieved bool d_flag_frame_sync; //!< Indicate when a frame sync is achieved
bool d_flag_parity; //!< Flag indicating when parity check was achieved (crc check) bool d_flag_parity; //!< Flag indicating when parity check was achieved (crc check)

View File

@ -457,11 +457,11 @@ int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__
try try
{ {
double tmp_double; double tmp_double;
unsigned long int tmp_ulong_int; uint64_t tmp_ulong_int;
tmp_double = static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0; tmp_double = static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0;
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double)); d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
tmp_ulong_int = current_symbol.Tracking_sample_counter; tmp_ulong_int = current_symbol.Tracking_sample_counter;
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(uint64_t));
tmp_double = static_cast<double>(d_TOW_at_Preamble_ms) / 1000.0; tmp_double = static_cast<double>(d_TOW_at_Preamble_ms) / 1000.0;
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double)); d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
} }

View File

@ -97,7 +97,7 @@ private:
Gnss_Satellite d_satellite; Gnss_Satellite d_satellite;
int d_channel; int d_channel;
unsigned long int d_preamble_time_samples; uint64_t d_preamble_time_samples;
unsigned int d_TOW_at_Preamble_ms; unsigned int d_TOW_at_Preamble_ms;
unsigned int d_TOW_at_current_symbol_ms; unsigned int d_TOW_at_current_symbol_ms;

View File

@ -210,11 +210,11 @@ int gps_l2c_telemetry_decoder_cc::general_work(int noutput_items __attribute__((
try try
{ {
double tmp_double; double tmp_double;
unsigned long int tmp_ulong_int; uint64_t tmp_ulong_int;
tmp_double = d_TOW_at_current_symbol; tmp_double = d_TOW_at_current_symbol;
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double)); d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
tmp_ulong_int = current_synchro_data.Tracking_sample_counter; tmp_ulong_int = current_synchro_data.Tracking_sample_counter;
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(uint64_t));
tmp_double = d_TOW_at_Preamble; tmp_double = d_TOW_at_Preamble;
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double)); d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
} }

View File

@ -266,11 +266,11 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u
try try
{ {
double tmp_double; double tmp_double;
unsigned long int tmp_ulong_int; uint64_t tmp_ulong_int;
tmp_double = static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0; tmp_double = static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0;
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double)); d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
tmp_ulong_int = current_synchro_data.Tracking_sample_counter; tmp_ulong_int = current_synchro_data.Tracking_sample_counter;
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(uint64_t));
tmp_double = static_cast<double>(d_TOW_at_Preamble_ms) / 1000.0; tmp_double = static_cast<double>(d_TOW_at_Preamble_ms) / 1000.0;
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double)); d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
} }

View File

@ -414,7 +414,7 @@ void dll_pll_veml_tracking::start_tracking()
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz; d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
long int acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); int64_t acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp);
double acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / trk_parameters.fs_in; double acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / trk_parameters.fs_in;
DLOG(INFO) << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples; DLOG(INFO) << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples;
DLOG(INFO) << "Number of seconds between Acquisition and Tracking = " << acq_trk_diff_seconds; DLOG(INFO) << "Number of seconds between Acquisition and Tracking = " << acq_trk_diff_seconds;
@ -869,7 +869,7 @@ void dll_pll_veml_tracking::log_data(bool integrating)
float tmp_VE, tmp_E, tmp_P, tmp_L, tmp_VL; float tmp_VE, tmp_E, tmp_P, tmp_L, tmp_VL;
float tmp_float; float tmp_float;
double tmp_double; double tmp_double;
unsigned long int tmp_long_int; uint64_t tmp_long_int;
if (trk_parameters.track_pilot) if (trk_parameters.track_pilot)
{ {
if (interchange_iq) if (interchange_iq)
@ -937,7 +937,7 @@ void dll_pll_veml_tracking::log_data(bool integrating)
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
// PRN start sample stamp // PRN start sample stamp
tmp_long_int = d_sample_counter + d_current_prn_length_samples; tmp_long_int = d_sample_counter + d_current_prn_length_samples;
d_dump_file.write(reinterpret_cast<char *>(&tmp_long_int), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&tmp_long_int), sizeof(uint64_t));
// accumulated carrier phase // accumulated carrier phase
tmp_float = d_acc_carrier_phase_rad; tmp_float = d_acc_carrier_phase_rad;
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
@ -984,7 +984,7 @@ int dll_pll_veml_tracking::save_matfile()
std::ifstream::pos_type size; std::ifstream::pos_type size;
int number_of_double_vars = 1; int number_of_double_vars = 1;
int number_of_float_vars = 17; int number_of_float_vars = 17;
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
sizeof(float) * number_of_float_vars + sizeof(unsigned int); sizeof(float) * number_of_float_vars + sizeof(unsigned int);
std::ifstream dump_file; std::ifstream dump_file;
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
@ -998,11 +998,11 @@ int dll_pll_veml_tracking::save_matfile()
return 1; return 1;
} }
// count number of epochs and rewind // count number of epochs and rewind
long int num_epoch = 0; int64_t num_epoch = 0;
if (dump_file.is_open()) if (dump_file.is_open())
{ {
size = dump_file.tellg(); size = dump_file.tellg();
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes); num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
dump_file.seekg(0, std::ios::beg); dump_file.seekg(0, std::ios::beg);
} }
else else
@ -1016,7 +1016,7 @@ int dll_pll_veml_tracking::save_matfile()
float *abs_VL = new float[num_epoch]; float *abs_VL = new float[num_epoch];
float *Prompt_I = new float[num_epoch]; float *Prompt_I = new float[num_epoch];
float *Prompt_Q = new float[num_epoch]; float *Prompt_Q = new float[num_epoch];
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
float *acc_carrier_phase_rad = new float[num_epoch]; float *acc_carrier_phase_rad = new float[num_epoch];
float *carrier_doppler_hz = new float[num_epoch]; float *carrier_doppler_hz = new float[num_epoch];
float *code_freq_chips = new float[num_epoch]; float *code_freq_chips = new float[num_epoch];
@ -1034,7 +1034,7 @@ int dll_pll_veml_tracking::save_matfile()
{ {
if (dump_file.is_open()) if (dump_file.is_open())
{ {
for (long int i = 0; i < num_epoch; i++) for (int64_t i = 0; i < num_epoch; i++)
{ {
dump_file.read(reinterpret_cast<char *>(&abs_VE[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_VE[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
@ -1043,7 +1043,7 @@ int dll_pll_veml_tracking::save_matfile()
dump_file.read(reinterpret_cast<char *>(&abs_VL[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_VL[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int)); dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(float));
@ -1093,7 +1093,7 @@ int dll_pll_veml_tracking::save_matfile()
filename.erase(filename.length() - 4, 4); filename.erase(filename.length() - 4, 4);
filename.append(".mat"); filename.append(".mat");
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
if (reinterpret_cast<long *>(matfp) != NULL) if (reinterpret_cast<int64_t *>(matfp) != NULL)
{ {
size_t dims[2] = {1, static_cast<size_t>(num_epoch)}; size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
matvar = Mat_VarCreate("abs_VE", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_VE, 0); matvar = Mat_VarCreate("abs_VE", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_VE, 0);
@ -1255,7 +1255,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)
case 1: // Pull-in case 1: // Pull-in
{ {
// Signal alignment (skip samples until the incoming signal is aligned with local replica) // Signal alignment (skip samples until the incoming signal is aligned with local replica)
unsigned long int acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; uint64_t acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp;
double acq_trk_shif_correction_samples = static_cast<double>(d_current_prn_length_samples) - std::fmod(static_cast<double>(acq_to_trk_delay_samples), static_cast<double>(d_current_prn_length_samples)); double acq_trk_shif_correction_samples = static_cast<double>(d_current_prn_length_samples) - std::fmod(static_cast<double>(acq_to_trk_delay_samples), static_cast<double>(d_current_prn_length_samples));
int samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); int samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples);
if (samples_offset < 0) if (samples_offset < 0)
@ -1566,7 +1566,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)
d_sample_counter += d_current_prn_length_samples; d_sample_counter += d_current_prn_length_samples;
if (current_synchro_data.Flag_valid_symbol_output) if (current_synchro_data.Flag_valid_symbol_output)
{ {
current_synchro_data.fs = static_cast<long int>(trk_parameters.fs_in); current_synchro_data.fs = static_cast<int64_t>(trk_parameters.fs_in);
current_synchro_data.Tracking_sample_counter = d_sample_counter; current_synchro_data.Tracking_sample_counter = d_sample_counter;
*out[0] = current_synchro_data; *out[0] = current_synchro_data;
return 1; return 1;

View File

@ -177,8 +177,8 @@ private:
// PRN period in samples // PRN period in samples
int d_current_prn_length_samples; int d_current_prn_length_samples;
// processing samples counters // processing samples counters
unsigned long int d_sample_counter; uint64_t d_sample_counter;
unsigned long int d_acq_sample_stamp; uint64_t d_acq_sample_stamp;
// CN0 estimation and lock detector // CN0 estimation and lock detector
int d_cn0_estimation_counter; int d_cn0_estimation_counter;

View File

@ -842,7 +842,7 @@ void dll_pll_veml_tracking_fpga::log_data(bool integrating)
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
// PRN start sample stamp // PRN start sample stamp
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
// accumulated carrier phase // accumulated carrier phase
tmp_float = d_acc_carrier_phase_rad; tmp_float = d_acc_carrier_phase_rad;
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
@ -889,7 +889,7 @@ int dll_pll_veml_tracking_fpga::save_matfile()
std::ifstream::pos_type size; std::ifstream::pos_type size;
int number_of_double_vars = 1; int number_of_double_vars = 1;
int number_of_float_vars = 17; int number_of_float_vars = 17;
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
sizeof(float) * number_of_float_vars + sizeof(unsigned int); sizeof(float) * number_of_float_vars + sizeof(unsigned int);
std::ifstream dump_file; std::ifstream dump_file;
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
@ -903,11 +903,11 @@ int dll_pll_veml_tracking_fpga::save_matfile()
return 1; return 1;
} }
// count number of epochs and rewind // count number of epochs and rewind
long int num_epoch = 0; int64_t num_epoch = 0;
if (dump_file.is_open()) if (dump_file.is_open())
{ {
size = dump_file.tellg(); size = dump_file.tellg();
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes); num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
dump_file.seekg(0, std::ios::beg); dump_file.seekg(0, std::ios::beg);
} }
else else
@ -921,7 +921,7 @@ int dll_pll_veml_tracking_fpga::save_matfile()
float *abs_VL = new float[num_epoch]; float *abs_VL = new float[num_epoch];
float *Prompt_I = new float[num_epoch]; float *Prompt_I = new float[num_epoch];
float *Prompt_Q = new float[num_epoch]; float *Prompt_Q = new float[num_epoch];
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
float *acc_carrier_phase_rad = new float[num_epoch]; float *acc_carrier_phase_rad = new float[num_epoch];
float *carrier_doppler_hz = new float[num_epoch]; float *carrier_doppler_hz = new float[num_epoch];
float *code_freq_chips = new float[num_epoch]; float *code_freq_chips = new float[num_epoch];
@ -939,7 +939,7 @@ int dll_pll_veml_tracking_fpga::save_matfile()
{ {
if (dump_file.is_open()) if (dump_file.is_open())
{ {
for (long int i = 0; i < num_epoch; i++) for (int64_t i = 0; i < num_epoch; i++)
{ {
dump_file.read(reinterpret_cast<char *>(&abs_VE[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_VE[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
@ -948,7 +948,7 @@ int dll_pll_veml_tracking_fpga::save_matfile()
dump_file.read(reinterpret_cast<char *>(&abs_VL[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_VL[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int)); dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(float));
@ -998,7 +998,7 @@ int dll_pll_veml_tracking_fpga::save_matfile()
filename.erase(filename.length() - 4, 4); filename.erase(filename.length() - 4, 4);
filename.append(".mat"); filename.append(".mat");
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
if (reinterpret_cast<long *>(matfp) != NULL) if (reinterpret_cast<int64_t *>(matfp) != NULL)
{ {
size_t dims[2] = {1, static_cast<size_t>(num_epoch)}; size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
matvar = Mat_VarCreate("abs_VE", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_VE, 0); matvar = Mat_VarCreate("abs_VE", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_VE, 0);
@ -1464,7 +1464,7 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
} }
if (current_synchro_data.Flag_valid_symbol_output) if (current_synchro_data.Flag_valid_symbol_output)
{ {
current_synchro_data.fs = static_cast<long int>(trk_parameters.fs_in); current_synchro_data.fs = static_cast<int64_t>(trk_parameters.fs_in);
current_synchro_data.Tracking_sample_counter = d_sample_counter + d_current_prn_length_samples; current_synchro_data.Tracking_sample_counter = d_sample_counter + d_current_prn_length_samples;
*out[0] = current_synchro_data; *out[0] = current_synchro_data;
return 1; return 1;

View File

@ -201,8 +201,8 @@ private:
// PRN period in samples // PRN period in samples
int d_current_prn_length_samples; int d_current_prn_length_samples;
// processing samples counters // processing samples counters
unsigned long int d_sample_counter; uint64_t d_sample_counter;
unsigned long int d_acq_sample_stamp; uint64_t d_acq_sample_stamp;
// CN0 estimation and lock detector // CN0 estimation and lock detector
int d_cn0_estimation_counter; int d_cn0_estimation_counter;
@ -219,7 +219,7 @@ private:
// extra // extra
int d_correlation_length_samples; int d_correlation_length_samples;
int d_next_prn_length_samples; int d_next_prn_length_samples;
unsigned long int d_sample_counter_next; uint64_t d_sample_counter_next;
unsigned int d_pull_in = 0; unsigned int d_pull_in = 0;
}; };

View File

@ -60,7 +60,7 @@
using google::LogMessage; using google::LogMessage;
galileo_e1_tcp_connector_tracking_cc_sptr galileo_e1_tcp_connector_make_tracking_cc( galileo_e1_tcp_connector_tracking_cc_sptr galileo_e1_tcp_connector_make_tracking_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -86,7 +86,7 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::forecast(int noutput_items,
Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc( Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -498,7 +498,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
// PRN start sample stamp // PRN start sample stamp
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
// accumulated carrier phase // accumulated carrier phase
tmp_float = d_acc_carrier_phase_rad; tmp_float = d_acc_carrier_phase_rad;
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));

View File

@ -55,7 +55,7 @@ typedef boost::shared_ptr<Galileo_E1_Tcp_Connector_Tracking_cc> galileo_e1_tcp_c
galileo_e1_tcp_connector_tracking_cc_sptr galileo_e1_tcp_connector_tracking_cc_sptr
galileo_e1_tcp_connector_make_tracking_cc( galileo_e1_tcp_connector_make_tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -85,7 +85,7 @@ public:
private: private:
friend galileo_e1_tcp_connector_tracking_cc_sptr friend galileo_e1_tcp_connector_tracking_cc_sptr
galileo_e1_tcp_connector_make_tracking_cc( galileo_e1_tcp_connector_make_tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -95,7 +95,7 @@ private:
size_t port_ch0); size_t port_ch0);
Galileo_E1_Tcp_Connector_Tracking_cc( Galileo_E1_Tcp_Connector_Tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -115,7 +115,7 @@ private:
Gnss_Synchro *d_acquisition_gnss_synchro; Gnss_Synchro *d_acquisition_gnss_synchro;
unsigned int d_channel; unsigned int d_channel;
long d_fs_in; int64_t d_fs_in;
int d_correlation_length_samples; int d_correlation_length_samples;
int d_n_correlator_taps; int d_n_correlator_taps;
@ -161,8 +161,8 @@ private:
int d_next_prn_length_samples; int d_next_prn_length_samples;
//processing samples counters //processing samples counters
unsigned long int d_sample_counter; uint64_t d_sample_counter;
unsigned long int d_acq_sample_stamp; uint64_t d_acq_sample_stamp;
// CN0 estimation and lock detector // CN0 estimation and lock detector
int d_cn0_estimation_counter; int d_cn0_estimation_counter;

View File

@ -62,7 +62,7 @@ using google::LogMessage;
glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr
glonass_l1_ca_dll_pll_c_aid_make_tracking_cc( glonass_l1_ca_dll_pll_c_aid_make_tracking_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -102,7 +102,7 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index(pmt::pm
glonass_l1_ca_dll_pll_c_aid_tracking_cc::glonass_l1_ca_dll_pll_c_aid_tracking_cc( glonass_l1_ca_dll_pll_c_aid_tracking_cc::glonass_l1_ca_dll_pll_c_aid_tracking_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -211,7 +211,7 @@ glonass_l1_ca_dll_pll_c_aid_tracking_cc::glonass_l1_ca_dll_pll_c_aid_tracking_cc
d_glonass_freq_ch = 0; d_glonass_freq_ch = 0;
//set_min_output_buffer((long int)300); //set_min_output_buffer((int64_t)300);
} }
@ -224,9 +224,9 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking()
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz; d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
long int acq_trk_diff_samples; int64_t acq_trk_diff_samples;
double acq_trk_diff_seconds; double acq_trk_diff_seconds;
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length; acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp); //-d_vector_length;
DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in); acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in);
// Doppler effect // Doppler effect
@ -354,7 +354,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
std::ifstream::pos_type size; std::ifstream::pos_type size;
int number_of_double_vars = 11; int number_of_double_vars = 11;
int number_of_float_vars = 5; int number_of_float_vars = 5;
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
sizeof(float) * number_of_float_vars + sizeof(unsigned int); sizeof(float) * number_of_float_vars + sizeof(unsigned int);
std::ifstream dump_file; std::ifstream dump_file;
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
@ -368,11 +368,11 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
return 1; return 1;
} }
// count number of epochs and rewind // count number of epochs and rewind
long int num_epoch = 0; int64_t num_epoch = 0;
if (dump_file.is_open()) if (dump_file.is_open())
{ {
size = dump_file.tellg(); size = dump_file.tellg();
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes); num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
dump_file.seekg(0, std::ios::beg); dump_file.seekg(0, std::ios::beg);
} }
else else
@ -384,7 +384,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
float *abs_L = new float[num_epoch]; float *abs_L = new float[num_epoch];
float *Prompt_I = new float[num_epoch]; float *Prompt_I = new float[num_epoch];
float *Prompt_Q = new float[num_epoch]; float *Prompt_Q = new float[num_epoch];
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
double *acc_carrier_phase_rad = new double[num_epoch]; double *acc_carrier_phase_rad = new double[num_epoch];
double *carrier_doppler_hz = new double[num_epoch]; double *carrier_doppler_hz = new double[num_epoch];
double *code_freq_chips = new double[num_epoch]; double *code_freq_chips = new double[num_epoch];
@ -402,14 +402,14 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
{ {
if (dump_file.is_open()) if (dump_file.is_open())
{ {
for (long int i = 0; i < num_epoch; i++) for (int64_t i = 0; i < num_epoch; i++)
{ {
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int)); dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double));
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double));
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double));
@ -457,7 +457,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
filename.erase(filename.length() - 4, 4); filename.erase(filename.length() - 4, 4);
filename.append(".mat"); filename.append(".mat");
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
if (reinterpret_cast<long *>(matfp) != NULL) if (reinterpret_cast<int64_t *>(matfp) != NULL)
{ {
size_t dims[2] = {1, static_cast<size_t>(num_epoch)}; size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0);
@ -652,7 +652,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
bool enable_dll_pll; bool enable_dll_pll;
if (d_enable_extended_integration == true) if (d_enable_extended_integration == true)
{ {
long int symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s)); int64_t symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s));
if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0) if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0)
{ {
// compute coherent integration and enable tracking loop // compute coherent integration and enable tracking loop
@ -880,7 +880,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
// PRN start sample stamp // PRN start sample stamp
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
// accumulated carrier phase // accumulated carrier phase
tmp_float = d_acc_carrier_phase_cycles * GLONASS_TWO_PI; tmp_float = d_acc_carrier_phase_cycles * GLONASS_TWO_PI;
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));

View File

@ -58,7 +58,7 @@ typedef boost::shared_ptr<glonass_l1_ca_dll_pll_c_aid_tracking_cc>
glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr
glonass_l1_ca_dll_pll_c_aid_make_tracking_cc( glonass_l1_ca_dll_pll_c_aid_make_tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -89,7 +89,7 @@ public:
private: private:
friend glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr friend glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr
glonass_l1_ca_dll_pll_c_aid_make_tracking_cc( glonass_l1_ca_dll_pll_c_aid_make_tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -100,7 +100,7 @@ private:
float early_late_space_chips); float early_late_space_chips);
glonass_l1_ca_dll_pll_c_aid_tracking_cc( glonass_l1_ca_dll_pll_c_aid_tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -117,7 +117,7 @@ private:
Gnss_Synchro* d_acquisition_gnss_synchro; Gnss_Synchro* d_acquisition_gnss_synchro;
unsigned int d_channel; unsigned int d_channel;
long d_fs_in; int64_t d_fs_in;
double d_glonass_freq_ch; double d_glonass_freq_ch;
double d_early_late_spc_chips; double d_early_late_spc_chips;
@ -176,8 +176,8 @@ private:
int d_correlation_length_samples; int d_correlation_length_samples;
//processing samples counters //processing samples counters
unsigned long int d_sample_counter; uint64_t d_sample_counter;
unsigned long int d_acq_sample_stamp; uint64_t d_acq_sample_stamp;
// CN0 estimation and lock detector // CN0 estimation and lock detector
int d_cn0_estimation_counter; int d_cn0_estimation_counter;

View File

@ -37,7 +37,6 @@
*/ */
#include "glonass_l1_ca_dll_pll_c_aid_tracking_sc.h" #include "glonass_l1_ca_dll_pll_c_aid_tracking_sc.h"
#include "gnss_synchro.h"
#include "glonass_l1_signal_processing.h" #include "glonass_l1_signal_processing.h"
#include "GLONASS_L1_L2_CA.h" #include "GLONASS_L1_L2_CA.h"
#include "tracking_discriminators.h" #include "tracking_discriminators.h"
@ -61,7 +60,7 @@ using google::LogMessage;
glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr
glonass_l1_ca_dll_pll_c_aid_make_tracking_sc( glonass_l1_ca_dll_pll_c_aid_make_tracking_sc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -100,7 +99,7 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index(pmt::pm
} }
glonass_l1_ca_dll_pll_c_aid_tracking_sc::glonass_l1_ca_dll_pll_c_aid_tracking_sc( glonass_l1_ca_dll_pll_c_aid_tracking_sc::glonass_l1_ca_dll_pll_c_aid_tracking_sc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -208,7 +207,7 @@ glonass_l1_ca_dll_pll_c_aid_tracking_sc::glonass_l1_ca_dll_pll_c_aid_tracking_sc
d_carrier_doppler_old_hz = 0.0; d_carrier_doppler_old_hz = 0.0;
d_glonass_freq_ch = 0; d_glonass_freq_ch = 0;
//set_min_output_buffer((long int)300); //set_min_output_buffer((int64_t)300);
} }
@ -221,9 +220,9 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking()
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz; d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
long int acq_trk_diff_samples; int64_t acq_trk_diff_samples;
double acq_trk_diff_seconds; double acq_trk_diff_seconds;
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length; acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp); //-d_vector_length;
DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in); acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in);
// Doppler effect // Doppler effect
@ -309,7 +308,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
std::ifstream::pos_type size; std::ifstream::pos_type size;
int number_of_double_vars = 11; int number_of_double_vars = 11;
int number_of_float_vars = 5; int number_of_float_vars = 5;
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
sizeof(float) * number_of_float_vars + sizeof(unsigned int); sizeof(float) * number_of_float_vars + sizeof(unsigned int);
std::ifstream dump_file; std::ifstream dump_file;
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
@ -323,11 +322,11 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
return 1; return 1;
} }
// count number of epochs and rewind // count number of epochs and rewind
long int num_epoch = 0; int64_t num_epoch = 0;
if (dump_file.is_open()) if (dump_file.is_open())
{ {
size = dump_file.tellg(); size = dump_file.tellg();
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes); num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
dump_file.seekg(0, std::ios::beg); dump_file.seekg(0, std::ios::beg);
} }
else else
@ -339,7 +338,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
float *abs_L = new float[num_epoch]; float *abs_L = new float[num_epoch];
float *Prompt_I = new float[num_epoch]; float *Prompt_I = new float[num_epoch];
float *Prompt_Q = new float[num_epoch]; float *Prompt_Q = new float[num_epoch];
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
double *acc_carrier_phase_rad = new double[num_epoch]; double *acc_carrier_phase_rad = new double[num_epoch];
double *carrier_doppler_hz = new double[num_epoch]; double *carrier_doppler_hz = new double[num_epoch];
double *code_freq_chips = new double[num_epoch]; double *code_freq_chips = new double[num_epoch];
@ -357,14 +356,14 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
{ {
if (dump_file.is_open()) if (dump_file.is_open())
{ {
for (long int i = 0; i < num_epoch; i++) for (int64_t i = 0; i < num_epoch; i++)
{ {
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int)); dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double));
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double));
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double));
@ -412,7 +411,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
filename.erase(filename.length() - 4, 4); filename.erase(filename.length() - 4, 4);
filename.append(".mat"); filename.append(".mat");
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
if (reinterpret_cast<long *>(matfp) != NULL) if (reinterpret_cast<int64_t *>(matfp) != NULL)
{ {
size_t dims[2] = {1, static_cast<size_t>(num_epoch)}; size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0);
@ -644,7 +643,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
bool enable_dll_pll; bool enable_dll_pll;
if (d_enable_extended_integration == true) if (d_enable_extended_integration == true)
{ {
long int symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s)); int64_t symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s));
if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0) if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0)
{ {
// compute coherent integration and enable tracking loop // compute coherent integration and enable tracking loop
@ -870,7 +869,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
// PRN start sample stamp // PRN start sample stamp
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
// accumulated carrier phase // accumulated carrier phase
tmp_float = d_acc_carrier_phase_cycles * GLONASS_TWO_PI; tmp_float = d_acc_carrier_phase_cycles * GLONASS_TWO_PI;
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));

View File

@ -59,7 +59,7 @@ typedef boost::shared_ptr<glonass_l1_ca_dll_pll_c_aid_tracking_sc>
glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr
glonass_l1_ca_dll_pll_c_aid_make_tracking_sc( glonass_l1_ca_dll_pll_c_aid_make_tracking_sc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -90,7 +90,7 @@ public:
private: private:
friend glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr friend glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr
glonass_l1_ca_dll_pll_c_aid_make_tracking_sc( glonass_l1_ca_dll_pll_c_aid_make_tracking_sc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -101,7 +101,7 @@ private:
float early_late_space_chips); float early_late_space_chips);
glonass_l1_ca_dll_pll_c_aid_tracking_sc( glonass_l1_ca_dll_pll_c_aid_tracking_sc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -118,8 +118,8 @@ private:
Gnss_Synchro* d_acquisition_gnss_synchro; Gnss_Synchro* d_acquisition_gnss_synchro;
unsigned int d_channel; unsigned int d_channel;
long d_fs_in; int64_t d_fs_in;
long d_glonass_freq_ch; int64_t d_glonass_freq_ch;
double d_early_late_spc_chips; double d_early_late_spc_chips;
int d_n_correlator_taps; int d_n_correlator_taps;
@ -179,8 +179,8 @@ private:
int d_correlation_length_samples; int d_correlation_length_samples;
//processing samples counters //processing samples counters
unsigned long int d_sample_counter; uint64_t d_sample_counter;
unsigned long int d_acq_sample_stamp; uint64_t d_acq_sample_stamp;
// CN0 estimation and lock detector // CN0 estimation and lock detector
int d_cn0_estimation_counter; int d_cn0_estimation_counter;

View File

@ -59,7 +59,7 @@ using google::LogMessage;
glonass_l1_ca_dll_pll_tracking_cc_sptr glonass_l1_ca_dll_pll_tracking_cc_sptr
glonass_l1_ca_dll_pll_make_tracking_cc( glonass_l1_ca_dll_pll_make_tracking_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -83,7 +83,7 @@ void Glonass_L1_Ca_Dll_Pll_Tracking_cc::forecast(int noutput_items,
Glonass_L1_Ca_Dll_Pll_Tracking_cc::Glonass_L1_Ca_Dll_Pll_Tracking_cc( Glonass_L1_Ca_Dll_Pll_Tracking_cc::Glonass_L1_Ca_Dll_Pll_Tracking_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -182,9 +182,9 @@ void Glonass_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz; d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
long int acq_trk_diff_samples; int64_t acq_trk_diff_samples;
double acq_trk_diff_seconds; double acq_trk_diff_seconds;
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length; acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp); //-d_vector_length;
DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
acq_trk_diff_seconds = static_cast<float>(acq_trk_diff_samples) / static_cast<float>(d_fs_in); acq_trk_diff_seconds = static_cast<float>(acq_trk_diff_samples) / static_cast<float>(d_fs_in);
// Doppler effect // Doppler effect
@ -306,7 +306,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile()
std::ifstream::pos_type size; std::ifstream::pos_type size;
int number_of_double_vars = 11; int number_of_double_vars = 11;
int number_of_float_vars = 5; int number_of_float_vars = 5;
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
sizeof(float) * number_of_float_vars + sizeof(unsigned int); sizeof(float) * number_of_float_vars + sizeof(unsigned int);
std::ifstream dump_file; std::ifstream dump_file;
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
@ -320,11 +320,11 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile()
return 1; return 1;
} }
// count number of epochs and rewind // count number of epochs and rewind
long int num_epoch = 0; int64_t num_epoch = 0;
if (dump_file.is_open()) if (dump_file.is_open())
{ {
size = dump_file.tellg(); size = dump_file.tellg();
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes); num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
dump_file.seekg(0, std::ios::beg); dump_file.seekg(0, std::ios::beg);
} }
else else
@ -336,7 +336,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile()
float *abs_L = new float[num_epoch]; float *abs_L = new float[num_epoch];
float *Prompt_I = new float[num_epoch]; float *Prompt_I = new float[num_epoch];
float *Prompt_Q = new float[num_epoch]; float *Prompt_Q = new float[num_epoch];
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
double *acc_carrier_phase_rad = new double[num_epoch]; double *acc_carrier_phase_rad = new double[num_epoch];
double *carrier_doppler_hz = new double[num_epoch]; double *carrier_doppler_hz = new double[num_epoch];
double *code_freq_chips = new double[num_epoch]; double *code_freq_chips = new double[num_epoch];
@ -354,14 +354,14 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile()
{ {
if (dump_file.is_open()) if (dump_file.is_open())
{ {
for (long int i = 0; i < num_epoch; i++) for (int64_t i = 0; i < num_epoch; i++)
{ {
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int)); dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double));
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double));
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double));
@ -409,7 +409,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile()
filename.erase(filename.length() - 4, 4); filename.erase(filename.length() - 4, 4);
filename.append(".mat"); filename.append(".mat");
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
if (reinterpret_cast<long *>(matfp) != NULL) if (reinterpret_cast<int64_t *>(matfp) != NULL)
{ {
size_t dims[2] = {1, static_cast<size_t>(num_epoch)}; size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0);
@ -722,7 +722,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
// PRN start sample stamp // PRN start sample stamp
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
// accumulated carrier phase // accumulated carrier phase
tmp_float = d_acc_carrier_phase_rad; tmp_float = d_acc_carrier_phase_rad;
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));

View File

@ -55,7 +55,7 @@ typedef boost::shared_ptr<Glonass_L1_Ca_Dll_Pll_Tracking_cc>
glonass_l1_ca_dll_pll_tracking_cc_sptr glonass_l1_ca_dll_pll_tracking_cc_sptr
glonass_l1_ca_dll_pll_make_tracking_cc( glonass_l1_ca_dll_pll_make_tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -83,7 +83,7 @@ public:
private: private:
friend glonass_l1_ca_dll_pll_tracking_cc_sptr friend glonass_l1_ca_dll_pll_tracking_cc_sptr
glonass_l1_ca_dll_pll_make_tracking_cc( glonass_l1_ca_dll_pll_make_tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -91,7 +91,7 @@ private:
float early_late_space_chips); float early_late_space_chips);
Glonass_L1_Ca_Dll_Pll_Tracking_cc( Glonass_L1_Ca_Dll_Pll_Tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -105,8 +105,8 @@ private:
Gnss_Synchro* d_acquisition_gnss_synchro; Gnss_Synchro* d_acquisition_gnss_synchro;
unsigned int d_channel; unsigned int d_channel;
long d_fs_in; int64_t d_fs_in;
long d_glonass_freq_ch; int64_t d_glonass_freq_ch;
double d_early_late_spc_chips; double d_early_late_spc_chips;
@ -144,8 +144,8 @@ private:
int d_current_prn_length_samples; int d_current_prn_length_samples;
//processing samples counters //processing samples counters
unsigned long int d_sample_counter; uint64_t d_sample_counter;
unsigned long int d_acq_sample_stamp; uint64_t d_acq_sample_stamp;
// CN0 estimation and lock detector // CN0 estimation and lock detector
int d_cn0_estimation_counter; int d_cn0_estimation_counter;

View File

@ -59,7 +59,7 @@ using google::LogMessage;
glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr
glonass_l2_ca_dll_pll_c_aid_make_tracking_cc( glonass_l2_ca_dll_pll_c_aid_make_tracking_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -99,7 +99,7 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index(pmt::pm
glonass_l2_ca_dll_pll_c_aid_tracking_cc::glonass_l2_ca_dll_pll_c_aid_tracking_cc( glonass_l2_ca_dll_pll_c_aid_tracking_cc::glonass_l2_ca_dll_pll_c_aid_tracking_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -208,7 +208,7 @@ glonass_l2_ca_dll_pll_c_aid_tracking_cc::glonass_l2_ca_dll_pll_c_aid_tracking_cc
d_glonass_freq_ch = 0; d_glonass_freq_ch = 0;
//set_min_output_buffer((long int)300); //set_min_output_buffer((int64_t)300);
} }
@ -221,9 +221,9 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_cc::start_tracking()
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz; d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
long int acq_trk_diff_samples; int64_t acq_trk_diff_samples;
double acq_trk_diff_seconds; double acq_trk_diff_seconds;
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length; acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp); //-d_vector_length;
DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in); acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in);
// Doppler effect // Doppler effect
@ -351,7 +351,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile()
std::ifstream::pos_type size; std::ifstream::pos_type size;
int number_of_double_vars = 11; int number_of_double_vars = 11;
int number_of_float_vars = 5; int number_of_float_vars = 5;
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
sizeof(float) * number_of_float_vars + sizeof(unsigned int); sizeof(float) * number_of_float_vars + sizeof(unsigned int);
std::ifstream dump_file; std::ifstream dump_file;
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
@ -365,11 +365,11 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile()
return 1; return 1;
} }
// count number of epochs and rewind // count number of epochs and rewind
long int num_epoch = 0; int64_t num_epoch = 0;
if (dump_file.is_open()) if (dump_file.is_open())
{ {
size = dump_file.tellg(); size = dump_file.tellg();
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes); num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
dump_file.seekg(0, std::ios::beg); dump_file.seekg(0, std::ios::beg);
} }
else else
@ -381,7 +381,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile()
float *abs_L = new float[num_epoch]; float *abs_L = new float[num_epoch];
float *Prompt_I = new float[num_epoch]; float *Prompt_I = new float[num_epoch];
float *Prompt_Q = new float[num_epoch]; float *Prompt_Q = new float[num_epoch];
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
double *acc_carrier_phase_rad = new double[num_epoch]; double *acc_carrier_phase_rad = new double[num_epoch];
double *carrier_doppler_hz = new double[num_epoch]; double *carrier_doppler_hz = new double[num_epoch];
double *code_freq_chips = new double[num_epoch]; double *code_freq_chips = new double[num_epoch];
@ -399,14 +399,14 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile()
{ {
if (dump_file.is_open()) if (dump_file.is_open())
{ {
for (long int i = 0; i < num_epoch; i++) for (int64_t i = 0; i < num_epoch; i++)
{ {
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int)); dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double));
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double));
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double));
@ -454,7 +454,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile()
filename.erase(filename.length() - 4, 4); filename.erase(filename.length() - 4, 4);
filename.append(".mat"); filename.append(".mat");
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
if (reinterpret_cast<long *>(matfp) != NULL) if (reinterpret_cast<int64_t *>(matfp) != NULL)
{ {
size_t dims[2] = {1, static_cast<size_t>(num_epoch)}; size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0);
@ -649,7 +649,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
bool enable_dll_pll; bool enable_dll_pll;
if (d_enable_extended_integration == true) if (d_enable_extended_integration == true)
{ {
long int symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s)); int64_t symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s));
if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0) if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0)
{ {
// compute coherent integration and enable tracking loop // compute coherent integration and enable tracking loop
@ -877,7 +877,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
// PRN start sample stamp // PRN start sample stamp
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
// accumulated carrier phase // accumulated carrier phase
tmp_float = d_acc_carrier_phase_cycles * GLONASS_TWO_PI; tmp_float = d_acc_carrier_phase_cycles * GLONASS_TWO_PI;
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));

View File

@ -56,7 +56,7 @@ typedef boost::shared_ptr<glonass_l2_ca_dll_pll_c_aid_tracking_cc>
glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr
glonass_l2_ca_dll_pll_c_aid_make_tracking_cc( glonass_l2_ca_dll_pll_c_aid_make_tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -87,7 +87,7 @@ public:
private: private:
friend glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr friend glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr
glonass_l2_ca_dll_pll_c_aid_make_tracking_cc( glonass_l2_ca_dll_pll_c_aid_make_tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -98,7 +98,7 @@ private:
float early_late_space_chips); float early_late_space_chips);
glonass_l2_ca_dll_pll_c_aid_tracking_cc( glonass_l2_ca_dll_pll_c_aid_tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -115,7 +115,7 @@ private:
Gnss_Synchro* d_acquisition_gnss_synchro; Gnss_Synchro* d_acquisition_gnss_synchro;
unsigned int d_channel; unsigned int d_channel;
long d_fs_in; int64_t d_fs_in;
double d_glonass_freq_ch; double d_glonass_freq_ch;
double d_early_late_spc_chips; double d_early_late_spc_chips;
@ -174,8 +174,8 @@ private:
int d_correlation_length_samples; int d_correlation_length_samples;
//processing samples counters //processing samples counters
unsigned long int d_sample_counter; uint64_t d_sample_counter;
unsigned long int d_acq_sample_stamp; uint64_t d_acq_sample_stamp;
// CN0 estimation and lock detector // CN0 estimation and lock detector
int d_cn0_estimation_counter; int d_cn0_estimation_counter;

View File

@ -35,7 +35,6 @@
*/ */
#include "glonass_l2_ca_dll_pll_c_aid_tracking_sc.h" #include "glonass_l2_ca_dll_pll_c_aid_tracking_sc.h"
#include "gnss_synchro.h"
#include "glonass_l2_signal_processing.h" #include "glonass_l2_signal_processing.h"
#include "tracking_discriminators.h" #include "tracking_discriminators.h"
#include "lock_detectors.h" #include "lock_detectors.h"
@ -59,7 +58,7 @@ using google::LogMessage;
glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr
glonass_l2_ca_dll_pll_c_aid_make_tracking_sc( glonass_l2_ca_dll_pll_c_aid_make_tracking_sc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -98,7 +97,7 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index(pmt::pm
} }
glonass_l2_ca_dll_pll_c_aid_tracking_sc::glonass_l2_ca_dll_pll_c_aid_tracking_sc( glonass_l2_ca_dll_pll_c_aid_tracking_sc::glonass_l2_ca_dll_pll_c_aid_tracking_sc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -206,7 +205,7 @@ glonass_l2_ca_dll_pll_c_aid_tracking_sc::glonass_l2_ca_dll_pll_c_aid_tracking_sc
d_carrier_doppler_old_hz = 0.0; d_carrier_doppler_old_hz = 0.0;
d_glonass_freq_ch = 0; d_glonass_freq_ch = 0;
//set_min_output_buffer((long int)300); //set_min_output_buffer((int64_t)300);
} }
@ -219,9 +218,9 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_sc::start_tracking()
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz; d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
long int acq_trk_diff_samples; int64_t acq_trk_diff_samples;
double acq_trk_diff_seconds; double acq_trk_diff_seconds;
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length; acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp); //-d_vector_length;
DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in); acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in);
// Doppler effect // Doppler effect
@ -307,7 +306,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile()
std::ifstream::pos_type size; std::ifstream::pos_type size;
int number_of_double_vars = 11; int number_of_double_vars = 11;
int number_of_float_vars = 5; int number_of_float_vars = 5;
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
sizeof(float) * number_of_float_vars + sizeof(unsigned int); sizeof(float) * number_of_float_vars + sizeof(unsigned int);
std::ifstream dump_file; std::ifstream dump_file;
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
@ -321,11 +320,11 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile()
return 1; return 1;
} }
// count number of epochs and rewind // count number of epochs and rewind
long int num_epoch = 0; int64_t num_epoch = 0;
if (dump_file.is_open()) if (dump_file.is_open())
{ {
size = dump_file.tellg(); size = dump_file.tellg();
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes); num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
dump_file.seekg(0, std::ios::beg); dump_file.seekg(0, std::ios::beg);
} }
else else
@ -337,7 +336,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile()
float *abs_L = new float[num_epoch]; float *abs_L = new float[num_epoch];
float *Prompt_I = new float[num_epoch]; float *Prompt_I = new float[num_epoch];
float *Prompt_Q = new float[num_epoch]; float *Prompt_Q = new float[num_epoch];
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
double *acc_carrier_phase_rad = new double[num_epoch]; double *acc_carrier_phase_rad = new double[num_epoch];
double *carrier_doppler_hz = new double[num_epoch]; double *carrier_doppler_hz = new double[num_epoch];
double *code_freq_chips = new double[num_epoch]; double *code_freq_chips = new double[num_epoch];
@ -355,14 +354,14 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile()
{ {
if (dump_file.is_open()) if (dump_file.is_open())
{ {
for (long int i = 0; i < num_epoch; i++) for (int64_t i = 0; i < num_epoch; i++)
{ {
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int)); dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double));
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double));
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double));
@ -410,7 +409,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile()
filename.erase(filename.length() - 4, 4); filename.erase(filename.length() - 4, 4);
filename.append(".mat"); filename.append(".mat");
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
if (reinterpret_cast<long *>(matfp) != NULL) if (reinterpret_cast<int64_t *>(matfp) != NULL)
{ {
size_t dims[2] = {1, static_cast<size_t>(num_epoch)}; size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0);
@ -642,7 +641,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
bool enable_dll_pll; bool enable_dll_pll;
if (d_enable_extended_integration == true) if (d_enable_extended_integration == true)
{ {
long int symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s)); int64_t symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s));
if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0) if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0)
{ {
// compute coherent integration and enable tracking loop // compute coherent integration and enable tracking loop
@ -868,7 +867,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
// PRN start sample stamp // PRN start sample stamp
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
// accumulated carrier phase // accumulated carrier phase
tmp_float = d_acc_carrier_phase_cycles * GLONASS_TWO_PI; tmp_float = d_acc_carrier_phase_cycles * GLONASS_TWO_PI;
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));

View File

@ -57,7 +57,7 @@ typedef boost::shared_ptr<glonass_l2_ca_dll_pll_c_aid_tracking_sc>
glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr
glonass_l2_ca_dll_pll_c_aid_make_tracking_sc( glonass_l2_ca_dll_pll_c_aid_make_tracking_sc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -88,7 +88,7 @@ public:
private: private:
friend glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr friend glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr
glonass_l2_ca_dll_pll_c_aid_make_tracking_sc( glonass_l2_ca_dll_pll_c_aid_make_tracking_sc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -99,7 +99,7 @@ private:
float early_late_space_chips); float early_late_space_chips);
glonass_l2_ca_dll_pll_c_aid_tracking_sc( glonass_l2_ca_dll_pll_c_aid_tracking_sc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -116,8 +116,8 @@ private:
Gnss_Synchro* d_acquisition_gnss_synchro; Gnss_Synchro* d_acquisition_gnss_synchro;
unsigned int d_channel; unsigned int d_channel;
long d_fs_in; int64_t d_fs_in;
long d_glonass_freq_ch; int64_t d_glonass_freq_ch;
double d_early_late_spc_chips; double d_early_late_spc_chips;
int d_n_correlator_taps; int d_n_correlator_taps;
@ -177,8 +177,8 @@ private:
int d_correlation_length_samples; int d_correlation_length_samples;
//processing samples counters //processing samples counters
unsigned long int d_sample_counter; uint64_t d_sample_counter;
unsigned long int d_acq_sample_stamp; uint64_t d_acq_sample_stamp;
// CN0 estimation and lock detector // CN0 estimation and lock detector
int d_cn0_estimation_counter; int d_cn0_estimation_counter;

View File

@ -59,7 +59,7 @@ using google::LogMessage;
glonass_l2_ca_dll_pll_tracking_cc_sptr glonass_l2_ca_dll_pll_tracking_cc_sptr
glonass_l2_ca_dll_pll_make_tracking_cc( glonass_l2_ca_dll_pll_make_tracking_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -83,7 +83,7 @@ void Glonass_L2_Ca_Dll_Pll_Tracking_cc::forecast(int noutput_items,
Glonass_L2_Ca_Dll_Pll_Tracking_cc::Glonass_L2_Ca_Dll_Pll_Tracking_cc( Glonass_L2_Ca_Dll_Pll_Tracking_cc::Glonass_L2_Ca_Dll_Pll_Tracking_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -182,9 +182,9 @@ void Glonass_L2_Ca_Dll_Pll_Tracking_cc::start_tracking()
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz; d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
long int acq_trk_diff_samples; int64_t acq_trk_diff_samples;
double acq_trk_diff_seconds; double acq_trk_diff_seconds;
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length; acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp); //-d_vector_length;
DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
acq_trk_diff_seconds = static_cast<float>(acq_trk_diff_samples) / static_cast<float>(d_fs_in); acq_trk_diff_seconds = static_cast<float>(acq_trk_diff_samples) / static_cast<float>(d_fs_in);
// Doppler effect // Doppler effect
@ -306,7 +306,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile()
std::ifstream::pos_type size; std::ifstream::pos_type size;
int number_of_double_vars = 11; int number_of_double_vars = 11;
int number_of_float_vars = 5; int number_of_float_vars = 5;
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
sizeof(float) * number_of_float_vars + sizeof(unsigned int); sizeof(float) * number_of_float_vars + sizeof(unsigned int);
std::ifstream dump_file; std::ifstream dump_file;
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
@ -320,11 +320,11 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile()
return 1; return 1;
} }
// count number of epochs and rewind // count number of epochs and rewind
long int num_epoch = 0; int64_t num_epoch = 0;
if (dump_file.is_open()) if (dump_file.is_open())
{ {
size = dump_file.tellg(); size = dump_file.tellg();
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes); num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
dump_file.seekg(0, std::ios::beg); dump_file.seekg(0, std::ios::beg);
} }
else else
@ -336,7 +336,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile()
float *abs_L = new float[num_epoch]; float *abs_L = new float[num_epoch];
float *Prompt_I = new float[num_epoch]; float *Prompt_I = new float[num_epoch];
float *Prompt_Q = new float[num_epoch]; float *Prompt_Q = new float[num_epoch];
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
double *acc_carrier_phase_rad = new double[num_epoch]; double *acc_carrier_phase_rad = new double[num_epoch];
double *carrier_doppler_hz = new double[num_epoch]; double *carrier_doppler_hz = new double[num_epoch];
double *code_freq_chips = new double[num_epoch]; double *code_freq_chips = new double[num_epoch];
@ -354,14 +354,14 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile()
{ {
if (dump_file.is_open()) if (dump_file.is_open())
{ {
for (long int i = 0; i < num_epoch; i++) for (int64_t i = 0; i < num_epoch; i++)
{ {
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int)); dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double));
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double));
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double));
@ -409,7 +409,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile()
filename.erase(filename.length() - 4, 4); filename.erase(filename.length() - 4, 4);
filename.append(".mat"); filename.append(".mat");
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
if (reinterpret_cast<long *>(matfp) != NULL) if (reinterpret_cast<int64_t *>(matfp) != NULL)
{ {
size_t dims[2] = {1, static_cast<size_t>(num_epoch)}; size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0);
@ -722,7 +722,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
// PRN start sample stamp // PRN start sample stamp
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
// accumulated carrier phase // accumulated carrier phase
tmp_float = d_acc_carrier_phase_rad; tmp_float = d_acc_carrier_phase_rad;
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));

View File

@ -53,7 +53,7 @@ typedef boost::shared_ptr<Glonass_L2_Ca_Dll_Pll_Tracking_cc>
glonass_l2_ca_dll_pll_tracking_cc_sptr glonass_l2_ca_dll_pll_tracking_cc_sptr
glonass_l2_ca_dll_pll_make_tracking_cc( glonass_l2_ca_dll_pll_make_tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -81,7 +81,7 @@ public:
private: private:
friend glonass_l2_ca_dll_pll_tracking_cc_sptr friend glonass_l2_ca_dll_pll_tracking_cc_sptr
glonass_l2_ca_dll_pll_make_tracking_cc( glonass_l2_ca_dll_pll_make_tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -89,7 +89,7 @@ private:
float early_late_space_chips); float early_late_space_chips);
Glonass_L2_Ca_Dll_Pll_Tracking_cc( Glonass_L2_Ca_Dll_Pll_Tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -103,8 +103,8 @@ private:
Gnss_Synchro* d_acquisition_gnss_synchro; Gnss_Synchro* d_acquisition_gnss_synchro;
unsigned int d_channel; unsigned int d_channel;
long d_fs_in; int64_t d_fs_in;
long d_glonass_freq_ch; int64_t d_glonass_freq_ch;
double d_early_late_spc_chips; double d_early_late_spc_chips;
@ -142,8 +142,8 @@ private:
int d_current_prn_length_samples; int d_current_prn_length_samples;
//processing samples counters //processing samples counters
unsigned long int d_sample_counter; uint64_t d_sample_counter;
unsigned long int d_acq_sample_stamp; uint64_t d_acq_sample_stamp;
// CN0 estimation and lock detector // CN0 estimation and lock detector
int d_cn0_estimation_counter; int d_cn0_estimation_counter;

View File

@ -51,7 +51,7 @@ using google::LogMessage;
gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr
gps_l1_ca_dll_pll_c_aid_make_tracking_cc( gps_l1_ca_dll_pll_c_aid_make_tracking_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -91,7 +91,7 @@ void gps_l1_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index(pmt::pmt_t
gps_l1_ca_dll_pll_c_aid_tracking_cc::gps_l1_ca_dll_pll_c_aid_tracking_cc( gps_l1_ca_dll_pll_c_aid_tracking_cc::gps_l1_ca_dll_pll_c_aid_tracking_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -195,7 +195,7 @@ gps_l1_ca_dll_pll_c_aid_tracking_cc::gps_l1_ca_dll_pll_c_aid_tracking_cc(
d_code_error_filt_chips_s = 0.0; d_code_error_filt_chips_s = 0.0;
d_carr_phase_error_secs_Ti = 0.0; d_carr_phase_error_secs_Ti = 0.0;
d_preamble_timestamp_s = 0.0; d_preamble_timestamp_s = 0.0;
//set_min_output_buffer((long int)300); //set_min_output_buffer((int64_t)300);
} }
@ -208,9 +208,9 @@ void gps_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking()
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz; d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
long int acq_trk_diff_samples; int64_t acq_trk_diff_samples;
double acq_trk_diff_seconds; double acq_trk_diff_seconds;
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length; acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp); //-d_vector_length;
DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in); acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in);
// Doppler effect // Doppler effect
@ -333,7 +333,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
std::ifstream::pos_type size; std::ifstream::pos_type size;
int number_of_double_vars = 11; int number_of_double_vars = 11;
int number_of_float_vars = 5; int number_of_float_vars = 5;
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
sizeof(float) * number_of_float_vars + sizeof(unsigned int); sizeof(float) * number_of_float_vars + sizeof(unsigned int);
std::ifstream dump_file; std::ifstream dump_file;
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
@ -347,11 +347,11 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
return 1; return 1;
} }
// count number of epochs and rewind // count number of epochs and rewind
long int num_epoch = 0; int64_t num_epoch = 0;
if (dump_file.is_open()) if (dump_file.is_open())
{ {
size = dump_file.tellg(); size = dump_file.tellg();
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes); num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
dump_file.seekg(0, std::ios::beg); dump_file.seekg(0, std::ios::beg);
} }
else else
@ -363,7 +363,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
float *abs_L = new float[num_epoch]; float *abs_L = new float[num_epoch];
float *Prompt_I = new float[num_epoch]; float *Prompt_I = new float[num_epoch];
float *Prompt_Q = new float[num_epoch]; float *Prompt_Q = new float[num_epoch];
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
double *acc_carrier_phase_rad = new double[num_epoch]; double *acc_carrier_phase_rad = new double[num_epoch];
double *carrier_doppler_hz = new double[num_epoch]; double *carrier_doppler_hz = new double[num_epoch];
double *code_freq_chips = new double[num_epoch]; double *code_freq_chips = new double[num_epoch];
@ -381,14 +381,14 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
{ {
if (dump_file.is_open()) if (dump_file.is_open())
{ {
for (long int i = 0; i < num_epoch; i++) for (int64_t i = 0; i < num_epoch; i++)
{ {
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int)); dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double));
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double));
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double));
@ -436,7 +436,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
filename.erase(filename.length() - 4, 4); filename.erase(filename.length() - 4, 4);
filename.append(".mat"); filename.append(".mat");
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
if (reinterpret_cast<long *>(matfp) != NULL) if (reinterpret_cast<int64_t *>(matfp) != NULL)
{ {
size_t dims[2] = {1, static_cast<size_t>(num_epoch)}; size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0);
@ -631,7 +631,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __attrib
bool enable_dll_pll; bool enable_dll_pll;
if (d_enable_extended_integration == true) if (d_enable_extended_integration == true)
{ {
long int symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s)); int64_t symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s));
if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0) if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0)
{ {
// compute coherent integration and enable tracking loop // compute coherent integration and enable tracking loop
@ -858,7 +858,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __attrib
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
// PRN start sample stamp // PRN start sample stamp
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
// accumulated carrier phase // accumulated carrier phase
tmp_float = d_acc_carrier_phase_cycles * GPS_TWO_PI; tmp_float = d_acc_carrier_phase_cycles * GPS_TWO_PI;
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));

View File

@ -56,7 +56,7 @@ typedef boost::shared_ptr<gps_l1_ca_dll_pll_c_aid_tracking_cc>
gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr
gps_l1_ca_dll_pll_c_aid_make_tracking_cc( gps_l1_ca_dll_pll_c_aid_make_tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -87,7 +87,7 @@ public:
private: private:
friend gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr friend gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr
gps_l1_ca_dll_pll_c_aid_make_tracking_cc( gps_l1_ca_dll_pll_c_aid_make_tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -98,7 +98,7 @@ private:
float early_late_space_chips); float early_late_space_chips);
gps_l1_ca_dll_pll_c_aid_tracking_cc( gps_l1_ca_dll_pll_c_aid_tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -114,7 +114,7 @@ private:
Gnss_Synchro* d_acquisition_gnss_synchro; Gnss_Synchro* d_acquisition_gnss_synchro;
unsigned int d_channel; unsigned int d_channel;
long d_fs_in; int64_t d_fs_in;
double d_early_late_spc_chips; double d_early_late_spc_chips;
int d_n_correlator_taps; int d_n_correlator_taps;
@ -170,8 +170,8 @@ private:
int d_correlation_length_samples; int d_correlation_length_samples;
//processing samples counters //processing samples counters
unsigned long int d_sample_counter; uint64_t d_sample_counter;
unsigned long int d_acq_sample_stamp; uint64_t d_acq_sample_stamp;
// CN0 estimation and lock detector // CN0 estimation and lock detector
int d_cn0_estimation_counter; int d_cn0_estimation_counter;

View File

@ -29,7 +29,6 @@
*/ */
#include "gps_l1_ca_dll_pll_c_aid_tracking_sc.h" #include "gps_l1_ca_dll_pll_c_aid_tracking_sc.h"
#include "gnss_synchro.h"
#include "gps_sdr_signal_processing.h" #include "gps_sdr_signal_processing.h"
#include "tracking_discriminators.h" #include "tracking_discriminators.h"
#include "lock_detectors.h" #include "lock_detectors.h"
@ -52,7 +51,7 @@ using google::LogMessage;
gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr
gps_l1_ca_dll_pll_c_aid_make_tracking_sc( gps_l1_ca_dll_pll_c_aid_make_tracking_sc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -91,7 +90,7 @@ void gps_l1_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index(pmt::pmt_t
} }
gps_l1_ca_dll_pll_c_aid_tracking_sc::gps_l1_ca_dll_pll_c_aid_tracking_sc( gps_l1_ca_dll_pll_c_aid_tracking_sc::gps_l1_ca_dll_pll_c_aid_tracking_sc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -195,7 +194,7 @@ gps_l1_ca_dll_pll_c_aid_tracking_sc::gps_l1_ca_dll_pll_c_aid_tracking_sc(
d_code_error_filt_chips_Ti = 0.0; d_code_error_filt_chips_Ti = 0.0;
d_preamble_timestamp_s = 0.0; d_preamble_timestamp_s = 0.0;
d_carr_phase_error_secs_Ti = 0.0; d_carr_phase_error_secs_Ti = 0.0;
//set_min_output_buffer((long int)300); //set_min_output_buffer((int64_t)300);
} }
@ -208,9 +207,9 @@ void gps_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking()
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz; d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
long int acq_trk_diff_samples; int64_t acq_trk_diff_samples;
double acq_trk_diff_seconds; double acq_trk_diff_seconds;
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length; acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp); //-d_vector_length;
DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in); acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in);
// Doppler effect // Doppler effect
@ -336,7 +335,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
std::ifstream::pos_type size; std::ifstream::pos_type size;
int number_of_double_vars = 11; int number_of_double_vars = 11;
int number_of_float_vars = 5; int number_of_float_vars = 5;
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars + int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
sizeof(float) * number_of_float_vars + sizeof(unsigned int); sizeof(float) * number_of_float_vars + sizeof(unsigned int);
std::ifstream dump_file; std::ifstream dump_file;
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
@ -350,11 +349,11 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
return 1; return 1;
} }
// count number of epochs and rewind // count number of epochs and rewind
long int num_epoch = 0; int64_t num_epoch = 0;
if (dump_file.is_open()) if (dump_file.is_open())
{ {
size = dump_file.tellg(); size = dump_file.tellg();
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes); num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
dump_file.seekg(0, std::ios::beg); dump_file.seekg(0, std::ios::beg);
} }
else else
@ -366,7 +365,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
float *abs_L = new float[num_epoch]; float *abs_L = new float[num_epoch];
float *Prompt_I = new float[num_epoch]; float *Prompt_I = new float[num_epoch];
float *Prompt_Q = new float[num_epoch]; float *Prompt_Q = new float[num_epoch];
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch]; uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
double *acc_carrier_phase_rad = new double[num_epoch]; double *acc_carrier_phase_rad = new double[num_epoch];
double *carrier_doppler_hz = new double[num_epoch]; double *carrier_doppler_hz = new double[num_epoch];
double *code_freq_chips = new double[num_epoch]; double *code_freq_chips = new double[num_epoch];
@ -384,14 +383,14 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
{ {
if (dump_file.is_open()) if (dump_file.is_open())
{ {
for (long int i = 0; i < num_epoch; i++) for (int64_t i = 0; i < num_epoch; i++)
{ {
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float)); dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int)); dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double));
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double));
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double)); dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double));
@ -439,7 +438,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
filename.erase(filename.length() - 4, 4); filename.erase(filename.length() - 4, 4);
filename.append(".mat"); filename.append(".mat");
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
if (reinterpret_cast<long *>(matfp) != NULL) if (reinterpret_cast<int64_t *>(matfp) != NULL)
{ {
size_t dims[2] = {1, static_cast<size_t>(num_epoch)}; size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0); matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0);
@ -634,7 +633,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __attrib
bool enable_dll_pll; bool enable_dll_pll;
if (d_enable_extended_integration == true) if (d_enable_extended_integration == true)
{ {
long int symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s)); int64_t symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s));
if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0) if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0)
{ {
// compute coherent integration and enable tracking loop // compute coherent integration and enable tracking loop
@ -860,7 +859,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __attrib
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
// PRN start sample stamp // PRN start sample stamp
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
// accumulated carrier phase // accumulated carrier phase
tmp_float = d_acc_carrier_phase_cycles * GPS_TWO_PI; tmp_float = d_acc_carrier_phase_cycles * GPS_TWO_PI;
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));

View File

@ -57,7 +57,7 @@ typedef boost::shared_ptr<gps_l1_ca_dll_pll_c_aid_tracking_sc>
gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr
gps_l1_ca_dll_pll_c_aid_make_tracking_sc( gps_l1_ca_dll_pll_c_aid_make_tracking_sc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -88,7 +88,7 @@ public:
private: private:
friend gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr friend gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr
gps_l1_ca_dll_pll_c_aid_make_tracking_sc( gps_l1_ca_dll_pll_c_aid_make_tracking_sc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -99,7 +99,7 @@ private:
float early_late_space_chips); float early_late_space_chips);
gps_l1_ca_dll_pll_c_aid_tracking_sc( gps_l1_ca_dll_pll_c_aid_tracking_sc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float pll_bw_hz, float pll_bw_hz,
@ -116,7 +116,7 @@ private:
Gnss_Synchro* d_acquisition_gnss_synchro; Gnss_Synchro* d_acquisition_gnss_synchro;
unsigned int d_channel; unsigned int d_channel;
long d_fs_in; int64_t d_fs_in;
double d_early_late_spc_chips; double d_early_late_spc_chips;
int d_n_correlator_taps; int d_n_correlator_taps;
@ -174,8 +174,8 @@ private:
int d_correlation_length_samples; int d_correlation_length_samples;
//processing samples counters //processing samples counters
unsigned long int d_sample_counter; uint64_t d_sample_counter;
unsigned long int d_acq_sample_stamp; uint64_t d_acq_sample_stamp;
// CN0 estimation and lock detector // CN0 estimation and lock detector
int d_cn0_estimation_counter; int d_cn0_estimation_counter;

View File

@ -49,7 +49,7 @@ using google::LogMessage;
gps_l1_ca_dll_pll_tracking_gpu_cc_sptr gps_l1_ca_dll_pll_tracking_gpu_cc_sptr
gps_l1_ca_dll_pll_make_tracking_gpu_cc( gps_l1_ca_dll_pll_make_tracking_gpu_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -73,7 +73,7 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::forecast(int noutput_items,
Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc( Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -163,7 +163,7 @@ Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc(
d_rem_code_phase_chips = 0.0; d_rem_code_phase_chips = 0.0;
d_code_phase_step_chips = 0.0; d_code_phase_step_chips = 0.0;
d_carrier_phase_step_rad = 0.0; d_carrier_phase_step_rad = 0.0;
//set_min_output_buffer((long int)300); //set_min_output_buffer((int64_t)300);
} }
@ -176,9 +176,9 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::start_tracking()
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz; d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
long int acq_trk_diff_samples; int64_t acq_trk_diff_samples;
double acq_trk_diff_seconds; double acq_trk_diff_seconds;
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length; acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp); //-d_vector_length;
DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples; DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in); acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in);
//doppler effect //doppler effect
@ -516,7 +516,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work(int noutput_items __attribut
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
// PRN start sample stamp // PRN start sample stamp
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
// accumulated carrier phase // accumulated carrier phase
tmp_float = d_acc_carrier_phase_cycles * GPS_TWO_PI; tmp_float = d_acc_carrier_phase_cycles * GPS_TWO_PI;
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));

View File

@ -53,7 +53,7 @@ typedef boost::shared_ptr<Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc>
gps_l1_ca_dll_pll_tracking_gpu_cc_sptr gps_l1_ca_dll_pll_tracking_gpu_cc_sptr
gps_l1_ca_dll_pll_make_tracking_gpu_cc( gps_l1_ca_dll_pll_make_tracking_gpu_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -82,7 +82,7 @@ public:
private: private:
friend gps_l1_ca_dll_pll_tracking_gpu_cc_sptr friend gps_l1_ca_dll_pll_tracking_gpu_cc_sptr
gps_l1_ca_dll_pll_make_tracking_gpu_cc( gps_l1_ca_dll_pll_make_tracking_gpu_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -91,7 +91,7 @@ private:
float early_late_space_chips); float early_late_space_chips);
Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc( Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -108,8 +108,8 @@ private:
Gnss_Synchro *d_acquisition_gnss_synchro; Gnss_Synchro *d_acquisition_gnss_synchro;
unsigned int d_channel; unsigned int d_channel;
long d_if_freq; int64_t d_if_freq;
long d_fs_in; int64_t d_fs_in;
double d_early_late_spc_chips; double d_early_late_spc_chips;
int d_n_correlator_taps; int d_n_correlator_taps;
@ -153,8 +153,8 @@ private:
int d_correlation_length_samples; int d_correlation_length_samples;
//processing samples counters //processing samples counters
unsigned long int d_sample_counter; uint64_t d_sample_counter;
unsigned long int d_acq_sample_stamp; uint64_t d_acq_sample_stamp;
// CN0 estimation and lock detector // CN0 estimation and lock detector
int d_cn0_estimation_counter; int d_cn0_estimation_counter;

View File

@ -58,7 +58,7 @@ using google::LogMessage;
gps_l1_ca_tcp_connector_tracking_cc_sptr gps_l1_ca_tcp_connector_tracking_cc_sptr
gps_l1_ca_tcp_connector_make_tracking_cc( gps_l1_ca_tcp_connector_make_tracking_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -81,7 +81,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::forecast(int noutput_items,
Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc( Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc(
long fs_in, int64_t fs_in,
unsigned int vector_length, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
@ -186,9 +186,9 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking()
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz; d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples; d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
long int acq_trk_diff_samples; int64_t acq_trk_diff_samples;
float acq_trk_diff_seconds; float acq_trk_diff_seconds;
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp);
std::cout << "acq_trk_diff_samples=" << acq_trk_diff_samples << std::endl; std::cout << "acq_trk_diff_samples=" << acq_trk_diff_samples << std::endl;
acq_trk_diff_seconds = static_cast<float>(acq_trk_diff_samples) / static_cast<float>(d_fs_in); acq_trk_diff_seconds = static_cast<float>(acq_trk_diff_samples) / static_cast<float>(d_fs_in);
//doppler effect //doppler effect
@ -535,7 +535,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
// PRN start sample stamp // PRN start sample stamp
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int)); d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
// accumulated carrier phase // accumulated carrier phase
tmp_float = d_acc_carrier_phase_rad; tmp_float = d_acc_carrier_phase_rad;
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float)); d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));

View File

@ -52,7 +52,7 @@ typedef boost::shared_ptr<Gps_L1_Ca_Tcp_Connector_Tracking_cc> gps_l1_ca_tcp_con
gps_l1_ca_tcp_connector_tracking_cc_sptr gps_l1_ca_tcp_connector_tracking_cc_sptr
gps_l1_ca_tcp_connector_make_tracking_cc( gps_l1_ca_tcp_connector_make_tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float early_late_space_chips, float early_late_space_chips,
@ -84,14 +84,14 @@ public:
private: private:
friend gps_l1_ca_tcp_connector_tracking_cc_sptr friend gps_l1_ca_tcp_connector_tracking_cc_sptr
gps_l1_ca_tcp_connector_make_tracking_cc( gps_l1_ca_tcp_connector_make_tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float early_late_space_chips, float early_late_space_chips,
size_t port_ch0); size_t port_ch0);
Gps_L1_Ca_Tcp_Connector_Tracking_cc( Gps_L1_Ca_Tcp_Connector_Tracking_cc(
long fs_in, unsigned int vector_length, int64_t fs_in, unsigned int vector_length,
bool dump, bool dump,
std::string dump_filename, std::string dump_filename,
float early_late_space_chips, float early_late_space_chips,
@ -104,7 +104,7 @@ private:
Gnss_Synchro *d_acquisition_gnss_synchro; Gnss_Synchro *d_acquisition_gnss_synchro;
unsigned int d_channel; unsigned int d_channel;
long d_fs_in; int64_t d_fs_in;
int d_correlation_length_samples; int d_correlation_length_samples;
int d_n_correlator_taps; int d_n_correlator_taps;
double d_early_late_spc_chips; double d_early_late_spc_chips;
@ -147,8 +147,8 @@ private:
double d_sample_counter_seconds; double d_sample_counter_seconds;
//processing samples counters //processing samples counters
unsigned long int d_sample_counter; uint64_t d_sample_counter;
unsigned long int d_acq_sample_stamp; uint64_t d_acq_sample_stamp;
// CN0 estimation and lock detector // CN0 estimation and lock detector
int d_cn0_estimation_counter; int d_cn0_estimation_counter;

View File

@ -450,9 +450,9 @@ void Galileo_Fnav_Message::decode_page(std::string data)
} }
unsigned long int Galileo_Fnav_Message::read_navigation_unsigned(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter) uint64_t Galileo_Fnav_Message::read_navigation_unsigned(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter)
{ {
unsigned long int value = 0; uint64_t value = 0;
int num_of_slices = parameter.size(); int num_of_slices = parameter.size();
for (int i = 0; i < num_of_slices; i++) for (int i = 0; i < num_of_slices; i++)
{ {
@ -469,12 +469,12 @@ unsigned long int Galileo_Fnav_Message::read_navigation_unsigned(std::bitset<GAL
} }
signed long int Galileo_Fnav_Message::read_navigation_signed(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter) int64_t Galileo_Fnav_Message::read_navigation_signed(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter)
{ {
signed long int value = 0; int64_t value = 0;
int num_of_slices = parameter.size(); int num_of_slices = parameter.size();
// Discriminate between 64 bits and 32 bits compiler // Discriminate between 64 bits and 32 bits compiler
int long_int_size_bytes = sizeof(signed long int); int long_int_size_bytes = sizeof(int64_t);
if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system
{ {
// read the MSB and perform the sign extension // read the MSB and perform the sign extension

View File

@ -45,6 +45,7 @@
#include "Galileo_E5a.h" #include "Galileo_E5a.h"
#include <boost/cstdint.hpp> // for boost::uint16_t #include <boost/cstdint.hpp> // for boost::uint16_t
#include <bitset> #include <bitset>
#include <cstdint>
#include <string> #include <string>
#include <vector> #include <vector>
#include <utility> #include <utility>
@ -213,8 +214,8 @@ public:
private: private:
bool _CRC_test(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, boost::uint32_t checksum); bool _CRC_test(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, boost::uint32_t checksum);
void decode_page(std::string data); void decode_page(std::string data);
unsigned long int read_navigation_unsigned(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter); uint64_t read_navigation_unsigned(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
signed long int read_navigation_signed(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter); int64_t read_navigation_signed(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
std::string omega0_1; std::string omega0_1;
//std::string omega0_2; //std::string omega0_2;

View File

@ -258,9 +258,9 @@ bool Galileo_Navigation_Message::CRC_test(std::bitset<GALILEO_DATA_FRAME_BITS> b
} }
unsigned long int Galileo_Navigation_Message::read_navigation_unsigned(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter) uint64_t Galileo_Navigation_Message::read_navigation_unsigned(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter)
{ {
unsigned long int value = 0; uint64_t value = 0;
int num_of_slices = parameter.size(); int num_of_slices = parameter.size();
for (int i = 0; i < num_of_slices; i++) for (int i = 0; i < num_of_slices; i++)
{ {
@ -277,9 +277,9 @@ unsigned long int Galileo_Navigation_Message::read_navigation_unsigned(std::bits
} }
unsigned long int Galileo_Navigation_Message::read_page_type_unsigned(std::bitset<GALILEO_PAGE_TYPE_BITS> bits, const std::vector<std::pair<int, int> > parameter) uint64_t Galileo_Navigation_Message::read_page_type_unsigned(std::bitset<GALILEO_PAGE_TYPE_BITS> bits, const std::vector<std::pair<int, int> > parameter)
{ {
unsigned long int value = 0; uint64_t value = 0;
int num_of_slices = parameter.size(); int num_of_slices = parameter.size();
for (int i = 0; i < num_of_slices; i++) for (int i = 0; i < num_of_slices; i++)
{ {
@ -296,12 +296,12 @@ unsigned long int Galileo_Navigation_Message::read_page_type_unsigned(std::bitse
} }
signed long int Galileo_Navigation_Message::read_navigation_signed(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter) int64_t Galileo_Navigation_Message::read_navigation_signed(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter)
{ {
signed long int value = 0; int64_t value = 0;
int num_of_slices = parameter.size(); int num_of_slices = parameter.size();
// Discriminate between 64 bits and 32 bits compiler // Discriminate between 64 bits and 32 bits compiler
int long_int_size_bytes = sizeof(signed long int); int long_int_size_bytes = sizeof(int64_t);
if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system
{ {
// read the MSB and perform the sign extension // read the MSB and perform the sign extension

View File

@ -38,8 +38,9 @@
#include "galileo_almanac.h" #include "galileo_almanac.h"
#include "galileo_utc_model.h" #include "galileo_utc_model.h"
#include "Galileo_E1.h" #include "Galileo_E1.h"
#include <boost/cstdint.hpp> // for boost::uint32_t //#include <boost/cstdint.hpp> // for boost::uint32_t
#include <bitset> #include <bitset>
#include <cstdint>
#include <map> #include <map>
#include <string> #include <string>
#include <utility> #include <utility>
@ -54,12 +55,12 @@
class Galileo_Navigation_Message class Galileo_Navigation_Message
{ {
private: private:
bool CRC_test(std::bitset<GALILEO_DATA_FRAME_BITS> bits, boost::uint32_t checksum); bool CRC_test(std::bitset<GALILEO_DATA_FRAME_BITS> bits, uint32_t checksum);
bool read_navigation_bool(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter); bool read_navigation_bool(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter);
//void print_galileo_word_bytes(unsigned int GPS_word); //void print_galileo_word_bytes(unsigned int GPS_word);
unsigned long int read_navigation_unsigned(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter); uint64_t read_navigation_unsigned(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter);
unsigned long int read_page_type_unsigned(std::bitset<GALILEO_PAGE_TYPE_BITS> bits, const std::vector<std::pair<int, int> > parameter); uint64_t read_page_type_unsigned(std::bitset<GALILEO_PAGE_TYPE_BITS> bits, const std::vector<std::pair<int, int> > parameter);
signed long int read_navigation_signed(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter); int64_t read_navigation_signed(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter);
public: public:
int Page_type_time_stamp; int Page_type_time_stamp;

View File

@ -228,9 +228,9 @@ bool Glonass_Gnav_Navigation_Message::read_navigation_bool(std::bitset<GLONASS_G
} }
unsigned long int Glonass_Gnav_Navigation_Message::read_navigation_unsigned(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter) uint64_t Glonass_Gnav_Navigation_Message::read_navigation_unsigned(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter)
{ {
unsigned long int value = 0; uint64_t value = 0;
int num_of_slices = parameter.size(); int num_of_slices = parameter.size();
for (int i = 0; i < num_of_slices; i++) for (int i = 0; i < num_of_slices; i++)
{ {
@ -247,10 +247,10 @@ unsigned long int Glonass_Gnav_Navigation_Message::read_navigation_unsigned(std:
} }
signed long int Glonass_Gnav_Navigation_Message::read_navigation_signed(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter) int64_t Glonass_Gnav_Navigation_Message::read_navigation_signed(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter)
{ {
signed long int value = 0; int64_t value = 0;
signed long int sign = 0; int64_t sign = 0;
int num_of_slices = parameter.size(); int num_of_slices = parameter.size();
// read the MSB and perform the sign extension // read the MSB and perform the sign extension
if (bits[GLONASS_GNAV_STRING_BITS - parameter[0].first] == 1) if (bits[GLONASS_GNAV_STRING_BITS - parameter[0].first] == 1)

View File

@ -40,6 +40,7 @@
#include "glonass_gnav_utc_model.h" #include "glonass_gnav_utc_model.h"
#include "GLONASS_L1_L2_CA.h" #include "GLONASS_L1_L2_CA.h"
#include <bitset> #include <bitset>
#include <cstdint>
/*! /*!
@ -50,8 +51,8 @@
class Glonass_Gnav_Navigation_Message class Glonass_Gnav_Navigation_Message
{ {
private: private:
unsigned long int read_navigation_unsigned(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter); uint64_t read_navigation_unsigned(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter);
signed long int read_navigation_signed(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter); int64_t read_navigation_signed(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter);
bool read_navigation_bool(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter); bool read_navigation_bool(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter);
public: public:

View File

@ -33,7 +33,7 @@
#define GNSS_SDR_GNSS_SYNCHRO_H_ #define GNSS_SDR_GNSS_SYNCHRO_H_
#include "gnss_signal.h" #include "gnss_signal.h"
#include <cstdint>
/*! /*!
* \brief This is the class that contains the information that is shared * \brief This is the class that contains the information that is shared
@ -45,29 +45,29 @@ public:
// Satellite and signal info // Satellite and signal info
char System; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) char System; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal)
char Signal[3]; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) char Signal[3]; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal)
unsigned int PRN; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) uint32_t PRN; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal)
int Channel_ID; //!< Set by Channel constructor int32_t Channel_ID; //!< Set by Channel constructor
// Acquisition // Acquisition
double Acq_delay_samples; //!< Set by Acquisition processing block double Acq_delay_samples; //!< Set by Acquisition processing block
double Acq_doppler_hz; //!< Set by Acquisition processing block double Acq_doppler_hz; //!< Set by Acquisition processing block
unsigned long int Acq_samplestamp_samples; //!< Set by Acquisition processing block uint64_t Acq_samplestamp_samples; //!< Set by Acquisition processing block
bool Flag_valid_acquisition; //!< Set by Acquisition processing block bool Flag_valid_acquisition; //!< Set by Acquisition processing block
//Tracking //Tracking
long int fs; //!< Set by Tracking processing block int64_t fs; //!< Set by Tracking processing block
double Prompt_I; //!< Set by Tracking processing block double Prompt_I; //!< Set by Tracking processing block
double Prompt_Q; //!< Set by Tracking processing block double Prompt_Q; //!< Set by Tracking processing block
double CN0_dB_hz; //!< Set by Tracking processing block double CN0_dB_hz; //!< Set by Tracking processing block
double Carrier_Doppler_hz; //!< Set by Tracking processing block double Carrier_Doppler_hz; //!< Set by Tracking processing block
double Carrier_phase_rads; //!< Set by Tracking processing block double Carrier_phase_rads; //!< Set by Tracking processing block
double Code_phase_samples; //!< Set by Tracking processing block double Code_phase_samples; //!< Set by Tracking processing block
unsigned long int Tracking_sample_counter; //!< Set by Tracking processing block uint64_t Tracking_sample_counter; //!< Set by Tracking processing block
bool Flag_valid_symbol_output; //!< Set by Tracking processing block bool Flag_valid_symbol_output; //!< Set by Tracking processing block
int correlation_length_ms; //!< Set by Tracking processing block int32_t correlation_length_ms; //!< Set by Tracking processing block
//Telemetry Decoder //Telemetry Decoder
bool Flag_valid_word; //!< Set by Telemetry Decoder processing block bool Flag_valid_word; //!< Set by Telemetry Decoder processing block
unsigned int TOW_at_current_symbol_ms; //!< Set by Telemetry Decoder processing block uint32_t TOW_at_current_symbol_ms; //!< Set by Telemetry Decoder processing block
// Observables // Observables
double Pseudorange_m; //!< Set by Observables processing block double Pseudorange_m; //!< Set by Observables processing block

View File

@ -88,9 +88,9 @@ bool Gps_CNAV_Navigation_Message::read_navigation_bool(std::bitset<GPS_CNAV_DATA
} }
unsigned long int Gps_CNAV_Navigation_Message::read_navigation_unsigned(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter) uint64_t Gps_CNAV_Navigation_Message::read_navigation_unsigned(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter)
{ {
unsigned long int value = 0; uint64_t value = 0;
int num_of_slices = parameter.size(); int num_of_slices = parameter.size();
for (int i = 0; i < num_of_slices; i++) for (int i = 0; i < num_of_slices; i++)
{ {
@ -107,12 +107,12 @@ unsigned long int Gps_CNAV_Navigation_Message::read_navigation_unsigned(std::bit
} }
signed long int Gps_CNAV_Navigation_Message::read_navigation_signed(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter) int64_t Gps_CNAV_Navigation_Message::read_navigation_signed(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter)
{ {
signed long int value = 0; int64_t value = 0;
int num_of_slices = parameter.size(); int num_of_slices = parameter.size();
// Discriminate between 64 bits and 32 bits compiler // Discriminate between 64 bits and 32 bits compiler
int long_int_size_bytes = sizeof(signed long int); int long_int_size_bytes = sizeof(int64_t);
if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system
{ {
// read the MSB and perform the sign extension // read the MSB and perform the sign extension

View File

@ -38,6 +38,7 @@
#include "gps_cnav_iono.h" #include "gps_cnav_iono.h"
#include "gps_cnav_utc_model.h" #include "gps_cnav_utc_model.h"
#include <bitset> #include <bitset>
#include <cstdint>
#include <map> #include <map>
#include <string> #include <string>
#include <vector> #include <vector>
@ -55,8 +56,8 @@
class Gps_CNAV_Navigation_Message class Gps_CNAV_Navigation_Message
{ {
private: private:
unsigned long int read_navigation_unsigned(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter); uint64_t read_navigation_unsigned(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter);
signed long int read_navigation_signed(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter); int64_t read_navigation_signed(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter);
bool read_navigation_bool(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter); bool read_navigation_bool(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter);
Gps_CNAV_Ephemeris ephemeris_record; Gps_CNAV_Ephemeris ephemeris_record;

View File

@ -176,9 +176,9 @@ bool Gps_Navigation_Message::read_navigation_bool(std::bitset<GPS_SUBFRAME_BITS>
} }
unsigned long int Gps_Navigation_Message::read_navigation_unsigned(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter) uint64_t Gps_Navigation_Message::read_navigation_unsigned(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter)
{ {
unsigned long int value = 0; uint64_t value = 0;
int num_of_slices = parameter.size(); int num_of_slices = parameter.size();
for (int i = 0; i < num_of_slices; i++) for (int i = 0; i < num_of_slices; i++)
{ {
@ -195,12 +195,12 @@ unsigned long int Gps_Navigation_Message::read_navigation_unsigned(std::bitset<G
} }
signed long int Gps_Navigation_Message::read_navigation_signed(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter) int64_t Gps_Navigation_Message::read_navigation_signed(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter)
{ {
signed long int value = 0; int64_t value = 0;
int num_of_slices = parameter.size(); int num_of_slices = parameter.size();
// Discriminate between 64 bits and 32 bits compiler // Discriminate between 64 bits and 32 bits compiler
int long_int_size_bytes = sizeof(signed long int); int long_int_size_bytes = sizeof(int64_t);
if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system
{ {
// read the MSB and perform the sign extension // read the MSB and perform the sign extension
@ -385,7 +385,9 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
if (SV_page > 24 && SV_page < 33) // Page 4 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) if (SV_page > 24 && SV_page < 33) // Page 4 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
{ {
//! \TODO read almanac //! \TODO read almanac
if(SV_data_ID){} if (SV_data_ID)
{
}
} }
if (SV_page == 52) // Page 13 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) if (SV_page == 52) // Page 13 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
@ -461,7 +463,9 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
if (SV_page_5 < 25) if (SV_page_5 < 25)
{ {
//! \TODO read almanac //! \TODO read almanac
if(SV_data_ID_5){} if (SV_data_ID_5)
{
}
} }
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) 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)
{ {

View File

@ -39,6 +39,7 @@
#include "gps_almanac.h" #include "gps_almanac.h"
#include "gps_utc_model.h" #include "gps_utc_model.h"
#include <bitset> #include <bitset>
#include <cstdint>
#include <map> #include <map>
#include <string> #include <string>
#include <utility> #include <utility>
@ -53,8 +54,8 @@
class Gps_Navigation_Message class Gps_Navigation_Message
{ {
private: private:
unsigned long int read_navigation_unsigned(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter); uint64_t read_navigation_unsigned(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
signed long int read_navigation_signed(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter); int64_t read_navigation_signed(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
bool read_navigation_bool(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter); bool read_navigation_bool(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
void print_gps_word_bytes(unsigned int GPS_word); void print_gps_word_bytes(unsigned int GPS_word);

View File

@ -195,7 +195,7 @@ std::string Rtcm::bin_to_binary_data(const std::string& s) const
{ {
s_aux.assign(s, 0, remainder); s_aux.assign(s, 0, remainder);
boost::dynamic_bitset<> rembits(s_aux); boost::dynamic_bitset<> rembits(s_aux);
unsigned long int n = rembits.to_ulong(); uint64_t n = rembits.to_ulong();
c[0] = static_cast<unsigned char>(n); c[0] = static_cast<unsigned char>(n);
k++; k++;
} }
@ -270,7 +270,7 @@ std::string Rtcm::hex_to_bin(const std::string& s) const
std::string s_lower = boost::to_upper_copy(ss.str()); std::string s_lower = boost::to_upper_copy(ss.str());
for (unsigned int i = 0; i < s.length(); i++) for (unsigned int i = 0; i < s.length(); i++)
{ {
unsigned long int n; uint64_t n;
std::istringstream(s_lower.substr(i, 1)) >> std::hex >> n; std::istringstream(s_lower.substr(i, 1)) >> std::hex >> n;
std::bitset<4> bs(n); std::bitset<4> bs(n);
s_aux += bs.to_string(); s_aux += bs.to_string();
@ -279,26 +279,26 @@ std::string Rtcm::hex_to_bin(const std::string& s) const
} }
unsigned long int Rtcm::bin_to_uint(const std::string& s) const uint64_t Rtcm::bin_to_uint(const std::string& s) const
{ {
if (s.length() > 32) if (s.length() > 32)
{ {
LOG(WARNING) << "Cannot convert to a unsigned long int"; LOG(WARNING) << "Cannot convert to a uint64_t";
return 0; return 0;
} }
unsigned long int reading = strtoul(s.c_str(), NULL, 2); uint64_t reading = strtoul(s.c_str(), NULL, 2);
return reading; return reading;
} }
long int Rtcm::bin_to_int(const std::string& s) const int64_t Rtcm::bin_to_int(const std::string& s) const
{ {
if (s.length() > 32) if (s.length() > 32)
{ {
LOG(WARNING) << "Cannot convert to a long int"; LOG(WARNING) << "Cannot convert to a int64_t";
return 0; return 0;
} }
long int reading; int64_t reading;
// Handle negative numbers // Handle negative numbers
if (s.substr(0, 1).compare("0")) if (s.substr(0, 1).compare("0"))
@ -316,15 +316,15 @@ long int Rtcm::bin_to_int(const std::string& s) const
} }
long int Rtcm::bin_to_sint(const std::string& s) const int64_t Rtcm::bin_to_sint(const std::string& s) const
{ {
if (s.length() > 32) if (s.length() > 32)
{ {
LOG(WARNING) << "Cannot convert to a long int"; LOG(WARNING) << "Cannot convert to a int64_t";
return 0; return 0;
} }
long int reading; int64_t reading;
long int sign; int64_t sign;
// Check for sign bit as defined RTCM doc // Check for sign bit as defined RTCM doc
if (s.substr(0, 1).compare("0") == 0) if (s.substr(0, 1).compare("0") == 0)
@ -343,7 +343,7 @@ long int Rtcm::bin_to_sint(const std::string& s) const
} }
// Find the sign for glonass data fields (neg = 1, pos = 0) // Find the sign for glonass data fields (neg = 1, pos = 0)
static inline unsigned long glo_sgn(double val) static inline uint64_t glo_sgn(double val)
{ {
if (val < 0) return 1; // If value is negative return 1 if (val < 0) return 1; // If value is negative return 1
if (val == 0) return 0; // Positive or equal to zero return 0 if (val == 0) return 0; // Positive or equal to zero return 0
@ -360,7 +360,7 @@ double Rtcm::bin_to_double(const std::string& s) const
return 0; return 0;
} }
long long int reading_int; int64_t reading_int;
// Handle negative numbers // Handle negative numbers
if (s.substr(0, 1).compare("0")) if (s.substr(0, 1).compare("0"))
@ -382,26 +382,26 @@ double Rtcm::bin_to_double(const std::string& s) const
} }
unsigned long int Rtcm::hex_to_uint(const std::string& s) const uint64_t Rtcm::hex_to_uint(const std::string& s) const
{ {
if (s.length() > 32) if (s.length() > 32)
{ {
LOG(WARNING) << "Cannot convert to a unsigned long int"; LOG(WARNING) << "Cannot convert to a uint64_t";
return 0; return 0;
} }
unsigned long int reading = strtoul(s.c_str(), NULL, 16); uint64_t reading = strtoul(s.c_str(), NULL, 16);
return reading; return reading;
} }
long int Rtcm::hex_to_int(const std::string& s) const int64_t Rtcm::hex_to_int(const std::string& s) const
{ {
if (s.length() > 32) if (s.length() > 32)
{ {
LOG(WARNING) << "Cannot convert to a long int"; LOG(WARNING) << "Cannot convert to a int64_t";
return 0; return 0;
} }
long int reading = strtol(s.c_str(), NULL, 16); int64_t reading = strtol(s.c_str(), NULL, 16);
return reading; return reading;
} }
@ -3560,7 +3560,7 @@ int Rtcm::set_DF003(unsigned int ref_station_ID)
int Rtcm::set_DF004(double obs_time) int Rtcm::set_DF004(double obs_time)
{ {
// TOW in milliseconds from the beginning of the GPS week, measured in GPS time // TOW in milliseconds from the beginning of the GPS week, measured in GPS time
unsigned long int tow = static_cast<unsigned long int>(std::round(obs_time * 1000)); uint64_t tow = static_cast<uint64_t>(std::round(obs_time * 1000));
if (tow > 604799999) if (tow > 604799999)
{ {
LOG(WARNING) << "To large TOW! Set to the last millisecond of the week"; LOG(WARNING) << "To large TOW! Set to the last millisecond of the week";
@ -3651,7 +3651,7 @@ int Rtcm::set_DF010(bool code_indicator)
int Rtcm::set_DF011(const Gnss_Synchro& gnss_synchro) int Rtcm::set_DF011(const Gnss_Synchro& gnss_synchro)
{ {
double ambiguity = std::floor(gnss_synchro.Pseudorange_m / 299792.458); double ambiguity = std::floor(gnss_synchro.Pseudorange_m / 299792.458);
unsigned long int gps_L1_pseudorange = static_cast<unsigned long int>(std::round((gnss_synchro.Pseudorange_m - ambiguity * 299792.458) / 0.02)); uint64_t gps_L1_pseudorange = static_cast<uint64_t>(std::round((gnss_synchro.Pseudorange_m - ambiguity * 299792.458) / 0.02));
DF011 = std::bitset<24>(gps_L1_pseudorange); DF011 = std::bitset<24>(gps_L1_pseudorange);
return 0; return 0;
} }
@ -3665,7 +3665,7 @@ int Rtcm::set_DF012(const Gnss_Synchro& gnss_synchro)
double gps_L1_pseudorange_c = gps_L1_pseudorange * 0.02 + ambiguity * 299792.458; double gps_L1_pseudorange_c = gps_L1_pseudorange * 0.02 + ambiguity * 299792.458;
double L1_phaserange_c = gnss_synchro.Carrier_phase_rads / GPS_TWO_PI; double L1_phaserange_c = gnss_synchro.Carrier_phase_rads / GPS_TWO_PI;
double L1_phaserange_c_r = std::fmod(L1_phaserange_c - gps_L1_pseudorange_c / lambda + 1500.0, 3000.0) - 1500.0; double L1_phaserange_c_r = std::fmod(L1_phaserange_c - gps_L1_pseudorange_c / lambda + 1500.0, 3000.0) - 1500.0;
long int gps_L1_phaserange_minus_L1_pseudorange = static_cast<long int>(std::round(L1_phaserange_c_r * lambda / 0.0005)); int64_t gps_L1_phaserange_minus_L1_pseudorange = static_cast<int64_t>(std::round(L1_phaserange_c_r * lambda / 0.0005));
DF012 = std::bitset<20>(gps_L1_phaserange_minus_L1_pseudorange); DF012 = std::bitset<20>(gps_L1_phaserange_minus_L1_pseudorange);
return 0; return 0;
} }
@ -3792,7 +3792,7 @@ int Rtcm::set_DF024(bool galileo_indicator)
int Rtcm::set_DF025(double antenna_ECEF_X_m) int Rtcm::set_DF025(double antenna_ECEF_X_m)
{ {
long long int ant_ref_x = static_cast<long long int>(std::round(antenna_ECEF_X_m * 10000)); int64_t ant_ref_x = static_cast<int64_t>(std::round(antenna_ECEF_X_m * 10000));
DF025 = std::bitset<38>(ant_ref_x); DF025 = std::bitset<38>(ant_ref_x);
return 0; return 0;
} }
@ -3800,7 +3800,7 @@ int Rtcm::set_DF025(double antenna_ECEF_X_m)
int Rtcm::set_DF026(double antenna_ECEF_Y_m) int Rtcm::set_DF026(double antenna_ECEF_Y_m)
{ {
long long int ant_ref_y = static_cast<long long int>(std::round(antenna_ECEF_Y_m * 10000)); int64_t ant_ref_y = static_cast<int64_t>(std::round(antenna_ECEF_Y_m * 10000));
DF026 = std::bitset<38>(ant_ref_y); DF026 = std::bitset<38>(ant_ref_y);
return 0; return 0;
} }
@ -3808,7 +3808,7 @@ int Rtcm::set_DF026(double antenna_ECEF_Y_m)
int Rtcm::set_DF027(double antenna_ECEF_Z_m) int Rtcm::set_DF027(double antenna_ECEF_Z_m)
{ {
long long int ant_ref_z = static_cast<long long int>(std::round(antenna_ECEF_Z_m * 10000)); int64_t ant_ref_z = static_cast<int64_t>(std::round(antenna_ECEF_Z_m * 10000));
DF027 = std::bitset<38>(ant_ref_z); DF027 = std::bitset<38>(ant_ref_z);
return 0; return 0;
} }
@ -3832,7 +3832,7 @@ int Rtcm::set_DF031(unsigned int antenna_setup_id)
int Rtcm::set_DF034(double obs_time) int Rtcm::set_DF034(double obs_time)
{ {
// TOW in milliseconds from the beginning of the GLONASS day, measured in GLONASS time // TOW in milliseconds from the beginning of the GLONASS day, measured in GLONASS time
unsigned long int tk = static_cast<unsigned long int>(std::round(obs_time * 1000)); uint64_t tk = static_cast<uint64_t>(std::round(obs_time * 1000));
if (tk > 86400999) if (tk > 86400999)
{ {
LOG(WARNING) << "To large GLONASS Epoch Time (tk)! Set to the last millisecond of the day"; LOG(WARNING) << "To large GLONASS Epoch Time (tk)! Set to the last millisecond of the day";
@ -3943,7 +3943,7 @@ int Rtcm::set_DF040(const Glonass_Gnav_Ephemeris& glonass_gnav_eph)
int Rtcm::set_DF041(const Gnss_Synchro& gnss_synchro) int Rtcm::set_DF041(const Gnss_Synchro& gnss_synchro)
{ {
double ambiguity = std::floor(gnss_synchro.Pseudorange_m / 599584.92); double ambiguity = std::floor(gnss_synchro.Pseudorange_m / 599584.92);
unsigned long int glonass_L1_pseudorange = static_cast<unsigned long int>(std::round((gnss_synchro.Pseudorange_m - ambiguity * 599584.92) / 0.02)); uint64_t glonass_L1_pseudorange = static_cast<uint64_t>(std::round((gnss_synchro.Pseudorange_m - ambiguity * 599584.92) / 0.02));
DF041 = std::bitset<25>(glonass_L1_pseudorange); DF041 = std::bitset<25>(glonass_L1_pseudorange);
return 0; return 0;
} }
@ -3957,7 +3957,7 @@ int Rtcm::set_DF042(const Gnss_Synchro& gnss_synchro)
double glonass_L1_pseudorange_c = glonass_L1_pseudorange * 0.02 + ambiguity * 299792.458; double glonass_L1_pseudorange_c = glonass_L1_pseudorange * 0.02 + ambiguity * 299792.458;
double L1_phaserange_c = gnss_synchro.Carrier_phase_rads / GLONASS_TWO_PI; double L1_phaserange_c = gnss_synchro.Carrier_phase_rads / GLONASS_TWO_PI;
double L1_phaserange_c_r = std::fmod(L1_phaserange_c - glonass_L1_pseudorange_c / lambda + 1500.0, 3000.0) - 1500.0; double L1_phaserange_c_r = std::fmod(L1_phaserange_c - glonass_L1_pseudorange_c / lambda + 1500.0, 3000.0) - 1500.0;
long int glonass_L1_phaserange_minus_L1_pseudorange = static_cast<long int>(std::round(L1_phaserange_c_r * lambda / 0.0005)); int64_t glonass_L1_phaserange_minus_L1_pseudorange = static_cast<int64_t>(std::round(L1_phaserange_c_r * lambda / 0.0005));
DF042 = std::bitset<20>(glonass_L1_phaserange_minus_L1_pseudorange); DF042 = std::bitset<20>(glonass_L1_phaserange_minus_L1_pseudorange);
return 0; return 0;
} }
@ -4058,7 +4058,7 @@ int Rtcm::set_DF050(const Gnss_Synchro& gnss_synchro)
int Rtcm::set_DF051(const Gps_Ephemeris& gps_eph, double obs_time) int Rtcm::set_DF051(const Gps_Ephemeris& gps_eph, double obs_time)
{ {
const double gps_t = obs_time; const double gps_t = obs_time;
boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast<long>((gps_t + 604800 * static_cast<double>(gps_eph.i_GPS_week % 1024)) * 1000)); boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast<int64_t>((gps_t + 604800 * static_cast<double>(gps_eph.i_GPS_week % 1024)) * 1000));
boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t);
std::string now_ptime = to_iso_string(p_time); std::string now_ptime = to_iso_string(p_time);
std::string today_ptime = now_ptime.substr(0, 8); std::string today_ptime = now_ptime.substr(0, 8);
@ -4072,14 +4072,14 @@ int Rtcm::set_DF051(const Gps_Ephemeris& gps_eph, double obs_time)
int Rtcm::set_DF052(const Gps_Ephemeris& gps_eph, double obs_time) int Rtcm::set_DF052(const Gps_Ephemeris& gps_eph, double obs_time)
{ {
const double gps_t = obs_time; const double gps_t = obs_time;
boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast<long>((gps_t + 604800 * static_cast<double>(gps_eph.i_GPS_week % 1024)) * 1000)); boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast<int64_t>((gps_t + 604800 * static_cast<double>(gps_eph.i_GPS_week % 1024)) * 1000));
boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t);
std::string now_ptime = to_iso_string(p_time); std::string now_ptime = to_iso_string(p_time);
std::string hours = now_ptime.substr(9, 2); std::string hours = now_ptime.substr(9, 2);
std::string minutes = now_ptime.substr(11, 2); std::string minutes = now_ptime.substr(11, 2);
std::string seconds = now_ptime.substr(13, 8); std::string seconds = now_ptime.substr(13, 8);
//boost::gregorian::date d(boost::gregorian::from_undelimited_string(today_ptime)); //boost::gregorian::date d(boost::gregorian::from_undelimited_string(today_ptime));
long unsigned int seconds_of_day = boost::lexical_cast<unsigned int>(hours) * 60 * 60 + boost::lexical_cast<unsigned int>(minutes) * 60 + boost::lexical_cast<unsigned int>(seconds); uint64_t seconds_of_day = boost::lexical_cast<unsigned int>(hours) * 60 * 60 + boost::lexical_cast<unsigned int>(minutes) * 60 + boost::lexical_cast<unsigned int>(seconds);
DF052 = std::bitset<17>(seconds_of_day); DF052 = std::bitset<17>(seconds_of_day);
return 0; return 0;
} }
@ -4159,7 +4159,7 @@ int Rtcm::set_DF083(const Gps_Ephemeris& gps_eph)
int Rtcm::set_DF084(const Gps_Ephemeris& gps_eph) int Rtcm::set_DF084(const Gps_Ephemeris& gps_eph)
{ {
long int af0 = static_cast<long int>(std::round(gps_eph.d_A_f0 / A_F0_LSB)); int64_t af0 = static_cast<int64_t>(std::round(gps_eph.d_A_f0 / A_F0_LSB));
DF084 = std::bitset<22>(af0); DF084 = std::bitset<22>(af0);
return 0; return 0;
} }
@ -4191,7 +4191,7 @@ int Rtcm::set_DF087(const Gps_Ephemeris& gps_eph)
int Rtcm::set_DF088(const Gps_Ephemeris& gps_eph) int Rtcm::set_DF088(const Gps_Ephemeris& gps_eph)
{ {
long int m0 = static_cast<long int>(std::round(gps_eph.d_M_0 / M_0_LSB)); int64_t m0 = static_cast<int64_t>(std::round(gps_eph.d_M_0 / M_0_LSB));
DF088 = std::bitset<32>(m0); DF088 = std::bitset<32>(m0);
return 0; return 0;
} }
@ -4206,7 +4206,7 @@ int Rtcm::set_DF089(const Gps_Ephemeris& gps_eph)
int Rtcm::set_DF090(const Gps_Ephemeris& gps_eph) int Rtcm::set_DF090(const Gps_Ephemeris& gps_eph)
{ {
unsigned long int ecc = static_cast<unsigned long int>(std::round(gps_eph.d_e_eccentricity / E_LSB)); uint64_t ecc = static_cast<uint64_t>(std::round(gps_eph.d_e_eccentricity / E_LSB));
DF090 = std::bitset<32>(ecc); DF090 = std::bitset<32>(ecc);
return 0; return 0;
} }
@ -4222,7 +4222,7 @@ int Rtcm::set_DF091(const Gps_Ephemeris& gps_eph)
int Rtcm::set_DF092(const Gps_Ephemeris& gps_eph) int Rtcm::set_DF092(const Gps_Ephemeris& gps_eph)
{ {
unsigned long int sqr_a = static_cast<unsigned long int>(std::round(gps_eph.d_sqrt_A / SQRT_A_LSB)); uint64_t sqr_a = static_cast<uint64_t>(std::round(gps_eph.d_sqrt_A / SQRT_A_LSB));
DF092 = std::bitset<32>(sqr_a); DF092 = std::bitset<32>(sqr_a);
return 0; return 0;
} }
@ -4246,7 +4246,7 @@ int Rtcm::set_DF094(const Gps_Ephemeris& gps_eph)
int Rtcm::set_DF095(const Gps_Ephemeris& gps_eph) int Rtcm::set_DF095(const Gps_Ephemeris& gps_eph)
{ {
long int Omega0 = static_cast<long int>(std::round(gps_eph.d_OMEGA0 / OMEGA_0_LSB)); int64_t Omega0 = static_cast<int64_t>(std::round(gps_eph.d_OMEGA0 / OMEGA_0_LSB));
DF095 = std::bitset<32>(Omega0); DF095 = std::bitset<32>(Omega0);
return 0; return 0;
} }
@ -4262,7 +4262,7 @@ int Rtcm::set_DF096(const Gps_Ephemeris& gps_eph)
int Rtcm::set_DF097(const Gps_Ephemeris& gps_eph) int Rtcm::set_DF097(const Gps_Ephemeris& gps_eph)
{ {
long int i0 = static_cast<long int>(std::round(gps_eph.d_i_0 / I_0_LSB)); int64_t i0 = static_cast<int64_t>(std::round(gps_eph.d_i_0 / I_0_LSB));
DF097 = std::bitset<32>(i0); DF097 = std::bitset<32>(i0);
return 0; return 0;
} }
@ -4278,7 +4278,7 @@ int Rtcm::set_DF098(const Gps_Ephemeris& gps_eph)
int Rtcm::set_DF099(const Gps_Ephemeris& gps_eph) int Rtcm::set_DF099(const Gps_Ephemeris& gps_eph)
{ {
long int omega = static_cast<long int>(std::round(gps_eph.d_OMEGA / OMEGA_LSB)); int64_t omega = static_cast<int64_t>(std::round(gps_eph.d_OMEGA / OMEGA_LSB));
DF099 = std::bitset<32>(omega); DF099 = std::bitset<32>(omega);
return 0; return 0;
} }
@ -4286,7 +4286,7 @@ int Rtcm::set_DF099(const Gps_Ephemeris& gps_eph)
int Rtcm::set_DF100(const Gps_Ephemeris& gps_eph) int Rtcm::set_DF100(const Gps_Ephemeris& gps_eph)
{ {
long int omegadot = static_cast<long int>(std::round(gps_eph.d_OMEGA_DOT / OMEGA_DOT_LSB)); int64_t omegadot = static_cast<int64_t>(std::round(gps_eph.d_OMEGA_DOT / OMEGA_DOT_LSB));
DF100 = std::bitset<24>(omegadot); DF100 = std::bitset<24>(omegadot);
return 0; return 0;
} }
@ -4636,7 +4636,7 @@ int Rtcm::set_DF137(const Gps_Ephemeris& gps_eph)
int Rtcm::set_DF248(double obs_time) int Rtcm::set_DF248(double obs_time)
{ {
// TOW in milliseconds from the beginning of the Galileo week, measured in Galileo time // TOW in milliseconds from the beginning of the Galileo week, measured in Galileo time
unsigned long int tow = static_cast<unsigned long int>(std::round(obs_time * 1000)); uint64_t tow = static_cast<uint64_t>(std::round(obs_time * 1000));
if (tow > 604799999) if (tow > 604799999)
{ {
LOG(WARNING) << "To large TOW! Set to the last millisecond of the week"; LOG(WARNING) << "To large TOW! Set to the last millisecond of the week";
@ -4722,7 +4722,7 @@ int Rtcm::set_DF294(const Galileo_Ephemeris& gal_eph)
int Rtcm::set_DF295(const Galileo_Ephemeris& gal_eph) int Rtcm::set_DF295(const Galileo_Ephemeris& gal_eph)
{ {
long int af1 = static_cast<long int>(std::round(gal_eph.af1_4 / FNAV_af1_1_LSB)); int64_t af1 = static_cast<int64_t>(std::round(gal_eph.af1_4 / FNAV_af1_1_LSB));
DF295 = std::bitset<21>(af1); DF295 = std::bitset<21>(af1);
return 0; return 0;
} }
@ -4730,7 +4730,7 @@ int Rtcm::set_DF295(const Galileo_Ephemeris& gal_eph)
int Rtcm::set_DF296(const Galileo_Ephemeris& gal_eph) int Rtcm::set_DF296(const Galileo_Ephemeris& gal_eph)
{ {
long int af0 = static_cast<unsigned int>(std::round(gal_eph.af0_4 / FNAV_af0_1_LSB)); int64_t af0 = static_cast<unsigned int>(std::round(gal_eph.af0_4 / FNAV_af0_1_LSB));
DF296 = std::bitset<31>(af0); DF296 = std::bitset<31>(af0);
return 0; return 0;
} }
@ -4754,7 +4754,7 @@ int Rtcm::set_DF298(const Galileo_Ephemeris& gal_eph)
int Rtcm::set_DF299(const Galileo_Ephemeris& gal_eph) int Rtcm::set_DF299(const Galileo_Ephemeris& gal_eph)
{ {
long int m0 = static_cast<long int>(std::round(gal_eph.M0_1 / FNAV_M0_2_LSB)); int64_t m0 = static_cast<int64_t>(std::round(gal_eph.M0_1 / FNAV_M0_2_LSB));
DF299 = std::bitset<32>(m0); DF299 = std::bitset<32>(m0);
return 0; return 0;
} }
@ -4770,7 +4770,7 @@ int Rtcm::set_DF300(const Galileo_Ephemeris& gal_eph)
int Rtcm::set_DF301(const Galileo_Ephemeris& gal_eph) int Rtcm::set_DF301(const Galileo_Ephemeris& gal_eph)
{ {
unsigned long int ecc = static_cast<unsigned long int>(std::round(gal_eph.e_1 / FNAV_e_2_LSB)); uint64_t ecc = static_cast<uint64_t>(std::round(gal_eph.e_1 / FNAV_e_2_LSB));
DF301 = std::bitset<32>(ecc); DF301 = std::bitset<32>(ecc);
return 0; return 0;
} }
@ -4786,7 +4786,7 @@ int Rtcm::set_DF302(const Galileo_Ephemeris& gal_eph)
int Rtcm::set_DF303(const Galileo_Ephemeris& gal_eph) int Rtcm::set_DF303(const Galileo_Ephemeris& gal_eph)
{ {
unsigned long int sqr_a = static_cast<unsigned long int>(std::round(gal_eph.A_1 / FNAV_a12_2_LSB)); uint64_t sqr_a = static_cast<uint64_t>(std::round(gal_eph.A_1 / FNAV_a12_2_LSB));
DF303 = std::bitset<32>(sqr_a); DF303 = std::bitset<32>(sqr_a);
return 0; return 0;
} }
@ -4810,7 +4810,7 @@ int Rtcm::set_DF305(const Galileo_Ephemeris& gal_eph)
int Rtcm::set_DF306(const Galileo_Ephemeris& gal_eph) int Rtcm::set_DF306(const Galileo_Ephemeris& gal_eph)
{ {
long int Omega0 = static_cast<long int>(std::round(gal_eph.OMEGA_0_2 / FNAV_omega0_2_LSB)); int64_t Omega0 = static_cast<int64_t>(std::round(gal_eph.OMEGA_0_2 / FNAV_omega0_2_LSB));
DF306 = std::bitset<32>(Omega0); DF306 = std::bitset<32>(Omega0);
return 0; return 0;
} }
@ -4826,7 +4826,7 @@ int Rtcm::set_DF307(const Galileo_Ephemeris& gal_eph)
int Rtcm::set_DF308(const Galileo_Ephemeris& gal_eph) int Rtcm::set_DF308(const Galileo_Ephemeris& gal_eph)
{ {
long int i0 = static_cast<long int>(std::round(gal_eph.i_0_2 / FNAV_i0_3_LSB)); int64_t i0 = static_cast<int64_t>(std::round(gal_eph.i_0_2 / FNAV_i0_3_LSB));
DF308 = std::bitset<32>(i0); DF308 = std::bitset<32>(i0);
return 0; return 0;
} }
@ -4850,7 +4850,7 @@ int Rtcm::set_DF310(const Galileo_Ephemeris& gal_eph)
int Rtcm::set_DF311(const Galileo_Ephemeris& gal_eph) int Rtcm::set_DF311(const Galileo_Ephemeris& gal_eph)
{ {
long int Omegadot = static_cast<long int>(std::round(gal_eph.OMEGA_dot_3 / FNAV_omegadot_2_LSB)); int64_t Omegadot = static_cast<int64_t>(std::round(gal_eph.OMEGA_dot_3 / FNAV_omegadot_2_LSB));
DF311 = std::bitset<24>(Omegadot); DF311 = std::bitset<24>(Omegadot);
return 0; return 0;
} }
@ -5226,7 +5226,7 @@ int Rtcm::set_DF401(const Gnss_Synchro& gnss_synchro)
double meters_to_miliseconds = GPS_C_m_s * 0.001; double meters_to_miliseconds = GPS_C_m_s * 0.001;
double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10; double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10;
double phrng_m; double phrng_m;
long int fine_phaserange; int64_t fine_phaserange;
double lambda = 0.0; double lambda = 0.0;
std::string sig_(gnss_synchro.Signal); std::string sig_(gnss_synchro.Signal);
@ -5284,7 +5284,7 @@ int Rtcm::set_DF401(const Gnss_Synchro& gnss_synchro)
} }
else else
{ {
fine_phaserange = static_cast<long int>(std::round(phrng_m / meters_to_miliseconds / TWO_N29)); fine_phaserange = static_cast<int64_t>(std::round(phrng_m / meters_to_miliseconds / TWO_N29));
} }
DF401 = std::bitset<22>(fine_phaserange); DF401 = std::bitset<22>(fine_phaserange);
@ -5397,7 +5397,7 @@ int Rtcm::set_DF405(const Gnss_Synchro& gnss_synchro)
double meters_to_miliseconds = GPS_C_m_s * 0.001; double meters_to_miliseconds = GPS_C_m_s * 0.001;
double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10; double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10;
double psrng_s; double psrng_s;
long int fine_pseudorange; int64_t fine_pseudorange;
psrng_s = gnss_synchro.Pseudorange_m - rough_range_m; psrng_s = gnss_synchro.Pseudorange_m - rough_range_m;
@ -5411,7 +5411,7 @@ int Rtcm::set_DF405(const Gnss_Synchro& gnss_synchro)
} }
else else
{ {
fine_pseudorange = static_cast<long int>(std::round(psrng_s / meters_to_miliseconds / TWO_N29)); fine_pseudorange = static_cast<int64_t>(std::round(psrng_s / meters_to_miliseconds / TWO_N29));
} }
DF405 = std::bitset<20>(fine_pseudorange); DF405 = std::bitset<20>(fine_pseudorange);
return 0; return 0;
@ -5420,7 +5420,7 @@ int Rtcm::set_DF405(const Gnss_Synchro& gnss_synchro)
int Rtcm::set_DF406(const Gnss_Synchro& gnss_synchro) int Rtcm::set_DF406(const Gnss_Synchro& gnss_synchro)
{ {
long int fine_phaserange_ex; int64_t fine_phaserange_ex;
double meters_to_miliseconds = GPS_C_m_s * 0.001; double meters_to_miliseconds = GPS_C_m_s * 0.001;
double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10; double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10;
double phrng_m; double phrng_m;
@ -5479,7 +5479,7 @@ int Rtcm::set_DF406(const Gnss_Synchro& gnss_synchro)
} }
else else
{ {
fine_phaserange_ex = static_cast<long int>(std::round(phrng_m / meters_to_miliseconds / TWO_N31)); fine_phaserange_ex = static_cast<int64_t>(std::round(phrng_m / meters_to_miliseconds / TWO_N31));
} }
DF406 = std::bitset<24>(fine_phaserange_ex); DF406 = std::bitset<24>(fine_phaserange_ex);

View File

@ -42,6 +42,7 @@
#include <boost/asio.hpp> #include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/posix_time/posix_time.hpp>
#include <bitset> #include <bitset>
#include <cstdint>
#include <deque> #include <deque>
#include <map> #include <map>
#include <memory> #include <memory>
@ -347,8 +348,8 @@ public:
std::string bin_to_binary_data(const std::string& s) const; //<! Returns a string of binary data from a string of binary symbols std::string bin_to_binary_data(const std::string& s) const; //<! Returns a string of binary data from a string of binary symbols
std::string binary_data_to_bin(const std::string& s) const; //<! Returns a string of binary symbols from a string of binary data std::string binary_data_to_bin(const std::string& s) const; //<! Returns a string of binary symbols from a string of binary data
unsigned long int bin_to_uint(const std::string& s) const; //<! Returns an unsigned long int from a string of binary symbols uint64_t bin_to_uint(const std::string& s) const; //<! Returns an uint64_t from a string of binary symbols
long int bin_to_int(const std::string& s) const; int64_t bin_to_int(const std::string& s) const;
double bin_to_double(const std::string& s) const; //<! Returns double from a string of binary symbols double bin_to_double(const std::string& s) const; //<! Returns double from a string of binary symbols
/*! /*!
* \brief Locks time period in which GLONASS signals have been continually tracked. * \brief Locks time period in which GLONASS signals have been continually tracked.
@ -356,11 +357,11 @@ public:
* \param eph GLONASS GNAV Broadcast Ephemeris * \param eph GLONASS GNAV Broadcast Ephemeris
* \param obs_time Time of observation at the moment of printing * \param obs_time Time of observation at the moment of printing
* \param observables Set of observables as defined by the platform * \param observables Set of observables as defined by the platform
* \return //<! Returns a long int from a string of binary symbols * \return //<! Returns a int64_t from a string of binary symbols
*/ */
long int bin_to_sint(const std::string& s) const; int64_t bin_to_sint(const std::string& s) const;
unsigned long int hex_to_uint(const std::string& s) const; //<! Returns an unsigned long int from a string of hexadecimal symbols uint64_t hex_to_uint(const std::string& s) const; //<! Returns an uint64_t from a string of hexadecimal symbols
long int hex_to_int(const std::string& s) const; //<! Returns a long int from a string of hexadecimal symbols int64_t hex_to_int(const std::string& s) const; //<! Returns a int64_t from a string of hexadecimal symbols
bool check_CRC(const std::string& message) const; //<! Checks that the CRC of a RTCM package is correct bool check_CRC(const std::string& message) const; //<! Checks that the CRC of a RTCM package is correct

View File

@ -68,6 +68,7 @@
#include <gnuradio/blocks/file_sink.h> #include <gnuradio/blocks/file_sink.h>
#include <stdlib.h> #include <stdlib.h>
#include <chrono> #include <chrono>
#include <cstdint>
#include <ctime> // for ctime #include <ctime> // for ctime
#include <exception> #include <exception>
#include <memory> #include <memory>
@ -123,7 +124,7 @@ void FrontEndCal_msg_rx::msg_handler_events(pmt::pmt_t msg)
{ {
try try
{ {
long int message = pmt::to_long(msg); int64_t message = pmt::to_long(msg);
rx_message = message; rx_message = message;
channel_internal_queue.push(rx_message); channel_internal_queue.push(rx_message);
} }
@ -204,7 +205,7 @@ bool front_end_capture(std::shared_ptr<ConfigurationInterface> configuration)
sink = gr::blocks::file_sink::make(sizeof(gr_complex), "tmp_capture.dat"); sink = gr::blocks::file_sink::make(sizeof(gr_complex), "tmp_capture.dat");
//--- Find number of samples per spreading code --- //--- Find number of samples per spreading code ---
long fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", 2048000); int64_t fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", 2048000);
int samples_per_code = round(fs_in_ / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); int samples_per_code = round(fs_in_ / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
int nsamples = samples_per_code * 50; int nsamples = samples_per_code * 50;
@ -234,7 +235,7 @@ bool front_end_capture(std::shared_ptr<ConfigurationInterface> configuration)
} }
static time_t utc_time(int week, long tow) static time_t utc_time(int week, int64_t tow)
{ {
time_t t; time_t t;
@ -350,7 +351,7 @@ int main(int argc, char** argv)
signal.copy(gnss_synchro->Signal, 2, 0); signal.copy(gnss_synchro->Signal, 2, 0);
gnss_synchro->PRN = 1; gnss_synchro->PRN = 1;
long fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", 2048000); int64_t fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", 2048000);
configuration->set_property("Acquisition.max_dwells", "10"); configuration->set_property("Acquisition.max_dwells", "10");
GNSSBlockFactory block_factory; GNSSBlockFactory block_factory;
@ -480,11 +481,11 @@ int main(int argc, char** argv)
Eph_map = global_gps_ephemeris_map.get_map_copy(); Eph_map = global_gps_ephemeris_map.get_map_copy();
current_TOW = Eph_map.begin()->second.d_TOW; current_TOW = Eph_map.begin()->second.d_TOW;
time_t t = utc_time(Eph_map.begin()->second.i_GPS_week, (long int)current_TOW); time_t t = utc_time(Eph_map.begin()->second.i_GPS_week, (int64_t)current_TOW);
fprintf(stdout, "Reference Time:\n"); fprintf(stdout, "Reference Time:\n");
fprintf(stdout, " GPS Week: %d\n", Eph_map.begin()->second.i_GPS_week); fprintf(stdout, " GPS Week: %d\n", Eph_map.begin()->second.i_GPS_week);
fprintf(stdout, " GPS TOW: %ld %lf\n", (long int)current_TOW, (long int)current_TOW * 0.08); fprintf(stdout, " GPS TOW: %ld %lf\n", (int64_t)current_TOW, (int64_t)current_TOW * 0.08);
fprintf(stdout, " ~ UTC: %s", ctime(&t)); fprintf(stdout, " ~ UTC: %s", ctime(&t));
std::cout << "Current TOW obtained from SUPL assistance = " << current_TOW << std::endl; std::cout << "Current TOW obtained from SUPL assistance = " << current_TOW << std::endl;
} }