Class DdsIdVec2dPublisher

Inheritance Relationships

Base Type

  • public QObject

Class Documentation

class DdsIdVec2dPublisher : public QObject

Publisher for DDS type IdVec2d as a QML element.

This class is a QML element and enables QML applications to publish a DDS signal type from a writable QML property.

Public Functions

explicit DdsIdVec2dPublisher(QObject *parent = nullptr)

Constructor.

The initialization is deferred to an init() function.

Parameters

parent[in] QObject pointer.

virtual ~DdsIdVec2dPublisher()

Destructor.

QVector2D value() const

Property accessor for vector as QML property.

Returns

QML compatible vector.

void init(QtToDds *dds, const QString &topic, const QString &id, QVector2D start_value, bool send_first)

Initializes DDS writer and sets initial value.

Parameters
  • dds[in] Pointer to QtToDds instance.

  • topic[in] Name of DDS topic to publish.

  • id[in] Key identifier for the topic instance.

  • start_value[in] Initial value of the signal.

  • send_first[in] Whether to forcefully send the initial value.

Public Slots

void setValue(QVector2D value)

Write function for the QML property, publishes value on DDS.

This slot publishes the vector onto the DDS topic with the configured key identifier. It also emits a valueChanged().

Note

It only publishes or emits a signal if the QML property value has changed!

Parameters

value[in] New vector value.

void publish()

Publish on DDS the value already set.

Signals

void valueChanged(QVector2D value)

DDS value has has changed.

This signal is connected to the QML DdsIdVec2dPublisher::value property.

Parameters

value[out] New vector value.

Properties

QVector2D value

DDS 2d-vector as QVector2D QML property.

Private Members

std::unique_ptr<sinspekto::Writer<fkin::IdVec2d>> m_writer

The DDS writer wrapper class.