2011-10-01 18:45:20 +00:00
|
|
|
/*!
|
|
|
|
* \file file_signal_source.cc
|
2011-12-28 21:36:45 +00:00
|
|
|
* \brief Implementation of a class that reads signals samples from a file
|
|
|
|
* and adapts it to a SignalSourceInterface
|
2011-10-01 18:45:20 +00:00
|
|
|
* \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
|
|
|
|
* Javier Arribas, 2011 jarribas(at)cttc.es
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2011-10-01 18:45:20 +00:00
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
2021-02-12 18:46:19 +00:00
|
|
|
* Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
|
2020-02-08 00:20:02 +00:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2011-10-01 18:45:20 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "file_signal_source.h"
|
2021-02-16 13:27:46 +00:00
|
|
|
#include "gnss_sdr_string_literals.h"
|
2018-02-26 02:15:53 +00:00
|
|
|
#include <glog/logging.h>
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2021-02-09 22:47:34 +00:00
|
|
|
using namespace std::string_literals;
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2021-02-09 22:47:34 +00:00
|
|
|
FileSignalSource::FileSignalSource(ConfigurationInterface const* configuration,
|
|
|
|
std::string const& role, unsigned int in_streams, unsigned int out_streams,
|
|
|
|
Concurrent_Queue<pmt::pmt_t>* queue)
|
2021-02-15 22:34:48 +00:00
|
|
|
: FileSourceBase(configuration, role, "File_Signal_Source"s, queue, "short"s)
|
2011-10-01 18:45:20 +00:00
|
|
|
{
|
2021-02-11 19:47:17 +00:00
|
|
|
if (in_streams > 0)
|
2018-06-03 17:11:16 +00:00
|
|
|
{
|
|
|
|
LOG(ERROR) << "A signal source does not have an input stream";
|
|
|
|
}
|
2021-02-11 19:47:17 +00:00
|
|
|
if (out_streams > 1)
|
2018-06-03 17:11:16 +00:00
|
|
|
{
|
|
|
|
LOG(ERROR) << "This implementation only supports one output stream";
|
|
|
|
}
|
2011-10-01 18:45:20 +00:00
|
|
|
}
|