guardcore.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef GUARDCORE_H
  2. #define GUARDCORE_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 "tcpserver.h"
  11. #include "devinfotcpserver.h"
  12. class GuardCore : public QObject
  13. {
  14. Q_OBJECT
  15. public:
  16. explicit GuardCore(QObject *parent = nullptr);
  17. ~GuardCore();
  18. void start();
  19. bool shm_load();
  20. void shm_init();
  21. signals:
  22. public slots:
  23. void onConnected();
  24. void dataLog(QString log);
  25. void mqtt_data(QString mqtt_msg);
  26. void mqtt_event(QString mqtt_event);
  27. void appendSql(QString sql);
  28. private:
  29. LogThread *logthread;
  30. HttpThread *httpthread;
  31. DatabaseThread *dbthread;
  32. TcpServer *tcpserver;
  33. DevInfoTcpServer *devinfoserver;
  34. QMQTT::Client *m_client;
  35. QSqlDatabase db;
  36. quint16 mqttIdx,mqttEventIdx;
  37. QString ip,port,username,password;
  38. QString devinfourl,devinfokey,devinfosignature;
  39. QString httpurl,httpkey,httpsignature;
  40. QString httpurl1,httpkey1,httpsignature1;
  41. QString tcpserverurl,tcpserverkey,tcpserversignature;
  42. };
  43. #endif // GUARDCORE_H