GNU Radio's SATNOGS Package
sigmf_metadata_impl.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_IMPL_H
22 #define INCLUDE_SATNOGS_SIGMF_METADATA_IMPL_H
23 
24 #include <satnogs/sigmf_metadata.h>
25 #include <libsigmf/sigmf.h>
26 #include <libsigmf/sigmf_antenna_generated.h>
27 #include <libsigmf/sigmf_satnogs_generated.h>
28 
29 
30 namespace gr {
31 namespace satnogs {
32 
33 /*!
34  * \brief <+description+>
35  *
36  */
38 public:
39  sigmf_metadata_impl(std::string global_segment_json);
40 
42 
43  metadata::metadata_sptr
44  make(const std::string &global_segment_json);
45 
46  void
47  transform(pmt::pmt_t &m);
48 
49  void
50  to_file(const std::string &filename);
51 
52 
53  const std::string
54  to_sting();
55 
56  void
57  append_capture_segment(uint64_t sample_start);
58 
59  void
60  append_capture_segment(uint64_t sample_start, uint64_t global_index,
61  double frequency, std::string datetime);
62 
63  void
64  append_capture_segment(std::string capture_json);
65 
66  void
67  append_annotation_segment(uint64_t sample_start, uint64_t sample_count);
68 
69  void
70  append_annotation_segment(uint64_t sample_start, uint64_t sample_count,
71  std::string generator, std::string comment,
72  double freq_lower_edge,
73  double freq_upper_edge);
74 
75  void
76  append_annotation_segment(std::string annotation_json);
77 
78  void
79  parse_json(std::string filename);
80 
81  sigmf::SigMF <
82  sigmf::Global<core::DescrT, antenna::DescrT, ::satnogs::DescrT>,
83  sigmf::Capture<core::DescrT>,
84  sigmf::Annotation<core::DescrT, antenna::DescrT, ::satnogs::DescrT> > &
85  get_sigmf();
86 
87 private:
88 
89  sigmf::SigMF <
90  sigmf::Global<core::DescrT, antenna::DescrT, ::satnogs::DescrT>,
91  sigmf::Capture<core::DescrT>,
92  sigmf::Annotation<core::DescrT, antenna::DescrT, ::satnogs::DescrT> > d_sigmf;
93 
94  std::string d_metafile_name;
95  std::string d_metadata_name;
96 
97  void
98  initialize_global(const std::string global_segment_json);
99 };
100 
101 } // namespace satnogs
102 } // namespace gr
103 
104 #endif /* INCLUDE_SATNOGS_SIGMF_METADATA_IMPL_H */
105 
Definition: sigmf_metadata.h:34
Definition: amsat_duv_decoder.h:29
#define SATNOGS_API
Definition: api.h:30
<+description+>
Definition: sigmf_metadata_impl.h:37