2014-02-18 19:40:44 +00:00
|
|
|
/*!
|
|
|
|
* \file array_signal_conditioner.cc
|
|
|
|
* \brief It wraps blocks to change data type, filter and resample input data, adapted to array receiver
|
|
|
|
* \author Javier Arribas jarribas (at) cttc.es
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*
|
2019-07-26 10:38:20 +00:00
|
|
|
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
|
2014-02-18 19:40:44 +00:00
|
|
|
*
|
|
|
|
* GNSS-SDR is a software defined Global Navigation
|
|
|
|
* Satellite Systems receiver
|
|
|
|
*
|
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
2020-02-08 00:20:02 +00:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2014-02-18 19:40:44 +00:00
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "array_signal_conditioner.h"
|
2019-03-04 07:12:50 +00:00
|
|
|
#include "configuration_interface.h"
|
2014-02-18 19:40:44 +00:00
|
|
|
#include <glog/logging.h>
|
2018-12-03 14:43:43 +00:00
|
|
|
#include <utility>
|
|
|
|
|
2014-02-18 19:40:44 +00:00
|
|
|
|
|
|
|
// Constructor
|
|
|
|
ArraySignalConditioner::ArraySignalConditioner(ConfigurationInterface *configuration,
|
2018-04-29 08:23:19 +00:00
|
|
|
std::shared_ptr<GNSSBlockInterface> data_type_adapt,
|
|
|
|
std::shared_ptr<GNSSBlockInterface> in_filt,
|
|
|
|
std::shared_ptr<GNSSBlockInterface> res,
|
|
|
|
std::string role,
|
2018-12-03 14:43:43 +00:00
|
|
|
std::string implementation) : data_type_adapt_(std::move(data_type_adapt)),
|
|
|
|
in_filt_(std::move(in_filt)),
|
|
|
|
res_(std::move(res)),
|
|
|
|
role_(std::move(role)),
|
|
|
|
implementation_(std::move(implementation))
|
2014-02-18 19:40:44 +00:00
|
|
|
{
|
|
|
|
connected_ = false;
|
2018-03-03 01:03:39 +00:00
|
|
|
if (configuration)
|
|
|
|
{
|
|
|
|
};
|
2014-02-18 19:40:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ArraySignalConditioner::connect(gr::top_block_sptr top_block)
|
|
|
|
{
|
2016-05-02 15:26:32 +00:00
|
|
|
// note: the array signal conditioner do not have data type adapter, and must use the array input filter (multichannel)
|
2014-02-18 19:40:44 +00:00
|
|
|
if (connected_)
|
|
|
|
{
|
2014-03-16 19:58:29 +00:00
|
|
|
LOG(WARNING) << "Array Signal conditioner already connected internally";
|
2014-02-18 19:40:44 +00:00
|
|
|
return;
|
|
|
|
}
|
2019-08-18 20:16:13 +00:00
|
|
|
// data_type_adapt_->connect(top_block);
|
2014-02-18 19:40:44 +00:00
|
|
|
in_filt_->connect(top_block);
|
|
|
|
res_->connect(top_block);
|
|
|
|
|
2019-08-18 20:16:13 +00:00
|
|
|
// top_block->connect(data_type_adapt_->get_right_block(), 0, in_filt_->get_left_block(), 0);
|
|
|
|
// DLOG(INFO) << "data_type_adapter -> input_filter";
|
2014-02-18 19:40:44 +00:00
|
|
|
|
|
|
|
top_block->connect(in_filt_->get_right_block(), 0,
|
2018-03-03 01:03:39 +00:00
|
|
|
res_->get_left_block(), 0);
|
2014-02-18 19:40:44 +00:00
|
|
|
|
|
|
|
DLOG(INFO) << "Array input_filter -> resampler";
|
|
|
|
|
|
|
|
connected_ = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ArraySignalConditioner::disconnect(gr::top_block_sptr top_block)
|
|
|
|
{
|
|
|
|
if (!connected_)
|
|
|
|
{
|
2014-03-16 19:58:29 +00:00
|
|
|
LOG(WARNING) << "Array Signal conditioner already disconnected internally";
|
2014-02-18 19:40:44 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-08-18 20:16:13 +00:00
|
|
|
// top_block->disconnect(data_type_adapt_->get_right_block(), 0,
|
2014-02-18 19:40:44 +00:00
|
|
|
// in_filt_->get_left_block(), 0);
|
|
|
|
top_block->disconnect(in_filt_->get_right_block(), 0,
|
2018-03-03 01:03:39 +00:00
|
|
|
res_->get_left_block(), 0);
|
2014-02-18 19:40:44 +00:00
|
|
|
|
2019-08-18 20:16:13 +00:00
|
|
|
// data_type_adapt_->disconnect(top_block);
|
2014-02-18 19:40:44 +00:00
|
|
|
in_filt_->disconnect(top_block);
|
|
|
|
res_->disconnect(top_block);
|
|
|
|
|
|
|
|
connected_ = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gr::basic_block_sptr ArraySignalConditioner::get_left_block()
|
|
|
|
{
|
2019-08-18 20:16:13 +00:00
|
|
|
// return data_type_adapt_->get_left_block();
|
2014-02-18 19:40:44 +00:00
|
|
|
return in_filt_->get_left_block();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gr::basic_block_sptr ArraySignalConditioner::get_right_block()
|
|
|
|
{
|
|
|
|
return res_->get_right_block();
|
|
|
|
}
|