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