GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
gnss_synchro.h
Go to the documentation of this file.
1 /*!
2  * \file gnss_synchro.h
3  * \brief Interface of the Gnss_Synchro class
4  * \author
5  * Luis Esteve, 2012. luis(at)epsilon-formacion.com
6  * Javier Arribas, 2012. jarribas(at)cttc.es
7  * Álvaro Cebrián Juan, 2018. acebrianjuan(at)gmail.com
8  * -----------------------------------------------------------------------------
9  *
10  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
11  *
12  * GNSS-SDR is a software defined Global Navigation
13  * Satellite Systems receiver
14  *
15  * This file is part of GNSS-SDR.
16  *
17  * SPDX-License-Identifier: GPL-3.0-or-later
18  *
19  * -----------------------------------------------------------------------------
20  */
21 
22 #ifndef GNSS_SDR_GNSS_SYNCHRO_H
23 #define GNSS_SDR_GNSS_SYNCHRO_H
24 
25 #include <boost/serialization/nvp.hpp>
26 #include <cstdint>
27 #include <utility>
28 
29 /*!
30  * \brief This is the class that contains the information that is shared
31  * by the processing blocks.
32  */
34 {
35 public:
36  Gnss_Synchro() = default; //!< Default constructor
37 
38  ~Gnss_Synchro() = default; //!< Default destructor
39 
40  // Satellite and signal info
41  char System{}; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal)
42  char Signal[3]{}; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal)
43  uint32_t PRN{}; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal)
44  int32_t Channel_ID{}; //!< Set by Channel constructor
45 
46  // Acquisition
47  double Acq_delay_samples{}; //!< Set by Acquisition processing block
48  double Acq_doppler_hz{}; //!< Set by Acquisition processing block
49  uint64_t Acq_samplestamp_samples{}; //!< Set by Acquisition processing block
50  uint32_t Acq_doppler_step{}; //!< Set by Acquisition processing block
51 
52  // Tracking
53  int64_t fs{}; //!< Set by Tracking processing block
54  double Prompt_I{}; //!< Set by Tracking processing block
55  double Prompt_Q{}; //!< Set by Tracking processing block
56  double CN0_dB_hz{}; //!< Set by Tracking processing block
57  double Carrier_Doppler_hz{}; //!< Set by Tracking processing block
58  double Carrier_phase_rads{}; //!< Set by Tracking processing block
59  double Code_phase_samples{}; //!< Set by Tracking processing block
60  uint64_t Tracking_sample_counter{}; //!< Set by Tracking processing block
61  int32_t correlation_length_ms{}; //!< Set by Tracking processing block
62 
63  // Telemetry Decoder
64  uint32_t TOW_at_current_symbol_ms{}; //!< Set by Telemetry Decoder processing block
65 
66  // Observables
67  double Pseudorange_m{}; //!< Set by Observables processing block
68  double RX_time{}; //!< Set by Observables processing block
69  double interp_TOW_ms{}; //!< Set by Observables processing block
70 
71  // Flags
72  bool Flag_valid_acquisition{}; //!< Set by Acquisition processing block
73  bool Flag_valid_symbol_output{}; //!< Set by Tracking processing block
74  bool Flag_valid_word{}; //!< Set by Telemetry Decoder processing block
75  bool Flag_valid_pseudorange{}; //!< Set by Observables processing block
76 
77  /// Copy constructor
78  Gnss_Synchro(const Gnss_Synchro& other) noexcept
79  {
80  *this = other;
81  };
82 
83  /// Copy assignment operator
84  Gnss_Synchro& operator=(const Gnss_Synchro& rhs) noexcept
85  {
86  // Only do assignment if RHS is a different object from this.
87  if (this != &rhs)
88  {
89  this->System = rhs.System;
90  this->Signal[0] = rhs.Signal[0];
91  this->Signal[1] = rhs.Signal[1];
92  this->Signal[2] = rhs.Signal[2];
93  this->PRN = rhs.PRN;
94  this->Channel_ID = rhs.Channel_ID;
95  this->Acq_delay_samples = rhs.Acq_delay_samples;
96  this->Acq_doppler_hz = rhs.Acq_doppler_hz;
97  this->Acq_samplestamp_samples = rhs.Acq_samplestamp_samples;
98  this->Acq_doppler_step = rhs.Acq_doppler_step;
99  this->fs = rhs.fs;
100  this->Prompt_I = rhs.Prompt_I;
101  this->Prompt_Q = rhs.Prompt_Q;
102  this->CN0_dB_hz = rhs.CN0_dB_hz;
103  this->Carrier_Doppler_hz = rhs.Carrier_Doppler_hz;
104  this->Carrier_phase_rads = rhs.Carrier_phase_rads;
105  this->Code_phase_samples = rhs.Code_phase_samples;
106  this->Tracking_sample_counter = rhs.Tracking_sample_counter;
107  this->correlation_length_ms = rhs.correlation_length_ms;
108  this->TOW_at_current_symbol_ms = rhs.TOW_at_current_symbol_ms;
109  this->Pseudorange_m = rhs.Pseudorange_m;
110  this->RX_time = rhs.RX_time;
111  this->interp_TOW_ms = rhs.interp_TOW_ms;
112  this->Flag_valid_acquisition = rhs.Flag_valid_acquisition;
113  this->Flag_valid_symbol_output = rhs.Flag_valid_symbol_output;
114  this->Flag_valid_word = rhs.Flag_valid_word;
115  this->Flag_valid_pseudorange = rhs.Flag_valid_pseudorange;
116  }
117  return *this;
118  };
119 
120  /// Move constructor
121  Gnss_Synchro(Gnss_Synchro&& other) noexcept
122  {
123  *this = std::move(other);
124  };
125 
126  /// Move assignment operator
128  {
129  if (this != &other)
130  {
131  this->System = other.System;
132  this->Signal[0] = other.Signal[0];
133  this->Signal[1] = other.Signal[1];
134  this->Signal[2] = other.Signal[2];
135  this->PRN = other.PRN;
136  this->Channel_ID = other.Channel_ID;
137  this->Acq_delay_samples = other.Acq_delay_samples;
138  this->Acq_doppler_hz = other.Acq_doppler_hz;
139  this->Acq_samplestamp_samples = other.Acq_samplestamp_samples;
140  this->Acq_doppler_step = other.Acq_doppler_step;
141  this->fs = other.fs;
142  this->Prompt_I = other.Prompt_I;
143  this->Prompt_Q = other.Prompt_Q;
144  this->CN0_dB_hz = other.CN0_dB_hz;
145  this->Carrier_Doppler_hz = other.Carrier_Doppler_hz;
146  this->Carrier_phase_rads = other.Carrier_phase_rads;
147  this->Code_phase_samples = other.Code_phase_samples;
148  this->Tracking_sample_counter = other.Tracking_sample_counter;
149  this->correlation_length_ms = other.correlation_length_ms;
150  this->TOW_at_current_symbol_ms = other.TOW_at_current_symbol_ms;
151  this->Pseudorange_m = other.Pseudorange_m;
152  this->RX_time = other.RX_time;
153  this->interp_TOW_ms = other.interp_TOW_ms;
154  this->Flag_valid_acquisition = other.Flag_valid_acquisition;
155  this->Flag_valid_symbol_output = other.Flag_valid_symbol_output;
156  this->Flag_valid_word = other.Flag_valid_word;
157  this->Flag_valid_pseudorange = other.Flag_valid_pseudorange;
158  }
159  return *this;
160  };
161 
162  /*!
163  * \brief This member function serializes and restores
164  * Gnss_Synchro objects from a byte stream.
165  */
166  template <class Archive>
167 
168  void serialize(Archive& ar, const unsigned int version)
169  {
170  if (version)
171  {
172  };
173  // Satellite and signal info
174  ar& BOOST_SERIALIZATION_NVP(System);
175  ar& BOOST_SERIALIZATION_NVP(Signal);
176  ar& BOOST_SERIALIZATION_NVP(PRN);
177  ar& BOOST_SERIALIZATION_NVP(Channel_ID);
178  // Acquisition
179  ar& BOOST_SERIALIZATION_NVP(Acq_delay_samples);
180  ar& BOOST_SERIALIZATION_NVP(Acq_doppler_hz);
181  ar& BOOST_SERIALIZATION_NVP(Acq_samplestamp_samples);
182  ar& BOOST_SERIALIZATION_NVP(Acq_doppler_step);
183  // Tracking
184  ar& BOOST_SERIALIZATION_NVP(fs);
185  ar& BOOST_SERIALIZATION_NVP(Prompt_I);
186  ar& BOOST_SERIALIZATION_NVP(Prompt_Q);
187  ar& BOOST_SERIALIZATION_NVP(CN0_dB_hz);
188  ar& BOOST_SERIALIZATION_NVP(Carrier_Doppler_hz);
189  ar& BOOST_SERIALIZATION_NVP(Carrier_phase_rads);
190  ar& BOOST_SERIALIZATION_NVP(Code_phase_samples);
191  ar& BOOST_SERIALIZATION_NVP(Tracking_sample_counter);
192  ar& BOOST_SERIALIZATION_NVP(correlation_length_ms);
193  // Telemetry Decoder
194  ar& BOOST_SERIALIZATION_NVP(TOW_at_current_symbol_ms);
195  // Observables
196  ar& BOOST_SERIALIZATION_NVP(Pseudorange_m);
197  ar& BOOST_SERIALIZATION_NVP(RX_time);
198  ar& BOOST_SERIALIZATION_NVP(interp_TOW_ms);
199  // Flags
200  ar& BOOST_SERIALIZATION_NVP(Flag_valid_acquisition);
201  ar& BOOST_SERIALIZATION_NVP(Flag_valid_symbol_output);
202  ar& BOOST_SERIALIZATION_NVP(Flag_valid_word);
203  ar& BOOST_SERIALIZATION_NVP(Flag_valid_pseudorange);
204  }
205 };
206 
207 #endif
double Prompt_Q
Set by Tracking processing block.
Definition: gnss_synchro.h:55
Gnss_Synchro(Gnss_Synchro &&other) noexcept
Move constructor.
Definition: gnss_synchro.h:121
double Pseudorange_m
Set by Observables processing block.
Definition: gnss_synchro.h:67
int32_t Channel_ID
Set by Channel constructor.
Definition: gnss_synchro.h:44
char Signal[3]
Set by Channel::set_signal(Gnss_Signal gnss_signal)
Definition: gnss_synchro.h:42
uint32_t PRN
Set by Channel::set_signal(Gnss_Signal gnss_signal)
Definition: gnss_synchro.h:43
Gnss_Synchro & operator=(const Gnss_Synchro &rhs) noexcept
Copy assignment operator.
Definition: gnss_synchro.h:84
void serialize(Archive &ar, const unsigned int version)
This member function serializes and restores Gnss_Synchro objects from a byte stream.
Definition: gnss_synchro.h:168
bool Flag_valid_pseudorange
Set by Observables processing block.
Definition: gnss_synchro.h:75
Gnss_Synchro(const Gnss_Synchro &other) noexcept
Copy constructor.
Definition: gnss_synchro.h:78
uint32_t TOW_at_current_symbol_ms
Set by Telemetry Decoder processing block.
Definition: gnss_synchro.h:64
int32_t correlation_length_ms
Set by Tracking processing block.
Definition: gnss_synchro.h:61
double Carrier_phase_rads
Set by Tracking processing block.
Definition: gnss_synchro.h:58
char System
Set by Channel::set_signal(Gnss_Signal gnss_signal)
Definition: gnss_synchro.h:41
Gnss_Synchro()=default
Default constructor.
This is the class that contains the information that is shared by the processing blocks.
Definition: gnss_synchro.h:33
double Acq_delay_samples
Set by Acquisition processing block.
Definition: gnss_synchro.h:47
uint64_t Acq_samplestamp_samples
Set by Acquisition processing block.
Definition: gnss_synchro.h:49
double Carrier_Doppler_hz
Set by Tracking processing block.
Definition: gnss_synchro.h:57
bool Flag_valid_symbol_output
Set by Tracking processing block.
Definition: gnss_synchro.h:73
double Acq_doppler_hz
Set by Acquisition processing block.
Definition: gnss_synchro.h:48
double RX_time
Set by Observables processing block.
Definition: gnss_synchro.h:68
double CN0_dB_hz
Set by Tracking processing block.
Definition: gnss_synchro.h:56
int64_t fs
Set by Tracking processing block.
Definition: gnss_synchro.h:53
Gnss_Synchro & operator=(Gnss_Synchro &&other) noexcept
Move assignment operator.
Definition: gnss_synchro.h:127
double Prompt_I
Set by Tracking processing block.
Definition: gnss_synchro.h:54
~Gnss_Synchro()=default
Default destructor.
uint64_t Tracking_sample_counter
Set by Tracking processing block.
Definition: gnss_synchro.h:60
double interp_TOW_ms
Set by Observables processing block.
Definition: gnss_synchro.h:69
double Code_phase_samples
Set by Tracking processing block.
Definition: gnss_synchro.h:59
uint32_t Acq_doppler_step
Set by Acquisition processing block.
Definition: gnss_synchro.h:50
bool Flag_valid_acquisition
Set by Acquisition processing block.
Definition: gnss_synchro.h:72
bool Flag_valid_word
Set by Telemetry Decoder processing block.
Definition: gnss_synchro.h:74