package BaoWen; import java.util.Vector; import Method.BaoWenShow; import Method.GetNowTime; import tbDataModel.Baowen; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * ´¦Àíԭʼ±¨ÎÄ * »ùÕ¾10ÃëÖÓ×Ô¶¯Æô¶¯Êý¾Ý * BBF9D5BE49443A2037313239202E0D0ABBF9D5BEC0E0D0CD3A2042202E0D0AB5A5B4CECDA8D1B6BBF9D5BECAFDC1BF3A203130B8F62E0D0A */ public class Dell_Baowen implements Runnable { static int sleeptime = 1; static Thread t; static Vector baowenvec = new Vector(); static int a = 0; final static Logger logger = LoggerFactory.getLogger(Dell_Baowen.class); public static void intsert(String ip, String hex, String time, int port) { Baowen baowen = new Baowen(); baowen.setHex(hex); baowen.setIp(ip); baowen.setAddtime(time); baowen.setTimestamp(GetNowTime.timestamp()); baowen.setPort(port); baowenvec.add(baowen); } /** * ´¦Àíԭʼ±¨ÎÄ */ public void dellhex() { int size = baowenvec.size(); if (size == 0) { sleeptime = 50; return; } if (size > 100000) {//Èç¹ûÊý¾Ý´óÓÚ10ÍòÌõûÓд¦ÀíÔòÇå¿Õ baowenvec.removeAllElements(); } else { sleeptime = 0; Baowen baowen0 = baowenvec.get(0); String ip = baowen0.getIp(); int port = baowen0.getPort(); String hex = baowen0.getHex(); String time = baowen0.getAddtime(); int timestamp = baowen0.getTimestamp(); int lenth = hex.length(); dellhex2(ip, port, hex, time, timestamp, lenth);//´¦ÀíԭʼÊý¾Ý baowenvec.remove(baowen0);//ɾ³ý´¦Àí¹ýµÄ±¨ÎÄ } } /** * Æô¶¯Ï̵߳ķ½·¨ */ public void startThread() { t = new Thread(this); t.start(); } public void run() { while (true) { try { dellhex(); Thread.sleep(sleeptime);//ÐÝÃßʱ¼ä } catch (InterruptedException e) { e.printStackTrace(); } } } public static Vector getBaowenvec() { return baowenvec; } /** * yang2023.07.08 */ public static void dellhex2(String ip, int port, String hex, String time, int timestamp, int lenth) { Have_Yuanshi_Do.Dell_yuanshi(ip, hex, time); //// if (AnchorSet.isReadpeizhi()) {//Èç¹ûÉ豸´¦ÓÚ¶ÁÈ¡ÅäÖÃģʽ} // else if (hex.startsWith("55AA02") && lenth == 32) { // Dell_55AA02.dellrgs(hex, ip, port); // } else if (hex != null) { if (hex.startsWith("55AA01") && lenth == 42) {//Èç¹ûÊǺϷ¨µÄ55AA01Êý¾Ý Dell_55AA01.dell_55AA01(ip, hex, time, timestamp, port); BaoWenShow.ok("2", "55AA01", hex, ip, "´¦Àíԭʼ±¨ÎÄ");//±¨ÎÄÏÔʾ //Èç¹ûÊǺϷ¨µÄ²â¾àÊý¾Ý } else if (hex.startsWith("55AA0C")) { BaoWenShow.ok("2", "55AA0C", hex, ip, "´¦Àíԭʼ±¨ÎÄ"); String s = GetNowTime.timestamp2(); BaoWenShow.show("{Êý¾Ý¼¯ºÏÊý¾Ý:" + s + ":" + hex, "´¦Àíʱ¼ä", "Êý¾Ý¼¯ºÏ"); Dell_baowen_55AA0C.intsert(ip, hex, time, port); //Èç¹ûÊÇÀ´×Ô±êÇ©²â¾àÊý¾Ý } else if (hex.startsWith("55AA12")) { BaoWenShow.ok("2", "ԭʼÊý¾Ý", hex, ip, "´¦Àíԭʼ±¨ÎÄ"); Dell_55AA12.dell_12(ip, time, hex, timestamp, port); }else if (hex.startsWith("55AA03")) { BaoWenShow.ok("2", "55AA03", hex, ip, "´¦Àíԭʼ±¨ÎÄ"); Dell_55AA03.dell(ip, hex); //Èç¹ûÊÇÐÄÌø°ü }else if (hex.startsWith("55AA02") && lenth == 32) { Dell_55AA02.dellrgs(hex, ip, port); //´¦Àí×¢²á±¨ÎÄ } else if (hex.startsWith("55AA0A") && lenth == 48) { Dell_55AA0A.dellrgs(hex, ip, port); BaoWenShow.ok("2", "55AA0A", hex, ip, "´¦Àíԭʼ±¨ÎÄ"); } else if (hex.startsWith("55AA07")) { //Ð޸ķµ»ØÐÅÏ¢ Dell_55AA07.dell(ip, hex.toString()); BaoWenShow.ok("2", "55AA07", hex, ip, "´¦Àíԭʼ±¨ÎÄ"); //»ùÕ¾ÊÕµ½ÅúÁ¿Ð޸ıêÇ©ÐÅÏ¢55AA09080B0C00000000D7FFio } else if (hex.startsWith("55AA09") && lenth == 24) { BaoWenShow.ok("2", "55AA09", hex, ip, "´¦Àíԭʼ±¨ÎÄ"); //»ùÕ¾·µ»Ø×´Ì¬Öµ55AA100E18980100000000000000000030 } else if (hex.startsWith("55AA10") && lenth == 34) { //µ÷Óô¦Àí×¢²áÐÅÏ¢µÄ·½·¨ Dell_55AA10.dell(hex); BaoWenShow.ok("2", "55AA10", hex, ip, "´¦Àíԭʼ±¨ÎÄ"); } else if (hex.startsWith("55AA0E")) { BaoWenShow.ok("2", "55AA0E", hex, ip, "´¦Àíԭʼ±¨ÎÄ"); Dell_55AA0E.dell(hex); } else if (hex.startsWith("55AA1A") && lenth == 48) { Dell_55AA1A.dell(hex, ip, port); BaoWenShow.ok("2", "55AA0A", hex, ip, "´¦Àíԭʼ±¨ÎÄ"); } } } }