Class DdsIdVec3dBuffer

Inheritance Relationships

Base Type

Class Documentation

class DdsIdVec3dBuffer : public DdsBuffer

Buffer class for IdVec3d or BatchIdVec3d.

This class subscribes to a DDS topic and makes sure the buffers are updated with incoming data.

When updating a QAbstractSeries with DdsBuffer::updateSeries() in QML scripts, the following mapping from DDS member variables to qml_enums::DimId enums are used.

QML enum

Variable

FKIN.T

time

FKIN.X

x

FKIN.Y

y

FKIN.Z

z

aBuffer.updateSeries(someSeries, FKIN.T, FKIN.Z)

TODO: Add batch buffer.

Public Functions

explicit DdsIdVec3dBuffer(QObject *parent = nullptr)

Constructor.

The initialization of DDS instances are deferred to an init() function, but it initializes the data buffers.

Parameters

parent[in] QObject pointer.

virtual ~DdsIdVec3dBuffer()

Destructor.

QPointF rangeX() const

Property accessor for x variable range.

QPointF rangeY() const

Property accessor for y variable range.

QPointF rangeZ() const

Property accessor for z variable range.

void init(QtToDds *dds, const QString &topic, const QString &id, int buffer_size, bool with_listener = true)

Initializes DDS reader and connects Qt signals and slots.

Note

An instance of this class can only be buffer for a single DDS topic, so either type IdVec3d or BatchIdVec3d.

Parameters
  • dds[in] Pointer to QtToDds instance.

  • topic[in] Name of DDS topic for which to subscribe.

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

  • buffer_size[in] Number of data points to store in the circular buffer.

  • with_listener[in] Use DdsReaderListener callback to trigger eventHeard() signal.

Public Slots

virtual void updateBuffers()

Adds samples to the appropriate buffer.

Each data member of the DDS data structure is separated into an appropriate buffer. It picks the last sample and emits newData().

Signals

void rangeChanged(QPointF range, qml_enums::DimId dim)

Triggered when the range has changed.

See class documentation for supported DimId enums.

Parameters
  • range[out] New range for the dimension.

  • dim[out] The dimension in question.

void eventHeard()

DdsReaderListener calls this signal when there is data available on the subscribed topic.

If init() is called with_listener=true, eventHeard() will be connected to the slot updateBuffers().

void newData()

Signal whenever new data is added to the buffers.

Properties

QPointF rangeX

Data range of variable x.

QPointF rangeY

Data range of variable y.

QPointF rangeZ

Data range of variable z.

Private Members

std::unique_ptr<sinspekto::Reader<fkin::IdVec3d>> m_reader

The DDS reader wrapper class.

QString m_id

Key identifier for topic instance.