测试 用electron + springboot 构建桌面应用
he wei
2022-03-21 c036bed301fcd484e7ba7f7f931efb85831d11fd
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
package testElectronJ;
 
import java.nio.ByteBuffer;
import java.util.Arrays;
 
 
/**
 *     结束数据
 * @author LiJun
 *
 */
public class FboDataHeadStop {
    private static final int BYTE_LEN = 40;
    
    public FboData.TestTime TestTimeLong;   //测试时长                    3
    public int StopType;            //结束方式 未使用                1
    public int BlockSum;            //保存数据的总块数 未使用        1
    public int StandBy;             //保留备用                    1
    public int[] SMaxIndex;         //最高单体索引 未使用            8    
    public int[] SMinIndex;         //最低单体索引 未使用            8
    public float[] SMaxVol;         //最高单体 未使用                8
    public float[] SMinVol;         //最低单体 未使用                8
    public float TestCap;           //测试容量 未使用                2
    
    public FboDataHeadStop() {
        SMaxIndex = new int[4];
        SMinIndex = new int[4];
        SMaxVol = new float[4];
        SMinVol = new float[4];
    }
 
    public void setFboStopData(ByteBuffer bf) {
        if(bf.remaining() < BYTE_LEN) {
            return;
        }
        //System.out.println("索引位置:"+bf.position());
        this.TestTimeLong = new FboData().new TestTime();
        this.TestTimeLong.hour = ComBase.changeByteToInt(bf.get());
        this.TestTimeLong.minute = ComBase.changeByteToInt(bf.get());
        this.TestTimeLong.second = ComBase.changeByteToInt(bf.get());
        this.StopType = ComBase.changeByteToInt(bf.get());            //结束方式 未使用                1
        this.BlockSum = ComBase.changeByteToInt(bf.get());            //保存数据的总块数 未使用        1
        this.StandBy = ComBase.changeByteToInt(bf.get());             //保留备用                    1
        for(int i = 0;i<SMaxIndex.length;i++) {
            this.SMaxIndex[i] = ComBase.changeShortToInt(bf.getShort()); //最高单体索引 未使用            8
        }
        for(int i=0;i<SMinIndex.length;i++) {
            this.SMinIndex[i] = ComBase.changeShortToInt(bf.getShort());//最低单体索引 未使用            8
        }
        for(int i=0;i<SMaxVol.length;i++) {
            this.SMaxVol[i] = ComBase.changeShortToFloat(bf.getShort());//最高单体 未使用                8
        }            
        for(int i=0;i<SMinVol.length;i++) {
            this.SMinVol[i] = ComBase.changeShortToFloat(bf.getShort()); //最低单体 未使用                8
        }            
        this.TestCap = ComBase.changeShortToFloat(bf.getShort());           //测试容量 未使用                2
        
        //System.out.println(this);
    }
 
    @Override
    public String toString() {
        return "FboDataHeadStop [TestTimeLong=" + TestTimeLong + ", StopType=" + StopType + ", BlockSum=" + BlockSum
                + ", StandBy=" + StandBy + ", SMaxIndex=" + Arrays.toString(SMaxIndex) + ", SMinIndex="
                + Arrays.toString(SMinIndex) + ", SMaxVol=" + Arrays.toString(SMaxVol) + ", SMinVol="
                + Arrays.toString(SMinVol) + ", TestCap=" + TestCap + "]";
    }
    
    
}