1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-14 09:16:51 +00:00
gnss-sdr/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.cc
Carles Fernandez b04d77f402
Fix dump_filename parameter in TelemetryDecoder blocks.
New parameter dump_mat, by default set equal to dump. If set to false, dump files are not converted to .mat
New class to configure Telemetry blocks more easily
2020-11-21 19:37:22 +01:00

90 lines
2.6 KiB
C++

/*!
* \file glonass_l1_ca_telemetry_decoder.cc
* \brief Implementation of an adapter of a GLONASS L1 C/A NAV data decoder block
* to a TelemetryDecoderInterface
* \note Code added as part of GSoC 2017 program
* \author Damian Miralles, 2017. dmiralles2009(at)gmail.com
*
* -----------------------------------------------------------------------------
*
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
* -----------------------------------------------------------------------------
*/
#include "glonass_l1_ca_telemetry_decoder.h"
#include "configuration_interface.h"
#include <glog/logging.h>
GlonassL1CaTelemetryDecoder::GlonassL1CaTelemetryDecoder(
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : role_(role),
in_streams_(in_streams),
out_streams_(out_streams)
{
DLOG(INFO) << "role " << role;
tlm_parameters_.SetFromConfiguration(configuration, role);
// make telemetry decoder object
telemetry_decoder_ = glonass_l1_ca_make_telemetry_decoder_gs(satellite_, tlm_parameters_);
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
channel_ = 0;
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
}
if (out_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one output stream";
}
}
void GlonassL1CaTelemetryDecoder::set_satellite(const Gnss_Satellite& satellite)
{
satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
telemetry_decoder_->set_satellite(satellite_);
DLOG(INFO) << "TELEMETRY DECODER: satellite set to " << satellite_;
}
void GlonassL1CaTelemetryDecoder::connect(gr::top_block_sptr top_block)
{
if (top_block)
{ /* top_block is not null */
};
// Nothing to connect internally
DLOG(INFO) << "nothing to connect internally";
}
void GlonassL1CaTelemetryDecoder::disconnect(gr::top_block_sptr top_block)
{
if (top_block)
{ /* top_block is not null */
};
// Nothing to disconnect
}
gr::basic_block_sptr GlonassL1CaTelemetryDecoder::get_left_block()
{
return telemetry_decoder_;
}
gr::basic_block_sptr GlonassL1CaTelemetryDecoder::get_right_block()
{
return telemetry_decoder_;
}