2011-10-01 18:45:20 +00:00
|
|
|
/*!
|
|
|
|
* \file gnss_flowgraph.h
|
2011-12-28 21:36:45 +00:00
|
|
|
* \brief Interface of a GNSS receiver flowgraph.
|
2011-10-01 18:45:20 +00:00
|
|
|
* \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
|
|
|
|
* Luis Esteve, 2011. luis(at)epsilon-formacion.com
|
2014-04-13 00:51:00 +00:00
|
|
|
* Carles Fernandez-Prades, 2014. cfernandez(at)cttc.es
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
|
|
|
* It contains a signal source,
|
|
|
|
* a signal conditioner, a set of channels, a pvt and an output filter.
|
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*
|
2015-01-08 18:49:59 +00:00
|
|
|
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
|
|
|
* 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
|
2015-01-08 18:49:59 +00:00
|
|
|
* (at your option) any later version.
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
|
|
|
* 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_
|
|
|
|
|
2014-04-13 00:51:00 +00:00
|
|
|
#include <list>
|
|
|
|
#include <memory>
|
|
|
|
#include <queue>
|
2011-10-01 18:45:20 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2013-07-04 13:47:40 +00:00
|
|
|
#include <gnuradio/top_block.h>
|
|
|
|
#include <gnuradio/msg_queue.h>
|
2012-01-16 18:27:31 +00:00
|
|
|
#include "GPS_L1_CA.h"
|
2012-01-27 11:58:55 +00:00
|
|
|
#include "gnss_signal.h"
|
2011-10-01 18:45:20 +00:00
|
|
|
|
|
|
|
class GNSSBlockInterface;
|
|
|
|
class ChannelInterface;
|
|
|
|
class ConfigurationInterface;
|
|
|
|
class GNSSBlockFactory;
|
|
|
|
|
2011-12-28 03:05:37 +00:00
|
|
|
/*! \brief This class represents a GNSS flowgraph.
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
|
|
|
* It contains a signal source,
|
|
|
|
* a signal conditioner, a set of channels, a PVT and an output filter.
|
|
|
|
*/
|
|
|
|
class GNSSFlowgraph
|
|
|
|
{
|
|
|
|
public:
|
2011-12-28 21:36:45 +00:00
|
|
|
/*!
|
|
|
|
* \brief Constructor that initializes the receiver flowgraph
|
2011-12-27 21:21:12 +00:00
|
|
|
*/
|
2014-04-03 21:59:14 +00:00
|
|
|
GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration,
|
|
|
|
boost::shared_ptr<gr::msg_queue> queue);
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2011-12-28 21:36:45 +00:00
|
|
|
/*!
|
|
|
|
* \brief Virtual destructor
|
|
|
|
*/
|
2011-10-01 18:45:20 +00:00
|
|
|
virtual ~GNSSFlowgraph();
|
|
|
|
|
2011-12-28 03:05:37 +00:00
|
|
|
//! \brief Start the flowgraph
|
2011-10-01 18:45:20 +00:00
|
|
|
void start();
|
|
|
|
|
2011-12-28 03:05:37 +00:00
|
|
|
//! \brief Stop the flowgraph
|
2011-10-01 18:45:20 +00:00
|
|
|
void stop();
|
|
|
|
|
2011-12-28 21:36:45 +00:00
|
|
|
/*!
|
|
|
|
* \brief Connects the defined blocks in the flowgraph
|
|
|
|
*
|
|
|
|
* Signal Source > Signal conditioner > Channels >> Observables >> PVT > Output filter
|
|
|
|
*/
|
2011-10-01 18:45:20 +00:00
|
|
|
void connect();
|
|
|
|
|
|
|
|
void wait();
|
|
|
|
|
2011-12-28 21:36:45 +00:00
|
|
|
/*!
|
|
|
|
* \brief Applies an action to the flowgraph
|
|
|
|
*
|
|
|
|
* \param[in] who Who generated the action
|
|
|
|
* \param[in] what What is the action 0: acquisition failed
|
|
|
|
*/
|
2011-10-01 18:45:20 +00:00
|
|
|
void apply_action(unsigned int who, unsigned int what);
|
|
|
|
|
2014-04-03 21:59:14 +00:00
|
|
|
void set_configuration(std::shared_ptr<ConfigurationInterface> configuration);
|
2011-10-01 18:45:20 +00:00
|
|
|
|
|
|
|
unsigned int applied_actions()
|
|
|
|
{
|
|
|
|
return applied_actions_;
|
|
|
|
}
|
|
|
|
bool connected()
|
|
|
|
{
|
|
|
|
return connected_;
|
|
|
|
}
|
|
|
|
bool running()
|
|
|
|
{
|
|
|
|
return running_;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2014-04-13 16:58:52 +00:00
|
|
|
void init(); // Populates the SV PRN list available for acquisition and tracking
|
2012-01-27 11:58:55 +00:00
|
|
|
void set_signals_list();
|
2014-04-13 16:58:52 +00:00
|
|
|
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)
|
2011-10-01 18:45:20 +00:00
|
|
|
bool connected_;
|
|
|
|
bool running_;
|
2015-02-12 17:56:05 +00:00
|
|
|
int sources_count_;
|
|
|
|
|
2011-10-01 18:45:20 +00:00
|
|
|
unsigned int channels_count_;
|
2012-03-02 17:17:51 +00:00
|
|
|
unsigned int acq_channels_count_;
|
|
|
|
unsigned int max_acq_channels_;
|
2011-10-01 18:45:20 +00:00
|
|
|
unsigned int applied_actions_;
|
|
|
|
std::string config_file_;
|
2014-04-03 21:59:14 +00:00
|
|
|
std::shared_ptr<ConfigurationInterface> configuration_;
|
2014-04-11 18:18:59 +00:00
|
|
|
std::shared_ptr<GNSSBlockFactory> block_factory_;
|
2015-02-12 17:56:05 +00:00
|
|
|
|
|
|
|
std::vector<std::shared_ptr<GNSSBlockInterface>> sig_source_;
|
|
|
|
std::vector<std::shared_ptr<GNSSBlockInterface>> sig_conditioner_;
|
|
|
|
|
2014-04-12 17:45:45 +00:00
|
|
|
std::shared_ptr<GNSSBlockInterface> observables_;
|
|
|
|
std::shared_ptr<GNSSBlockInterface> pvt_;
|
|
|
|
std::shared_ptr<GNSSBlockInterface> output_filter_;
|
2015-02-12 17:56:05 +00:00
|
|
|
|
2014-04-12 22:32:16 +00:00
|
|
|
std::vector<std::shared_ptr<ChannelInterface>> channels_;
|
2013-07-04 13:47:40 +00:00
|
|
|
gr::top_block_sptr top_block_;
|
|
|
|
boost::shared_ptr<gr::msg_queue> queue_;
|
2012-01-27 11:58:55 +00:00
|
|
|
std::list<Gnss_Signal> available_GNSS_signals_;
|
2012-03-02 17:17:51 +00:00
|
|
|
std::vector<unsigned int> channels_state_;
|
2011-10-01 18:45:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /*GNSS_SDR_GNSS_FLOWGRAPH_H_*/
|