1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #ifndef GENERATORCORE_H
- #define GENERATORCORE_H
- #include <QObject>
- #include <qmqtt.h>
- #include <QSqlDatabase>
- #include <QSqlQuery>
- #include "logthread.h"
- #include "httpthread.h"
- #include "databasethread.h"
- #include "devinfotcpserver.h"
- class GeneratorCore : public QObject
- {
- Q_OBJECT
- public:
- explicit GeneratorCore(QObject *parent = nullptr);
- ~GeneratorCore();
- void start();
- bool shm_load();
- void shm_init();
- signals:
- public slots:
- void onConnected();
- void dataLog(QString log);
- void mqtt_data(QString mqtt_msg);
- void mqtt_alarm(QString mqtt_alarm);
- void appendSql(QString sql);
- private:
- LogThread *logthread;
- HttpThread *httpthread;
- DatabaseThread *dbthread;
- DevInfoTcpServer *devinfoserver;
- QMQTT::Client *m_client;
- QSqlDatabase db;
- quint16 mqttIdx,mqttAlarmIdx;
- QString ip,port,username,password;
- };
- #endif // GENERATORCORE_H
|