21 #include <SDKDDKVer.h>
23 #include <boost/asio.hpp>
25 #include <boost/asio.hpp>
54 [[nodiscard]] std::string
type()
const override;
57 [[nodiscard]]
static std::string
category();
64 [[nodiscard]]
json save()
const override;
nlohmann::json json
json namespace
Utility for the UDP Send and Receive nodes.
Node(std::string name)
Constructor.
static std::string category()
String representation of the Class Category.
UdpRecv()
Default constructor.
void asyncReceive()
Polls the next data.
void guiConfig() override
ImGui config window which is shown on double click.
UdpUtil::MessageType _outputType
The selected output type in the GUI.
bool initialize() override
Initialize the node.
~UdpRecv() override
Destructor.
boost::asio::io_context _io_context
Asynchronous receive fct.
UdpRecv(UdpRecv &&)=delete
Move constructor.
bool _isStartup
Startup handler: used in 'initialize()' to differentiate between startup and re-initialization.
std::array< char, UdpUtil::MAXIMUM_BYTES > _charArray
The array that contains the data from the UDP stream.
bool resetNode() override
Resets the node. Moves the read cursor to the start.
UdpRecv & operator=(const UdpRecv &)=delete
Copy assignment operator.
std::thread _recvThread
Receiver thread.
bool _running
Flag that indicates the running data link.
UdpRecv & operator=(UdpRecv &&)=delete
Move assignment operator.
std::chrono::steady_clock::time_point _startPoint
Time point where the first package has been received.
void restore(const json &j) override
Restores the node from a json object.
static constexpr size_t OUTPUT_PORT_INDEX_NODE_DATA
Object (NodeData)
UdpRecv(const UdpRecv &)=delete
Copy constructor.
json save() const override
Saves the node into a json object.
std::string type() const override
String representation of the Class Type.
boost::asio::ip::udp::socket _socket
Boost udp socket.
static std::string typeStatic()
String representation of the Class Type.
int _port
UDP port number.
void deinitialize() override
Deinitialize the node.
boost::asio::ip::udp::endpoint _sender_endpoint
Boost udp endpoint.
MessageType
Enum specifying the type of the output message.
@ PosVelAtt
Extract PosVelAtt data.
const char * to_string(gui::widgets::PositionWithFrame::ReferenceFrame refFrame)
Converts the enum to a string.