0.4.1
Loading...
Searching...
No Matches
TimeWindow.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 TimeWindow.hpp
10/// @brief Limits measurement data from any source to a user-defined timewindow
11/// @author M. Maier (marcel.maier@ins.uni-stuttgart.de)
12/// @date 2022-10-27
13
14#pragma once
15
16#include <array>
18
20
22#include "util/Eigen.hpp"
23
24namespace NAV
25{
26/// Limits measurement data from any source to a user-defined timewindow
27class TimeWindow : public Node
28{
29 public:
30 /// @brief Default constructor
31 TimeWindow();
32 /// @brief Destructor
33 ~TimeWindow() override;
34 /// @brief Copy Constructor
35 TimeWindow(const TimeWindow&) = delete;
36 /// @brief Move Constructor
38 /// @brief Copy assignment operator
39 TimeWindow& operator=(const TimeWindow&) = delete;
40 /// @brief Move assignment operator
42
43 /// @brief String representation of the Class Type
44 [[nodiscard]] static std::string typeStatic();
45
46 /// @brief String representation of the Class Type
47 [[nodiscard]] std::string type() const override;
48
49 /// @brief String representation of the Class Category
50 [[nodiscard]] static std::string category();
51
52 /// @brief ImGui config window which is shown on double click
53 /// @attention Don't forget to set _hasConfig to true in the constructor of the node
54 void guiConfig() override;
55
56 /// @brief Saves the node into a json object
57 [[nodiscard]] json save() const override;
58
59 /// @brief Restores the node from a json object
60 /// @param[in] j Json object with the node state
61 void restore(const json& j) override;
62
63 private:
64 constexpr static size_t OUTPUT_PORT_INDEX_FLOW = 0; ///< @brief Flow
65 constexpr static size_t INPUT_PORT_INDEX_FLOW = 0; ///< @brief Flow
66
67 /// @brief Initialize the node
68 bool initialize() override;
69
70 /// @brief Called when a new link was established
71 /// @param[in] startPin Pin where the link starts
72 /// @param[in] endPin Pin where the link ends
73 void afterCreateLink(OutputPin& startPin, InputPin& endPin) override;
74
75 /// @brief Called when a link was deleted
76 /// @param[in] startPin Pin where the link starts
77 /// @param[in] endPin Pin where the link ends
78 void afterDeleteLink(OutputPin& startPin, InputPin& endPin) override;
79
80 /// @brief Callback when receiving data on a port
81 /// @param[in] queue Queue with all the received data messages
82 /// @param[in] pinIdx Index of the pin the data is received on
83 void receiveObs(InputPin::NodeDataQueue& queue, size_t pinIdx);
84
85 /// Beginning and end of the time window
86 std::array<InsTime, 2> _startEndTime;
87
88 /// Time edit format for start and end times
89 std::array<gui::widgets::TimeEditFormat, 2> _timeEditFormat;
90
91 /// If true, the window lets only times pass through, which are out of the time frame
92 bool _inverseWindow = false;
93};
94} // namespace NAV
Vector space operations.
nlohmann::json json
json namespace
The class is responsible for all time-related tasks.
Node Class.
Widget to modify time point values.
Input pins of nodes.
Definition Pin.hpp:491
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
Output pins of nodes.
Definition Pin.hpp:338
~TimeWindow() override
Destructor.
TimeWindow & operator=(TimeWindow &&)=delete
Move assignment operator.
void receiveObs(InputPin::NodeDataQueue &queue, size_t pinIdx)
Callback when receiving data on a port.
std::array< gui::widgets::TimeEditFormat, 2 > _timeEditFormat
Time edit format for start and end times.
void guiConfig() override
ImGui config window which is shown on double click.
static std::string typeStatic()
String representation of the Class Type.
std::string type() const override
String representation of the Class Type.
TimeWindow(TimeWindow &&)=delete
Move Constructor.
void restore(const json &j) override
Restores the node from a json object.
json save() const override
Saves the node into a json object.
static constexpr size_t INPUT_PORT_INDEX_FLOW
Flow.
void afterCreateLink(OutputPin &startPin, InputPin &endPin) override
Called when a new link was established.
TimeWindow & operator=(const TimeWindow &)=delete
Copy assignment operator.
static constexpr size_t OUTPUT_PORT_INDEX_FLOW
Flow.
std::array< InsTime, 2 > _startEndTime
Beginning and end of the time window.
static std::string category()
String representation of the Class Category.
bool initialize() override
Initialize the node.
TimeWindow(const TimeWindow &)=delete
Copy Constructor.
bool _inverseWindow
If true, the window lets only times pass through, which are out of the time frame.
void afterDeleteLink(OutputPin &startPin, InputPin &endPin) override
Called when a link was deleted.
TimeWindow()
Default constructor.