GNU Radio's SATNOGS Package
sigmf_metadata.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * gr-satnogs: SatNOGS GNU Radio Out-Of-Tree Module
4 *
5 * Copyright (C) 2020, Libre Space Foundation <http://libre.space>
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef INCLUDE_SATNOGS_SIGMF_METADATA_H
22#define INCLUDE_SATNOGS_SIGMF_METADATA_H
23
24#include "libsigmf/sigmf.h"
25#include "libsigmf/sigmf_antenna_generated.h"
26#include "libsigmf/sigmf_satnogs_generated.h"
27
30#include <pmt/pmt.h>
31
32
33namespace gr {
34namespace satnogs {
35
36/*!
37 * The sigMF implementation of gr-satnogs metadata
38 */
40{
41public:
42 sigmf_metadata(std::string global_segment_json);
43
45
46 static metadata::metadata_sptr make(const std::string global_segment_json);
47
48 void transform(pmt::pmt_t& m);
49
50 void to_file(const std::string& filename);
51
52 const std::string to_sting();
53
54 void append_capture_segment(uint64_t sample_start);
55
56 void append_capture_segment(uint64_t sample_start,
57 uint64_t global_index,
58 double frequency,
59 std::string datetime);
60
61 void append_capture_segment(std::string capture_json);
62
63 void append_annotation_segment(uint64_t sample_start, uint64_t sample_count);
64
65 void append_annotation_segment(uint64_t sample_start,
66 uint64_t sample_count,
67 std::string generator,
68 std::string comment,
69 double freq_lower_edge,
70 double freq_upper_edge);
71
72 void append_annotation_segment(std::string annotation_json);
73
74 void parse_json(std::string filename);
75
76 sigmf::SigMF<sigmf::Global<core::DescrT, antenna::DescrT, ::satnogs::DescrT>,
77 sigmf::Capture<core::DescrT>,
78 sigmf::Annotation<core::DescrT, antenna::DescrT, ::satnogs::DescrT>>&
80
81private:
82 sigmf::SigMF<sigmf::Global<core::DescrT, antenna::DescrT, ::satnogs::DescrT>,
83 sigmf::Capture<core::DescrT>,
84 sigmf::Annotation<core::DescrT, antenna::DescrT, ::satnogs::DescrT>>
85 d_sigmf;
86
87 std::string d_metafile_name;
88 std::string d_metadata_name;
89
90 void initialize_global(const std::string global_segment_json);
91};
92
93
94} // namespace satnogs
95} // namespace gr
96
97#endif /* INCLUDE_SATNOGS_SIGMF_METADATA_H */
#define SATNOGS_API
Definition: api.h:19
Definition: metadata.h:36
Definition: sigmf_metadata.h:40
void append_annotation_segment(uint64_t sample_start, uint64_t sample_count)
void append_capture_segment(std::string capture_json)
sigmf_metadata(std::string global_segment_json)
void to_file(const std::string &filename)
void transform(pmt::pmt_t &m)
sigmf::SigMF< sigmf::Global< core::DescrT, antenna::DescrT, ::satnogs::DescrT >, sigmf::Capture< core::DescrT >, sigmf::Annotation< core::DescrT, antenna::DescrT, ::satnogs::DescrT > > & get_sigmf()
void append_capture_segment(uint64_t sample_start)
static metadata::metadata_sptr make(const std::string global_segment_json)
void append_capture_segment(uint64_t sample_start, uint64_t global_index, double frequency, std::string datetime)
void append_annotation_segment(std::string annotation_json)
const std::string to_sting()
void append_annotation_segment(uint64_t sample_start, uint64_t sample_count, std::string generator, std::string comment, double freq_lower_edge, double freq_upper_edge)
Definition: amsat_duv_decoder.h:29