54 if (ImGui::Checkbox(fmt::format(
"Inverse Window##{}",
size_t(
id)).c_str(), &
_inverseWindow))
60 "Inverse: (-∞, startTime), (endTime, ∞)");
62 if (ImGui::BeginTable(fmt::format(
"Time Window##{}",
size_t(
id)).c_str(), 2, ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_NoHostExtendX, ImVec2(0.0F, 0.0F)))
64 ImGui::TableSetupColumn(
"Beginning");
65 ImGui::TableSetupColumn(
"End");
66 ImGui::TableHeadersRow();
70 ImGui::TableNextColumn();
100 if (j.contains(
"startEndTime"))
104 if (j.contains(
"timeEditFormat"))
108 if (j.contains(
"inverseWindow"))
120 LOG_ERROR(
"{}: startTime >= endTime is not allowed. Please reconfigure the node.",
nameId());
146 if (
auto* endPin = link.getConnectedPin())
161 if (
auto* connectedPin = link.getConnectedPin())
nlohmann::json json
json namespace
Text Help Marker (?) with Tooltip.
#define LOG_DEBUG
Debug information. Should not be called on functions which receive observations (spamming)
#define LOG_ERROR
Error occurred, which stops part of the program to work, but not everything.
#define LOG_TRACE
Detailled info to trace the execution of the program. Should not be called on functions which receive...
Limits measurement data from any source to a user-defined timewindow.
static std::string type()
Returns the type of the data class.
bool doDeinitialize(bool wait=false)
Asks the node worker to deinitialize the node.
ImVec2 _guiConfigDefaultWindowSize
std::vector< OutputPin > outputPins
List of output pins.
Node(std::string name)
Constructor.
std::vector< InputPin > inputPins
List of input pins.
std::string nameId() const
Node name and id.
std::string name
Name of the Node.
void invokeCallbacks(size_t portIndex, const std::shared_ptr< const NodeData > &data)
Calls all registered callbacks on the specified output port.
ax::NodeEditor::NodeId id
Unique Id of the Node.
bool _hasConfig
Flag if the config window should be shown.
Node * parentNode
Reference to the parent node.
ax::NodeEditor::PinId id
Unique Id of the Pin.
std::vector< std::string > dataIdentifier
One or multiple Data Identifiers (Unique name which is used for data flows)
~TimeWindow() override
Destructor.
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.
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.
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.
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.
auto extract_front()
Returns a copy of the first element in the container and removes it from the container.
OutputPin * CreateOutputPin(Node *node, const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier, OutputPin::PinData data=static_cast< void * >(nullptr), int idx=-1)
Create an Output Pin object.
InputPin * CreateInputPin(Node *node, const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier={}, InputPin::Callback callback=static_cast< InputPin::FlowFirableCallbackFunc >(nullptr), InputPin::FlowFirableCheckFunc firable=nullptr, int priority=0, int idx=-1)
Create an Input Pin object.
void ApplyChanges()
Signals that there have been changes to the flow.