0.2.0
|
Abstract parent class for all nodes. More...
Classes | |
struct | Kind |
Kind information class. More... | |
Public Types | |
enum class | Mode { REAL_TIME , POST_PROCESSING } |
Different Modes the Node can work in. More... | |
enum class | State { 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. | |
virtual void | deinitialize () |
Deinitialize the Node. | |
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. | |
virtual bool | initialize () |
Initialize the Node. | |
InputPin & | inputPinFromId (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. | |
Node & | operator= (const Node &)=delete |
Copy assignment operator. | |
Node & | operator= (Node &&)=delete |
Move assignment operator. | |
OutputPin & | outputPinFromId (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. | |
Public Attributes | |
bool | callbacksEnabled |
Enables the callbacks. | |
ax::NodeEditor::NodeId | id |
Unique Id of the Node. | |
std::vector< InputPin > | inputPins |
List of input pins. | |
Kind | kind |
Kind of the Node. | |
std::string | name |
Name of the Node. | |
std::vector< OutputPin > | outputPins |
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. | |
Abstract parent class for all nodes.
|
strong |
|
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. |
|
explicit |
Constructor.
[in] | name | Name of the node |
Called when a link was deleted.
Reimplemented in NAV::Merger.
bool NAV::Node::doDeinitialize | ( | bool | wait = false | ) |
Asks the node worker to deinitialize the node.
[in] | wait | Wait for the worker to complete the request |
bool NAV::Node::doDisable | ( | bool | wait = false | ) |
Asks the node worker to disable the node.
[in] | wait | Wait for the worker to complete the request |
bool NAV::Node::doEnable | ( | ) |
Enable the node.
bool NAV::Node::doInitialize | ( | bool | wait = false | ) |
Asks the node worker to initialize the node.
[in] | wait | Wait for the worker to complete the request |
bool NAV::Node::doReinitialize | ( | bool | wait = false | ) |
Asks the node worker to reinitialize the node.
[in] | wait | Wait for the worker to complete the request |
|
inline |
Get Input Value connected on the pin. Only const data types.
T | Type of the connected object |
[in] | portIndex | Input port where to retrieve the data from |
|
virtual |
ImGui config window which is shown on double click.
Reimplemented in NAV::UartPacketConverter, NAV::VectorNavBinaryConverter, NAV::UdpRecv, NAV::UdpSend, NAV::CsvLogger, NAV::KmlLogger, NAV::MatrixLogger, NAV::RinexObsLogger, NAV::UartDataLogger, NAV::VectorNavDataLogger, NAV::ErrorModel, NAV::GnssAnalyzer, NAV::SinglePointPositioning, NAV::ImuIntegrator, NAV::LooselyCoupledKF, NAV::TightlyCoupledKF, NAV::ImuFusion, NAV::CsvFile, NAV::EmlidFile, NAV::NmeaFile, NAV::RinexNavFile, NAV::RinexObsFile, NAV::RtklibPosFile, NAV::UbloxFile, NAV::EmlidSensor, NAV::UbloxSensor, NAV::ImuFile, NAV::KvhFile, NAV::MultiImuFile, NAV::UlogFile, NAV::VectorNavFile, NAV::Imu, NAV::KvhSensor, NAV::Navio2Sensor, NAV::VectorNavSensor, NAV::ImuSimulator, NAV::PosVelAttFile, NAV::experimental::ARMA, NAV::experimental::SkydelNetworkStream, NAV::experimental::Delay, NAV::Plot, NAV::PosVelAttInitializer, NAV::Combiner, NAV::Demo, and NAV::TimeWindow.
InputPin & NAV::Node::inputPinFromId | ( | ax::NodeEditor::PinId | pinId | ) |
size_t NAV::Node::inputPinIndexFromId | ( | ax::NodeEditor::PinId | pinId | ) | const |
void NAV::Node::invokeCallbacks | ( | size_t | portIndex, |
const std::shared_ptr< const NodeData > & | data ) |
Calls all registered callbacks on the specified output port.
[in] | portIndex | Output port where to call the callbacks |
[in] | data | The data to pass to the callback targets |
void NAV::Node::notifyOutputValueChanged | ( | size_t | pinIdx, |
const InsTime & | insTime, | ||
const std::scoped_lock< std::mutex > & | guard ) |
Notifies connected nodes about the change.
[in] | pinIdx | Output Port index where to set the value |
[in] | insTime | Time the value was generated |
[in] | guard | Lock guard of the output data |
Called when a new link is to be established.
Reimplemented in NAV::VectorNavDataLogger, NAV::experimental::Delay, NAV::Demo, and NAV::Merger.
OutputPin & NAV::Node::outputPinFromId | ( | ax::NodeEditor::PinId | pinId | ) |
size_t NAV::Node::outputPinIndexFromId | ( | ax::NodeEditor::PinId | pinId | ) | const |
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.
[in] | portIndex | Input port where the data should be released |
std::scoped_lock< std::mutex > NAV::Node::requestOutputValueLock | ( | size_t | pinIdx | ) |
Blocks the thread till the output values was read by all connected nodes.
[in] | pinIdx | Output Pin index where to request the lock |
|
virtual |
Restores the node from a json object.
[in] | j | Json object with the node state |
Reimplemented in NAV::UartPacketConverter, NAV::VectorNavBinaryConverter, NAV::UdpRecv, NAV::UdpSend, NAV::CsvLogger, NAV::KmlLogger, NAV::MatrixLogger, NAV::RinexObsLogger, NAV::UartDataLogger, NAV::VectorNavDataLogger, NAV::ErrorModel, NAV::GnssAnalyzer, NAV::SinglePointPositioning, NAV::ImuIntegrator, NAV::LooselyCoupledKF, NAV::TightlyCoupledKF, NAV::ImuFusion, NAV::CsvFile, NAV::EmlidFile, NAV::NmeaFile, NAV::RinexNavFile, NAV::RinexObsFile, NAV::RtklibPosFile, NAV::UbloxFile, NAV::EmlidSensor, NAV::UbloxSensor, NAV::ImuFile, NAV::KvhFile, NAV::MultiImuFile, NAV::UlogFile, NAV::VectorNavFile, NAV::Imu, NAV::KvhSensor, NAV::Navio2Sensor, NAV::VectorNavSensor, NAV::ImuSimulator, NAV::PosVelAttFile, NAV::experimental::ARMA, NAV::experimental::Delay, NAV::Plot, NAV::PosVelAttInitializer, NAV::Combiner, NAV::Demo, NAV::GroupBox, and NAV::TimeWindow.
|
virtual |
Restores link related properties of the node from a json object.
[in] | j | Json object with the node state |
|
static |
Converts the state into a printable text.
[in] | state | State to convert |
|
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)