#ifndef CHALETDATA_H
#define CHALETDATA_H
#include <QString>
#include "GlobalDefine.h"
#include <QDateTime>
#include <QByteArray>

enum eWiFiState
{
    WIFI_MODULE_OFF_STATE = 0,
    WIFI_CONNECTED_STATE,
    WIFI_DISCONNECTED_STATE,
    WIFI_INIT_ERROR_STATE,
    WIFI_UNKNOWN_STATE
};

enum eChaletPowerRelayState
{
    CHALET_POWER_RELAY_OFF_STATE = 0,
    CHALET_POWER_RELAY_ON_STATE,
    CHALET_POWER_RELAY_UNKNOWN_STATE
};

enum eChaletCurrentSensorState
{
    CHALET_CURRENT_SENSOR_DEFECT_STATE = 0,
    CHALET_CURRENT_SENSOR_OK_STATE,
    CHALET_CURRENT_SENSOR_UNKNOWN_STATE
};


class CChaletMainStatus
{
public:

  //  QByteArray ToByteArray();
    int FromByteArray(QByteArray Data);

    CChaletMainStatus();

    quint8 mInverterRelayStatus;
    quint8 mWiFiModuleStatus;
    qint8 mCurrentSensorStatus;

    float mBatteryVoltage;
    float mChaletTemperature;
    qint16 mBatteryCurrent;
    qint16 mBatterySOC;

    bool mHarakiriDone;
    bool mIsOnline;

    bool mStatusToggleBit;

    QDateTime mLastLoraStatus;
     QDateTime mThisStatusDateTime;

     float mLostRequestPercentage;


     int mTotalNbChaletRxCmds;
     int mTotalMasterTxCmds;
     int mMasterLostRequestCount;


};
     QDataStream &operator>>(QDataStream &in, CChaletMainStatus &dest);

#endif // CHALETDATA_H
