GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
FileSourceBase Class Reference

Base class to file-oriented SignalSourceBase GNSS blocks. More...

#include <file_source_base.h>

Inheritance diagram for FileSourceBase:
SignalSourceBase SignalSourceInterface GNSSBlockInterface FileSignalSource FileTimestampSignalSource FourBitCpxFileSignalSource NTLabFileSignalSource NsrFileSignalSource SpirFileSignalSource TwoBitCpxFileSignalSource TwoBitPackedFileSignalSource

Public Member Functions

void connect (gr::top_block_sptr top_block) override
void disconnect (gr::top_block_sptr top_block) override
gr::basic_block_sptr get_left_block () override
gr::basic_block_sptr get_right_block () override
std::string filename () const
 The file to read.
std::string item_type () const
 The item type.
size_t item_size () override
 The configured size of each item.
virtual size_t item_size () const
bool repeat () const
 Whether to repeat reading after end-of-file.
int64_t sampling_frequency () const
 The sampling frequency of the source file.
uint64_t samples () const
 The number of samples in the file.
Public Member Functions inherited from SignalSourceBase
std::string role () final
std::string implementation () final
size_t getRfChannels () const override
gr::basic_block_sptr get_left_block () override
Public Member Functions inherited from GNSSBlockInterface
virtual gr::basic_block_sptr get_left_block (int RF_channel)
virtual gr::basic_block_sptr get_right_block (int RF_channel)
virtual void start ()
 Start the flow of samples if needed.

Protected Member Functions

 FileSourceBase (ConfigurationInterface const *configuration, std::string const &role, std::string impl, Concurrent_Queue< pmt::pmt_t > *queue, std::string default_item_type="short")
 Constructor.
void init ()
 Perform post-construction initialization.
virtual std::tuple< size_t, bool > itemTypeToSize ()
 Compute the item size, from the item_type(). Subclasses may constrain types that don't make.
virtual double packetsPerSample () const
 The number of (possibly unpacked) samples in a (raw) file sample (default=1).
virtual uint64_t samplesToSkip () const
 Compute the number of samples to skip.
uint64_t computeSamplesInFile () const
 Compute the number of samples in the file.
virtual gnss_shared_ptr< gr::block > source () const
 Abstracted front-end source. Sub-classes may override if they create specialized chains to decode source files into a usable format.
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.
bool is_complex () const
gnss_shared_ptr< gr::block > file_source () const
gnss_shared_ptr< gr::block > valve () const
gnss_shared_ptr< gr::block > throttle () const
gnss_shared_ptr< gr::block > sink () const
SensorDataSource::sptr sensor_data_source () const
gr::blocks::file_source::sptr create_file_source ()
gr::blocks::throttle::sptr create_throttle ()
gnss_shared_ptr< gr::block > create_valve ()
gr::blocks::file_sink::sptr create_sink ()
SensorDataSource::sptr create_sensor_data_source ()
virtual void create_file_source_hook ()
virtual void create_throttle_hook ()
virtual void create_valve_hook ()
virtual void create_sink_hook ()
virtual void pre_connect_hook (gr::top_block_sptr top_block)
virtual void post_connect_hook (gr::top_block_sptr top_block)
virtual void pre_disconnect_hook (gr::top_block_sptr top_block)
virtual void post_disconnect_hook (gr::top_block_sptr top_block)
Protected Member Functions inherited from SignalSourceBase
 SignalSourceBase (ConfigurationInterface const *configuration, std::string role, std::string impl)
 Constructor.
size_t decode_item_type (std::string const &item_type, bool *is_interleaved=nullptr, bool throw_on_error=false)
 utility for decoding passed ".item_type" values

Detailed Description

Base class to file-oriented SignalSourceBase GNSS blocks.

This class supports the following properties:

.filename - the path to the input file

  • may be overridden by the -signal_source or -s command-line arguments

.samples - number of samples to process (default 0)

  • if not specified or 0, read the entire file; otherwise stop after that many samples

.sampling_frequency - the frequency of the sampled data (samples/second)

.item_type - data type of the samples (default "short")

