package com.battdata_rt;
|
|
import java.util.Date;
|
|
public class BattStatData {
|
public static final byte BATTDATA_NULL = 0;
|
public static final byte BATTDATA_FLOAT = 1;
|
public static final byte BATTDATA_CHARGE = 2;
|
public static final byte BATTDATA_DISCHARGE = 3;
|
public static final byte BATTDATA_JUNCHARGE = 4;
|
public static final byte BATTDATA_RES = 5;
|
public static final byte BATTDATA_SER = 6;
|
public static final byte BATTDATA_TMP = 7;
|
public static final byte BATTDATA_CONNRES = 8;
|
public static final byte BATTDATA_MONITOR = 9;
|
public static final byte BATTSTATE_NULL = 0;
|
public static final byte BATTSTATE_FLOAT = 1;
|
public static final byte BATTSTATE_CHARGE = 2;
|
public static final byte BATTSTATE_DISCHARGE = 3;
|
public static final byte BATTSTATE_JUNCHARGE = 4;
|
public static final byte BATTSTATE_RES = 5;
|
public static final byte BATTSTATE_SER = 6;
|
public static final byte BATTSTATE_TMP = 7;
|
public static final byte BATTSTATE_CONNRES = 8;
|
public static final byte BATTSTATE_MONITOR = 9;
|
public static final byte TEST_LOADER_REALLOADER = 1;
|
public static final byte TEST_LOADER_FBI_IDCE = 2;
|
public static final byte TEST_LOADER_FBS9100S = 3;
|
private boolean CurrDataIsUseForIdceFbi = false;
|
private boolean CurrDataIsUseForIdceFbi_LaZha = false;
|
private boolean FBI_ConState = false;
|
private int mFBICommTimeout = 0;
|
|
private float mBattFloatCurrLevel = 30.0F;
|
|
private int mSourceBattDataType = 0;
|
private boolean mSybSrvCurrChargeDirPos = true;
|
|
public int dev_FBS9100S_WorkState = 0;
|
public byte battTestState = 1;
|
public byte battTestType_For_DataSave = 1;
|
public int dataCalCount;
|
public int testRecordCount;
|
public byte testLoaderType = 0;
|
public int test_stoptype = 0;
|
public int recordNum;
|
public int recordNum_BPM7100;
|
public Date startTestTime = new Date();
|
public Date recordTime = new Date();
|
public int testTimeLong;
|
public float onlineVol;
|
public float groupVol;
|
public float groupTmp;
|
public byte battState;
|
private boolean bpm7100_runState = false;
|
|
public float testCurr = 0.0F;
|
public float testCurrAbsMax = 0.0F;
|
public float TestCurr_RT = 0.0F;
|
public float TestCurr_RT_TMP = 0.0F;
|
public int TestState_RT;
|
public float sybase_server_battcurr;
|
public float testCap;
|
public float battRealCap;
|
public float battRestCap;
|
public int battRestTime;
|
|
public BattStatData(int type, boolean syb_srv_curr_charge_dir_pos) {
|
this.mSourceBattDataType = type;
|
this.mSybSrvCurrChargeDirPos = syb_srv_curr_charge_dir_pos;
|
init((byte) 1, 0);
|
}
|
|
public void setBattFloatCurrLevel(float curr_level) {
|
this.mBattFloatCurrLevel = curr_level;
|
}
|
|
public void setBpm7100RunState(boolean stat) {
|
this.bpm7100_runState = stat;
|
}
|
|
public boolean getBpm7100RunState() {
|
return this.bpm7100_runState;
|
}
|
|
public BattStatData clone() {
|
BattStatData bdata = new BattStatData(this.mSourceBattDataType, this.mSybSrvCurrChargeDirPos);
|
bdata.battTestState = this.battTestState;
|
bdata.battTestType_For_DataSave = this.battTestType_For_DataSave;
|
bdata.battState = this.battState;
|
bdata.dataCalCount = this.dataCalCount;
|
bdata.testRecordCount = this.testRecordCount;
|
bdata.recordNum = this.recordNum;
|
bdata.recordNum_BPM7100 = this.recordNum_BPM7100;
|
bdata.startTestTime = new Date(this.startTestTime.getTime());
|
bdata.testLoaderType = this.testLoaderType;
|
bdata.test_stoptype = this.test_stoptype;
|
bdata.recordTime = new Date(this.recordTime.getTime());
|
bdata.testTimeLong = this.testTimeLong;
|
bdata.onlineVol = this.onlineVol;
|
bdata.groupVol = this.groupVol;
|
bdata.groupTmp = this.groupTmp;
|
bdata.testCurr = this.testCurr;
|
bdata.testCurrAbsMax = this.testCurrAbsMax;
|
bdata.sybase_server_battcurr = this.sybase_server_battcurr;
|
bdata.testCap = this.testCap;
|
bdata.battRealCap = this.battRealCap;
|
bdata.battRestCap = this.battRestCap;
|
bdata.battRestTime = this.battRestTime;
|
|
return bdata;
|
}
|
|
public void init(byte test_type, int count) {
|
this.battTestState = test_type;
|
this.battTestType_For_DataSave = test_type;
|
if (9 == test_type)
|
this.TestState_RT = this.battTestState;
|
else {
|
this.battState = test_type;
|
}
|
|
this.testLoaderType = 1;
|
this.test_stoptype = -1;
|
|
this.testRecordCount = count;
|
this.dataCalCount = 0;
|
this.recordNum = 0;
|
this.recordNum_BPM7100 = 0;
|
this.startTestTime = new Date();
|
this.recordTime = new Date();
|
this.testTimeLong = 0;
|
this.testCap = 0.0F;
|
this.testCurrAbsMax = 0.0F;
|
}
|
|
public void bpm7100_init(byte batt_state) {
|
this.battState = batt_state;
|
this.dataCalCount = 0;
|
this.recordNum_BPM7100 = 0;
|
this.testCap = 0.0F;
|
this.testCurrAbsMax = 0.0F;
|
}
|
|
private void upDateCurrRT(float curr) {
|
this.TestCurr_RT = curr;
|
|
if (Math.abs(this.testCurrAbsMax) < Math.abs(this.TestCurr_RT)) {
|
this.testCurrAbsMax = this.TestCurr_RT;
|
}
|
|
if (Math.abs(this.TestCurr_RT) < this.mBattFloatCurrLevel) {
|
this.TestState_RT = 1;
|
}
|
if (this.TestCurr_RT >= this.mBattFloatCurrLevel)
|
this.TestState_RT = 2;
|
else if (this.TestCurr_RT <= this.mBattFloatCurrLevel * -1.0F) {
|
this.TestState_RT = 3;
|
}
|
this.testCurr = this.TestCurr_RT;
|
}
|
|
public boolean isCurrDataUseForIdceFbi() {
|
return this.CurrDataIsUseForIdceFbi;
|
}
|
|
public void setCurrDataIsUseForIdceFbi(boolean stat) {
|
this.CurrDataIsUseForIdceFbi = stat;
|
}
|
|
public void setLoaderType(byte ld_t) {
|
this.testLoaderType = ld_t;
|
}
|
|
public byte getLoaderType() {
|
return this.testLoaderType;
|
}
|
|
public void setDevFBS9100S_WorkState(int alarm_stat, int wks_t) {
|
this.test_stoptype = alarm_stat;
|
this.dev_FBS9100S_WorkState = wks_t;
|
}
|
|
public int getDevFBS9100S_WorkState() {
|
return this.dev_FBS9100S_WorkState;
|
}
|
|
public boolean isCurrDataUseForIdceFbi_LaZha() {
|
return this.CurrDataIsUseForIdceFbi_LaZha;
|
}
|
|
public void setCurrDataIsUseForIdceFbi_LaZha(boolean stat) {
|
this.CurrDataIsUseForIdceFbi_LaZha = stat;
|
}
|
|
public boolean checkIfFBIComMTimeout() {
|
boolean time_ount = false;
|
if (this.mFBICommTimeout >= 60) {
|
time_ount = true;
|
this.FBI_ConState = false;
|
setCurrDataIsUseForIdceFbi(false);
|
|
if (this.mSourceBattDataType != 0) {
|
updateCurrFrom_SqlServer();
|
}
|
}
|
if (this.mFBICommTimeout < 1000) {
|
this.mFBICommTimeout += 1;
|
}
|
return time_ount;
|
}
|
|
public void updateOnlineVolFrom_FBSDev(float vol) {
|
if (this.mSourceBattDataType == 0) {
|
this.onlineVol = vol;
|
}
|
}
|
|
public void updateGroupVolFrom_FBSDev(float vol) {
|
if (this.mSourceBattDataType == 0) {
|
this.groupVol = vol;
|
}
|
}
|
|
public void updateCurrFromFBI(float curr) {
|
this.FBI_ConState = true;
|
this.mFBICommTimeout = 0;
|
setCurrDataIsUseForIdceFbi(true);
|
upDateCurrRT(curr);
|
}
|
|
public void updateCurrFrom_FBSDev(float curr) {
|
//if (!this.FBI_ConState) {
|
upDateCurrRT(curr);
|
//}
|
}
|
|
public void updateCurrFrom_SqlServer() {
|
this.sybase_server_battcurr = this.TestCurr_RT_TMP;
|
if (!this.mSybSrvCurrChargeDirPos) {
|
this.sybase_server_battcurr *= -1.0F;
|
}
|
|
if (!this.FBI_ConState)
|
upDateCurrRT(0.0F);
|
}
|
|
public void calTestCap(int second_interval) {
|
this.recordTime = new Date();
|
|
this.testTimeLong = ((int) ((this.recordTime.getTime() - this.startTestTime.getTime()) / 1000L));
|
|
this.testCap += this.testCurr * second_interval / 3600.0F;
|
|
if (++this.dataCalCount >= 36000)
|
this.dataCalCount = 0;
|
}
|
}
|
|
/*
|
* Location:
|
* C:\Users\LiJun\Desktop\公司各种设备资料\9600显示模块相关文件\后台程序\2018-09-07\BattFBS9600XSP.
|
* jar Qualified Name: com.battdata_rt.BattStatData JD-Core Version: 0.6.2
|
*/
|