package PbuliClass;
|
import java.util.Iterator;
|
import java.util.List;
|
import java.util.Vector;
|
|
import DataBase.DatabaseManagement;
|
import tbDataModel.Tb_led;
|
|
@SuppressWarnings("rawtypes")
|
public class Leds {
|
static Vector<Tb_led> tb_leds=new Vector<>(); //»ñÈ¡ËùÓÐled¶ÔÏó
|
static Vector<String> kqvc=new Vector<String>();//ÐèÒªÏÔʾµÄ¿¼ÇÚÄÚÈÝ
|
static Vector<String> gasvc=new Vector<String>();//ÐèÒªÏÔÊ¾ÆøÌåÄÚÈÝ
|
static int i=0;
|
static {
|
Iterator iterator = DatabaseManagement.get_alldate_indatabase("tb_led").iterator();
|
while (iterator.hasNext()) {//µü´úÆ÷´æÔÚÔªËØ
|
List info = (List) iterator.next();//½«µü´úÆ÷ÀïÃæµÄÔªËØ¸øµ½info¼¯ºÏ
|
Tb_led led=new Tb_led();
|
|
led.setId(Integer.parseInt((String)info.get(0)));
|
led.setIp((String)info.get(1));
|
String open=(String)info.get(2);
|
led.setPort(open);
|
led.setOpen((String)info.get(3));
|
led.setClose((String)info.get(4));
|
led.setLight((String)info.get(5));
|
led.setTitle((String)info.get(6));
|
led.setLeft((String)info.get(7));
|
led.setRight((String)info.get(8));
|
led.setTime((String)info.get(9));
|
led.setGas((String)info.get(10));
|
led.setTayTime((String)info.get(11));
|
led.setGengxintime((String)info.get(12));
|
led.setTitle_x((String)info.get(13));
|
led.setTitle_y((String)info.get(14));
|
led.setTitle_S((String)info.get(15));
|
led.setTime_x((String)info.get(16));
|
led.setTime_y((String)info.get(17));
|
led.setTime_s((String)info.get(18));
|
led.setKq_x((String)info.get(19));
|
led.setKq_y((String)info.get(20));
|
led.setKq_s((String)info.get(21));
|
led.setKq_g((String)info.get(22));
|
led.setShx((String)info.get(23));
|
led.setShy((String)info.get(24));
|
led.setShs((String)info.get(25));
|
led.setShg((String)info.get(26));
|
led.setLed_w((String)info.get(27));
|
led.setLed_h((String)info.get(28));
|
led.setShow_name((String)info.get(29));
|
led.setShow_kahao((String)info.get(30));
|
led.setShow_bumen((String)info.get(31));
|
led.setShow_quyu((String)info.get(32));
|
led.setShow_time((String)info.get(33));
|
led.setShow_distance((String)info.get(34));
|
led.setGas_name((String)info.get(35));
|
led.setGas_type((String)info.get(36));
|
led.setGas_nongdu((String)info.get(37));
|
led.setGas_quyu((String)info.get(38));
|
led.setGas_time((String)info.get(39));
|
led.setGas_state((String)info.get(40));
|
led.setTimeshow((String)info.get(41));
|
led.setJx((String)info.get(42));
|
led.setJy((String)info.get(43));
|
led.setjW((String)info.get(44));
|
led.setJh((String)info.get(45));
|
led.setTh((String)info.get(46));
|
led.setTl((String)info.get(47));
|
String x0=(String)info.get(48);
|
String y0=(String)info.get(49);
|
if(x0==null) {
|
led.setBaoliu1("0");
|
led.setBaoliu2("0");
|
}else {
|
led.setBaoliu1(x0);
|
led.setBaoliu2(y0);
|
}
|
|
if(((String)info.get(29)).equals("1")) {
|
kqvc.add("ÐÕÃû");
|
}
|
|
if(((String)info.get(30)).equals("1")) {
|
kqvc.add("¿¨ºÅ");
|
}
|
|
if(((String)info.get(31)).equals("1")) {
|
kqvc.add("²¿ÃÅ");
|
}
|
|
if(((String)info.get(32)).equals("1")) {
|
kqvc.add("ÇøÓò");
|
}
|
|
if(((String)info.get(33)).equals("1")) {
|
kqvc.add("½øÈë");
|
}
|
|
if(((String)info.get(34)).equals("1")) {
|
kqvc.add("¾àÀë");
|
}
|
|
if(((String)info.get(35)).equals("1")) {
|
gasvc.add("ÆøÌå");
|
}
|
|
if(((String)info.get(36)).equals("1")) {
|
gasvc.add("ÀàÐÍ");
|
}
|
|
if(((String)info.get(37)).equals("1")) {
|
gasvc.add("Ũ¶È");
|
}
|
|
if(((String)info.get(38)).equals("1")) {
|
gasvc.add("ÇøÓò");
|
}
|
|
if(((String)info.get(39)).equals("1")) {
|
gasvc.add("ʱ¼ä");
|
}
|
|
if(((String)info.get(40)).equals("1")) {
|
gasvc.add("״̬");
|
}
|
|
if(i==0) {
|
tb_leds.add(led);
|
i=1;
|
}
|
}
|
}
|
|
|
|
public static Vector<Tb_led> get_tb_leds(){
|
return tb_leds;
|
}
|
|
/**¸Ä±äled*/
|
public static void alert_tb_led(
|
String ip,
|
String port,
|
String open,
|
String close,
|
String light,
|
String title,
|
String left,
|
String right,
|
String time,
|
String gas,
|
String tayTime,
|
String gengxintime,
|
String title_x,
|
String title_y,
|
String title_S,
|
String time_x,
|
String time_y,
|
String time_s,
|
String kq_x,
|
String kq_y,
|
String kq_s,
|
String kq_g,
|
String shx,
|
String shy,
|
String shs,
|
String shg,
|
String led_w,
|
String led_h,
|
String show_name,
|
String show_kahao,
|
String show_bumen,
|
String show_quyu,
|
String show_time,
|
String show_distance,
|
String gas_name,
|
String gas_type,
|
String gas_nongdu,
|
String gas_quyu,
|
String gas_time,
|
String gas_state,
|
String timeshow,
|
String jx,
|
String jy,
|
String jW,
|
String jh,
|
String th,
|
String tl,
|
String baoliu1,
|
String baoliu2
|
|
) {
|
tb_leds.get(0).setIp(ip);
|
tb_leds.get(0).setPort(port);
|
tb_leds.get(0).setOpen(open);
|
tb_leds.get(0).setClose(close);
|
tb_leds.get(0).setLight(light);
|
tb_leds.get(0).setTitle(title);
|
tb_leds.get(0).setLeft(left);
|
tb_leds.get(0).setRight(right);
|
tb_leds.get(0).setTime(time);
|
tb_leds.get(0).setGas(gas);
|
tb_leds.get(0).setTayTime(tayTime);
|
tb_leds.get(0).setGengxintime(gengxintime);
|
tb_leds.get(0).setTitle_x(title_x);
|
tb_leds.get(0).setTitle_y(title_y);
|
tb_leds.get(0).setTitle_S(title_S);
|
tb_leds.get(0).setTime_x(time_x);
|
tb_leds.get(0).setTime_y(time_y);
|
tb_leds.get(0).setTime_s(time_s);
|
tb_leds.get(0).setKq_x(kq_x);
|
tb_leds.get(0).setKq_y(kq_y);
|
tb_leds.get(0).setKq_s(kq_s);
|
tb_leds.get(0).setKq_g(kq_g);
|
tb_leds.get(0).setShx(shx);
|
tb_leds.get(0).setShy(shy);
|
tb_leds.get(0).setShs(shs);
|
tb_leds.get(0).setShg(shg);
|
tb_leds.get(0).setLed_w(led_w);
|
tb_leds.get(0).setLed_h(led_h);
|
tb_leds.get(0).setShow_name(show_name);
|
tb_leds.get(0).setShow_kahao(show_kahao);
|
tb_leds.get(0).setShow_bumen(show_bumen);
|
tb_leds.get(0).setShow_quyu(show_quyu);
|
tb_leds.get(0).setShow_time(show_time);
|
tb_leds.get(0).setShow_distance(show_distance);
|
tb_leds.get(0).setGas_name(gas_name);
|
tb_leds.get(0).setGas_type(gas_type);
|
tb_leds.get(0).setGas_nongdu(gas_nongdu);
|
tb_leds.get(0).setGas_quyu(gas_quyu);
|
tb_leds.get(0).setGas_time(gas_time);
|
tb_leds.get(0).setGas_state(gas_state);
|
tb_leds.get(0).setTimeshow(timeshow);
|
tb_leds.get(0).setJx(jx);
|
tb_leds.get(0).setJy(jy);
|
tb_leds.get(0).setjW(jW);
|
tb_leds.get(0).setJh(jh);
|
tb_leds.get(0).setTh(th);
|
tb_leds.get(0).setTl(tl);
|
tb_leds.get(0).setBaoliu1(baoliu1);
|
tb_leds.get(0).setBaoliu2(baoliu2);
|
|
|
String[] ziduan= {
|
"ip",
|
"port",
|
"open" ,
|
"close",
|
"light",
|
"title",
|
"left1",
|
"right1",
|
"time",
|
"gas",
|
"tayTime",
|
"gengxintime",
|
"title_x",
|
"title_y",
|
"title_S",
|
"time_x",
|
"time_y",
|
"time_s",
|
"kq_x",
|
"kq_y",
|
"kq_s",
|
"kq_g",
|
"shx",
|
"shy",
|
"shs",
|
"shg",
|
"led_w",
|
"led_h",
|
"show_name",
|
"show_kahao",
|
"show_bumen",
|
"show_quyu",
|
"show_time",
|
"show_distance",
|
"gas_name",
|
"gas_type",
|
"gas_nongdu",
|
"gas_quyu",
|
"gas_time",
|
"gas_state",
|
"timeshow",
|
"jx",
|
"jy",
|
"jW",
|
"jh",
|
"th",
|
"tl",
|
"baoliu1",
|
"baoliu2",
|
"id"};
|
String[] zhi= {
|
ip,
|
port,
|
open,
|
close,
|
light,
|
title,
|
left,
|
right,
|
time,
|
gas,
|
tayTime,
|
gengxintime,
|
title_x,
|
title_y,
|
title_S,
|
time_x,
|
time_y,
|
time_s,
|
kq_x,
|
kq_y,
|
kq_s,
|
kq_g,
|
shx,
|
shy,
|
shs,
|
shg,
|
led_w,
|
led_h,
|
show_name,
|
show_kahao,
|
show_bumen,
|
show_quyu,
|
show_time,
|
show_distance,
|
gas_name,
|
gas_type,
|
gas_nongdu,
|
gas_quyu,
|
gas_time,
|
gas_state,
|
timeshow,
|
jx,
|
jy,
|
jW,
|
jh,
|
th,
|
tl,
|
baoliu1,
|
baoliu2,
|
"1"};
|
|
if(DatabaseManagement.fast_alert_dbase("tb_led", ziduan, zhi)) {
|
ShowMessage.zidingyi("Êý¾Ý±£´æ³É¹¦£¡");
|
}else {
|
ShowMessage.zidingyi("Êý¾Ý±£´æÊ§°Ü£¡");
|
}
|
}
|
|
/**¸Ä±äledµÄ¿ª¹Ø×´Ì¬*/
|
public static void alert_led_open(String open) {
|
tb_leds.get(0).setOpen(open);
|
StringBuffer updateSQL=new StringBuffer("UPDATE tb_led SET open='"+open+"' where id='1'");
|
DatabaseManagement.update(updateSQL.toString());
|
}
|
|
/**¸Ä±äledµÄÁÁ¶È*/
|
public static void alert_led_light(String light) {
|
tb_leds.get(0).setLight(light);
|
StringBuffer updateSQL=new StringBuffer("UPDATE tb_led SET light='"+light+"' where id='1'");
|
DatabaseManagement.update(updateSQL.toString());
|
}
|
|
/**¿ªÆôLEDͶÆÁ¹¦ÄÜ*/
|
public static void start_screnn(String close) {
|
tb_leds.get(0).setLight(close);
|
StringBuffer updateSQL=new StringBuffer("UPDATE tb_led SET close='"+close+"' where id='1'");
|
DatabaseManagement.update(updateSQL.toString());
|
}
|
|
|
/**»ñÈ¡led¶ÔÏó*/
|
public static Tb_led get_tb_led() {
|
if (tb_leds.size()==0){
|
//ShowMessage.zidingyi_24("ÎÞ¿¼ÇڼǼ");
|
return null;
|
}
|
Tb_led tb_led=tb_leds.get(0);
|
return tb_led;
|
}
|
|
|
public static Vector<String> getKqvc() {
|
return kqvc;
|
}
|
|
/**ÐèÒªÏÔʾµÄ¿¼ÇÚÄÚÈÝÊýÁ¿*/
|
public static int kqtitlenum(){
|
int num=0;
|
if(kqvc !=null) {
|
num=kqvc.size();
|
}
|
return num;
|
}
|
|
public static Vector<String> getGasvc() {
|
return gasvc;
|
}
|
|
/**ÐèÒªÏÔʾµÄÆøÌåÄÚÈÝÊýÁ¿*/
|
public static int gasnum(){
|
int num=0;
|
if(gasvc !=null) {
|
num=kqvc.size();
|
}
|
return num;
|
}
|
|
}
|