.header_size - the size of a prefixed header to skip in "samples" (default 0)

.seconds_to_skip - number of seconds of lead-in data to skip over (default 0)

.enable_throttle_control - whether to stop reading if the upstream buffer is full (default false)

.repeat - whether to rewind and continue at end of file (default false)

(probably abstracted to the base class)

.dump - whether to archive input data

.dump_filename - if dumping, path to file for output

Definition at line 68 of file file_source_base.h.

Constructor & Destructor Documentation

◆ FileSourceBase()

FileSourceBase::FileSourceBase ( ConfigurationInterface const * configuration,
std::string const & role,
std::string impl,
Concurrent_Queue< pmt::pmt_t > * queue,
std::string default_item_type = "short" )
protected

Constructor.

Subclasses may want to assert default item types that are appropriate to the specific file type supported. Rather than require the item type to be specified in the config file, allow sub-classes to impose their will

Member Function Documentation

◆ computeSamplesInFile()

uint64_t FileSourceBase::computeSamplesInFile ( ) const
protected

Compute the number of samples in the file.

◆ connect()

void FileSourceBase::connect ( gr::top_block_sptr top_block)
overridevirtual

Implements GNSSBlockInterface.

◆ disconnect()

void FileSourceBase::disconnect ( gr::top_block_sptr top_block)
overridevirtual

Implements GNSSBlockInterface.

◆ filename()

std::string FileSourceBase::filename ( ) const

The file to read.

◆ get_left_block()

gr::basic_block_sptr FileSourceBase::get_left_block ( )
overridevirtual

Implements GNSSBlockInterface.

◆ get_right_block()

gr::basic_block_sptr FileSourceBase::get_right_block ( )
overridevirtual

Implements GNSSBlockInterface.

◆ init()

void FileSourceBase::init ( )
protected

Perform post-construction initialization.

◆ item_size()

size_t FileSourceBase::item_size ( )
overridevirtual

The configured size of each item.

Implements GNSSBlockInterface.

◆ item_type()

std::string FileSourceBase::item_type ( ) const

The item type.

◆ itemTypeToSize()

virtual std::tuple< size_t, bool > FileSourceBase::itemTypeToSize ( )
protectedvirtual

Compute the item size, from the item_type(). Subclasses may constrain types that don't make.

Reimplemented in FourBitCpxFileSignalSource, NsrFileSignalSource, NTLabFileSignalSource, SpirFileSignalSource, TwoBitCpxFileSignalSource, and TwoBitPackedFileSignalSource.

◆ packetsPerSample()

virtual double FileSourceBase::packetsPerSample ( ) const
protectedvirtual

The number of (possibly unpacked) samples in a (raw) file sample (default=1).

Reimplemented in FourBitCpxFileSignalSource, NsrFileSignalSource, NTLabFileSignalSource, TwoBitCpxFileSignalSource, and TwoBitPackedFileSignalSource.

◆ repeat()

bool FileSourceBase::repeat ( ) const

Whether to repeat reading after end-of-file.

◆ samples()

uint64_t FileSourceBase::samples ( ) const

The number of samples in the file.

◆ samplesToSkip()

virtual uint64_t FileSourceBase::samplesToSkip ( ) const
protectedvirtual

Compute the number of samples to skip.

◆ sampling_frequency()

int64_t FileSourceBase::sampling_frequency ( ) const

The sampling frequency of the source file.

◆ source()

virtual gnss_shared_ptr< gr::block > FileSourceBase::source ( ) const
protectedvirtual

Abstracted front-end source. Sub-classes may override if they create specialized chains to decode source files into a usable format.

Reimplemented in FileTimestampSignalSource, FourBitCpxFileSignalSource, NsrFileSignalSource, NTLabFileSignalSource, SpirFileSignalSource, TwoBitCpxFileSignalSource, and TwoBitPackedFileSignalSource.

◆ source_item_size()

virtual size_t FileSourceBase::source_item_size ( ) const
protectedvirtual

For complex source chains, the size of the file item may not be the same as the size of the.


The documentation for this class was generated from the following file: