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
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
package Frame;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DecimalFormat;
 
import javax.swing.Box;
import javax.swing.ImageIcon;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.event.InternalFrameEvent;
import javax.swing.event.InternalFrameListener;
 
import BaoWen.Dell_55AA0C;
import ColorAndFont.ChooseFont;
import ColorAndFont.NothJPanel;
import ColorAndFont.UIColor;
import Method.GetNowTime;
import Method.JComboBoxModel;
import PbuliClass.JButtonModel;
import PbuliClass.JlableModel;
import PbuliClass.Systems;
import PbuliClass.jinternalFrame;
import tag.Tag_Dell;
/**¾àÀë·ÖÎö*/
public class Julidebug extends jinternalFrame {
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    jinternalFrame jinerFrame=null;
    JInternalFrame jinFrame=null;    
    NothJPanel northPanel=null;//±±²¿Ãæ°å
    JPanel mb=null;//Ãæ°å
 
    static JButtonModel jbt_distance=null;
    JButtonModel jbt_statr=null;//¿ªÊ¼µ÷ÊÔ
    JButtonModel jbt_stop=null;//ÔÝÍ£µ÷ÊÔ
    static JButtonModel jbt_big=null;//×î´ó²â¼ÛÖµ
    static JButtonModel jbt_samll=null;//×îС²â¼ÛÖµ
    JButtonModel clear=null;//Çå¿Õ°´Å¥°´Å¥
    static JButtonModel jbt_diu=null;//¶ª°ü·ÖÎö
 
    JScrollPane gd=null;//¹ö¶¯Ãæ°å
 
    JlableModel jl_anchorid=new JlableModel("»ùÕ¾");
    JTextField  jt_anchorid=null;
    static JTextArea textArea=null;
    static String tagid_str=null;
    static String anchorid_st=null;
 
 
 
 
    static int max=0;
    static int small=0;
    static int num=0;
 
 
    Box topicBox;    
    JlableModel jl_choose_anchor= new JlableModel("»ùÕ¾ID:");    
    JComboBoxModel box_tagid=null;//±êÇ©µÄ¼¯ºÏ
    static boolean start_test=false;
 
    static DecimalFormat decimalFormat=new DecimalFormat("0.00");
 
    public Julidebug() {//¹¹Ôì·½·¨
        topicBox = Box.createHorizontalBox();// ´´½¨Ò»¸öˮƽÏäÈÝÆ÷
        Container rq=getContentPane();//»ñÈ¡ÈÝÆ÷
        rq.setLayout(new BorderLayout());
        rq.setBackground(UIColor.getNorth_color());
        this.addInternalFrameListener(new InternalFrameListener() {
 
            @Override
            public void internalFrameOpened(InternalFrameEvent e) {    
            }
 
            @Override
            public void internalFrameIconified(InternalFrameEvent e) {
            }
 
            @Override
            public void internalFrameDeiconified(InternalFrameEvent e) {                
            }
 
            @Override
            public void internalFrameDeactivated(InternalFrameEvent e) {                
            }
 
            @Override
            public void internalFrameClosing(InternalFrameEvent e) {
                start_test=false;
                textArea=null;
                max=0;
                small=0;
                jbt_diu.setText("0");
            }
 
            @Override
            public void internalFrameClosed(InternalFrameEvent e) {
            }
 
            @Override
            public void internalFrameActivated(InternalFrameEvent e) {
            }
        });
        String title="²â¾à·ÖÎö";
        if(Systems.sys().getLanguage().equals("English")) {
            title="Ranging analysis";
        }
        this.setTitle(title);
        this.setFrameIcon(new ImageIcon("image/icon/debug.png"));//ÉèÖô°Ìåͼ±ê
        rq.add(getNorthPanel(),BorderLayout.NORTH);    
        rq.add(getMb(),BorderLayout.CENTER);
 
    }
 
 
    /**»ñÈ¡±±²¿Ãæ°åµÄ·½·¨*/    
    public NothJPanel getNorthPanel() {
        if(northPanel==null) {
            northPanel=new NothJPanel();
            topicBox.add(jl_choose_anchor);
            topicBox.add(Box.createHorizontalStrut(10));
            topicBox.add(getBox_tagid() );
            topicBox.add(Box.createHorizontalStrut(20));
            topicBox.add(jl_choose_anchor);
            topicBox.add(Box.createHorizontalStrut(5));
            topicBox.add(getJt_anchorid());
            topicBox.add(Box.createHorizontalStrut(20));            
            topicBox.add(getJbt_statr());
            topicBox.add(Box.createHorizontalStrut(20));
            topicBox.add(getClear());
            northPanel.add(topicBox );
 
 
        }
        return northPanel;
    }
 
 
 
 
 
