0.2.0
Loading...
Searching...
No Matches
NmeaFile.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
13
14#pragma once
15
18
19namespace NAV
20{
22class NmeaFile : public Node, public FileReader
23{
24 public:
28 ~NmeaFile() override;
30 NmeaFile(const NmeaFile&) = delete;
32 NmeaFile(NmeaFile&&) = delete;
34 NmeaFile& operator=(const NmeaFile&) = delete;
37
39 [[nodiscard]] static std::string typeStatic();
40
42 [[nodiscard]] std::string type() const override;
43
45 [[nodiscard]] static std::string category();
46
49 void guiConfig() override;
50
52 [[nodiscard]] json save() const override;
53
56 void restore(const json& j) override;
57
59 bool resetNode() override;
60
61 private:
62 constexpr static size_t OUTPUT_PORT_INDEX_NMEA_POS_OBS = 0;
63
65 bool initialize() override;
66
68 void deinitialize() override;
69
72 [[nodiscard]] std::shared_ptr<const NodeData> pollData();
73
76 [[nodiscard]] FileType determineFileType() override;
77
79 void readHeader() override;
80
82 bool _hasValidDate = false;
83
85 double _oldSoD = -1.0;
86
88 struct
89 {
90 int year = 0;
91 int month = 0;
92 int day = 0;
93 } _currentDate;
94
98 bool setDateFromZDA(const std::string& line);
99
103 bool setDateFromRMC(const std::string& line);
104};
105
106} // namespace NAV
Abstract File Reader class.
nlohmann::json json
json namespace
Definition FlowManager.hpp:21
Node Class.
Abstract File Reader class.
Definition FileReader.hpp:31
FileType
File Type Enumeration.
Definition FileReader.hpp:35
File Reader for NMEA log files.
Definition NmeaFile.hpp:23
NmeaFile & operator=(NmeaFile &&)=delete
Move assignment operator.
static std::string category()
String representation of the Class Category.
void restore(const json &j) override
Restores the node from a json object.
NmeaFile(const NmeaFile &)=delete
Copy constructor.
int month
Month 01 to 12.
Definition NmeaFile.hpp:91
NmeaFile()
Default constructor.
json save() const override
Saves the node into a json object.
~NmeaFile() override
Destructor.
static std::string typeStatic()
String representation of the Class Type.
int year
Year.
Definition NmeaFile.hpp:90
void guiConfig() override
ImGui config window which is shown on double click.
bool resetNode() override
Resets the node. Moves the read cursor to the start.
std::string type() const override
String representation of the Class Type.
int day
Day 01 to 31.
Definition NmeaFile.hpp:92
NmeaFile & operator=(const NmeaFile &)=delete
Copy assignment operator.
NmeaFile(NmeaFile &&)=delete
Move constructor.
Abstract parent class for all nodes.
Definition Node.hpp:86