0.5.1
Loading...
Searching...
No Matches
NAV::Node Class Referenceabstract

Abstract parent class for all nodes. More...

Data Structures

struct  Kind
 Kind information class. More...

Public Types

enum class  Mode : uint8_t {
  REAL_TIME ,
  POST_PROCESSING
}
 Different Modes the Node can work in. More...
enum class  State : uint8_t {
  Disabled ,
  Deinitialized ,
  DoInitialize ,
  Initializing ,
  Initialized ,
  DoDeinitialize ,
  Deinitializing ,
  DoShutdown ,
  Shutdown
}
 Possible states of the node. More...

Public Member Functions

virtual void afterCreateLink (OutputPin &startPin, InputPin &endPin)
 Called when a new link was established.
virtual void afterDeleteLink (OutputPin &startPin, InputPin &endPin)
 Called when a link was deleted.
template<std::derived_from< Node > T>
InputPinCreateInputPin (const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier, void(T::*notifyFunc)(const InsTime &, size_t), int idx=-1)
 Create an Input Pin object for data pins. The additional notify function gets called when the connected data was changed and the connected node calls NAV::Node::notifyOutputValueChanged.
InputPinCreateInputPin (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.
template<std::derived_from< Node > T>
InputPinCreateInputPin (const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier={}, void(T::*callback)(InputPin::NodeDataQueue &, size_t)=nullptr, InputPin::FlowFirableCheckFunc firable=nullptr, int priority=0, int idx=-1)
 Create an Input Pin object.
OutputPinCreateOutputPin (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.
template<std::derived_from< Node > T>
OutputPinCreateOutputPin (const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier, std::shared_ptr< const NAV::NodeData >(T::*peekPollDataFunc)(size_t, bool)=nullptr, int idx=-1)
 Create an Output Pin object for Flow Pins.
template<std::derived_from< Node > T>
OutputPinCreateOutputPin (const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier, std::shared_ptr< const NAV::NodeData >(T::*pollDataFunc)()=nullptr, int idx=-1)
 Create an Output Pin object for Flow Pins.
virtual void deinitialize ()
 Deinitialize the Node.
bool DeleteInputPin (size_t pinIndex)
 Deletes the input pin. Invalidates the pin reference given.
bool DeleteOutputPin (size_t pinIndex)
 Deletes the output pin. Invalidates the pin reference given.
bool doDeinitialize (bool wait=false)
 Asks the node worker to deinitialize the node.
bool doDisable (bool wait=false)
 Asks the node worker to disable the node.
bool doEnable ()
 Enable the node.
bool doInitialize (bool wait=false)
 Asks the node worker to initialize the node.
bool doReinitialize (bool wait=false)
 Asks the node worker to reinitialize the node.
virtual void flush ()
 Function called by the flow executer after finishing to flush out remaining data.
template<typename T>
std::optional< InputPin::IncomingLink::ValueWrapper< T > > getInputValue (size_t portIndex) const
 Get Input Value connected on the pin. Only const data types.
Mode getMode () const
 Get the current mode of the node.
const ImVec2 & getSize () const
 Get the size of the node.
State getState () const
 Get the current state of the node.
virtual void guiConfig ()
 ImGui config window which is shown on double click.
bool hasInputPinWithSameTime (const InsTime &insTime) const
 Checks wether there is an input pin with the same time.
virtual bool initialize ()
 Initialize the Node.
InputPininputPinFromId (ax::NodeEditor::PinId pinId)
 Returns the pin with the given id.
size_t inputPinIndexFromId (ax::NodeEditor::PinId pinId) const
 Returns the index of the pin.
void invokeCallbacks (size_t portIndex, const std::shared_ptr< const NodeData > &data)
 Calls all registered callbacks on the specified output port.
bool isDisabled () const
 Checks if the node is disabled.
bool isInitialized () const
 Checks if the node is initialized.
bool isOnlyRealtime () const
 Checks if the node is only working in real time (sensors, network interfaces, ...)
bool isTransient () const
 Checks if the node is changing its state currently.
std::string nameId () const
 Node name and id.
 Node (const Node &)=delete
 Copy constructor.
 Node (Node &&)=delete
 Move constructor.
 Node (std::string name)
 Constructor.
void notifyOutputValueChanged (size_t pinIdx, const InsTime &insTime, const std::scoped_lock< std::mutex > &&guard)
 Notifies connected nodes about the change.
virtual bool onCreateLink (OutputPin &startPin, InputPin &endPin)
 Called when a new link is to be established.
virtual void onDeleteLink (OutputPin &startPin, InputPin &endPin)
 Called when a link is to be deleted.
Nodeoperator= (const Node &)=delete
 Copy assignment operator.
Nodeoperator= (Node &&)=delete
 Move assignment operator.
OutputPinoutputPinFromId (ax::NodeEditor::PinId pinId)
 Returns the pin with the given id.
size_t outputPinIndexFromId (ax::NodeEditor::PinId pinId) const
 Returns the index of the pin.
void releaseInputValue (size_t portIndex)
 Unblocks the connected node. Has to be called when the input value should be released and getInputValue was not called.
std::scoped_lock< std::mutex > requestOutputValueLock (size_t pinIdx)
 Blocks the thread till the output values was read by all connected nodes.
virtual bool resetNode ()
 Resets the node. It is guaranteed that the node is initialized when this is called.
virtual void restore (const json &j)
 Restores the node from a json object.
virtual void restoreAtferLink (const json &j)
 Restores link related properties of the node from a json object.
virtual json save () const
 Saves the node into a json object.
virtual std::string type () const =0
 String representation of the Class Type.
void wakeWorker ()
 Wakes the worker thread.
virtual ~Node ()
 Destructor.

Static Public Member Functions

static std::string toString (State state)
 Converts the state into a printable text.

Data Fields

bool callbacksEnabled
 Enables the callbacks.
ax::NodeEditor::NodeId id
 Unique Id of the Node.
std::vector< InputPininputPins
 List of input pins.
Kind kind
 Kind of the Node.
std::string name
 Name of the Node.
std::vector< OutputPinoutputPins
 List of output pins.
std::multimap< InsTime, std::pair< OutputPin *, size_t > > pollEvents
 Map with callback events (sorted by time)

Protected Attributes

ImVec2 _guiConfigDefaultWindowSize
bool _hasConfig
 Flag if the config window should be shown.
bool _lockConfigDuringRun
 Lock the config when executing post-processing.
bool _onlyRealTime
 Whether the node can run in post-processing or only real-time.

Private Member Functions

bool workerDeinitializeNode ()
 Called by the worker to deinitialize the node.
bool workerInitializeNode ()
 Called by the worker to initialize the node.
virtual void workerTimeoutHandler ()
 Handler which gets triggered if the worker runs into a periodic timeout.

Static Private Member Functions

static void workerThread (Node *node)
 Worker thread.

Private Attributes

bool _configWindowFocus
 Flag if the config window should be focused.
bool _configWindowForceCollapse
 Flag if the config window should be forced collapsed.
bool _configWindowIsCollapsed
 Flag if the config window is collapsed.
std::mutex _configWindowMutex
 Mutex to show the config window (prevents initialization to modify values within the config window)
bool _disable
 Flag if the node should be disabled after deinitializing.
std::atomic< Mode_mode
 Mode the node is currently running in.
bool _reinitialize
 Flag if the node should be reinitialize after deinitializing.
bool _showConfig
 Flag if the config window is shown.
ImVec2 _size
 Size of the node in pixels.
State _state
 Current state of the node.
std::mutex _stateMutex
 Mutex to interact with the worker state variable.
std::thread _worker
 Worker handling initialization and processing of data.
std::condition_variable _workerConditionVariable
 Condition variable to signal the worker thread to do something.
std::mutex _workerMutex
 Mutex to interact with the worker condition variable.
std::chrono::duration< int64_t > _workerTimeout
 Periodic timeout of the worker to check if new data available.
bool _workerWakeup
 Variable to prevent the worker from sleeping.

Static Private Attributes

static bool _autostartWorker
 Flag which prevents the worker to be autostarted if false.

Friends

void gui::menus::ShowRunMenu ()
 Show the run menu dropdown.
class gui::NodeEditorApplication
void NAV::FlowExecutor::deinitialize ()
 Deinitialize all Nodes.
void NAV::FlowExecutor::execute ()
 Main task of the FlowExecutor thread.
void NAV::from_json (const json &j, Node &node)
 Converts the provided json object into a node object.
class NAV::GroupBox
void NAV::NodeRegistry::RegisterNodeTypes ()
 Register all available Node types for the program.
void NAV::to_json (json &j, const Node &node)
 Converts the provided node into a json object.

Detailed Description

Abstract parent class for all nodes.

Definition at line 91 of file Node.hpp.

Member Enumeration Documentation

◆ Mode

enum class NAV::Node::Mode : uint8_t
strong

Different Modes the Node can work in.

Enumerator
REAL_TIME 

Node running in real-time mode.

POST_PROCESSING 

Node running in post-processing mode.

Definition at line 189 of file Node.hpp.

◆ State

enum class NAV::Node::State : uint8_t
strong

Possible states of the node.

Enumerator
Disabled 

Node is disabled and won't be initialized.

Deinitialized 

Node is deinitialized (red)

DoInitialize 

Node should be initialized.

Initializing 

Node is currently initializing.

Initialized 

Node is initialized (green)

DoDeinitialize 

Node should be deinitialized.

Deinitializing 

Node is currently deinitializing.

DoShutdown 

Node should shut down.

Shutdown 

Node is shutting down.

Definition at line 175 of file Node.hpp.

Constructor & Destructor Documentation

◆ Node() [1/3]

NAV::Node::Node ( std::string name)
explicit

Constructor.

Parameters
[in]nameName of the node

Definition at line 29 of file Node.cpp.

◆ ~Node()

NAV::Node::~Node ( )
virtual

Destructor.

Definition at line 39 of file Node.cpp.

◆ Node() [2/3]

NAV::Node::Node ( const Node & )
delete

Copy constructor.

◆ Node() [3/3]

NAV::Node::Node ( Node && )
delete

Move constructor.

Member Function Documentation

◆ afterCreateLink()

void NAV::Node::afterCreateLink ( OutputPin & startPin,
InputPin & endPin )
virtual

Called when a new link was established.

Parameters
[in]startPinPin where the link starts
[in]endPinPin where the link ends

Reimplemented in NAV::ErrorModel, NAV::LowPassFilter, NAV::Plot, and NAV::TimeWindow.

Definition at line 88 of file Node.cpp.

◆ afterDeleteLink()

void NAV::Node::afterDeleteLink ( OutputPin & startPin,
InputPin & endPin )
virtual

Called when a link was deleted.

Parameters
[in]startPinPin where the link starts
[in]endPinPin where the link ends

Reimplemented in NAV::Demo, NAV::ErrorModel, NAV::LowPassFilter, NAV::Merger, and NAV::TimeWindow.

Definition at line 90 of file Node.cpp.

◆ CreateInputPin() [1/3]

template<std::derived_from< Node > T>
InputPin * NAV::Node::CreateInputPin ( const char * name,
Pin::Type pinType,
const std::vector< std::string > & dataIdentifier,
void(T::* notifyFunc )(const InsTime &, size_t),
int idx = -1 )
inline

Create an Input Pin object for data pins. The additional notify function gets called when the connected data was changed and the connected node calls NAV::Node::notifyOutputValueChanged.

Template Parameters
TNode Class where the function is member of
Parameters
[in]nameDisplay name of the Pin
[in]pinTypeType of the pin
[in]dataIdentifierIdentifier of the data which is represented by the pin
[in]notifyFuncFunction to call when the data is updated
[in]idxIndex where to put the new pin (-1 means at the end)
Returns
Pointer to the created pin

Definition at line 372 of file Node.hpp.

◆ CreateInputPin() [2/3]

NAV::InputPin * NAV::Node::CreateInputPin ( 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.

Parameters
[in]nameDisplay name of the Pin
[in]pinTypeType of the pin
[in]dataIdentifierIdentifier of the data which is represented by the pin
[in]callbackCallback to register with the pin
[in]firableFunction to check whether the callback is firable
[in]priorityPriority when checking firable condition related to other pins (higher priority gets triggered first)
[in]idxIndex where to put the new pin (-1 means at the end)
Returns
Pointer to the created pin

Definition at line 252 of file Node.cpp.

◆ CreateInputPin() [3/3]

template<std::derived_from< Node > T>
InputPin * NAV::Node::CreateInputPin ( const char * name,
Pin::Type pinType,
const std::vector< std::string > & dataIdentifier = {},
void(T::* callback )(InputPin::NodeDataQueue &, size_t) = nullptr,
InputPin::FlowFirableCheckFunc firable = nullptr,
int priority = 0,
int idx = -1 )
inline

Create an Input Pin object.

Template Parameters
TNode Class where the function is member of
Parameters
[in]nameDisplay name of the Pin
[in]pinTypeType of the pin
[in]dataIdentifierIdentifier of the data which is represented by the pin
[in]callbackFlow firable callback function to register with the pin
[in]firableFunction to check whether the callback is firable
[in]priorityPriority when checking firable condition related to other pins (higher priority gets triggered first)
[in]idxIndex where to put the new pin (-1 means at the end)
Returns
Pointer to the created pin

Definition at line 353 of file Node.hpp.

◆ CreateOutputPin() [1/3]

NAV::OutputPin * NAV::Node::CreateOutputPin ( 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.

Parameters
[in]nameDisplay name of the Pin
[in]pinTypeType of the pin
[in]dataIdentifierIdentifier of the data which is represented by the pin
[in]dataPointer to data which is represented by the pin
[in]idxIndex where to put the new pin (-1 means at the end)
Returns
Pointer to the created pin

Definition at line 278 of file Node.cpp.

◆ CreateOutputPin() [2/3]

template<std::derived_from< Node > T>
OutputPin * NAV::Node::CreateOutputPin ( const char * name,
Pin::Type pinType,
const std::vector< std::string > & dataIdentifier,
std::shared_ptr< const NAV::NodeData >(T::* peekPollDataFunc )(size_t, bool) = nullptr,
int idx = -1 )
inline

Create an Output Pin object for Flow Pins.

Template Parameters
TClass where the function is member of
Parameters
[in]nameDisplay name of the Pin
[in]pinTypeType of the pin
[in]dataIdentifierIdentifier of the data which is represented by the pin
[in]peekPollDataFuncFunction to poll for data on this pin
[in]idxIndex where to put the new pin (-1 means at the end)
Returns
Pointer to the created pin

Definition at line 398 of file Node.hpp.

◆ CreateOutputPin() [3/3]

template<std::derived_from< Node > T>
OutputPin * NAV::Node::CreateOutputPin ( const char * name,
Pin::Type pinType,
const std::vector< std::string > & dataIdentifier,
std::shared_ptr< const NAV::NodeData >(T::* pollDataFunc )() = nullptr,
int idx = -1 )
inline

Create an Output Pin object for Flow Pins.

Template Parameters
TClass where the function is member of
Parameters
[in]nameDisplay name of the Pin
[in]pinTypeType of the pin
[in]dataIdentifierIdentifier of the data which is represented by the pin
[in]pollDataFuncFunction to poll for data on this pin
[in]idxIndex where to put the new pin (-1 means at the end)
Returns
Pointer to the created pin

Definition at line 418 of file Node.hpp.

◆ deinitialize()

◆ DeleteInputPin()

bool NAV::Node::DeleteInputPin ( size_t pinIndex)

Deletes the input pin. Invalidates the pin reference given.

Parameters
[in]pinIndexIndex of the pin to delete
Returns
True if the pin was delete

Definition at line 310 of file Node.cpp.

◆ DeleteOutputPin()

bool NAV::Node::DeleteOutputPin ( size_t pinIndex)

Deletes the output pin. Invalidates the pin reference given.

Parameters
[in]pinIndexIndex of the pin to delete
Returns
True if the pin was delete

Definition at line 298 of file Node.cpp.

◆ doDeinitialize()

bool NAV::Node::doDeinitialize ( bool wait = false)

Asks the node worker to deinitialize the node.

Parameters
[in]waitWait for the worker to complete the request
Returns
True if the worker accepted the request

Definition at line 465 of file Node.cpp.

◆ doDisable()

bool NAV::Node::doDisable ( bool wait = false)

Asks the node worker to disable the node.

Parameters
[in]waitWait for the worker to complete the request
Returns
True if the worker accepted the request

Definition at line 506 of file Node.cpp.

◆ doEnable()

bool NAV::Node::doEnable ( )

Enable the node.

Returns
True if enabling was successful

Definition at line 548 of file Node.cpp.

◆ doInitialize()

bool NAV::Node::doInitialize ( bool wait = false)

Asks the node worker to initialize the node.

Parameters
[in]waitWait for the worker to complete the request
Returns
True if not waiting and the worker accepted the request otherwise if waiting only true if the node initialized correctly

Definition at line 370 of file Node.cpp.

◆ doReinitialize()

bool NAV::Node::doReinitialize ( bool wait = false)

Asks the node worker to reinitialize the node.

Parameters
[in]waitWait for the worker to complete the request
Returns
True if not waiting and the worker accepted the request otherwise if waiting only true if the node initialized correctly

Definition at line 420 of file Node.cpp.

◆ flush()

void NAV::Node::flush ( )
virtual

Function called by the flow executer after finishing to flush out remaining data.

Reimplemented in NAV::CsvLogger, NAV::KmlLogger, NAV::MatrixLogger, NAV::RinexObsLogger, NAV::UartDataLogger, NAV::VectorNavDataLogger, and NAV::WiFiObsLogger.

Definition at line 72 of file Node.cpp.

◆ getInputValue()

template<typename T>
std::optional< InputPin::IncomingLink::ValueWrapper< T > > NAV::Node::getInputValue ( size_t portIndex) const
inlinenodiscard

Get Input Value connected on the pin. Only const data types.

Template Parameters
TType of the connected object
Parameters
[in]portIndexInput port where to retrieve the data from
Returns
Pointer to the object

Definition at line 290 of file Node.hpp.

◆ getMode()

NAV::Node::Mode NAV::Node::getMode ( ) const
nodiscard

Get the current mode of the node.

Definition at line 365 of file Node.cpp.

◆ getSize()

const ImVec2 & NAV::Node::getSize ( ) const
nodiscard

Get the size of the node.

Definition at line 328 of file Node.cpp.

◆ getState()

NAV::Node::State NAV::Node::getState ( ) const
nodiscard

Get the current state of the node.

Definition at line 359 of file Node.cpp.

◆ guiConfig()

◆ hasInputPinWithSameTime()

bool NAV::Node::hasInputPinWithSameTime ( const InsTime & insTime) const

Checks wether there is an input pin with the same time.

Parameters
[in]insTimeTime to check

Definition at line 172 of file Node.cpp.

◆ initialize()

bool NAV::Node::initialize ( )
virtual

Initialize the Node.

Here a node can do things like

  • connecting to a sensor
  • read a static data file which needs to be read completely (e.g. RINEX nav files)
  • reset variables in case the NAV::Node::resetNode() is not used
    Attention
    This function is called in the default implementation of the NAV::Node::resetNode() function. If the initialize function should not be called more than once, make sure to override the NAV::Node::resetNode() function.

Reimplemented in NAV::AllanDeviation, NAV::ArubaSensor, NAV::BaroSimulator, NAV::Combiner, NAV::CsvFile, NAV::CsvLogger, NAV::Demo, NAV::EmlidFile, NAV::EmlidSensor, NAV::EspressifSensor, NAV::experimental::ARMA, NAV::experimental::Delay, NAV::experimental::SkydelNetworkStream, NAV::GnssAnalyzer, NAV::ImuFile, NAV::ImuFusion, NAV::ImuIntegrator, NAV::ImuSimulator, NAV::KmlLogger, NAV::KvhFile, NAV::KvhSensor, NAV::Ln200Sensor, NAV::LooselyCoupledKF, NAV::MatrixLogger, NAV::MultiImuFile, NAV::Navio2Sensor, NAV::NmeaFile, NAV::Plot, NAV::PosVelAttFile, NAV::PosVelAttInitializer, NAV::PressToHgt, NAV::RealTimeKinematic, NAV::RinexNavFile, NAV::RinexObsFile, NAV::RinexObsLogger, NAV::RtklibPosConverter, NAV::RtklibPosFile, NAV::SinglePointPositioning, NAV::TimeWindow, NAV::UartDataLogger, NAV::UartPacketConverter, NAV::UbloxFile, NAV::UbloxGnssObsConverter, NAV::UbloxGnssOrbitCollector, NAV::UbloxSensor, NAV::UdpRecv, NAV::UdpSend, NAV::UlogFile, NAV::VectorNavBinaryConverter, NAV::VectorNavDataLogger, NAV::VectorNavFile, NAV::VectorNavSensor, NAV::WiFiObsFile, NAV::WiFiObsLogger, and NAV::WiFiPositioning.

Definition at line 65 of file Node.cpp.

◆ inputPinFromId()

NAV::InputPin & NAV::Node::inputPinFromId ( ax::NodeEditor::PinId pinId)
nodiscard

Returns the pin with the given id.

Parameters
[in]pinIdId of the Pin
Returns
The input pin

Definition at line 212 of file Node.cpp.

◆ inputPinIndexFromId()

size_t NAV::Node::inputPinIndexFromId ( ax::NodeEditor::PinId pinId) const
nodiscard

Returns the index of the pin.

Parameters
[in]pinIdId of the Pin
Returns
The index of the pin

Definition at line 232 of file Node.cpp.

◆ invokeCallbacks()

void NAV::Node::invokeCallbacks ( size_t portIndex,
const std::shared_ptr< const NodeData > & data )

Calls all registered callbacks on the specified output port.

Parameters
[in]portIndexOutput port where to call the callbacks
[in]dataThe data to pass to the callback targets

Definition at line 179 of file Node.cpp.

◆ isDisabled()

bool NAV::Node::isDisabled ( ) const
nodiscard

Checks if the node is disabled.

Definition at line 569 of file Node.cpp.

◆ isInitialized()

bool NAV::Node::isInitialized ( ) const
nodiscard

Checks if the node is initialized.

Definition at line 574 of file Node.cpp.

◆ isOnlyRealtime()

bool NAV::Node::isOnlyRealtime ( ) const
nodiscard

Checks if the node is only working in real time (sensors, network interfaces, ...)

Definition at line 599 of file Node.cpp.

◆ isTransient()

bool NAV::Node::isTransient ( ) const
nodiscard

Checks if the node is changing its state currently.

Definition at line 579 of file Node.cpp.

◆ nameId()

std::string NAV::Node::nameId ( ) const
nodiscard

Node name and id.

Definition at line 323 of file Node.cpp.

◆ notifyOutputValueChanged()

void NAV::Node::notifyOutputValueChanged ( size_t pinIdx,
const InsTime & insTime,
const std::scoped_lock< std::mutex > && guard )

Notifies connected nodes about the change.

Parameters
[in]pinIdxOutput Port index where to set the value
[in]insTimeTime the value was generated
[in]guardLock guard of the output data

Definition at line 92 of file Node.cpp.

◆ onCreateLink()

bool NAV::Node::onCreateLink ( OutputPin & startPin,
InputPin & endPin )
virtual

Called when a new link is to be established.

Parameters
[in]startPinPin where the link starts
[in]endPinPin where the link ends
Returns
True if link is allowed, false if link is rejected

Reimplemented in NAV::CsvLogger, NAV::Demo, NAV::experimental::Delay, NAV::Merger, and NAV::VectorNavDataLogger.

Definition at line 81 of file Node.cpp.

◆ onDeleteLink()

void NAV::Node::onDeleteLink ( OutputPin & startPin,
InputPin & endPin )
virtual

Called when a link is to be deleted.

Parameters
[in]startPinPin where the link starts
[in]endPinPin where the link ends

Reimplemented in NAV::UbloxGnssOrbitCollector.

Definition at line 86 of file Node.cpp.

◆ operator=() [1/2]

Node & NAV::Node::operator= ( const Node & )
delete

Copy assignment operator.

◆ operator=() [2/2]

Node & NAV::Node::operator= ( Node && )
delete

Move assignment operator.

◆ outputPinFromId()

NAV::OutputPin & NAV::Node::outputPinFromId ( ax::NodeEditor::PinId pinId)
nodiscard

Returns the pin with the given id.

Parameters
[in]pinIdId of the Pin
Returns
The output pin

Definition at line 222 of file Node.cpp.

◆ outputPinIndexFromId()

size_t NAV::Node::outputPinIndexFromId ( ax::NodeEditor::PinId pinId) const
nodiscard

Returns the index of the pin.

Parameters
[in]pinIdId of the Pin
Returns
The index of the pin

Definition at line 242 of file Node.cpp.

◆ releaseInputValue()

void NAV::Node::releaseInputValue ( size_t portIndex)

Unblocks the connected node. Has to be called when the input value should be released and getInputValue was not called.

Parameters
[in]portIndexInput port where the data should be released

Definition at line 147 of file Node.cpp.

◆ requestOutputValueLock()

std::scoped_lock< std::mutex > NAV::Node::requestOutputValueLock ( size_t pinIdx)
nodiscard

Blocks the thread till the output values was read by all connected nodes.

Parameters
[in]pinIdxOutput Pin index where to request the lock

Definition at line 132 of file Node.cpp.

◆ resetNode()

◆ restore()

◆ restoreAtferLink()

void NAV::Node::restoreAtferLink ( const json & j)
virtual

Restores link related properties of the node from a json object.

Parameters
[in]jJson object with the node state

Definition at line 63 of file Node.cpp.

◆ save()

◆ toString()

std::string NAV::Node::toString ( State state)
static

Converts the state into a printable text.

Parameters
[in]stateState to convert
Returns
String representation of the state

Definition at line 333 of file Node.cpp.

◆ type()

◆ wakeWorker()

void NAV::Node::wakeWorker ( )

Wakes the worker thread.

Definition at line 560 of file Node.cpp.

◆ workerDeinitializeNode()

bool NAV::Node::workerDeinitializeNode ( )
private

Called by the worker to deinitialize the node.

Returns
True if the deinitialization was successful

Definition at line 997 of file Node.cpp.

◆ workerInitializeNode()

bool NAV::Node::workerInitializeNode ( )
private

Called by the worker to initialize the node.

Returns
True if the initialization was successful

Definition at line 907 of file Node.cpp.

◆ workerThread()

void NAV::Node::workerThread ( Node * node)
staticprivate

Worker thread.

Parameters
[in,out]nodeThe node where the thread belongs to

Definition at line 604 of file Node.cpp.

◆ workerTimeoutHandler()

void NAV::Node::workerTimeoutHandler ( )
privatevirtual

Handler which gets triggered if the worker runs into a periodic timeout.

Definition at line 1055 of file Node.cpp.

◆ gui::menus::ShowRunMenu

void gui::menus::ShowRunMenu ( )
friend

Show the run menu dropdown.

◆ gui::NodeEditorApplication

friend class gui::NodeEditorApplication
friend

Definition at line 586 of file Node.hpp.

◆ NAV::FlowExecutor::deinitialize

Deinitialize all Nodes.

◆ NAV::FlowExecutor::execute

void NAV::FlowExecutor::execute ( )
friend

Main task of the FlowExecutor thread.

◆ NAV::from_json

void NAV::from_json ( const json & j,
Node & node )
friend

Converts the provided json object into a node object.

Parameters
[in]jJson object with the needed values
[out]nodeObject to fill from the json

◆ NAV::GroupBox

friend class NAV::GroupBox
friend

Definition at line 587 of file Node.hpp.

◆ NAV::NodeRegistry::RegisterNodeTypes

Register all available Node types for the program.

◆ NAV::to_json

void NAV::to_json ( json & j,
const Node & node )
friend

Converts the provided node into a json object.

Parameters
[out]jJson object which gets filled with the info
[in]nodeNode to convert into json

Field Documentation

◆ _autostartWorker

bool NAV::Node::_autostartWorker
inlinestaticprivate

Flag which prevents the worker to be autostarted if false.

Definition at line 563 of file Node.hpp.

◆ _configWindowFocus

bool NAV::Node::_configWindowFocus
private

Flag if the config window should be focused.

Definition at line 557 of file Node.hpp.

◆ _configWindowForceCollapse

bool NAV::Node::_configWindowForceCollapse
private

Flag if the config window should be forced collapsed.

Definition at line 552 of file Node.hpp.

◆ _configWindowIsCollapsed

bool NAV::Node::_configWindowIsCollapsed
private

Flag if the config window is collapsed.

Definition at line 554 of file Node.hpp.

◆ _configWindowMutex

std::mutex NAV::Node::_configWindowMutex
private

Mutex to show the config window (prevents initialization to modify values within the config window)

Definition at line 550 of file Node.hpp.

◆ _disable

bool NAV::Node::_disable
private

Flag if the node should be disabled after deinitializing.

Definition at line 544 of file Node.hpp.

◆ _guiConfigDefaultWindowSize

ImVec2 NAV::Node::_guiConfigDefaultWindowSize
protected

The Default Window size for new config windows. Only set the variable if the object/window has no persistently saved data (no entry in .ini file)

Definition at line 522 of file Node.hpp.

◆ _hasConfig

bool NAV::Node::_hasConfig
protected

Flag if the config window should be shown.

Definition at line 525 of file Node.hpp.

◆ _lockConfigDuringRun

bool NAV::Node::_lockConfigDuringRun
protected

Lock the config when executing post-processing.

Definition at line 528 of file Node.hpp.

◆ _mode

std::atomic<Mode> NAV::Node::_mode
private

Mode the node is currently running in.

Definition at line 538 of file Node.hpp.

◆ _onlyRealTime

bool NAV::Node::_onlyRealTime
protected

Whether the node can run in post-processing or only real-time.

Definition at line 531 of file Node.hpp.

◆ _reinitialize

bool NAV::Node::_reinitialize
private

Flag if the node should be reinitialize after deinitializing.

Definition at line 541 of file Node.hpp.

◆ _showConfig

bool NAV::Node::_showConfig
private

Flag if the config window is shown.

Definition at line 547 of file Node.hpp.

◆ _size

ImVec2 NAV::Node::_size
private

Size of the node in pixels.

Definition at line 560 of file Node.hpp.

◆ _state

State NAV::Node::_state
private

Current state of the node.

Definition at line 534 of file Node.hpp.

◆ _stateMutex

std::mutex NAV::Node::_stateMutex
mutableprivate

Mutex to interact with the worker state variable.

Definition at line 535 of file Node.hpp.

◆ _worker

std::thread NAV::Node::_worker
private

Worker handling initialization and processing of data.

Definition at line 566 of file Node.hpp.

◆ _workerConditionVariable

std::condition_variable NAV::Node::_workerConditionVariable
private

Condition variable to signal the worker thread to do something.

Definition at line 568 of file Node.hpp.

◆ _workerMutex

std::mutex NAV::Node::_workerMutex
private

Mutex to interact with the worker condition variable.

Definition at line 567 of file Node.hpp.

◆ _workerTimeout

std::chrono::duration<int64_t> NAV::Node::_workerTimeout
private

Periodic timeout of the worker to check if new data available.

Definition at line 565 of file Node.hpp.

◆ _workerWakeup

bool NAV::Node::_workerWakeup
private

Variable to prevent the worker from sleeping.

Definition at line 569 of file Node.hpp.

◆ callbacksEnabled

bool NAV::Node::callbacksEnabled

Enables the callbacks.

Definition at line 514 of file Node.hpp.

◆ id

ax::NodeEditor::NodeId NAV::Node::id

Unique Id of the Node.

Definition at line 503 of file Node.hpp.

◆ inputPins

std::vector<InputPin> NAV::Node::inputPins

List of input pins.

Definition at line 509 of file Node.hpp.

◆ kind

Kind NAV::Node::kind

Kind of the Node.

Definition at line 505 of file Node.hpp.

◆ name

std::string NAV::Node::name

Name of the Node.

Definition at line 507 of file Node.hpp.

◆ outputPins

std::vector<OutputPin> NAV::Node::outputPins

List of output pins.

Definition at line 511 of file Node.hpp.

◆ pollEvents

std::multimap<InsTime, std::pair<OutputPin*, size_t> > NAV::Node::pollEvents

Map with callback events (sorted by time)

Definition at line 517 of file Node.hpp.


The documentation for this class was generated from the following files:
  • /home/runner/work/INSTINCT/INSTINCT/src/internal/Node/Node.hpp
  • /home/runner/work/INSTINCT/INSTINCT/src/internal/Node/Node.cpp