#ifndef ELEVATORCORE_H
#define ELEVATORCORE_H


#include <QObject>
#include <qmqtt.h>
#include <QSqlDatabase>
#include <QSqlQuery>
#include "logthread.h"
#include "httpthread.h"
#include "databasethread.h"

#include <QObject>

class ElevatorCore : public QObject
{
    Q_OBJECT
public:
    explicit ElevatorCore(QObject *parent = nullptr);
    ~ElevatorCore();
    void start();
    bool shm_load();
    void shm_init();

signals:

public slots:
    void onConnected();
    void dataLog(QString log);
    void mqtt_data(QString mqtt_msg);
    void append_sql(QString sql);

private:
    LogThread *logthread;
    HttpThread *httpthread;
    DatabaseThread *dbthread;

    QMQTT::Client *m_client;
    QSqlDatabase db;
    quint16 mqttIdx;
    QString ip,port,username,password;

signals:

public slots:
};

#endif // ELEVATORCORE_H
