18 #ifndef GNSS_SDR_FILE_SOURCE_BASE_H 19 #define GNSS_SDR_FILE_SOURCE_BASE_H 23 #include <gnuradio/blocks/file_sink.h> 24 #include <gnuradio/blocks/file_source.h> 25 #include <gnuradio/blocks/throttle.h> 70 void connect(gr::top_block_sptr top_block)
override;
71 void disconnect(gr::top_block_sptr top_block)
override;
72 gr::basic_block_sptr get_left_block()
override;
73 gr::basic_block_sptr get_right_block()
override;
102 std::string default_item_type =
"short");
122 virtual gnss_shared_ptr<gr::block>
source()
const;
127 bool is_complex()
const;
130 gnss_shared_ptr<gr::block> file_source()
const;
131 gnss_shared_ptr<gr::block> valve()
const;
132 gnss_shared_ptr<gr::block> throttle()
const;
133 gnss_shared_ptr<gr::block> sink()
const;
137 gr::blocks::file_source::sptr create_file_source();
138 gr::blocks::throttle::sptr create_throttle();
139 gnss_shared_ptr<gr::block> create_valve();
140 gr::blocks::file_sink::sptr create_sink();
143 virtual void create_file_source_hook();
144 virtual void create_throttle_hook();
145 virtual void create_valve_hook();
146 virtual void create_sink_hook();
149 virtual void pre_connect_hook(gr::top_block_sptr top_block);
150 virtual void post_connect_hook(gr::top_block_sptr top_block);
151 virtual void pre_disconnect_hook(gr::top_block_sptr top_block);
152 virtual void post_disconnect_hook(gr::top_block_sptr top_block);
155 gr::blocks::file_source::sptr file_source_;
156 gr::blocks::throttle::sptr throttle_;
157 gr::blocks::file_sink::sptr sink_;
165 gnss_shared_ptr<gr::block> valve_;
169 std::string filename_;
170 std::string dump_filename_;
171 std::string item_type_;
175 int64_t sampling_frequency_;
176 double minimum_tail_s_;
177 double seconds_to_skip_;
180 bool enable_throttle_control_;
186 #endif // GNSS_SDR_FILE_SOURCE_BASE_H Interface of a thread-safe std::queue.
size_t computeSamplesInFile() const
Compute the number of samples in the file.
void init()
Perform post-construction initialization.
Header file of the base class to signal_source GNSS blocks.
std::string item_type() const
The item type.
virtual std::tuple< size_t, bool > itemTypeToSize()
Compute the item size, from the item_type(). Subclasses may constrain types that don't make...
FileSourceBase(ConfigurationInterface const *configuration, std::string const &role, std::string impl, Concurrent_Queue< pmt::pmt_t > *queue, std::string default_item_type="short")
Constructor.
This abstract class represents an interface to configuration parameters.
size_t item_size() override
The configured size of each item.
int64_t sampling_frequency() const
The sampling frequency of the source file.
bool repeat() const
Whether to repeat reading after end-of-file.
virtual gnss_shared_ptr< gr::block > source() const
Abstracted front-end source. Sub-classes may override if they create specialized chains to decode sou...
Base class to file-oriented SignalSourceBase GNSS blocks.
virtual size_t source_item_size() const
For complex source chains, the size of the file item may not be the same as the size of the...
virtual size_t samplesToSkip() const
Compute the number of samples to skip.
std::string filename() const
The file to read.
virtual double packetsPerSample() const
The number of (possibly unpacked) samples in a (raw) file sample (default=1)
uint64_t samples() const
The number of samples in the file.