0.4.1
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
UartDataLogger.hpp
Go to the documentation of this file.
1// This file is part of INSTINCT, the INS Toolkit for Integrated
2// Navigation Concepts and Training by the Institute of Navigation of
3// the University of Stuttgart, Germany.
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9/// @file UartDataLogger.hpp
10/// @brief Data Logger for Uart packets
11/// @author T. Topp (topp@ins.uni-stuttgart.de)
12/// @date 2022-06-13
13
14#pragma once
15
18
19namespace NAV
20{
21class NodeData;
22
23/// Data Logger for Ublox observations
24class UartDataLogger : public Node, public FileWriter
25{
26 public:
27 /// @brief Default constructor
29 /// @brief Destructor
30 ~UartDataLogger() override;
31 /// @brief Copy constructor
33 /// @brief Move constructor
35 /// @brief Copy assignment operator
37 /// @brief Move assignment operator
39
40 /// @brief String representation of the Class Type
41 [[nodiscard]] static std::string typeStatic();
42
43 /// @brief String representation of the Class Type
44 [[nodiscard]] std::string type() const override;
45
46 /// @brief String representation of the Class Category
47 [[nodiscard]] static std::string category();
48
49 /// @brief ImGui config window which is shown on double click
50 /// @attention Don't forget to set _hasConfig to true in the constructor of the node
51 void guiConfig() override;
52
53 /// @brief Saves the node into a json object
54 [[nodiscard]] json save() const override;
55
56 /// @brief Restores the node from a json object
57 /// @param[in] j Json object with the node state
58 void restore(const json& j) override;
59
60 /// @brief Function called by the flow executer after finishing to flush out remaining data
61 void flush() override;
62
63 private:
64 /// @brief Initialize the node
65 bool initialize() override;
66
67 /// @brief Deinitialize the node
68 void deinitialize() override;
69
70 /// @brief Write Observation to the file
71 /// @param[in] queue Queue with all the received data messages
72 /// @param[in] pinIdx Index of the pin the data is received on
73 void writeObservation(InputPin::NodeDataQueue& queue, size_t pinIdx);
74};
75
76} // namespace NAV
File Writer class.
nlohmann::json json
json namespace
Node Class.
FileWriter(const FileWriter &)=delete
Copy constructor.
TsDeque< std::shared_ptr< const NAV::NodeData > > NodeDataQueue
Node data queue type.
Definition Pin.hpp:707
Parent class for all data transmitted over Flow pins.
Definition NodeData.hpp:28
Node(std::string name)
Constructor.
Definition Node.cpp:30
UartDataLogger()
Default constructor.
UartDataLogger & operator=(UartDataLogger &&)=delete
Move assignment operator.
UartDataLogger(const UartDataLogger &)=delete
Copy constructor.
static std::string category()
String representation of the Class Category.
void guiConfig() override
ImGui config window which is shown on double click.
static std::string typeStatic()
String representation of the Class Type.
json save() const override
Saves the node into a json object.
UartDataLogger & operator=(const UartDataLogger &)=delete
Copy assignment operator.
UartDataLogger(UartDataLogger &&)=delete
Move constructor.
void flush() override
Function called by the flow executer after finishing to flush out remaining data.
void restore(const json &j) override
Restores the node from a json object.
std::string type() const override
String representation of the Class Type.
bool initialize() override
Initialize the node.
void deinitialize() override
Deinitialize the node.
void writeObservation(InputPin::NodeDataQueue &queue, size_t pinIdx)
Write Observation to the file.
~UartDataLogger() override
Destructor.