package com.pwt.netty.common.chargerold.client;

import com.pwt.netty.common.chargerold.RequestData;
import io.netty.buffer.ByteBuf;
import lombok.Data;

/**
 * @author linyun
 * @version V1.0
 * @Title: ChargerStatusData
 * @Description: 充电机状态数据包
 * @date 2022/11/15
 **/
@Data
public class ChargerStatusData extends RequestData {

    /*1#充电模块电压*/
    private short status1;

    /*1#充电模块电流*/
    private short status2;

    /*1#充电模块温度*/
    private short status3;

    /*2#充电模块电压*/
    private short status4;

    /*2#充电模块电流*/
    private short status5;

    /*2#充电模块温度*/
    private short status6;

    /*3#充电模块电压*/
    private short status7;

    /*3#充电模块电流*/
    private short status8;

    /*3#充电模块温度*/
    private short status9;

    /*4#充电模块电压*/
    private short status10;

    /*4#充电模块电流*/
    private short status11;

    /*4#充电模块温度*/
    private short status12;

    /*5#充电模块电压*/
    private short status13;

    /*5#充电模块电流*/
    private short status14;

    /*5#充电模块温度*/
    private short status15;

    /*6#充电模块电压*/
    private short status16;

    /*6#充电模块电流*/
    private short status17;

    /*6#充电模块温度*/
    private short status18;

    /*7#充电模块电压*/
    private short status19;

    /*7#充电模块电流*/
    private short status20;

    /*7#充电模块温度*/
    private short status21;

    /*8#充电模块电压*/
    private short status22;

    /*8#充电模块电流*/
    private short status23;

    /*8#充电模块温度*/
    private short status24;

    /*峰时电量*/
    private int status25;

    /*谷时电量*/
    private int status26;

    /*平时电量*/
    private int status27;

    /*备用*/
    private int reserved1;

    /*备用*/
    private int reserved2;

    /***
     * 子类编码
     * @param byteBuf
     */
    @Override
    protected void encodeInternal(ByteBuf byteBuf)
    {
        byteBuf.writeShort(getStatus1());
        byteBuf.writeShort(getStatus2());
        byteBuf.writeShort(getStatus3());
        byteBuf.writeShort(getStatus4());
        byteBuf.writeShort(getStatus5());
        byteBuf.writeShort(getStatus6());
        byteBuf.writeShort(getStatus7());
        byteBuf.writeShort(getStatus8());
        byteBuf.writeShort(getStatus9());
        byteBuf.writeShort(getStatus10());
        byteBuf.writeShort(getStatus11());
        byteBuf.writeShort(getStatus12());
        byteBuf.writeShort(getStatus13());
        byteBuf.writeShort(getStatus14());
        byteBuf.writeShort(getStatus15());
        byteBuf.writeShort(getStatus16());
        byteBuf.writeShort(getStatus17());
        byteBuf.writeShort(getStatus18());
        byteBuf.writeShort(getStatus19());
        byteBuf.writeShort(getStatus20());
        byteBuf.writeShort(getStatus21());
        byteBuf.writeShort(getStatus22());
        byteBuf.writeShort(getStatus23());
        byteBuf.writeShort(getStatus24());
        byteBuf.writeInt(getStatus25());
        byteBuf.writeInt(getStatus26());
        byteBuf.writeInt(getStatus27());
        byteBuf.writeInt(getReserved1());
        byteBuf.writeInt(getReserved2());
    }

    /**
     * 子类解码
     *
     * @param byteBuf
     */
    @Override
    protected void decodeInternal(ByteBuf byteBuf)
    {
        setStatus1(byteBuf.readShort());
        setStatus2(byteBuf.readShort());
        setStatus3(byteBuf.readShort());
        setStatus4(byteBuf.readShort());
        setStatus5(byteBuf.readShort());
        setStatus6(byteBuf.readShort());
        setStatus7(byteBuf.readShort());
        setStatus8(byteBuf.readShort());
        setStatus9(byteBuf.readShort());
        setStatus10(byteBuf.readShort());
        setStatus11(byteBuf.readShort());
        setStatus12(byteBuf.readShort());
        setStatus13(byteBuf.readShort());
        setStatus14(byteBuf.readShort());
        setStatus15(byteBuf.readShort());
        setStatus16(byteBuf.readShort());
        setStatus17(byteBuf.readShort());
        setStatus18(byteBuf.readShort());
        setStatus19(byteBuf.readShort());
        setStatus20(byteBuf.readShort());
        setStatus21(byteBuf.readShort());
        setStatus22(byteBuf.readShort());
        setStatus23(byteBuf.readShort());
        setStatus24(byteBuf.readShort());
        setStatus25(byteBuf.readInt());
        setStatus26(byteBuf.readInt());
        setStatus27(byteBuf.readInt());
        setReserved1(byteBuf.readInt());
        setReserved2(byteBuf.readInt());
    }
}
