826220679@qq.com
2025-08-07 4d6cd980c5c69e4d9d150669c89734642297e0cd
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
package udptcp;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Vector;
/**
 * ´¦Àíԭʼ±¨ÎÄ 
 */
public class DellHexBaowen implements Runnable {
    static int sleeptime = 1;
    static Thread t;
    static Vector<HexBaowen>  allReceivedHexMessages = new Vector<HexBaowen>();
    static int a = 0;
    public static void intsert(String ip, String hex, String time, int port,int timestamp) {
        HexBaowen HexBaowen = new HexBaowen();
        HexBaowen.setHex(hex);
        HexBaowen.setIp(ip);
        HexBaowen.setAddtime(time);
        HexBaowen.setTimestamp(timestamp);
        HexBaowen.setPort(port);
         allReceivedHexMessages.add(HexBaowen);
    }
 
 
    /**
     * ´¦Àíԭʼ±¨ÎÄ
     */
    public void dellhex() {
        int size =  allReceivedHexMessages.size();
        if (size == 0) {
            sleeptime = 50;
            return;
        }
        if (size > 100000) {//Èç¹ûÊý¾Ý´óÓÚ10ÍòÌõûÓд¦ÀíÔòÇå¿Õ
             allReceivedHexMessages.removeAllElements();
        } else {
            sleeptime = 0;
            HexBaowen HexBaowen0 =  allReceivedHexMessages.get(0);
            String ip = HexBaowen0.getIp();
            int port = HexBaowen0.getPort();
            String hex = HexBaowen0.getHex();
            String time = HexBaowen0.getAddtime();
            int timestamp = HexBaowen0.getTimestamp();
            int lenth = hex.length();
            try {
                dellhex2(ip, port, hex, time, timestamp, lenth);//´¦ÀíԭʼÊý¾Ý
 
            } catch (Exception e) {
                logger.info("errorData:"+hex);
                e.printStackTrace();
            }
             allReceivedHexMessages.remove(HexBaowen0);//ɾ³ý´¦Àí¹ýµÄ±¨ÎÄ
        }
    }
 
 
    /**
     * Æô¶¯Ï̵߳ķ½·¨
     */
    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<HexBaowen> get allReceivedHexMessages() {
        return  allReceivedHexMessages;
    }
 
    /**
     * 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);
                HexBaowenShow.ok("2", "55AA01", hex, ip, LanguageTools.getTranslation(CLYSBW));//±¨ÎÄÏÔʾ
                //Èç¹ûÊǺϷ¨µÄ²â¾àÊý¾Ý
            } else if (hex.startsWith("55AA0C")) {
                Dell_HexBaowen_55AA0C.intsert(ip, hex, time, port,"0");
            } else if (hex.startsWith("55AA12")) {
                Dell_HexBaowen_55AA0C.intsert(ip, hex, time, port,"0");
            }else if (hex.startsWith("55AA22")) {
                Dell_HexBaowen_55AA0C.intsert(ip, hex, time, port,"0");
            }else if (hex.startsWith("55AA24")) {
                Dell_HexBaowen_55AA0C.intsert(ip, hex, time, port,"0");
            }else if (hex.startsWith("55AA23")) {
                Dell_HexBaowen_55AA0C.intsert(ip, hex, time, port,"0");
            }else if (hex.startsWith("55AA0A")) {
                Dell_HexBaowen_55AA0C.intsert(ip, hex, time, port,"0");
            }  else if (hex.startsWith("55AA1A") ) {
                Dell_HexBaowen_55AA0C.intsert(ip, hex, time, port,"0");
            } else if (hex.startsWith("55AA20") ) {
                Dell_HexBaowen_55AA0C.intsert(ip, hex, time, port,"0");
            }else if (hex.startsWith("55AACC") ) {
                Dell_HexBaowen_55AA0C.intsert(ip, hex, time, port,"0");
            }else if (hex.startsWith("55AACD") ) {
                Dell_HexBaowen_55AA0C.intsert(ip, hex, time, port,"0");
            }else if (hex.startsWith("55AACF") ) {
                Dell_HexBaowen_55AA0C.intsert(ip, hex, time, port,"0");
            }else if (hex.startsWith("55AA07")) {
                //Ð޸ķµ»ØÐÅÏ¢
                Dell_55AA07.dell(ip, hex.toString());
                HexBaowenShow.ok("2", "55AA07", hex, ip, LanguageTools.getTranslation(CLYSBW));
                //»ùÕ¾ÊÕµ½ÅúÁ¿Ð޸ıêÇ©ÐÅÏ¢55AA09080B0C00000000D7FFio
            } else if (hex.startsWith("55AA09") ) {
                HexBaowenShow.ok("2", "55AA09", hex, ip, LanguageTools.getTranslation(CLYSBW));
                //»ùÕ¾·µ»Ø×´Ì¬Öµ55AA100E18980100000000000000000030
            } else if (hex.startsWith("55AA10") ) {
                //µ÷Óô¦Àí×¢²áÐÅÏ¢µÄ·½·¨
                Dell_55AA10.dell(hex);
                HexBaowenShow.ok("2", "55AA10", hex, ip, LanguageTools.getTranslation(CLYSBW));
 
            } else if (hex.startsWith("55AA0E")) {
                HexBaowenShow.ok("2", "55AA0E", hex, ip, LanguageTools.getTranslation(CLYSBW));
                Dell_55AA0E.dell(hex);
            }else if (hex.startsWith("55AA02")) {
                Dell_55AA02.dellrgs(hex, ip, port);
 
            } else if (hex.startsWith("55AA31")) {
                Dell_55AA31.dellrgs(hex, ip, port);
                //»ùÕ¾ÐÄÌø°ü
            }else if (hex.startsWith("55AA32")) {
                Dell_55AA32.dellrgs(hex, ip, port);
                //´¦ÀíÉý¼¶½ø¶È
            }else if (hex.startsWith("55AA34")) {
                Dell_55AA34.dellrgs(hex, ip, port);
                //´¦Àí×¢²á±¨ÎÄ
            }else if (hex.startsWith("55AA03")) {
                HexBaowenShow.ok("2", "55AA03", hex, ip, LanguageTools.getTranslation(CLYSBW));
                Dell_55AA03.dell(ip, hex,port);
                //Èç¹ûÊÇÐÄÌø°ü
            }else if (hex.startsWith("55AA39")) {
                HexBaowenShow.ok("2", "55AA39", hex, ip, LanguageTools.getTranslation(CLYSBW));
                Dell_55AA39.dell(ip, hex,port);
                //Èç¹ûÊÇÐÄÌø°ü
            } else if (hex.startsWith("55AA14")) {
                HexBaowenShow.ok("2", "55AA14", hex, ip, LanguageTools.getTranslation(CLYSBW));
                Dell_55AA14.dell_14(ip, time, hex, timestamp, port);
 
            }else {
                Dell_uanshi_byt.intsert(ip, hex, time, timestamp, port);
            }
        }
    }
 
 
    public static Logger getLogger() {
        return logger;
    }
}