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