Torc  0.1
torcoutput.h
Go to the documentation of this file.
1 #ifndef TORCOUTPUT_H
2 #define TORCOUTPUT_H
3 
4 // Qt
5 #include <QMutex>
6 #include <QObject>
7 
8 // Torc
9 #include "torcreferencecounted.h"
10 #include "torchttpservice.h"
11 #include "torcdevice.h"
12 
13 #define OUTPUTS_DIRECTORY QStringLiteral("outputs")
14 
15 class TorcOutput : public TorcDevice, public TorcHTTPService
16 {
17  Q_OBJECT
18  Q_CLASSINFO("Version", "1.0.0")
19 
20  friend class TorcOutputs;
21 
22  public:
23  enum Type
24  {
25  Unknown = 0,
27  pH,
29  PWM,
34  };
35 
36  Q_ENUM(Type)
37 
38  public:
39  TorcOutput(TorcOutput::Type Type, double Value, const QString &ModelId, const QVariantMap &Details);
40  TorcOutput(TorcOutput::Type Type, double Value, const QString &ModelId, const QVariantMap &Details,
41  QObject *Output, const QMetaObject &MetaObject, const QString &Blacklist = QStringLiteral(""));
42 
43  virtual ~TorcOutput() = default;
44 
45  virtual TorcOutput::Type GetType (void) = 0;
46 
47  bool HasOwner (void);
48  bool SetOwner (QObject *Owner);
49  QString GetUIName (void) override;
50 
51  public slots:
52  // TorcHTTPService
53  void SubscriberDeleted (QObject *Subscriber);
54 
55  protected:
56  virtual void Graph (QByteArray* Data);
57 
58  private:
59  QObject *m_owner;
60 
61  private:
62  Q_DISABLE_COPY(TorcOutput)
63 };
64 
65 #endif // TORCOUTPUT_H
virtual void Graph(QByteArray *Data)
Definition: torcoutput.cpp:92
virtual TorcOutput::Type GetType(void)=0
void SubscriberDeleted(QObject *Subscriber)
Definition: torcoutput.cpp:87
bool HasOwner(void)
Definition: torcoutput.cpp:52
QString GetUIName(void) override
Definition: torcoutput.cpp:58
bool SetOwner(QObject *Owner)
Definition: torcoutput.cpp:66