Program Listing for File RatatoskGyroInfo.hpp

Return to documentation for file (sinspekto/ratatosk/RatatoskGyroInfo.hpp)

#pragma once

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

class RatatoskGyroInfoSubscriber : public QObject
{
  Q_OBJECT
  Q_PROPERTY(double hdt READ hdt NOTIFY hdtChanged)
  Q_PROPERTY(double rot READ rot NOTIFY rotChanged)
  Q_PROPERTY(QDateTime timestamp READ timestamp NOTIFY timestampChanged)

public:
  explicit RatatoskGyroInfoSubscriber(QObject *parent = nullptr);
  virtual ~RatatoskGyroInfoSubscriber();
  double hdt() const;
  double rot() const;
  QDateTime timestamp() const;
  Q_INVOKABLE void init(
      QtToDds* dds,
      const QString& topic,
      bool with_listener=true);

signals:
  void hdtChanged(double hdt);
  void rotChanged(double rot);
  void timestampChanged(QDateTime timestamp);
  void eventHeard();

public slots:
  void updateValue();

private:
  std::unique_ptr<sinspekto::Reader<ratatosk::types::GyroInfo>> m_reader;

};