forked from gnss-sdr/gnss-sdr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gnss_flowgraph.h
145 lines (128 loc) · 4.37 KB
/
gnss_flowgraph.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/*!
* \file gnss_flowgraph.h
* \brief Interface of a GNSS receiver flowgraph.
* \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
* Luis Esteve, 2011. luis(at)epsilon-formacion.com
* Carles Fernandez-Prades, 2014. cfernandez(at)cttc.es
*
* It contains a signal source,
* a signal conditioner, a set of channels, a pvt and an output filter.
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_GNSS_FLOWGRAPH_H_
#define GNSS_SDR_GNSS_FLOWGRAPH_H_
#include <list>
#include <memory>
#include <queue>
#include <string>
#include <vector>
#include <gnuradio/top_block.h>
#include <gnuradio/msg_queue.h>
#include "GPS_L1_CA.h"
#include "gnss_signal.h"
class GNSSBlockInterface;
class ChannelInterface;
class ConfigurationInterface;
class GNSSBlockFactory;
/*! \brief This class represents a GNSS flowgraph.
*
* It contains a signal source,
* a signal conditioner, a set of channels, a PVT and an output filter.
*/
class GNSSFlowgraph
{
public:
/*!
* \brief Constructor that initializes the receiver flowgraph
*/
GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration,
boost::shared_ptr<gr::msg_queue> queue);
/*!
* \brief Virtual destructor
*/
virtual ~GNSSFlowgraph();
//! \brief Start the flowgraph
void start();
//! \brief Stop the flowgraph
void stop();
/*!
* \brief Connects the defined blocks in the flowgraph
*
* Signal Source > Signal conditioner > Channels >> Observables >> PVT > Output filter
*/
void connect();
void wait();
/*!
* \brief Applies an action to the flowgraph
*
* \param[in] who Who generated the action
* \param[in] what What is the action 0: acquisition failed
*/
void apply_action(unsigned int who, unsigned int what);
void set_configuration(std::shared_ptr<ConfigurationInterface> configuration);
unsigned int applied_actions()
{
return applied_actions_;
}
bool connected()
{
return connected_;
}
bool running()
{
return running_;
}
/*!
* \brief Sends a GNURadio asyncronous message from telemetry to PVT
*
* It is used to assist the receiver with external ephemeris data
*/
bool send_telemetry_msg(pmt::pmt_t msg);
private:
void init(); // Populates the SV PRN list available for acquisition and tracking
void set_signals_list();
void set_channels_state(); // Initializes the channels state (start acquisition or keep standby)
// using the configuration parameters (number of channels and max channels in acquisition)
bool connected_;
bool running_;
int sources_count_;
unsigned int channels_count_;
unsigned int acq_channels_count_;
unsigned int max_acq_channels_;
unsigned int applied_actions_;
std::string config_file_;
std::shared_ptr<ConfigurationInterface> configuration_;
std::vector<std::shared_ptr<GNSSBlockInterface>> sig_source_;
std::vector<std::shared_ptr<GNSSBlockInterface>> sig_conditioner_;
std::shared_ptr<GNSSBlockInterface> observables_;
std::shared_ptr<GNSSBlockInterface> pvt_;
std::vector<std::shared_ptr<ChannelInterface>> channels_;
gr::top_block_sptr top_block_;
boost::shared_ptr<gr::msg_queue> queue_;
std::list<Gnss_Signal> available_GNSS_signals_;
std::vector<unsigned int> channels_state_;
};
#endif /*GNSS_SDR_GNSS_FLOWGRAPH_H_*/