GNSS-SDR  0.0.14
An Open Source GNSS Software Defined Receiver
spir_gss6450_file_signal_source.h
Go to the documentation of this file.
1 /*!
2  * \file spir_gss6450_file_signal_source.h
3  * \brief Implementation of a class that reads signals samples from a SPIR file
4  * and adapts it to a SignalSourceInterface.
5  * \author Antonio Ramos, 2017 antonio.ramos(at)cttc.es
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 not part of GNSS-SDR.
15  *
16  * SPDX-License-Identifier: GPL-3.0-or-later
17  *
18  * -----------------------------------------------------------------------------
19  */
20 
21 #ifndef GNSS_SDR_SPIR_GSS6450_FILE_SIGNAL_SOURCE_H
22 #define GNSS_SDR_SPIR_GSS6450_FILE_SIGNAL_SOURCE_H
23 
24 #include "concurrent_queue.h"
25 #include "gnss_block_interface.h"
26 #include "gnss_sdr_valve.h"
28 #include <gnuradio/blocks/deinterleave.h>
29 #include <gnuradio/blocks/endian_swap.h>
30 #include <gnuradio/blocks/file_sink.h>
31 #include <gnuradio/blocks/file_source.h>
32 #include <gnuradio/blocks/null_sink.h>
33 #include <gnuradio/blocks/throttle.h>
34 #include <gnuradio/hier_block2.h>
35 #include <pmt/pmt.h>
36 #include <cstdint>
37 #include <string>
38 #include <vector>
39 
40 
41 /** \addtogroup Signal_Source
42  * \{ */
43 /** \addtogroup Signal_Source_adapters
44  * \{ */
45 
46 
48 
49 /*!
50  * \brief Class that reads signals samples from a file
51  * and adapts it to a SignalSourceInterface
52  */
54 {
55 public:
56  SpirGSS6450FileSignalSource(const ConfigurationInterface* configuration, const std::string& role,
57  uint32_t in_streams, uint32_t out_streams, Concurrent_Queue<pmt::pmt_t>* queue);
58 
59  ~SpirGSS6450FileSignalSource() = default;
60  inline std::string role() override
61  {
62  return role_;
63  }
64 
65  inline std::string implementation() override
66  {
67  return "Spir_GSS6450_File_Signal_Source";
68  }
69 
70  inline size_t item_size() override
71  {
72  return item_size_;
73  }
74 
75  void connect(gr::top_block_sptr top_block) override;
76  void disconnect(gr::top_block_sptr top_block) override;
77  gr::basic_block_sptr get_left_block() override;
78  gr::basic_block_sptr get_right_block(int RF_channel) override;
79  gr::basic_block_sptr get_right_block() override;
80 
81  inline std::string filename() const
82  {
83  return filename_;
84  }
85 
86  inline std::string item_type() const
87  {
88  return item_type_;
89  }
90 
91  inline bool repeat() const
92  {
93  return repeat_;
94  }
95 
96  inline int64_t sampling_frequency() const
97  {
98  return sampling_frequency_;
99  }
100 
101  inline uint64_t samples() const
102  {
103  return samples_;
104  }
105 
106 private:
107  gr::blocks::file_source::sptr file_source_;
108  gr::blocks::deinterleave::sptr deint_;
109  std::vector<gnss_shared_ptr<gr::block>> valve_vec_;
110  std::vector<gr::blocks::endian_swap::sptr> endian_vec_;
111  std::vector<gr::blocks::null_sink::sptr> null_sinks_;
112  std::vector<unpack_spir_gss6450_samples_sptr> unpack_spir_vec_;
113  std::vector<gr::blocks::file_sink::sptr> sink_vec_;
114  std::vector<gr::blocks::throttle::sptr> throttle_vec_;
115  std::string filename_;
116  std::string dump_filename_;
117  std::string role_;
118  std::string item_type_;
119  uint64_t samples_;
120  int64_t sampling_frequency_;
121  size_t item_size_;
122  uint32_t in_streams_;
123  uint32_t out_streams_;
124  uint32_t adc_bits_;
125  int32_t n_channels_;
126  int32_t sel_ch_;
127  bool repeat_;
128  bool dump_; // Enables dumping the gr_complex sample output
129  bool enable_throttle_control_;
130  bool endian_swap_;
131 };
132 
133 
134 /** \} */
135 /** \} */
136 #endif // GNSS_SDR_SPIR_GSS6450_FILE_SIGNAL_SOURCE_H
Interface of a thread-safe std::queue.
Interface of a GNU Radio block that sends a STOP message to the control queue right after a specific ...
Unpacks SPIR int samples.
This interface represents a GNSS block.
This abstract class represents an interface to configuration parameters.
This abstract class represents an interface to GNSS blocks.
Class that reads signals samples from a file and adapts it to a SignalSourceInterface.