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