package com.whyc.fbo;
|
|
import com.whyc.util.ComBase;
|
|
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 + "]";
|
}
|
|
|
}
|