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;
|
}
|
|
|
}
|