Program Listing for File DdsIdVec2dBuffer.hpp

Return to documentation for file (sinspekto/DdsIdVec2dBuffer.hpp)

#pragma once

#include <memory>

#include "sinspekto/QtToDds.hpp"
#include "sinspekto/DdsBuffer.hpp"

class DdsIdVec2dBuffer : public DdsBuffer
{
  Q_OBJECT
  Q_PROPERTY(QPointF rangeX READ rangeX NOTIFY rangeChanged)
  Q_PROPERTY(QPointF rangeY READ rangeY NOTIFY rangeChanged)


public:
  explicit DdsIdVec2dBuffer(QObject *parent = nullptr);
  virtual ~DdsIdVec2dBuffer();
  QPointF rangeX() const;
  QPointF rangeY() const;
  Q_INVOKABLE void init(
      QtToDds* dds,
      const QString& topic,
      const QString& id,
      int buffer_size,
      bool with_listener=true);

signals:
  void rangeChanged(QPointF range, qml_enums::DimId dim);
  void eventHeard();
  void newData();

public slots:
  virtual void updateBuffers();

private:
  std::unique_ptr<sinspekto::Reader<fkin::IdVec2d>> m_reader;
  QString m_id;
};