47 [[nodiscard]] std::string
type()
const override;
50 [[nodiscard]]
static std::string
category();
57 [[nodiscard]]
json save()
const override;
80 std::array<int, 3>
integer = { 12, -2, 2 };
123 [[nodiscard]] std::shared_ptr<const NodeData>
peekPollData(
bool peek =
false);
127 [[nodiscard]] std::shared_ptr<const NodeData>
pollData();
nlohmann::json json
json namespace
Manages a thread which calls a specified function at a specified interval.
bool _fileReaderInsteadSensor
Whether to have a file reader instead of a sensor output pin.
int _iPollData
Counter for data Reading.
bool _valueBool
Value which is represented over the Bool pin.
bool _enableInt
Switch to enable the int pin.
void afterDeleteLink(OutputPin &startPin, InputPin &endPin) override
Called when a link was deleted.
bool onCreateLink(OutputPin &startPin, InputPin &endPin) override
Called when a new link is to be established.
CallbackTimer _timer
Timer object to handle async data requests.
Demo(Demo &&)=delete
Move constructor.
bool _enableFlow
Switch to enable the flow pin.
int _receivedDataCnt
Counter how often data was received.
bool _enableDouble
Switch to enable the double pin.
std::optional< size_t > getPinIdx(DemoPins pinType) const
Calculates the pin index for the given type.
bool _enableObject
Switch to enable the object pin.
float _valueFloat
Value which is represented over the Float pin.
bool _enableString
Switch to enable the string pin.
bool initialize() override
Initialize the node.
bool _enableFloat
Switch to enable the float pin.
void updatePins()
Update the pins depending on the GUI.
bool _enableBool
Switch to enable the bool pin.
size_t _stringUpdateCounter
Counter of how often the string was updated.
bool resetNode() override
Resets the node. It is guaranteed that the node is initialized when this is called.
static void readSensorDataThread(void *userData)
Function which performs the async data reading.
void stringUpdatedNotifyFunction(const InsTime &insTime, size_t pinIdx)
Function to call when the string is updated.
void restore(const json &j) override
Restores the node from a json object.
void updateOutputFlowPin()
Updates the output flow pin depending on the GUI selection.
std::shared_ptr< const NodeData > peekPollData(bool peek=false)
Polls data from the file. This function is needed, if we have multiple output pins,...
static std::string typeStatic()
String representation of the Class Type.
int _valueInt
Value which is represented over the Int pin.
Eigen::MatrixXd _valueMatrix
Value which is represented over the Matrix pin.
Demo(const Demo &)=delete
Copy constructor.
Demo & operator=(const Demo &)=delete
Copy assignment operator.
void deinitialize() override
Deinitialize the node.
int _nPollData
Amount of Observations to be read.
std::shared_ptr< const NodeData > pollData()
Polls data from the file.
bool _enableMatrix
Switch to enable the matrix pin.
std::string type() const override
String representation of the Class Type.
DemoPins
Pin types used in this demo.
@ Delegate
Delegate pins giving access to the complete connected node.
@ Flow
Flow pins transmitting data as timestamped shared pointers.
int _outputFrequency
Output frequency for the simulated sensor data.
void receiveData(InputPin::NodeDataQueue &queue, size_t pinIdx)
Receive callback on the Flow pin.
std::string _valueString
Value which is represented over the String pin.
static std::string category()
String representation of the Class Category.
bool _enableDelegate
Switch to enable the delegate pin.
void guiConfig() override
ImGui config window which is shown on double click.
Demo()
Default constructor.
json save() const override
Saves the node into a json object.
DemoData _valueObject
Value which is represented over the Object pin.
Demo & operator=(Demo &&)=delete
Move assignment operator.
double _valueDouble
Value which is represented over the Double pin.
~Demo() override
Destructor.
The class is responsible for all time-related tasks.
Node(std::string name)
Constructor.
Data struct transmitted over an output port.
std::array< int, 3 > integer
Integer inside the DemoData.