whyclj
2020-09-28 e23ca11a5424f723ba6d1fd5e3e76bea8a332b9d
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
package com.battmonitor.data;
 
public class BattAlarmParam {
    
    public AlarmParamCell alm_OnlineVol;
    public AlarmParamCell alm_GroupVol;
    public AlarmParamCell alm_BattChargeCurr;
    public AlarmParamCell alm_BattDisChargeCurr;
    public AlarmParamCell alm_MonVol;
    public AlarmParamCell alm_MonTmp;
    public AlarmParamCell alm_MonRes;
    public AlarmParamCell alm_ConnRes;
    public AlarmParamCell alm_DischargeMonVol;
    
    public boolean update_en = false;                        //Åжϸ澯²ÎÊýÊÇ·ñÓиüÐÂ
    /**
     * Ä¬ÈÏ¿ªÆô   ×é¶Ëµçѹ(ÉÏÏÂÏÞ) µ¥Ìåµçѹ(ÉÏÏÂÏÞ)  ³äµçµçÁ÷(ÉÏÏÞ)  ·ÅµçµçÁ÷(ÉÏÏÞ)
     */
    public BattAlarmParam()
    {
        alm_OnlineVol = new AlarmParamCell((float)1.125, (float)1.10,  2, 2,  true, true);
        alm_GroupVol = new AlarmParamCell((float)1.17, (float)0.96,  2, 2,  true, true);
        alm_BattChargeCurr = new AlarmParamCell((float)3, (float)0,  2, 2,  true, false);
        alm_BattDisChargeCurr = new AlarmParamCell((float)3, (float)0,  2, 2,  true, false);
        
        alm_MonVol = new AlarmParamCell((float)1.2, (float)0.8,  3, 3,  true, true);
        alm_MonTmp = new AlarmParamCell((float)1.5, (float)0.5,  3, 3,  true, true);
        
        alm_MonRes = new AlarmParamCell((float)2, (float)0.5,  3, 3,  true, true);
        alm_ConnRes = new AlarmParamCell((float)2, (float)0.5,  3, 3,  false, false);
        
        alm_DischargeMonVol = new AlarmParamCell((float)1.2, (float)0.8,  3, 3,  false, false);
    }
    
    public void setAlarmParamCellValue(float std_value, AlarmParamCell apc_target, AlarmParamCell apc_param)
    {
        apc_target.alm_High = std_value * apc_param.alm_High;
        apc_target.alm_High_Level = apc_param.alm_High_Level;
        apc_target.alm_High_EN = apc_param.alm_High_EN;
        
        apc_target.alm_Low = std_value * apc_param.alm_Low;
        apc_target.alm_Low_Level = apc_param.alm_Low_Level;
        apc_target.alm_Low_EN = apc_param.alm_Low_EN;
    }
    
    public class AlarmParamCell {
        public int alm_Id = 0;
        public String alm_Name = "";
        public float alm_High = 0;
        public float alm_Low = 0;
        public int alm_High_Level = 1;
        public int alm_Low_Level = 1;
        public boolean alm_High_EN = true;
        public boolean alm_Low_EN = true;
        
        public AlarmParamCell(float high, float low)
        {
            alm_Id = 0;
            alm_Name = "";
            alm_High = high;
            alm_Low = low;
            alm_High_Level = 1;
            alm_Low_Level = 1;
            alm_High_EN = true;
            alm_Low_EN = true;
        }
        
        public AlarmParamCell(float high, float low, int high_lev, 
                            int low_lev, boolean high_en, boolean low_en)
        {
            alm_Id = 0;
            alm_Name = "";
            alm_High = high;
            alm_Low = low;
            alm_High_Level = high_lev;
            alm_Low_Level = low_lev;
            alm_High_EN = high_en;
            alm_Low_EN = low_en;
        }
    }
}