Administrator
2021-01-20 929c6af032f17eb85310cb027730fc6472b6fd5f
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 com.config.AppConfig;
import com.config.AppParam;
import com.sql.MysqlConnPool;
import java.util.ArrayList;
import java.util.Date;
 
public class BattData_RT {
    public static final int DEF_CommTimeOutMax = 7200;
    private MysqlConnPool m_Conn_Pool;
    private boolean MonDataFromCInterfaceOk = false;
 
    private boolean MonDataIsUseForIdce8200 = false;
    private boolean mIDCE8200_ConState = false;
    public int StationId;
    public String StationName;
    public byte[] StationIp = new byte[4];
    public int BattGroupId = 0;
    public int BattCurrDeviceId = 0;
    public int[] BattCurrValueId = new int[16];
 
    public int FBSDeviceId = 0;
    public String FBSDeviceIp = " ";
    public String FBSDeviceName = " ";
    public int GroupIndexInFBSDevice = 1;
    public int BattGroupNum;
    public int BattState;
    public int MonCount = 1;
    public float MonStdVol;
    public float MonStdCap;
    private boolean StoreBattRes_DataEn = false;
    public boolean MysqlDataResInfTable_Exist = false;
    public boolean MysqlRecordInf_Exist = false;
 
    public ArrayList<MonVolData> al_MonVol = new ArrayList();
    public ArrayList<MonVolData> al_MonVol_RtOld = new ArrayList();
    public ArrayList<MonVolData> al_MonVol_History = new ArrayList();
    public ArrayList<ArrayList<Integer>> al_MonVol_C_Id = new ArrayList();
    public BattStatData mTestData;
    private int mCommTimeCoutCount = 0;
    public int mMaxMonNum = 0;
    public float mMaxMonVol = 0.0F;
    public int mMinMonNum = 0;
    public float mMinMonVol = 0.0F;
 
    private AppParam mAppParam = new AppParam();
 
    private float mBattFloatCurrLevel = 15.0F;
    public int mSaveDataTimeInterval = 10;
 
    public BattData_RT(AppConfig cfg, AppParam param, MysqlConnPool pool) {
        this.mTestData = new BattStatData(cfg.getSourceBattDataType(), cfg.getSybSrvCurrChargeDirPos());
 
        this.mAppParam.copyAppParam(param);
 
        this.m_Conn_Pool = pool;
    }
 
    public void updata_BattRtSate_To_RamDb() {
        BattData_RT_SQL.updateBattState_RT_RamDB_Table(this.m_Conn_Pool, this);
    }
 
    public void updata_BattRtData_To_RamDb() {
        BattData_RT_SQL.updateBattData_RT_RamDB_Table(this.m_Conn_Pool, this);
    }
 
    public void setStoreBattRes_DataEnStat(boolean stat) {
        this.StoreBattRes_DataEn = stat;
    }
 
    public boolean getStoreBattRes_DataEnStat() {
        return this.StoreBattRes_DataEn;
    }
 
    public void setBattFloatVolCurrLevel(float vol_lev, float curr_level) {
        this.mBattFloatCurrLevel = curr_level;
        this.mTestData.setBattFloatCurrLevel(this.mBattFloatCurrLevel);
    }
 
    public boolean isMonDataFromCInterfaceOk() {
        return this.MonDataFromCInterfaceOk;
    }
 
    public void setMonDataFromCInterfaceOk(boolean stat) {
        this.MonDataFromCInterfaceOk = stat;
    }
 
    public boolean isMonDataUseForIdce8200() {
        return this.MonDataIsUseForIdce8200;
    }
 
    public void setMonDataUseForIdce8200(boolean stat) {
        this.MonDataIsUseForIdce8200 = stat;
    }
 
    public boolean getIdce8200ComState() {
        return this.mIDCE8200_ConState;
    }
 
    public void updateMonVolFromIDCE8200(int mon_index, float vol) {
        this.mIDCE8200_ConState = true;
        setMonDataUseForIdce8200(true);
 
        ((MonVolData) this.al_MonVol.get(mon_index)).monVol = vol;
    }
 
    public int getBattCount() {
        return this.MonCount;
    }
 
    public byte getBattState() {
        return this.mTestData.battState;
    }
 
    public byte getBattTestType() {
        return this.mTestData.battTestState;
    }
 
    public float getOnlineVol() {
        return this.mTestData.onlineVol;
    }
 
