123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #ifndef CORE_H
- #define CORE_H
- #include <QObject>
- #include <qmqtt.h>
- #include <QSqlDatabase>
- #include <QSqlQuery>
- #include <QDateTime>
- #include <QTimer>
- #include "logthread.h"
- #include "jzmqttpub.h"
- #include "jzmqttsub.h"
- #include "httpthread.h"
- #include "ytmqttpub.h"
- #include "ytmqttsub.h"
- class Core : public QObject
- {
- Q_OBJECT
- public:
- explicit Core(QObject *parent = nullptr);
- ~Core();
- void start();
- void shm_init();
- bool shm_load();
- signals:
- public slots:
- void onConnected();
- void dataLog(QString log);
- void receiveDevData(QString topic,QByteArray data);
- void receiveYtDevData(QString topic,QByteArray data);
- void mqtt_data(QString mqtt_msg);
- void mqtt_data1(QString mqtt_msg);
- void mqtt_data2(QString mqtt_msg);
- void time_out();
- private:
- LogThread *logthread;
- JZMqttPub *jzmqttpub;
- JZMqttSub *jzmqttsub;
- HttpThread *httpthread;
- YTMqttPub *ytmqttpub;
- YTMqttSub *ytmqttsub;
- QMQTT::Client *m_client;
- QSqlDatabase db;
- quint16 mqttIdx,mqttIdx1,mqttIdx2;
- QString ip,port,username,password;
- QTimer *timer;
- };
- #endif // CORE_H
|