18 #include <SDKDDKVer.h>
20 #include <boost/asio.hpp>
22 #include <boost/asio.hpp>
53 [[nodiscard]] std::string
type()
const override;
56 [[nodiscard]]
static std::string
category();
63 [[nodiscard]]
json save()
const override;
88 static constexpr std::array<int, 2>
PORT_LIMITS = { 0, 65535 };
nlohmann::json json
json namespace
Position, Velocity and Attitude Storage Class.
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.
bool initialize() override
Initialize the node.
static constexpr std::array< int, 2 > PORT_LIMITS
Range a port can be in [0, 2^16-1].
~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.
bool resetNode() override
Resets the node. Moves the read cursor to the start.
UdpRecv & operator=(const UdpRecv &)=delete
Copy assignment operator.
std::array< double, 13 > _data
Network data stream array.
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.
static constexpr unsigned int _maxBytes
Network data stream maximum buffer size in [bytes].
int _port
UDP port number.
void deinitialize() override
Deinitialize the node.
boost::asio::ip::udp::endpoint _sender_endpoint
Boost udp endpoint.