generatorcore.h 912 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef GENERATORCORE_H
  2. #define GENERATORCORE_H
  3. #include <QObject>
  4. #include <qmqtt.h>
  5. #include <QSqlDatabase>
  6. #include <QSqlQuery>
  7. #include "logthread.h"
  8. #include "httpthread.h"
  9. #include "databasethread.h"
  10. #include "devinfotcpserver.h"
  11. class GeneratorCore : public QObject
  12. {
  13. Q_OBJECT
  14. public:
  15. explicit GeneratorCore(QObject *parent = nullptr);
  16. ~GeneratorCore();
  17. void start();
  18. bool shm_load();
  19. void shm_init();
  20. signals:
  21. public slots:
  22. void onConnected();
  23. void dataLog(QString log);
  24. void mqtt_data(QString mqtt_msg);
  25. void mqtt_alarm(QString mqtt_alarm);
  26. void appendSql(QString sql);
  27. private:
  28. LogThread *logthread;
  29. HttpThread *httpthread;
  30. DatabaseThread *dbthread;
  31. DevInfoTcpServer *devinfoserver;
  32. QMQTT::Client *m_client;
  33. QSqlDatabase db;
  34. quint16 mqttIdx,mqttAlarmIdx;
  35. QString ip,port,username,password;
  36. };
  37. #endif // GENERATORCORE_H