elevatorcore.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef ELEVATORCORE_H
  2. #define ELEVATORCORE_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. #include <QObject>
  12. class ElevatorCore : public QObject
  13. {
  14. Q_OBJECT
  15. public:
  16. explicit ElevatorCore(QObject *parent = nullptr);
  17. ~ElevatorCore();
  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. DevInfoTcpServer *devinfoserver;
  33. QMQTT::Client *m_client;
  34. QSqlDatabase db;
  35. quint16 mqttIdx,mqttEventIdx;
  36. QString ip,port,username,password;
  37. QString devinfourl,devinfokey,devinfosignature;
  38. QString httpurl,httpkey,httpsignature;
  39. QString httpurl1,httpkey1,httpsignature1;
  40. signals:
  41. public slots:
  42. };
  43. #endif // ELEVATORCORE_H