package com.dev.ntm.cmd;
|
|
import java.nio.ByteBuffer;
|
|
import com.dev.bts.data.FBS9100_ComBase;
|
|
public class NTM_TestData {
|
private final int BYTE_LEN = 16;
|
|
public int battgroup_cnt = 0;
|
public int mon_cnt = 0;
|
public double online_vol = 0;
|
public double group_vol = 0;
|
public byte[] test_starttime = new byte[6];
|
public byte[] test_timelong = new byte[3];
|
public byte button_stat = 0;
|
public int monvol_lower_cnt = 0;
|
public double batt_curr = 0;
|
public double batt_cap = 0;
|
|
public int mon_volmax_num = 0;
|
public double mon_volmax = 0;
|
public int mon_volmin_num = 0;
|
public double mon_volmin = 0;
|
|
public boolean putByteBuffer(final ByteBuffer bf) {
|
if(bf.limit() < BYTE_LEN) {
|
return false;
|
}
|
|
bf.position(0);
|
online_vol = FBS9100_ComBase.changeShortToDouble(bf.getShort()) / 10;
|
group_vol = FBS9100_ComBase.changeShortToDouble(bf.getShort()) / 10;
|
for(int n=0; n<test_starttime.length; n++) {
|
test_starttime[n] = bf.get();
|
}
|
for(int n=0; n<test_timelong.length; n++) {
|
test_timelong[n] = bf.get();
|
}
|
button_stat = bf.get();
|
monvol_lower_cnt = FBS9100_ComBase.changeShortToInt(bf.getShort());
|
batt_curr = FBS9100_ComBase.changeShortToDouble(bf.getShort()) / 10;
|
batt_cap = FBS9100_ComBase.changeShortToDouble(bf.getShort());
|
mon_volmax_num = FBS9100_ComBase.changeShortToInt(bf.getShort());
|
mon_volmax = FBS9100_ComBase.changeShortToDouble(bf.getShort()) / 1000;
|
mon_volmin_num = FBS9100_ComBase.changeShortToInt(bf.getShort());
|
mon_volmin = FBS9100_ComBase.changeShortToDouble(bf.getShort()) / 1000;
|
|
return true;
|
}
|
}
|