    public float getGroupVol() {
        return this.mTestData.groupVol;
    }
 
    public float getGroupTmp() {
        return this.mTestData.groupTmp;
    }
 
    public float getTestCurr() {
        return this.mTestData.testCurr;
    }
 
    public float getTestCap() {
        return this.mTestData.testCap;
    }
 
    public long getTestStartTime() {
        return this.mTestData.startTestTime.getTime();
    }
 
    public long getTestRecordTime() {
        return this.mTestData.recordTime.getTime();
    }
 
    public int getTestTimeLong() {
        return this.mTestData.testTimeLong;
    }
 
    public float getBattRealCap() {
        return this.mTestData.battRealCap;
    }
 
    public float getBattRestCap() {
        return this.mTestData.battRestCap;
    }
 
    public int getBattRestTime() {
        return this.mTestData.battRestTime;
    }
 
    public void makeMaxMinMonVol(ArrayList<MonVolData> al_vol) {
        if (al_vol != null) {
            float maxvol = -80000.0F;
            float minvol = 80000.0F;
            for (int n = 0; n < al_vol.size(); n++) {
                if (maxvol < ((MonVolData) al_vol.get(n)).monVol) {
                    maxvol = ((MonVolData) al_vol.get(n)).monVol;
                    this.mMaxMonNum = (n + 1);
                }
                if (minvol > ((MonVolData) al_vol.get(n)).monVol) {
                    minvol = ((MonVolData) al_vol.get(n)).monVol;
                    this.mMinMonNum = (n + 1);
                }
            }
            this.mMaxMonVol = maxvol;
            this.mMinMonVol = minvol;
        }
    }
 
    public float getMaxMonVol() {
        float maxvol = -80000.0F;
        for (int n = 0; n < this.al_MonVol.size(); n++) {
            if (maxvol < ((MonVolData) this.al_MonVol.get(n)).monVol) {
                maxvol = ((MonVolData) this.al_MonVol.get(n)).monVol;
                this.mMaxMonNum = (n + 1);
            }
        }
        return maxvol;
    }
 
    public float getMinMonVol() {
        float minvol = 80000.0F;
        for (int n = 0; n < this.al_MonVol.size(); n++) {
            if (minvol > ((MonVolData) this.al_MonVol.get(n)).monVol) {
                minvol = ((MonVolData) this.al_MonVol.get(n)).monVol;
                this.mMinMonNum = (n + 1);
            }
        }
        return minvol;
    }
 
    public float getGroupVolFromMonVol() {
        float gvol = 0.0F;
        for (int n = 0; n < this.al_MonVol.size(); n++) {
            gvol += ((MonVolData) this.al_MonVol.get(n)).monVol;
        }
        return gvol;
    }
 
    public void makeDataClearByCommTimeOut() {
        if (this.mCommTimeCoutCount < 7300) {
            this.mCommTimeCoutCount += 1;
        }
        if (this.mCommTimeCoutCount >= 7200) {
            this.mTestData.TestCurr_RT = 0.0F;
            this.mTestData.testCurr = 0.0F;
        }
    }
 
    public void makeDataResetByCommTimeOut() {
        this.mCommTimeCoutCount = 0;
    }
 
    public float get_al_MonVol_History(int index) {
        float vol = 0.0F;
        if ((index >= 0) && (index < this.al_MonVol_History.size())) {
            vol = ((MonVolData) this.al_MonVol_History.get(index)).monVol;
        }
        return vol;
    }
 
    public boolean is_al_MonVol_History_New(int index) {
        boolean isnew = false;
        if ((index >= 0) && (index < this.al_MonVol_History.size())) {
            isnew = ((MonVolData) this.al_MonVol_History.get(index)).data_new;
        }
        return isnew;
    }
 
    public boolean checkIfHaveZeroMonVol() {
        boolean have_zero_vol = false;
 
        for (int n = 0; n < this.al_MonVol.size(); n++) {
            if (n >= 10000) {
                break;
            }
            if (((MonVolData) this.al_MonVol.get(n)).monVol <= 0.001D) {
                have_zero_vol = true;
                break;
            }
        }
 
        return have_zero_vol;
    }
}
 
/*
 * Location:
 * C:\Users\LiJun\Desktop\公司各种设备资料\9600显示模块相关文件\后台程序\2018-09-07\BattFBS9600XSP.
 * jar Qualified Name: com.battdata_rt.BattData_RT JD-Core Version: 0.6.2
 */