writecore.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef WRITECORE_H
  2. #define WRITECORE_H
  3. #include <QObject>
  4. #include <QTimer>
  5. #include <QDateTime>
  6. #include "databasethread.h"
  7. #include "databaseeventthread.h"
  8. #include "logthread.h"
  9. #include "mqttdatathread.h"
  10. #include "dealmqttthread.h"
  11. #include "mqtteventdatathread.h"
  12. #include "dealmqtteventthread.h"
  13. #include "mqttalarmdatathread.h"
  14. #include "dealmqttalarmthread.h"
  15. class WriteCore : public QObject
  16. {
  17. Q_OBJECT
  18. public:
  19. explicit WriteCore(QObject *parent = nullptr);
  20. ~WriteCore();
  21. void start();
  22. signals:
  23. public slots:
  24. void time_out();
  25. void mqtt_data(QString ip,QString port,QString username,QString password);
  26. void dbdata_log(QString log);
  27. void mq_log(QString log);
  28. void sendMqttData(QString topic,QByteArray data);
  29. void sendMqttEventData(QString topic,QByteArray data);
  30. void sendMqttAlarmData(QString topic,QByteArray data);
  31. void dmq_log(QString log);
  32. void appendSql(QString sql);
  33. void appendEventSql(QString sql);
  34. private:
  35. QTimer *timer;
  36. DatabaseThread *dbthread;
  37. DatabaseEventThread *dbeventthread;
  38. LogThread *logthread;
  39. MqttDataThread *mqthread;
  40. DealMqttThread *dealmqthread;
  41. MqttEventDataThread *mqeventthread;
  42. DealMqttEventThread *dealmqeventthread;
  43. MqttAlarmDataThread *mqalarmthread;
  44. DealMqttAlarmThread *dealmqalarmthread;
  45. };
  46. #endif // WRITECORE_H