2014-06-10 16:58:17 +00:00
|
|
|
/*!
|
|
|
|
* \file hybrid_observables.cc
|
|
|
|
* \brief Implementation of an adapter of a Galileo E1 observables block
|
|
|
|
* to a ObservablesInterface
|
|
|
|
* \author Javier Arribas, 2011. jarribas(at)cttc.es
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2014-06-10 16:58:17 +00:00
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2014-06-10 16:58:17 +00:00
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
2020-02-08 00:20:02 +00:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2014-06-10 16:58:17 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2014-06-10 16:58:17 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "hybrid_observables.h"
|
|
|
|
#include "configuration_interface.h"
|
2020-02-10 18:51:33 +00:00
|
|
|
#include "gnss_sdr_flags.h"
|
2020-02-10 09:59:10 +00:00
|
|
|
#include "obs_conf.h"
|
2018-02-26 02:15:53 +00:00
|
|
|
#include <glog/logging.h>
|
2019-03-05 07:59:04 +00:00
|
|
|
#include <ostream> // for operator<<
|
2018-02-26 02:15:53 +00:00
|
|
|
|
2020-06-29 07:07:41 +00:00
|
|
|
HybridObservables::HybridObservables(const ConfigurationInterface* configuration,
|
2022-12-06 11:54:21 +00:00
|
|
|
const std::string& role,
|
|
|
|
unsigned int in_streams,
|
|
|
|
unsigned int out_streams) : role_(role),
|
|
|
|
in_streams_(in_streams),
|
|
|
|
out_streams_(out_streams),
|
|
|
|
dump_(configuration->property(role + ".dump", false)),
|
|
|
|
dump_mat_(configuration->property(role + ".dump_mat", true))
|
2014-06-10 16:58:17 +00:00
|
|
|
{
|
2020-07-17 08:48:37 +00:00
|
|
|
const std::string default_dump_filename("./observables.dat");
|
2014-06-10 16:58:17 +00:00
|
|
|
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
2018-02-16 17:10:48 +00:00
|
|
|
|
2021-06-12 09:01:18 +00:00
|
|
|
Obs_Conf conf{};
|
2020-02-10 09:59:10 +00:00
|
|
|
conf.dump = dump_;
|
|
|
|
conf.dump_mat = dump_mat_;
|
|
|
|
conf.dump_filename = dump_filename_;
|
|
|
|
conf.nchannels_in = in_streams_;
|
|
|
|
conf.nchannels_out = out_streams_;
|
2021-06-12 09:01:18 +00:00
|
|
|
conf.observable_interval_ms = configuration->property("GNSS-SDR.observable_interval_ms", conf.observable_interval_ms);
|
2020-02-10 18:51:33 +00:00
|
|
|
conf.enable_carrier_smoothing = configuration->property(role + ".enable_carrier_smoothing", conf.enable_carrier_smoothing);
|
2021-10-22 13:40:17 +00:00
|
|
|
conf.always_output_gs = configuration->property("PVT.an_output_enabled", conf.always_output_gs) || configuration->property(role + ".always_output_gs", conf.always_output_gs);
|
2020-02-10 18:51:33 +00:00
|
|
|
|
2020-02-11 18:34:21 +00:00
|
|
|
if (FLAGS_carrier_smoothing_factor == DEFAULT_CARRIER_SMOOTHING_FACTOR)
|
2020-02-10 18:51:33 +00:00
|
|
|
{
|
|
|
|
conf.smoothing_factor = configuration->property(role + ".smoothing_factor", conf.smoothing_factor);
|
|
|
|
}
|
2022-12-06 11:54:21 +00:00
|
|
|
DLOG(INFO) << "role " << role;
|
2020-02-10 09:59:10 +00:00
|
|
|
if (conf.enable_carrier_smoothing == true)
|
|
|
|
{
|
|
|
|
LOG(INFO) << "Observables carrier smoothing enabled with smoothing factor " << conf.smoothing_factor;
|
|
|
|
}
|
|
|
|
observables_ = hybrid_observables_gs_make(conf);
|
2018-02-14 10:56:22 +00:00
|
|
|
DLOG(INFO) << "Observables block ID (" << observables_->unique_id() << ")";
|
2014-06-10 16:58:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void HybridObservables::connect(gr::top_block_sptr top_block)
|
|
|
|
{
|
2018-03-03 01:03:39 +00:00
|
|
|
if (top_block)
|
|
|
|
{ /* top_block is not null */
|
|
|
|
};
|
2015-03-16 23:22:20 +00:00
|
|
|
// Nothing to connect internally
|
2014-06-10 16:58:17 +00:00
|
|
|
DLOG(INFO) << "nothing to connect internally";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void HybridObservables::disconnect(gr::top_block_sptr top_block)
|
|
|
|
{
|
2018-03-03 01:03:39 +00:00
|
|
|
if (top_block)
|
|
|
|
{ /* top_block is not null */
|
|
|
|
};
|
2015-03-16 23:22:20 +00:00
|
|
|
// Nothing to disconnect
|
2014-06-10 16:58:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gr::basic_block_sptr HybridObservables::get_left_block()
|
|
|
|
{
|
|
|
|
return observables_;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gr::basic_block_sptr HybridObservables::get_right_block()
|
|
|
|
{
|
|
|
|
return observables_;
|
|
|
|
}
|