0.4.1
Loading...
Searching...
No Matches
RinexObsLogger.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 RinexObsLogger.hpp
10/// @brief Logger for GnssObs to RINEX observation files
11/// @author T. Topp (topp@ins.uni-stuttgart.de)
12/// @date 2024-01-18
13
14#pragma once
15
16#include <set>
17
20
22
24
25namespace NAV
26{
27
28/// Data Logger for GnssObs to RINEX observation files
29class RinexObsLogger : public Node, public FileWriter
30{
31 public:
32 /// @brief Default constructor
34 /// @brief Destructor
35 ~RinexObsLogger() override;
36 /// @brief Copy constructor
38 /// @brief Move constructor
40 /// @brief Copy assignment operator
42 /// @brief Move assignment operator
44
45 /// @brief String representation of the Class Type
46 [[nodiscard]] static std::string typeStatic();
47
48 /// @brief String representation of the Class Type
49 [[nodiscard]] std::string type() const override;
50
51 /// @brief String representation of the Class Category
52 [[nodiscard]] static std::string category();
53
54 /// @brief ImGui config window which is shown on double click
55 /// @attention Don't forget to set _hasConfig to true in the constructor of the node
56 void guiConfig() override;
57
58 /// @brief Saves the node into a json object
59 [[nodiscard]] json save() const override;
60
61 /// @brief Restores the node from a json object
62 /// @param[in] j Json object with the node state
63 void restore(const json& j) override;
64
65 /// @brief Function called by the flow executer after finishing to flush out remaining data
66 void flush() override;
67
68 private:
69 /// @brief Initialize the node
70 bool initialize() override;
71
72 /// @brief Deinitialize the node
73 void deinitialize() override;
74
75 /// @brief Function to call to add a new pin
76 /// @param[in, out] node Pointer to this node
77 static void pinAddCallback(Node* node);
78 /// @brief Function to call to delete a pin
79 /// @param[in, out] node Pointer to this node
80 /// @param[in] pinIdx Input pin index to delete
81 static void pinDeleteCallback(Node* node, size_t pinIdx);
82
83 /// @brief Update the file header and eventually rewrite the file
84 /// @param[in] oldTimeSys Old time system before this epoch
85 void updateFileHeader(TimeSystem oldTimeSys);
86
87 /// @brief Write Observation to the file
88 /// @param[in] queue Queue with all the received data messages
89 /// @param[in] pinIdx Index of the pin the data is received on
90 void writeObservation(InputPin::NodeDataQueue& queue, size_t pinIdx);
91
92 /// @brief Supported RINEX versions
93 static inline const std::set<double> _supportedVersions = { 3.04 };
94
95 /// Header information
97
98 /// @brief Dynamic input pins
99 /// @attention This should always be the last variable in the header, because it accesses others through the function callbacks
101};
102
103} // namespace NAV
Inputs pins which can be added dynamically.
File Writer class.
nlohmann::json json
json namespace
Node Class.
Functions to work with RINEX.
FileWriter(const FileWriter &)=delete
Copy constructor.
TsDeque< std::shared_ptr< const NAV::NodeData > > NodeDataQueue
Node data queue type.
Definition Pin.hpp:707
Node(std::string name)
Constructor.
Definition Node.cpp:30
RinexObsLogger(RinexObsLogger &&)=delete
Move constructor.
RinexObsLogger(const RinexObsLogger &)=delete
Copy constructor.
static void pinAddCallback(Node *node)
Function to call to add a new pin.
gui::widgets::DynamicInputPins _dynamicInputPins
Dynamic input pins.
RinexObsLogger & operator=(RinexObsLogger &&)=delete
Move assignment operator.
vendor::RINEX::ObsHeader _header
Header information.
void deinitialize() override
Deinitialize the node.
void updateFileHeader(TimeSystem oldTimeSys)
Update the file header and eventually rewrite the file.
std::string type() const override
String representation of the Class Type.
void writeObservation(InputPin::NodeDataQueue &queue, size_t pinIdx)
Write Observation to the file.
bool initialize() override
Initialize the node.
void guiConfig() override
ImGui config window which is shown on double click.
RinexObsLogger & operator=(const RinexObsLogger &)=delete
Copy assignment operator.
void flush() override
Function called by the flow executer after finishing to flush out remaining data.
static std::string typeStatic()
String representation of the Class Type.
json save() const override
Saves the node into a json object.
static const std::set< double > _supportedVersions
Supported RINEX versions.
static std::string category()
String representation of the Class Category.
RinexObsLogger()
Default constructor.
static void pinDeleteCallback(Node *node, size_t pinIdx)
Function to call to delete a pin.
~RinexObsLogger() override
Destructor.
void restore(const json &j) override
Restores the node from a json object.
Time System defintions.
Inputs pins which can be added dynamically.
Rinex Observation File Header information.