#ifndef WRITECORE_H
#define WRITECORE_H

#include <QObject>
#include "databasethread.h"
#include "logthread.h"
#include "mqttdatathread.h"
#include "dealmqttthread.h"

class WriteCore : public QObject
{
    Q_OBJECT
public:
    explicit WriteCore(QObject *parent = nullptr);
    ~WriteCore();
    void start();

signals:

public slots:
    void mqtt_data(QString ip,QString port,QString username,QString password);
    void dbdata_log(QString log);
    void mq_log(QString log);
    void sendMqttData(QString topic,QByteArray data);
    void dmq_log(QString log);
    void appendSql(QString sql);
    void appendAlarm(QString sql);

private:
    DatabaseThread *dbthread;
    LogThread *logthread;
    MqttDataThread *mqthread;
    DealMqttThread *dealmqthread;
};

#endif // WRITECORE_H
