9度通讯程序适用于9度多组设备
Administrator
2023-12-27 c736aaea5522e295b42676f094d313e7f6a4afb4
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
package com.dev.fbs9009;
 
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
 
public class BattStateData {
    
    private int BattGroupId;                //µç³Ø×éid
    private int dev_id;                        //É豸id
    
    private int test_mon_num = 0;            //±»²âµ¥Ìå±àºÅ
    private int last_test_mon_num = 0;        //ÉϴβâÊԵĵ¥Ìå±àºÅ    
    private int mon_count;                    //µ¥ÌåÊýÁ¿
    private int batt_state = 0;                //µç³Ø×´Ì¬                    ->ϵͳ״̬
    private Date updatetime;                //Êý¾Ý¸üеÄʱ¼ä    
    private double onlinevol = 0.0;            //ÔÚÏßµçѹ
    private double groupvol = 0.0;            //×é¶Ëµçѹ
    private int record_num = 0;                //¼Ç¼µÄ±ÊÊý
    private int test_record_count = 1;        //²âÊÔ´ÎÊý
    private Date test_starttime;            //²âÊÔ¿ªÊ¼Ê±¼ä
    private double maxmon_vol;                //×î´óµ¥Ìåµçѹ
    private int maxmon_num;                    //×î´óµ¥Ìåµçѹ±àºÅ
    private double minmon_vol;                //×îµÍµ¥Ìåµçѹ
    private int minmon_num;                    //×îµÍµ¥Ìåµçѹ±àºÅ
    private double batt_tmp;                //ζÈ
    
    private List<LD_mon_states> mon_info;
    
    //private List<List<LD_mon_states>> history;        //±¾´ÎÊý¾ÝµÄÀúÊ·Êý¾Ý
    
    public BattStateData() {
        
    }
    
    
    /**
     *     ÉèÖõ±Ç°µÄÊý¾Ý
     */
    public void recordHistory(){
        for(int i=0;i<this.mon_info.size() && i<this.mon_count;i++){
            if(this.mon_info.get(i).getMon_vol() > this.maxmon_vol){
                this.maxmon_vol = this.mon_info.get(i).getMon_vol();
                this.maxmon_num = i+1;
            }
            if(this.mon_info.get(i).getMon_vol()<this.minmon_vol){
                this.minmon_vol = this.mon_info.get(i).getMon_vol();
                this.minmon_num = i+1;
            }
        }
    }
    
    //³õʼ»¯µç³Ø×éµÄ״̬
    public BattStateData(int BattGroupId,int dev_id,int mon_count) {
        this.BattGroupId = BattGroupId;
        this.dev_id = dev_id;
        this.mon_count = mon_count;
        mon_info = new ArrayList<LD_mon_states>();
        for(int i=0;i<this.mon_count;i++){
            LD_mon_states mon_state = new LD_mon_states();
            mon_info.add(mon_state);
        }
    }
    
    /**
     * »ñÈ¡µ±Ç°²âÊԵĵ¥Ìå±àºÅ
     * @return
     */
    public int getNowTestMonNum(){
        int test_mon_num = 0;
        for(int i=0;i<mon_info.size();i++){
            LD_mon_states mondata = mon_info.get(i);
            if(mondata.getMon_states() == MyModBusCom.BATT_DISCHARGE){
                this.test_mon_num = (i+1);
                return (i+1);
            }
        }
        return test_mon_num;
    }
 
    public int getBattGroupId() {
        return BattGroupId;
    }
 
    public void setBattGroupId(int battGroupId) {
        BattGroupId = battGroupId;
    }
 
    public int getDev_id() {
        return dev_id;
    }
 
    public void setDev_id(int dev_id) {
        this.dev_id = dev_id;
    }
 
    public int getTest_mon_num() {
        return test_mon_num;
    }
 
    public void setTest_mon_num(int test_mon_num) {
        this.test_mon_num = test_mon_num;
    }
 
    public int getLast_test_mon_num() {
        return last_test_mon_num;
    }
 
    public void setLast_test_mon_num(int last_test_mon_num) {
        this.last_test_mon_num = last_test_mon_num;
    }
 
    public int getMon_count() {
        return mon_count;
    }
 
    public void setMon_count(int mon_count) {
        this.mon_count = mon_count;
    }
 
    public int getBatt_state() {
        return batt_state;
    }
 
    public void setBatt_state(int batt_state) {
        this.batt_state = batt_state;
    }
 
    public Date getUpdatetime() {
        return updatetime;
    }
 
    public void setUpdatetime(Date updatetime) {
        this.updatetime = updatetime;
    }
 
    public double getOnlinevol() {
        return onlinevol;
    }
 
    public void setOnlinevol(double onlinevol) {
        this.onlinevol = onlinevol;
    }
 
    public double getGroupvol() {
        return groupvol;
    }
 
    public void setGroupvol(double groupvol) {
        this.groupvol = groupvol;
    }
 
    public List<LD_mon_states> getMon_info() {
        return mon_info;
    }
 
    public void setMon_info(List<LD_mon_states> mon_info) {
        this.mon_info = mon_info;
    }
 
    public int getRecord_num() {
        return record_num;
    }
 
    public void setRecord_num(int record_num) {
        this.record_num = record_num;
    }
 
    public int getTest_record_count() {
        return test_record_count;
    }
 
    public void setTest_record_count(int test_record_count) {
        this.test_record_count = test_record_count;
    }
 
    public double getMaxmon_vol() {
        return maxmon_vol;
    }
 
    public void setMaxmon_vol(double maxmon_vol) {
        this.maxmon_vol = maxmon_vol;
    }
 
    public int getMaxmon_num() {
        return maxmon_num;
    }
 
    public void setMaxmon_num(int maxmon_num) {
        this.maxmon_num = maxmon_num;
    }
 
    public double getMinmon_vol() {
        return minmon_vol;
    }
 
    public void setMinmon_vol(double minmon_vol) {
        this.minmon_vol = minmon_vol;
    }
 
    public int getMinmon_num() {
        return minmon_num;
    }
 
    public void setMinmon_num(int minmon_num) {
        this.minmon_num = minmon_num;
    }
 
    public double getBatt_tmp() {
        return batt_tmp;
    }
 
    public void setBatt_tmp(double batt_tmp) {
        this.batt_tmp = batt_tmp;
    }
 
    public Date getTest_starttime() {
        return test_starttime;
    }
 
    public void setTest_starttime(Date test_starttime) {
        this.test_starttime = test_starttime;
    }
 
}