GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
signal_generator.h
Go to the documentation of this file.
1 /*!
2  * \file signal_generator.h
3  * \brief Adapter of a class that generates synthesized GNSS signal.
4  * \author Marc Molina, 2013. marc.molina.pena@gmail.com
5  *
6  *
7  * -----------------------------------------------------------------------------
8  *
9  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
10  *
11  * GNSS-SDR is a software defined Global Navigation
12  * Satellite Systems receiver
13  *
14  * This file is part of GNSS-SDR.
15  *
16  * SPDX-License-Identifier: GPL-3.0-or-later
17  *
18  * -----------------------------------------------------------------------------
19  */
20 
21 
22 #ifndef GNSS_SDR_SIGNAL_GENERATOR_H
23 #define GNSS_SDR_SIGNAL_GENERATOR_H
24 
25 #include "concurrent_queue.h"
26 #include "gnss_block_interface.h"
27 #include "signal_generator_c.h"
28 #include <gnuradio/blocks/file_sink.h>
29 #include <gnuradio/blocks/vector_to_stream.h>
30 #include <gnuradio/hier_block2.h>
31 #include <pmt/pmt.h>
32 #include <memory>
33 #include <string>
34 #include <vector>
35 
37 
38 /*!
39 * \brief This class generates synthesized GNSS signal.
40 *
41 */
43 {
44 public:
45  SignalGenerator(const ConfigurationInterface* configuration,
46  const std::string& role, unsigned int in_stream,
47  unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue);
48 
49  ~SignalGenerator() = default;
50 
51  inline std::string role() override
52  {
53  return role_;
54  }
55 
56  /*!
57  * \brief Returns "GNSSSignalGenerator".
58  */
59  inline std::string implementation() override
60  {
61  return "GNSSSignalGenerator";
62  }
63 
64  inline size_t item_size() override
65  {
66  return item_size_;
67  }
68 
69  void connect(gr::top_block_sptr top_block) override;
70  void disconnect(gr::top_block_sptr top_block) override;
71  gr::basic_block_sptr get_left_block() override;
72  gr::basic_block_sptr get_right_block() override;
73 
74 private:
75 #if GNURADIO_USES_STD_POINTERS
76  std::shared_ptr<gr::block> gen_source_;
77 #else
78  boost::shared_ptr<gr::block> gen_source_;
79 #endif
80  gr::blocks::vector_to_stream::sptr vector_to_stream_;
81  gr::blocks::file_sink::sptr file_sink_;
82  std::string role_;
83  std::string item_type_;
84  std::string dump_filename_;
85  size_t item_size_;
86  unsigned int in_stream_;
87  unsigned int out_stream_;
88  bool dump_;
89 };
90 
91 #endif // GNSS_SDR_SIGNAL_GENERATOR_H
Interface of a thread-safe std::queue.
This class generates synthesized GNSS signal.
std::string implementation() override
Returns "GNSSSignalGenerator".
This interface represents a GNSS block.
This abstract class represents an interface to configuration parameters.
This abstract class represents an interface to GNSS blocks.
GNU Radio source block that generates synthesized GNSS signal.