DELL
2024-09-24 a01db2b59f0de8dfa4fb029d86d45924f4534abc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package com.whyc.mcp;
 
import com.whyc.util.ComBase;
 
import java.nio.ByteBuffer;
 
public class BattParam {
    public static final int BYTE_LEN = 44;
 
    public int STD_CAP;                    //标称容量 分辨率 1AH
    public float STD_RES;                //标称内阻 分辨率0.001mΩ
    public int battGroupCount;            //组数
    public int eachGroupBattCount;        //每组单体个数
    public float monomerVol;            //单体标称电压 分辨率0.1V
    public float groupVol;                //未使用
    public float battTemp;                ////未使用
    public float floatChargeVol;        //未使用
    public float floatChargeCurr;        //未使用
    public float onlineVolLow;            //未使用
    public int groupConnType;            //未使用
 
    public int bakeup1;
    public int bakeup2;
    public int bakeup3;
    public int bakeup4;
    public int bakeup5;
    public int bakeup6;
    public int bakeup7;
    public int bakeup8;
    public int bakeup9;
    public int bakeup10;
 
    public int CRC;                        //未使用
 
    public boolean putByteBuffer(ByteBuffer bf) {
        if(bf.remaining() < BYTE_LEN) {
            return false;
        }
        bf.position(0);
 
        STD_CAP = ComBase.changeShortToInt(bf.getShort());                    //标称容量 分辨率 1AH
        STD_RES = ComBase.changeShortToFloat(bf.getShort()) * 0.001f;        //标称内阻 分辨率0.001mΩ
        battGroupCount = ComBase.changeShortToInt(bf.getShort());            //组数
        eachGroupBattCount = ComBase.changeShortToInt(bf.getShort());        //每组单体个数
        monomerVol = ComBase.changeShortToFloat(bf.getShort())*0.1f;        //单体标称电压 分辨率0.1V
        groupVol = ComBase.changeShortToFloat(bf.getShort());                //未使用
        battTemp = ComBase.changeShortToFloat(bf.getShort());                ////未使用
        floatChargeVol = ComBase.changeShortToFloat(bf.getShort());            //未使用
        floatChargeCurr = ComBase.changeShortToFloat(bf.getShort());        //未使用
        onlineVolLow = ComBase.changeShortToFloat(bf.getShort());            //未使用
        groupConnType = ComBase.changeShortToInt(bf.getShort());            //未使用
 
        bakeup1 = ComBase.changeShortToInt(bf.getShort());
        bakeup2 = ComBase.changeShortToInt(bf.getShort());
        bakeup3 = ComBase.changeShortToInt(bf.getShort());
        bakeup4 = ComBase.changeShortToInt(bf.getShort());
        bakeup5 = ComBase.changeShortToInt(bf.getShort());
        bakeup6 = ComBase.changeShortToInt(bf.getShort());
        bakeup7 = ComBase.changeShortToInt(bf.getShort());
        bakeup8 = ComBase.changeShortToInt(bf.getShort());
        bakeup9 = ComBase.changeShortToInt(bf.getShort());
        bakeup10 = ComBase.changeShortToInt(bf.getShort());
 
        CRC = ComBase.changeShortToInt(bf.getShort());
 
        //System.out.println(this);
        //System.out.println("bf.limit()"+bf.limit());
        bf.compact();
        //System.out.println("bf.limit()"+bf.limit());
        return true;
    }
 
    @Override
    public String toString() {
        return "BattParam [STD_CAP=" + STD_CAP + ", STD_RES=" + STD_RES + ", battGroupCount=" + battGroupCount
                + ", eachGroupBattCount=" + eachGroupBattCount + ", monomerVol=" + monomerVol + ", groupVol="
                + groupVol + ", battTemp=" + battTemp + ", floatChargeVol=" + floatChargeVol + ", floatChargeCurr="
                + floatChargeCurr + ", onlineVolLow=" + onlineVolLow + ", groupConnType=" + groupConnType
                + ", bakeup1=" + bakeup1 + ", bakeup2=" + bakeup2 + ", bakeup3=" + bakeup3 + ", bakeup4=" + bakeup4
                + ", bakeup5=" + bakeup5 + ", bakeup6=" + bakeup6 + ", bakeup7=" + bakeup7 + ", bakeup8=" + bakeup8
                + ", bakeup9=" + bakeup9 + ", bakeup10=" + bakeup10 + ", CRC=" + CRC + "]";
    }
}