0.4.1
Loading...
Searching...
No Matches
KvhFile.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 KvhFile.hpp
10/// @brief File Reader for Kvh log files
11/// @author T. Topp (topp@ins.uni-stuttgart.de)
12/// @date 2020-03-16
13
14#pragma once
15
18
20
21namespace NAV
22{
23/// File Reader for Kvh log files
24class KvhFile : public Imu, public FileReader
25{
26 public:
27 /// @brief Default constructor
28 KvhFile();
29 /// @brief Destructor
30 ~KvhFile() override;
31 /// @brief Copy constructor
32 KvhFile(const KvhFile&) = delete;
33 /// @brief Move constructor
34 KvhFile(KvhFile&&) = delete;
35 /// @brief Copy assignment operator
36 KvhFile& operator=(const KvhFile&) = delete;
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 Resets the node. Moves the read cursor to the start
61 bool resetNode() override;
62
63 private:
64 constexpr static size_t OUTPUT_PORT_INDEX_KVH_OBS = 0; ///< @brief Flow (KvhObs)
65 constexpr static size_t OUTPUT_PORT_INDEX_HEADER_COLUMNS = 1; ///< @brief Object (std::vector<std::string>)
66
67 /// @brief Initialize the node
68 bool initialize() override;
69
70 /// @brief Deinitialize the node
71 void deinitialize() override;
72
73 /// @brief Polls data from the file
74 /// @return The read observation
75 [[nodiscard]] std::shared_ptr<const NodeData> pollData();
76
77 /// @brief Determines the type of the file
78 /// @return The File Type
79 [[nodiscard]] FileType determineFileType() override;
80
81 /// Sensor Object
83
84 /// Previous Sequence number to check for order errors
85 uint8_t _prevSequenceNumber = UINT8_MAX;
86};
87
88} // namespace NAV
Abstract File Reader class.
nlohmann::json json
json namespace
Abstract IMU Class.
Class to read out KVH Sensors.
FileType
File Type Enumeration.
FileReader(const FileReader &)=delete
Copy constructor.
Imu(const Imu &)=delete
Copy constructor.
static constexpr size_t OUTPUT_PORT_INDEX_KVH_OBS
Flow (KvhObs)
Definition KvhFile.hpp:64
~KvhFile() override
Destructor.
Definition KvhFile.cpp:33
KvhFile(const KvhFile &)=delete
Copy constructor.
KvhFile()
Default constructor.
Definition KvhFile.cpp:21
KvhFile(KvhFile &&)=delete
Move constructor.
static std::string typeStatic()
String representation of the Class Type.
Definition KvhFile.cpp:38
bool resetNode() override
Resets the node. Moves the read cursor to the start.
Definition KvhFile.cpp:156
void deinitialize() override
Deinitialize the node.
Definition KvhFile.cpp:149
KvhFile & operator=(const KvhFile &)=delete
Copy assignment operator.
KvhFile & operator=(KvhFile &&)=delete
Move assignment operator.
uint8_t _prevSequenceNumber
Previous Sequence number to check for order errors.
Definition KvhFile.hpp:85
void restore(const json &j) override
Restores the node from a json object.
Definition KvhFile.cpp:128
static std::string category()
String representation of the Class Category.
Definition KvhFile.cpp:48
vendor::kvh::KvhUartSensor _sensor
Sensor Object.
Definition KvhFile.hpp:82
void guiConfig() override
ImGui config window which is shown on double click.
Definition KvhFile.cpp:53
FileType determineFileType() override
Determines the type of the file.
Definition KvhFile.cpp:349
static constexpr size_t OUTPUT_PORT_INDEX_HEADER_COLUMNS
Object (std::vector<std::string>)
Definition KvhFile.hpp:65
std::shared_ptr< const NodeData > pollData()
Polls data from the file.
Definition KvhFile.cpp:163
std::string type() const override
String representation of the Class Type.
Definition KvhFile.cpp:43
json save() const override
Saves the node into a json object.
Definition KvhFile.cpp:116
bool initialize() override
Initialize the node.
Definition KvhFile.cpp:142
Class to read out KVH Sensors.