    public JComboBoxModel getBox_tagid() {
        if(box_tagid==null) {
            box_tagid=new JComboBoxModel(Tag_Dell.GetTagAllstr());
            box_tagid.addActionListener(new ActionListener() {                
                @Override
                public void actionPerformed(ActionEvent e) {
                    tagid_str=(String) box_tagid.getSelectedItem();    
 
                }
            });
        }
        return  box_tagid;
    }
 
 
    public JButtonModel getJbt_statr() {
        if(jbt_statr==null) {
            jbt_statr=new JButtonModel("¿ª Ê¼");
            jbt_statr.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
 
                    if(!start_test) {
                        jbt_statr.setText("  Ôݠͣ  ");
                        Dell_55AA0C.setB(0);
                        Dell_55AA0C.setNum(0);
                        jbt_diu.setText("0");
                        start_test=true;
                        anchorid_st=getJt_anchorid().getText().trim();
                        tagid_str=(String) box_tagid.getSelectedItem();    
                        max=0;
                        small=0;
 
 
                    }else {
                        jbt_statr.setText("  ¿ª Ê¼  ");
                        start_test=false;
                    }
 
 
                }
            });
        }
        return jbt_statr;
    }
 
 
 
 
    public static boolean isStart_test() {
        return start_test;
    }
 
 
 
 
 
 
 
    public static JButtonModel getJbt_distance() {
        if(jbt_distance==null) {
            jbt_distance=new JButtonModel("ʵʱ¾àÀë");
            jbt_distance.setFont(ChooseFont.getFont(35));
 
        }
        return jbt_distance;
    }
 
 
    public JButtonModel getClear() {
        if(clear==null) {
            clear=new JButtonModel("Çå¿Õ");
            clear.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    textArea.setText("");
                    max=0;
                    small=0;
 
                }
            });
        }
        return clear;
    }
 
 
    public JTextField getJt_anchorid() {
        if(jt_anchorid==null) {
            jt_anchorid=new JTextField(10);
        }
        return jt_anchorid;
    }
 
 
    public static JTextArea getTextArea() {
        if(textArea==null) {
            textArea=new JTextArea();
        }
        return textArea;
    }
 
 
    public JScrollPane getGd() {
        if(gd==null) {
            gd=new JScrollPane(getTextArea());
        }
        return gd;
    }
 
 
    public JPanel getMb() {
        if(mb==null) {
            mb=new JPanel();
            mb.setLayout(null);
            int x=220;
            int y=40;
            int width=400;
            int height=100;
 
            mb.add(getJbt_distance());
            jbt_distance.setBounds(x, y, 200, height);
 
            mb.add(getJbt_diu());
            jbt_diu.setBounds(x+205, y,195, height);
 
            mb.add(getJbt_big() );
            jbt_big.setBounds(x, y+height+1, 200,30);
 
            mb.add(getJbt_samll());
            jbt_samll.setBounds(x+205, y+height+1, 195,30);
 
            mb.add(getGd());
            gd.setBounds(x, y+height+50, width, height+100);
 
 
        }
        return mb;
    }
 
 
 
 
    public static JButtonModel getJbt_diu() {
        if(jbt_diu==null) {
            jbt_diu=new JButtonModel("0%");
            jbt_diu.setFont(ChooseFont.getFont(35));
        }
        return jbt_diu;
    }
 
 
    public static JButtonModel getJbt_big() {
        if(jbt_big==null) {
            jbt_big=new JButtonModel("max");
        }
        return jbt_big;
    }
 
 
    public static JButtonModel getJbt_samll() {
        if(jbt_samll==null) {
            jbt_samll=new JButtonModel("small");
        }
        return jbt_samll;
    }
 
 
 
 
 
    /**²â¾à·ÖÎöµÄ·½·¨*/
    public static void cejifenxi(
            String tagid,
            int baoxu0,
            int baoxu,
            int baoxunow,
            int anchornum,
            String[] anchorid,
            int[] distance) {
        if(tagid.equals(tagid_str)) {            
            if(num==0) {
                baoxu0=baoxu;
            }
            num++;
            if(num==100) {
                baoxunow=baoxu;    
                float c=(baoxunow-baoxu0+1)-100;
                float d=baoxunow-baoxu0+1;
                float a=(c/d);                            
                String p=decimalFormat.format(a);
                jbt_diu.setText(p);
                baoxu0=baoxu;
                num=0;
            }
            for(int k=0;k<anchornum;k++) {
                if(anchorid_st.equals(anchorid[k])) {
                    String jl=String.valueOf(distance[k]);                    
                    if(max==0 && small==0) {
                        max=distance[k];
                        small=distance[k];
                    }else {
                        if(distance[k]>max && distance[k] !=131071) {
                            small=distance[k];
                        }
                        if(small>distance[k]) {
                            small=distance[k];
                        }
                    }
 
                    jbt_big.setText("max:"+max);
                    jbt_samll.setText("small:"+small);
                    jbt_distance.setText(jl);
                    textArea.append(GetNowTime.HH_MM_SS()+
                            "     °üÐò:"+baoxu+
                            "     ¾àÀë:"+distance[k]+
                            "     ¼ÆÊý:"+num+
                            "\n");
                    textArea.setCaretPosition(textArea.getText().length());
                    break;
                }
            }
 
        }
    }
 
}