1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-10-31 23:26:22 +00:00
gnss-sdr/src/algorithms/channel/adapters/channel.h

120 lines
4.3 KiB
C
Raw Normal View History

/*!
* \file channel.h
* \brief Interface of a GNSS channel.
* \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
* Luis Esteve, 2011. luis(at)epsilon-formacion.com
*
* It holds blocks for acquisition, tracking,
* navigation data extraction and pseudorange calculation.
*
2020-07-28 14:57:15 +00:00
* -----------------------------------------------------------------------------
*
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
* This file is part of GNSS-SDR.
*
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
* SPDX-License-Identifier: GPL-3.0-or-later
*
2020-07-28 14:57:15 +00:00
* -----------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_CHANNEL_H
#define GNSS_SDR_CHANNEL_H
2019-04-27 11:09:36 +00:00
#include "channel_fsm.h"
#include "channel_interface.h"
#include "channel_msg_receiver_cc.h"
#include "concurrent_queue.h"
2019-03-04 07:12:50 +00:00
#include "gnss_signal.h"
#include "gnss_synchro.h"
#include <gnuradio/block.h>
#include <pmt/pmt.h>
2019-03-04 07:12:50 +00:00
#include <cstddef>
#include <cstdint>
#include <memory>
#include <mutex>
#include <string>
/** \addtogroup Channel
* Classes containing a GNSS channel.
* \{ */
/** \addtogroup Channel_adapters channel_adapters
* Classes that wrap an AcquisitionInterface,
* a TrackingInterface and a TelemetryDecoderInterface, and handles
* their interaction.
* \{ */
class ConfigurationInterface;
class AcquisitionInterface;
class TrackingInterface;
class TelemetryDecoderInterface;
2019-04-27 11:09:36 +00:00
/*!
* \brief This class represents a GNSS channel. It wraps an AcquisitionInterface,
* a TrackingInterface and a TelemetryDecoderInterface, and handles
* their interaction through a Finite State Machine
*
*/
class Channel : public ChannelInterface
{
public:
//! Constructor
Channel(const ConfigurationInterface* configuration,
uint32_t channel,
std::shared_ptr<AcquisitionInterface> acq,
std::shared_ptr<TrackingInterface> trk,
std::shared_ptr<TelemetryDecoderInterface> nav,
const std::string& role,
const std::string& signal_str,
Concurrent_Queue<pmt::pmt_t>* queue);
2019-04-27 11:09:36 +00:00
~Channel() = default; //!< Destructor
void connect(gr::top_block_sptr top_block) override; //!< Connects the tracking block to the top_block and to the telemetry
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_left_block_trk() override; //!< Gets the GNU Radio tracking block input pointer
gr::basic_block_sptr get_right_block_trk() override; //!< Gets the GNU Radio tracking block output pointer
gr::basic_block_sptr get_left_block_acq() override; //!< Gets the GNU Radio acquisition block input pointer
gr::basic_block_sptr get_right_block_acq() override; //!< Gets the GNU Radio acquisition block output pointer
gr::basic_block_sptr get_right_block() override; //!< Gets the GNU Radio channel block output pointer
inline std::string role() override { return role_; }
inline std::string implementation() override { return std::string("Channel"); } //!< Returns "Channel"
inline size_t item_size() override { return 2 * sizeof(float); }
2023-12-02 11:54:28 +00:00
Gnss_Signal get_signal() override;
void start_acquisition() override; //!< Start the State Machine
void stop_channel() override; //!< Stop the State Machine
void set_signal(const Gnss_Signal& gnss_signal_) override; //!< Sets the channel GNSS signal
void assist_acquisition_doppler(double Carrier_Doppler_hz) override;
inline std::shared_ptr<AcquisitionInterface> acquisition() const { return acq_; }
inline std::shared_ptr<TrackingInterface> tracking() const { return trk_; }
inline std::shared_ptr<TelemetryDecoderInterface> telemetry() const { return nav_; }
private:
2022-12-06 11:54:21 +00:00
bool glonass_dll_pll_c_aid_tracking_check() const;
std::shared_ptr<ChannelFsm> channel_fsm_;
std::shared_ptr<AcquisitionInterface> acq_;
std::shared_ptr<TrackingInterface> trk_;
std::shared_ptr<TelemetryDecoderInterface> nav_;
2020-06-19 10:39:28 +00:00
channel_msg_receiver_cc_sptr channel_msg_rx_;
Gnss_Synchro gnss_synchro_{};
Gnss_Signal gnss_signal_;
std::string role_;
2020-06-19 10:39:28 +00:00
std::mutex mx_;
2020-06-24 09:34:14 +00:00
uint32_t channel_;
2022-08-25 08:16:40 +00:00
int glonass_extend_correlation_ms_;
2020-06-19 10:39:28 +00:00
bool connected_;
bool repeat_;
bool flag_enable_fpga_;
};
/** \} */
/** \} */
#endif // GNSS_SDR_CHANNEL_H