Administrator
2021-04-29 e2b58dc05d331566ef83ba20ab60a419c0e73805
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
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
 */