GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
sensor_data_source_configuration.h
Go to the documentation of this file.
1/*!
2 * \file sensor_data_source_configuration.h
3 * \brief
4 * \author Victor Castillo, 2024. victorcastilloaguero(at)gmail.com
5 *
6 * -----------------------------------------------------------------------------
7 *
8 * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
9 * This file is part of GNSS-SDR.
10 *
11 * Copyright (C) 2024-2025 (see AUTHORS file for a list of contributors)
12 * SPDX-License-Identifier: GPL-3.0-or-later
13 *
14 * -----------------------------------------------------------------------------
15 */
16
17
18#ifndef GNSS_SDR_SENSOR_DATA_SOURCE_CONFIGURATION_H
19#define GNSS_SDR_SENSOR_DATA_SOURCE_CONFIGURATION_H
20
22#include "sensor_data_type.h"
23#include "sensor_identifier.h"
24#include <string>
25#include <unordered_map>
26
27/** \addtogroup Algorithms_Library
28 * \{ */
29/** \addtogroup Algorithm_libs algorithms_libs
30 * \{ */
31
33
35{
36 uint64_t id;
37 uint64_t chunk_size;
38 uint64_t file_offset;
39 uint64_t sample_offset;
40 uint64_t sample_period;
41 std::string filename;
42 bool repeat;
43};
44
45
47{
48 uint64_t id;
49 uint64_t file_id;
50 uint64_t offset;
51 SensorIdentifier::value_type identifier;
52 SensorDataType::value_type type;
53 pmt::pmt_t tag_key;
54};
55
56
57class SensorDataSourceConfiguration
58{
59public:
60 explicit SensorDataSourceConfiguration(const ConfigurationInterface* configuration);
61
62 bool validate() const;
63
64 bool is_enabled() const;
65
66 bool is_sensor_provided(SensorIdentifier::value_type sensor_id) const;
67
68 const std::unordered_map<uint64_t, SensorDataFileConfiguration>& files() const;
69
70 const std::vector<SensorDataConfiguration>& sensors() const;
71
72 void set_items_per_sample(uint64_t items_per_sample);
73
74 uint64_t get_items_per_sample() const;
75
76private:
77 void configure_files(const ConfigurationInterface* configuration);
78
79 void configure_sensors(const ConfigurationInterface* configuration);
80
81 bool validate_files() const;
82
83 bool validate_sensors() const;
84
85 bool enabled_;
86 std::unordered_map<uint64_t, SensorDataFileConfiguration> files_;
87 std::vector<SensorDataConfiguration> sensors_;
88 uint64_t items_per_sample_;
89};
90
91/** \} */
92/** \} */
93#endif // GNSS_SDR_SENSOR_DATA_SOURCE_CONFIGURATION_H
This abstract class represents an interface to configuration parameters.
This class represents an interface to configuration parameters.