Program Listing for File RatatoskDouble4.hpp¶
↰ Return to documentation for file (sinspekto/ratatosk/RatatoskDouble4.hpp
)
#pragma once
#include "sinspekto/QtToDds.hpp"
#include "QDateTime"
#include "QVector4D"
class RatatoskDouble4Subscriber : public QObject
{
Q_OBJECT
Q_PROPERTY(QVector4D value READ value NOTIFY valueChanged)
Q_PROPERTY(QDateTime timestamp READ timestamp NOTIFY timestampChanged)
public:
explicit RatatoskDouble4Subscriber(QObject *parent = nullptr);
virtual ~RatatoskDouble4Subscriber();
QVector4D value() const;
QDateTime timestamp() const;
Q_INVOKABLE void init(
QtToDds* dds,
const QString& topic,
bool with_listener=true);
signals:
void valueChanged(QVector4D value);
void timestampChanged(QDateTime timestamp);
void eventHeard();
public slots:
void updateValue();
private:
std::unique_ptr<sinspekto::Reader<ratatosk::types::Double4>> m_reader;
};
class RatatoskDouble4Publisher : public QObject
{
Q_OBJECT
Q_PROPERTY(QVector4D value READ value WRITE setValue NOTIFY valueChanged)
public:
explicit RatatoskDouble4Publisher(QObject *parent = nullptr);
virtual ~RatatoskDouble4Publisher();
QVector4D value() const;
Q_INVOKABLE void init(
QtToDds* dds,
const QString& topic,
QVector4D start_value,
bool send_first);
signals:
void valueChanged(QVector4D value);
public slots:
void setValue(QVector4D value);
void publish();
private:
std::unique_ptr<sinspekto::Writer<ratatosk::types::Double4>> m_writer;
};