GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
nsr_file_signal_source.h
Go to the documentation of this file.
1 /*!
2  * \file nsr_file_signal_source.h
3  * \brief Implementation of a class that reads signals samples from a NSR 2 bits sampler front-end file
4  * and adapts it to a SignalSourceInterface. More information about the front-end here
5  * http://www.ifen.com/products/sx-scientific-gnss-solutions/nsr-software-receiver.html
6  * \author Javier Arribas, 2013 jarribas(at)cttc.es
7  *
8  * This class represents a file signal source.
9  *
10  * -----------------------------------------------------------------------------
11  *
12  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
13  * This file is part of GNSS-SDR.
14  *
15  * Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
16  * SPDX-License-Identifier: GPL-3.0-or-later
17  *
18  * -----------------------------------------------------------------------------
19  */
20 
21 #ifndef GNSS_SDR_NSR_FILE_SIGNAL_SOURCE_H
22 #define GNSS_SDR_NSR_FILE_SIGNAL_SOURCE_H
23 
24 #include "file_source_base.h"
26 #include <cstddef>
27 #include <string>
28 #include <tuple>
29 
30 /** \addtogroup Signal_Source
31  * \{ */
32 /** \addtogroup Signal_Source_adapters
33  * \{ */
34 
36 
37 /*!
38  * \brief Class that reads signals samples from a file
39  * and adapts it to a SignalSourceInterface
40  */
42 {
43 public:
44  NsrFileSignalSource(const ConfigurationInterface* configuration, const std::string& role,
45  unsigned int in_streams, unsigned int out_streams,
47 
48  ~NsrFileSignalSource() = default;
49 
50 protected:
51  std::tuple<size_t, bool> itemTypeToSize() override;
52  double packetsPerSample() const override;
53  gnss_shared_ptr<gr::block> source() const override;
54  void create_file_source_hook() override;
55  void pre_connect_hook(gr::top_block_sptr top_block) override;
56  void pre_disconnect_hook(gr::top_block_sptr top_block) override;
57 
58 private:
59  unpack_byte_2bit_samples_sptr unpack_byte_;
60 };
61 
62 
63 /** \} */
64 /** \} */
65 #endif // GNSS_SDR_NSR_FILE_SIGNAL_SOURCE_H
double packetsPerSample() const override
The number of (possibly unpacked) samples in a (raw) file sample (default=1)
This abstract class represents an interface to configuration parameters.
Header file of the base class to file-oriented signal_source GNSS blocks.
Class that reads signals samples from a file and adapts it to a SignalSourceInterface.
Base class to file-oriented SignalSourceBase GNSS blocks.
std::tuple< size_t, bool > itemTypeToSize() override
Compute the item size, from the item_type(). Subclasses may constrain types that don&#39;t make...
Unpacks byte samples to NSR 2 bits samples.
gnss_shared_ptr< gr::block > source() const override
Abstracted front-end source. Sub-classes may override if they create specialized chains to decode sou...