5G-MAG Reference Tools - MBMS Modem
src
MeasurementFileWriter.h
Go to the documentation of this file.
1
// 5G-MAG Reference Tools
2
// MBMS Modem Process
3
//
4
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
5
//
6
// This program is free software: you can redistribute it and/or modify
7
// it under the terms of the GNU Affero General Public License as published by
8
// the Free Software Foundation, either version 3 of the License, or
9
// (at your option) any later version.
10
//
11
// This program is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
// GNU Affero General Public License for more details.
15
//
16
// You should have received a copy of the GNU Affero General Public License
17
// along with this program. If not, see <http://www.gnu.org/licenses/>.
18
//
19
20
#pragma once
21
22
#include <libgpsmm.h>
23
24
#include <string>
25
#include <thread>
26
#include <cstdint>
27
#include <memory>
28
#include <vector>
29
30
#include <libconfig.h++>
31
35
class
MeasurementFileWriter
{
36
public
:
42
explicit
MeasurementFileWriter
(
const
libconfig::Config&
cfg
);
43
47
virtual
~MeasurementFileWriter
();
48
60
void
WriteLogValues
(
const
std::vector<std::string>& values);
61
62
private
:
63
void
ReadGps
();
64
65
const
libconfig::Config&
_cfg
;
66
67
std::unique_ptr<gpsmm>
_gps
;
68
struct
gps_data_t*
_gps_data
{};
69
std::thread
_gps_reader_thread
;
70
bool
_running
=
true
;
71
72
std::string
_last_gps_lat
=
""
;
73
std::string
_last_gps_lng
=
""
;
74
std::string
_last_gps_time
=
""
;
75
};
MeasurementFileWriter
Writes measurement data / current reception parameters to a file.
Definition:
MeasurementFileWriter.h:35
MeasurementFileWriter::_gps
std::unique_ptr< gpsmm > _gps
Definition:
MeasurementFileWriter.h:67
MeasurementFileWriter::_running
bool _running
Definition:
MeasurementFileWriter.h:70
MeasurementFileWriter::ReadGps
void ReadGps()
Definition:
MeasurementFileWriter.cpp:66
MeasurementFileWriter::_gps_reader_thread
std::thread _gps_reader_thread
Definition:
MeasurementFileWriter.h:69
MeasurementFileWriter::~MeasurementFileWriter
virtual ~MeasurementFileWriter()
Default destructor.
Definition:
MeasurementFileWriter.cpp:61
MeasurementFileWriter::_cfg
const libconfig::Config & _cfg
Definition:
MeasurementFileWriter.h:65
MeasurementFileWriter::WriteLogValues
void WriteLogValues(const std::vector< std::string > &values)
Write a line containing the passed values.
Definition:
MeasurementFileWriter.cpp:100
MeasurementFileWriter::_last_gps_lat
std::string _last_gps_lat
Definition:
MeasurementFileWriter.h:72
MeasurementFileWriter::_last_gps_time
std::string _last_gps_time
Definition:
MeasurementFileWriter.h:74
MeasurementFileWriter::MeasurementFileWriter
MeasurementFileWriter(const libconfig::Config &cfg)
Default constructor.
Definition:
MeasurementFileWriter.cpp:37
MeasurementFileWriter::_gps_data
struct gps_data_t * _gps_data
Definition:
MeasurementFileWriter.h:68
MeasurementFileWriter::_last_gps_lng
std::string _last_gps_lng
Definition:
MeasurementFileWriter.h:73
cfg
static Config cfg
Global configuration object.
Definition:
main.cpp:165
Generated by
1.9.1