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


//Read registers
#define CHALET_MODBUS_ONLINE_STATE_REG 2000
#define CHALET_MODBUS_WIFI_STATE_REG 2001
#define CHALET_MODBUS_CURRENT_SENSOR_STATE_REG 2002
#define CHALET_MODBUS_HARAKIRI_DONE_REG 2003
#define CHALET_MODBUS_STATUS_TOGGLE_REG 2004
#define CHALET_MODBUS_WATCHDOG_STATUS_REG 2005
#define CHALET_MODBUS_INVERTER_REG 2006

#define CHALET_MODBUS_BATTERY_VOLTAGE_REG_1 2010
#define CHALET_MODBUS_BATTERY_VOLTAGE_REG_2 2011
#define CHALET_MODBUS_BATTERY_CURRENT_REG_1 2012
#define CHALET_MODBUS_BATTERY_CURRENT_REG_2 2013
#define CHALET_MODBUS_BATTERY_SOC_REG 2014
#define CHALET_MODBUS_LOST_REQUESTS_REG_1 2015
#define CHALET_MODBUS_LOST_REQUESTS_REG_2 2016
#define CHALET_MODBUS_TEMPERATURE_VAL_REG_1 2017
#define CHALET_MODBUS_TEMPERATURE_VAL_REG_2 2018


//Write registers
#define CHALET_MODBUS_SET_INVERTER_STATE_REG 3000
#define CHALET_MODBUS_SET_WIFI_STATE_REG 3001
#define CHALET_MODBUS_REBOOT_CPU_REQUEST_REG 3002



class CChaletMainStatus
{
public:

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

    CChaletMainStatus();

    quint8 mInverterRelayStatus;
    quint8 mWiFiModuleStatus;
    qint8 mCurrentSensorStatus;

    float mBatteryVoltage;
    qint16 mBatteryCurrent;
    qint16 mBatterySOC;

    bool mHarakiriDone;
    bool mIsOnline;

    bool mStatusToggleBit;

    QDateTime mLastLoraStatus;
    QDateTime mThisStatusDateTime;

    float mLostRequestPercentage;

    float mChaletTemperature;

    int mTotalNbChaletRxCmds;
    int mTotalNbMasterTxCmds;
    int mMasterLostRequestCount;



};


#endif // CHALETDATA_H
