Torc  0.1
torccentral.h
Go to the documentation of this file.
1 #ifndef TORCCENTRAL_H
2 #define TORCCENTRAL_H
3 
4 // Qt
5 #include <QMutex>
6 #include <QObject>
7 #include <QVariant>
8 
9 // Torc
10 #include "torcdevice.h"
11 #include "http/torchttpservice.h"
12 
13 class TorcCentral final : public QObject, public TorcHTTPService
14 {
15  public:
17  {
18  Celsius = 0,
20  };
21  Q_ENUM(TemperatureUnits)
22 
23  Q_OBJECT
24  Q_CLASSINFO("Version", "1.0.0")
25  Q_PROPERTY(QString temperatureUnits READ GetTemperatureUnits CONSTANT)
26 
27  public:
28  TorcCentral();
29  ~TorcCentral();
30 
31  QString GetUIName (void) override;
32  bool event (QEvent *Event) override;
33  static QByteArray GetCustomisedXSD (const QString &BaseXSDFile);
35 
36  public slots:
37  // TorcHTTPService
38  void SubscriberDeleted (QObject *Subscriber);
39  QString GetTemperatureUnits (void);
40 
41  protected:
43 
44  private:
45  bool LoadConfig (void);
46 
47  private:
48  QVariantMap m_config;
49  QByteArray m_graph;
50  QString temperatureUnits;
51 };
52 
53 #define XSD_TYPES QStringLiteral("<!--TORC_XSD_TYPES-->")
54 #define XSD_INPUTTYPES QStringLiteral("<!--TORC_XSD_INPUTTYPES-->")
55 #define XSD_INPUTS QStringLiteral("<!--TORC_XSD_INPUTS-->")
56 #define XSD_CONTROLTYPES QStringLiteral("<!--TORC_XSD_CONTROLTYPES-->")
57 #define XSD_CONTROLS QStringLiteral("<!--TORC_XSD_CONTROLS-->")
58 #define XSD_OUTPUTTYPES QStringLiteral("<!--TORC_XSD_OUTPUTTYPES-->")
59 #define XSD_OUTPUTS QStringLiteral("<!--TORC_XSD_OUTPUTS-->")
60 #define XSD_NOTIFIERTYPES QStringLiteral("<!--TORC_XSD_NOTIFIERTYPES-->")
61 #define XSD_NOTIFIERS QStringLiteral("<!--TORC_XSD_NOTIFIERS-->")
62 #define XSD_NOTIFICATIONTYPES QStringLiteral("<!--TORC_XSD_NOTIFICATIONYPES-->")
63 #define XSD_NOTIFICATIONS QStringLiteral("<!--TORC_XSD_NOTIFICATIONS-->")
64 #define XSD_UNIQUE QStringLiteral("<!--TORC_XSD_UNIQUE-->")
65 #define XSD_CAMERATYPES QStringLiteral("<!--TORC_XSD_CAMERATYPES-->")
66 
68 {
69  public:
71  virtual ~TorcXSDFactory() = default;
72 
73  static void CustomiseXSD (QByteArray &XSD);
74  static TorcXSDFactory* GetTorcXSDFactory (void);
75  TorcXSDFactory* NextFactory (void) const;
76 
77  virtual void GetXSD (QMultiMap<QString,QString> &XSD) = 0;
78 
79  protected:
82 
83  private:
84  Q_DISABLE_COPY(TorcXSDFactory)
85 };
86 
87 #endif // TORCCENTRAL_H
static QByteArray GetCustomisedXSD(const QString &BaseXSDFile)
void SubscriberDeleted(QObject *Subscriber)
QString GetTemperatureUnits(void)
static TemperatureUnits gTemperatureUnits
Definition: torccentral.h:42
static TemperatureUnits GetGlobalTemperatureUnits(void)
Definition: torccentral.cpp:58
TorcXSDFactory * nextTorcXSDFactory
Definition: torccentral.h:81
bool event(QEvent *Event) override
Handle Exit events.
QString GetUIName(void) override
static TorcXSDFactory * gTorcXSDFactory
Definition: torccentral.h:80
QString temperatureUnits
Definition: torccentral.h:25