GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
gnss_satellite.h
Go to the documentation of this file.
1 /*!
2  * \file gnss_satellite.h
3  * \brief Interface of the Gnss_Satellite class
4  * \author Carles Fernandez-Prades, 2012. cfernandez(at)cttc.es
5  *
6  * -----------------------------------------------------------------------------
7  *
8  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
9  *
10  * GNSS-SDR is a software defined Global Navigation
11  * Satellite Systems receiver
12  *
13  * This file is part of GNSS-SDR.
14  *
15  * SPDX-License-Identifier: GPL-3.0-or-later
16  *
17  * -----------------------------------------------------------------------------
18  */
19 
20 
21 #ifndef GNSS_SDR_GNSS_SATELLITE_H
22 #define GNSS_SDR_GNSS_SATELLITE_H
23 
24 #include <cstdint>
25 #include <map>
26 #include <ostream>
27 #include <set>
28 #include <string>
29 
30 
31 /*!
32  * \brief This class represents a GNSS satellite.
33  *
34  * It contains information about the space vehicles currently operational
35  * of GPS, Glonass, SBAS and Galileo constellations.
36  */
38 {
39 public:
40  Gnss_Satellite() = default; //!< Default Constructor.
41  Gnss_Satellite(const std::string& system_, uint32_t PRN_); //!< Concrete GNSS satellite Constructor.
42  ~Gnss_Satellite() = default; //!< Default Destructor.
43 
44  Gnss_Satellite(const Gnss_Satellite& other) noexcept; //!< Copy constructor
45  Gnss_Satellite& operator=(const Gnss_Satellite&); //!< Copy assignment operator
46  Gnss_Satellite(Gnss_Satellite&& other) noexcept; //!< Move constructor
47  Gnss_Satellite& operator=(Gnss_Satellite&& other) noexcept; //!< Move assignment operator
48 
49  friend bool operator==(const Gnss_Satellite& /*sat1*/, const Gnss_Satellite& /*sat2*/); //!< operator== for comparison
50  friend std::ostream& operator<<(std::ostream& /*out*/, const Gnss_Satellite& /*sat*/); //!< operator<< for pretty printing
51 
52  void update_PRN(uint32_t PRN); //!< Updates the PRN Number when information is decoded, only applies to GLONASS GNAV messages
53  uint32_t get_PRN() const; //!< Gets satellite's PRN
54  int32_t get_rf_link() const; //!< Gets the satellite's rf link
55  std::string get_system() const; //!< Gets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Beidou"}
56  std::string get_system_short() const; //!< Gets the satellite system {"G", "R", "SBAS", "E", "C"}
57  std::string get_block() const; //!< Gets the satellite block. If GPS, returns {"IIA", "IIR", "IIR-M", "IIF"}
58  std::string what_block(const std::string& system_, uint32_t PRN_); //!< Gets the block of a given satellite
59 
60 private:
61  const std::set<std::string> system_set = {"GPS", "Glonass", "SBAS", "Galileo", "Beidou"};
62  const std::map<std::string, std::string> satelliteSystem = {{"GPS", "G"}, {"Glonass", "R"}, {"SBAS", "S"}, {"Galileo", "E"}, {"Beidou", "C"}};
63  void set_system(const std::string& system); // Sets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Beidou"}.
64  void set_PRN(uint32_t PRN); // Sets satellite's PRN
65  void set_block(const std::string& system_, uint32_t PRN_);
66  void reset();
67  void set_rf_link(int32_t rf_link_);
68  std::string system{};
69  std::string block{};
70  uint32_t PRN{};
71  int32_t rf_link{};
72 };
73 #endif
friend std::ostream & operator<<(std::ostream &, const Gnss_Satellite &)
operator<< for pretty printing
Gnss_Satellite()=default
Default Constructor.
This class represents a GNSS satellite.
std::string get_block() const
Gets the satellite block. If GPS, returns {"IIA", "IIR", "IIR-M", "IIF"}.
friend bool operator==(const Gnss_Satellite &, const Gnss_Satellite &)
operator== for comparison
std::string get_system() const
Gets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Beidou"}.
std::string get_system_short() const
Gets the satellite system {"G", "R", "SBAS", "E", "C"}.
std::string what_block(const std::string &system_, uint32_t PRN_)
Gets the block of a given satellite.
~Gnss_Satellite()=default
Default Destructor.
Gnss_Satellite & operator=(const Gnss_Satellite &)
Copy assignment operator.
int32_t get_rf_link() const
Gets the satellite&#39;s rf link.
uint32_t get_PRN() const
Gets satellite&#39;s PRN.
void update_PRN(uint32_t PRN)
Updates the PRN Number when information is decoded, only applies to GLONASS GNAV messages.