2017-05-02 10:01:18 +00:00
|
|
|
/*!
|
|
|
|
* \file gnss_sdr_sample_counter.h
|
|
|
|
* \brief Simple block to report the current receiver time based on the output of the tracking or telemetry blocks
|
2018-04-03 17:07:05 +00:00
|
|
|
* \author Javier Arribas 2018. jarribas(at)cttc.es
|
2017-05-02 10:01:18 +00:00
|
|
|
*
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2017-05-02 10:01:18 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
2017-05-02 10:01:18 +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
|
2017-05-02 10:01:18 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2017-05-02 10:01:18 +00:00
|
|
|
*/
|
2019-03-06 22:59:35 +00:00
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#ifndef GNSS_SDR_GNSS_SDR_SAMPLE_COUNTER_H
|
|
|
|
#define GNSS_SDR_GNSS_SDR_SAMPLE_COUNTER_H
|
2017-05-02 10:01:18 +00:00
|
|
|
|
2020-11-03 19:51:57 +00:00
|
|
|
#include "gnss_block_interface.h"
|
2018-12-09 21:00:09 +00:00
|
|
|
#include <gnuradio/sync_decimator.h>
|
2019-03-06 12:49:14 +00:00
|
|
|
#include <gnuradio/types.h> // for gr_vector_const_void_star
|
|
|
|
#include <cstddef> // for size_t
|
2018-08-10 18:34:03 +00:00
|
|
|
#include <cstdint>
|
2017-05-02 10:01:18 +00:00
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
/** \addtogroup Core
|
|
|
|
* \{ */
|
|
|
|
/** \addtogroup Core_Receiver_Library
|
|
|
|
* Utilities for the core GNSS receiver.
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
|
2017-05-02 10:01:18 +00:00
|
|
|
class gnss_sdr_sample_counter;
|
|
|
|
|
2020-11-03 19:51:57 +00:00
|
|
|
using gnss_sdr_sample_counter_sptr = gnss_shared_ptr<gnss_sdr_sample_counter>;
|
2017-05-02 10:01:18 +00:00
|
|
|
|
2018-12-09 21:00:09 +00:00
|
|
|
gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter(
|
|
|
|
double _fs,
|
|
|
|
int32_t _interval_ms,
|
|
|
|
size_t _size);
|
2017-05-02 10:01:18 +00:00
|
|
|
|
2018-02-13 17:16:03 +00:00
|
|
|
class gnss_sdr_sample_counter : public gr::sync_decimator
|
2017-05-02 10:01:18 +00:00
|
|
|
{
|
2019-07-01 21:44:42 +00:00
|
|
|
public:
|
2019-07-21 17:32:52 +00:00
|
|
|
~gnss_sdr_sample_counter() = default;
|
2019-07-01 21:44:42 +00:00
|
|
|
int work(int noutput_items,
|
|
|
|
gr_vector_const_void_star &input_items,
|
|
|
|
gr_vector_void_star &output_items);
|
|
|
|
|
2018-02-14 10:56:22 +00:00
|
|
|
private:
|
2019-07-01 21:44:42 +00:00
|
|
|
friend gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter(
|
|
|
|
double _fs,
|
|
|
|
int32_t _interval_ms,
|
|
|
|
size_t _size);
|
|
|
|
|
|
|
|
gnss_sdr_sample_counter(double _fs,
|
|
|
|
int32_t _interval_ms,
|
|
|
|
size_t _size);
|
|
|
|
|
2018-08-07 18:04:44 +00:00
|
|
|
double fs;
|
2020-06-27 07:25:04 +00:00
|
|
|
int64_t current_T_rx_ms; // Receiver time in ms since the beginning of the run
|
2018-08-10 18:34:03 +00:00
|
|
|
uint64_t sample_counter;
|
|
|
|
int32_t interval_ms;
|
|
|
|
int32_t report_interval_ms;
|
2020-06-27 07:25:04 +00:00
|
|
|
uint32_t samples_per_output;
|
|
|
|
uint32_t current_s; // Receiver time in seconds, modulo 60
|
|
|
|
uint32_t current_m; // Receiver time in minutes, modulo 60
|
|
|
|
uint32_t current_h; // Receiver time in hours, modulo 24
|
|
|
|
uint32_t current_days; // Receiver time in days since the beginning of the run
|
|
|
|
bool flag_m; // True if the receiver has been running for at least 1 minute
|
|
|
|
bool flag_h; // True if the receiver has been running for at least 1 hour
|
|
|
|
bool flag_days; // True if the receiver has been running for at least 1 day
|
2017-05-02 10:01:18 +00:00
|
|
|
bool flag_enable_send_msg;
|
|
|
|
};
|
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
|
|
|
|
/** \} */
|
|
|
|
/** \} */
|
2020-02-08 09:10:46 +00:00
|
|
|
#endif // GNSS_SDR_GNSS_SDR_SAMPLE_COUNTER_H
|