zsh_root
2024-01-02 7b595546af704983dbafcd0d385c8768ddacefc2
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
package LedShow;
import java.util.Iterator;
 
import PbuliClass.Get_Tb_Gass;
import PbuliClass.Leds;
import tbDataModel.TbGas;
 
public class GaSMessage {
    
    
    /**»ñÈ¡ËíµÀµÄÆøÌåÐÅÏ¢
     * @param name²É¼¯Òǰ²×°Î»ÖÃ
     */
    public static StringBuffer get_gas_message() {
        StringBuffer gas_message=new StringBuffer("");
        Iterator<TbGas> it = Get_Tb_Gass.get_gass().iterator();
        while (it.hasNext()) {//µü´úÆ÷´æÔÚÔªËØ
            TbGas tbgas = it.next();//½«µü´úÆ÷ÀïÃæµÄÔªËØ¸øµ½info¼¯ºÏ
                
                //Èç¹û¹´Ñ¡ÏÔÊ¾ÆøÌåÃû³Æ
                if(Leds.get_tb_led().getGas_name().equals("1")) {
                    String name="ÑõÆø    ";
                    if(tbgas.getGas_type().replace(" ","").equals("CO")) {
                        name="Ò»Ñõ»¯Ì¼";
                    }else if(tbgas.getGas_type().replace(" ","").equals("H2S")) {
                        name="Áò»¯Çâ  ";
                    }
                    
                    if(tbgas.getGas_type().replace(" ","").equals("CH4")) {
                        name="¼×Íé    ";
                    }
                    
                    if(tbgas.getGas_type().replace(" ","").equals("CO2")) {
                        name="¶þÑõ»¯Ì¼";
                    }
                    
                    if(tbgas.getGas_type().replace(" ","").equals("SO2")) {
                        name="¶þÑõ»¯Áò";
                    }
                    
                    if(tbgas.getGas_type().replace(" ","").equals("O2")) {
                        name="ÑõÆø    ";
                    }
                    
                    gas_message.append(name+GetKong.get_kong("gas1"));
                }
                
                
                //Èç¹û¹´Ñ¡ÆøÌåÀàÐÍ
                if(Leds.get_tb_led().getGas_type().equals("1")) {
                    String type=tbgas.getGas_type();
                    if(type.length()==2) {
                        type=type+"  ";
                    }else if(type.length()==3) {
                        type=type+" ";
                    }else if(type.length()==1) {
                        type=type+"   ";
                    }
                    
                    gas_message.append(type+GetKong.get_kong("gas2"));
                }
                
                
                
                //Èç¹û¹´Ñ¡ÁËŨ¶È
                if(Leds.get_tb_led().getGas_nongdu().equals("1")) {
                    String nongdu=tbgas.getNong_du();
                    if(nongdu.length()==1) {
                        nongdu=nongdu+"  ";
                    }else if(nongdu.length()==2) {
                        nongdu=nongdu+" ";
                    }else if(nongdu.length()==3) {
                        nongdu=nongdu+"";
                    }
                    
                    gas_message.append(nongdu+GetKong.get_kong("gas3"));
                }
                
                
                //Èç¹û¹´Ñ¡ÁËÇøÓò
                if(Leds.get_tb_led().getGas_quyu().equals("1")) {        
                    gas_message.append(tbgas.getWei_zhi()+GetKong.get_kong("gas4"));
                }
                
                
                //Èç¹û¹´Ñ¡Á˸üÐÂʱ¼ä
                if(Leds.get_tb_led().getGas_time().equals("1")) {    
                    gas_message.append(tbgas.getAddtime()+"  "+GetKong.get_kong("gas5"));
                }
                
                //Èç¹û¹´Ñ¡ÁË״̬
                if(Leds.get_tb_led().getGas_state().equals("1")) {    
                    gas_message.append(tbgas.getStatus());
                }
                
                gas_message.append("\n");
                
        }
        
        
        
        return gas_message;
 
    }
    
    
    /**»ñÈ¡ÆøÌåµÄ±êÌâ*/
    public static StringBuffer get_gas_title() {
        StringBuffer gas_message=new StringBuffer("");
        
        if(Leds.getGasvc().size() !=0) {
            for(int i=0;i<Leds.getGasvc().size() ;i++) {
                String name=Leds.getGasvc().get(i);
                gas_message.append(name);
            }
        }
        return gas_message;
    }
 
 
}