mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-31 11:19:18 +00:00
fix whitespace
This commit is contained in:
parent
75483e1d2d
commit
41c7a7ad7d
@ -51,14 +51,6 @@ public:
|
|||||||
|
|
||||||
void start() override;
|
void start() override;
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief Returns "Ad9361_Fpga_Signal_Source"
|
|
||||||
*/
|
|
||||||
inline std::string implementation() override
|
|
||||||
{
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline size_t item_size() override
|
inline size_t item_size() override
|
||||||
{
|
{
|
||||||
return item_size_;
|
return item_size_;
|
||||||
|
@ -175,8 +175,8 @@ uint64_t FileSourceBase::samples() const
|
|||||||
|
|
||||||
|
|
||||||
FileSourceBase::FileSourceBase(ConfigurationInterface const* configuration, std::string role, std::string impl,
|
FileSourceBase::FileSourceBase(ConfigurationInterface const* configuration, std::string role, std::string impl,
|
||||||
Concurrent_Queue<pmt::pmt_t>* queue,
|
Concurrent_Queue<pmt::pmt_t>* queue,
|
||||||
std::string default_item_type)
|
std::string default_item_type)
|
||||||
: SignalSourceBase(configuration, role, impl)
|
: SignalSourceBase(configuration, role, impl)
|
||||||
, filename_(configuration->property(role + ".filename"s, "../data/example_capture.dat"s))
|
, filename_(configuration->property(role + ".filename"s, "../data/example_capture.dat"s))
|
||||||
, file_source_()
|
, file_source_()
|
||||||
@ -295,16 +295,16 @@ size_t FileSourceBase::samplesToSkip() const
|
|||||||
|
|
||||||
if (seconds_to_skip_ > 0)
|
if (seconds_to_skip_ > 0)
|
||||||
{
|
{
|
||||||
// sampling_frequency is in terms of actual samples (output packets). If this source is
|
// sampling_frequency is in terms of actual samples (output packets). If this source is
|
||||||
// compressed, there may be multiple packets per file (read) sample. First compute the
|
// compressed, there may be multiple packets per file (read) sample. First compute the
|
||||||
// actual number of samples to skip (function of time and sample rate)
|
// actual number of samples to skip (function of time and sample rate)
|
||||||
samples_to_skip = static_cast<size_t>(seconds_to_skip_ * sampling_frequency_);
|
samples_to_skip = static_cast<size_t>(seconds_to_skip_ * sampling_frequency_);
|
||||||
|
|
||||||
// convert from sample to input items, scaling this value to input item space
|
// convert from sample to input items, scaling this value to input item space
|
||||||
// (rounding up)
|
// (rounding up)
|
||||||
samples_to_skip = std::ceil(samples_to_skip / packetsPerSample());
|
samples_to_skip = std::ceil(samples_to_skip / packetsPerSample());
|
||||||
|
|
||||||
// complex inputs require two input items for one sample (arguably, packetsPerSample could be scaled by 0.5)
|
// complex inputs require two input items for one sample (arguably, packetsPerSample could be scaled by 0.5)
|
||||||
if (is_complex())
|
if (is_complex())
|
||||||
{
|
{
|
||||||
samples_to_skip *= 2;
|
samples_to_skip *= 2;
|
||||||
@ -330,7 +330,7 @@ size_t FileSourceBase::computeSamplesInFile() const
|
|||||||
// this could throw, but the existence of the file has been proven before we get here.
|
// this could throw, but the existence of the file has been proven before we get here.
|
||||||
auto size = fs::file_size(filename());
|
auto size = fs::file_size(filename());
|
||||||
|
|
||||||
// if there is some kind of compression/encoding, figure out the uncompressed number of samples
|
// if there is some kind of compression/encoding, figure out the uncompressed number of samples
|
||||||
n_samples = std::floor(packetsPerSample() * size / item_size());
|
n_samples = std::floor(packetsPerSample() * size / item_size());
|
||||||
|
|
||||||
auto to_skip = samplesToSkip();
|
auto to_skip = samplesToSkip();
|
||||||
@ -479,4 +479,3 @@ void FileSourceBase::pre_connect_hook(gr::top_block_sptr top_block [[maybe_unuse
|
|||||||
void FileSourceBase::post_connect_hook(gr::top_block_sptr top_block [[maybe_unused]]) {}
|
void FileSourceBase::post_connect_hook(gr::top_block_sptr top_block [[maybe_unused]]) {}
|
||||||
void FileSourceBase::pre_disconnect_hook(gr::top_block_sptr top_block [[maybe_unused]]) {}
|
void FileSourceBase::pre_disconnect_hook(gr::top_block_sptr top_block [[maybe_unused]]) {}
|
||||||
void FileSourceBase::post_disconnect_hook(gr::top_block_sptr top_block [[maybe_unused]]) {}
|
void FileSourceBase::post_disconnect_hook(gr::top_block_sptr top_block [[maybe_unused]]) {}
|
||||||
|
|
||||||
|
@ -85,8 +85,8 @@ protected:
|
|||||||
// type supported. Rather than require the item type to be specified in the config file, allow
|
// type supported. Rather than require the item type to be specified in the config file, allow
|
||||||
// sub-classes to impose their will
|
// sub-classes to impose their will
|
||||||
FileSourceBase(ConfigurationInterface const* configuration, std::string role, std::string impl,
|
FileSourceBase(ConfigurationInterface const* configuration, std::string role, std::string impl,
|
||||||
Concurrent_Queue<pmt::pmt_t>* queue,
|
Concurrent_Queue<pmt::pmt_t>* queue,
|
||||||
std::string default_item_type="short");
|
std::string default_item_type = "short");
|
||||||
|
|
||||||
//! perform post-construction initialization
|
//! perform post-construction initialization
|
||||||
void init();
|
void init();
|
||||||
|
@ -24,7 +24,7 @@ using namespace std::string_literals;
|
|||||||
NsrFileSignalSource::NsrFileSignalSource(const ConfigurationInterface* configuration,
|
NsrFileSignalSource::NsrFileSignalSource(const ConfigurationInterface* configuration,
|
||||||
const std::string& role, unsigned int in_streams, unsigned int out_streams,
|
const std::string& role, unsigned int in_streams, unsigned int out_streams,
|
||||||
Concurrent_Queue<pmt::pmt_t>* queue)
|
Concurrent_Queue<pmt::pmt_t>* queue)
|
||||||
: FileSourceBase(configuration, role, "Nsr_File_Signal_Source"s, queue, "byte"s)
|
: FileSourceBase(configuration, role, "Nsr_File_Signal_Source"s, queue, "byte"s)
|
||||||
{
|
{
|
||||||
if (in_streams > 0)
|
if (in_streams > 0)
|
||||||
{
|
{
|
||||||
@ -39,7 +39,7 @@ NsrFileSignalSource::NsrFileSignalSource(const ConfigurationInterface* configura
|
|||||||
std::tuple<size_t, bool> NsrFileSignalSource::itemTypeToSize()
|
std::tuple<size_t, bool> NsrFileSignalSource::itemTypeToSize()
|
||||||
{
|
{
|
||||||
auto is_complex = false;
|
auto is_complex = false;
|
||||||
auto item_size = size_t(sizeof(char)); // default
|
auto item_size = size_t(sizeof(char)); // default
|
||||||
|
|
||||||
if (item_type() == "byte")
|
if (item_type() == "byte")
|
||||||
{
|
{
|
||||||
@ -47,7 +47,7 @@ std::tuple<size_t, bool> NsrFileSignalSource::itemTypeToSize()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG(WARNING) << item_type() << " unrecognized item type. Using byte.";
|
LOG(WARNING) << item_type() << " unrecognized item type. Using byte.";
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::make_tuple(item_size, is_complex);
|
return std::make_tuple(item_size, is_complex);
|
||||||
|
@ -1101,7 +1101,7 @@ int GNSSFlowgraph::disconnect_signal_sources_from_signal_conditioners()
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
auto& src = sig_source_.at(i);
|
auto& src = sig_source_.at(i);
|
||||||
|
|
||||||
// TODO: Remove this array implementation and create generic multistream connector
|
// TODO: Remove this array implementation and create generic multistream connector
|
||||||
// (if a signal source has more than 1 stream, then connect it to the multistream signal conditioner)
|
// (if a signal source has more than 1 stream, then connect it to the multistream signal conditioner)
|
||||||
@ -1115,7 +1115,7 @@ int GNSSFlowgraph::disconnect_signal_sources_from_signal_conditioners()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto RF_Channels = src->getRfChannels();
|
auto RF_Channels = src->getRfChannels();
|
||||||
|
|
||||||
for (auto j = 0u; j < RF_Channels; ++j)
|
for (auto j = 0u; j < RF_Channels; ++j)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user