Program Listing for File DdsNlpConfig.hpp

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

#pragma once

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

class DdsNlpConfigSubscriber : public QObject
{
  Q_OBJECT
  Q_PROPERTY(QString technique READ technique NOTIFY techniqueChanged)
  Q_PROPERTY(QString solver READ solver NOTIFY solverChanged)
  Q_PROPERTY(int degree READ degree NOTIFY degreeChanged)
  Q_PROPERTY(double horizon READ horizon NOTIFY horizonChanged)
  Q_PROPERTY(unsigned int elements READ elements NOTIFY elementsChanged)
  Q_PROPERTY(unsigned int nx READ nx NOTIFY nxChanged)
  Q_PROPERTY(unsigned int np READ np NOTIFY npChanged)
  Q_PROPERTY(unsigned int ng READ ng NOTIFY ngChanged)
  Q_PROPERTY(QDateTime timestamp READ timestamp NOTIFY timestampChanged)

public:
  explicit DdsNlpConfigSubscriber(QObject *parent = nullptr);
  virtual ~DdsNlpConfigSubscriber();
  QString technique() const;
  QString solver() const;
  int degree() const;
  double horizon() const;
  unsigned int elements() const;
  unsigned int nx() const;
  unsigned int np() const;
  unsigned int ng() const;
  QDateTime timestamp() const;
  Q_INVOKABLE void init(
      QtToDds* dds,
      const QString& topic,
      const QString& id,
      bool with_listener=true);

signals:
  void techniqueChanged(QString technique);
  void solverChanged(QString solver);
  void degreeChanged(int degree);
  void horizonChanged(double horizon);
  void elementsChanged(unsigned int elements);
  void nxChanged(unsigned int nx);
  void npChanged(unsigned int np);
  void ngChanged(unsigned int ng);
  void timestampChanged(QDateTime timestamp);
  void eventHeard();

public slots:
  void updateValues();

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

};