#ifndef CHALETGUI_H
#define CHALETGUI_H

#include <QWidget>
#include "ChaletData.h"
#include "QCustomPlot/qcustomplot.h"
#include <QHostAddress>

class CChalet;
class CLoraModuleInterface;
class CLoraModuleInterfaceStatus;


namespace Ui {
class CChaletGui;
}

class CChaletGui : public QWidget
{
    Q_OBJECT

public:
    explicit CChaletGui(QWidget *parent = nullptr);
    ~CChaletGui();

    CChalet *mProgramHandle;
    CLoraModuleInterface *mLoraModuleIFProgramHandle;
    QCustomPlot *mBatteryPlotWidget;

    int UpdateChaletStatus(CChaletMainStatus Status);
    int UpdateLoraModuleStatus(CLoraModuleInterfaceStatus Status);
    int UpdateChaletLogPlot(QByteArray* Log);
    int ChaletCommActivity();
    QTimer *mGetWifiParamsButtonColorTimer, *mGetFimwVersionButtonColorTimer;
    QPalette mFirmVersionDefaultBtnPal, mWifiDefaultBtnPal;
    int mChaletLastLostReqCount;
    QHostAddress mModuleIPAddress;

private:
    Ui::CChaletGui *ui;

public slots:
    void WiFiONButtonClicked();
    void WiFiOFFButtonClicked();
    void InverterPowerONButtonClicked();
    void InverterPowerOFFButtonClicked();
    void RebootCPUButtonClicked();
    void DoHarakiriButtonClicked();
    void EnableHarakiriClicked(bool);
    void GetChaletLogsBtnClicked();
    void GetDeviceWiFiParamsButtonClicked(bool);
    void SetDeviceWiFiParamsButtonClicked(bool);
    void UpdateDeviceWiFiParameters(QHostAddress IP,QHostAddress Gateway,QString APName, QString APPassword, bool UseDHCP);
    void GetFirmwareVersionBtnClicked();
    void UpdateFirmwareVersion(QByteArray Version);
    void StartSyslogShellBtnClicked();
    void StartTerminalShellBtnClicked();
    void GetWifiParamsBtnColorTimerExpired();
    void GetFirmwVersionBtnColorTimerExpired();
    void ResetCommStatsBtnClicked();
    void UpdateDeviceWifiStatus(char WifiState, QHostAddress IP);
    void GetModuleWifiStatusBtnClicked();
    void WiFiSettingsSelectionChanged();


};

#endif // CHALETGUI_H
