⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setperformance.java

📁 天线阵列的涉及软件
💻 JAVA
字号:
/*
 *	SetPerformance
 *
 *	Button action to read initial performances
 *	Set up complete interface
 *
 *	Meirong He
 *	EEE Department
 *	University of Sheffield
 *	July 2005
 */

import java.awt.*;
import java.awt.event.*;

class SetPerformance implements ActionListener {
		
		private AntennaDesigner des;
		private Button b;
				
		public SetPerformance (AntennaDesigner des, Button b) {	
			this.des=des;
			this.b=b;
		}
	
		public void actionPerformed (ActionEvent e) {
			
			des.screen.clear();
			des.taper.removeAll();
			
			double pi=Math.PI;
			int N=(new Integer(new String(des.element.getText()))).intValue();
			
			des.N=N;
			des.f=Double.parseDouble(new String(des.frequency.getText()));
			des.er=Double.parseDouble(new String(des.permittivity.getText()));	
			des.lamda0=3*Math.pow(10.0,8.0)/(des.f*Math.pow(10.0,6.0));
			des.k0=2*pi/des.lamda0;
			des.lamda=des.lamda0/Math.sqrt(des.er);
			des.k=2*pi/des.lamda;
						//Read and calculate needed parameters
						
						
			//////////// Panel for further parameters and bottons///////////////////
						
			des.taper.setLayout(new GridLayout(N+4,1));
			
			Panel action0=new Panel();
			action0.setLayout(new FlowLayout());
		
			action0.add(new Label("Spaing in Lamda", Label.CENTER));
			des.spacing=new TextField("0.6", 5);
			action0.add(des.spacing);
		
			action0.add(new Label("Substrate Height (mm)", Label.CENTER));
			des.height=new TextField("1.6",5);
			action0.add(des.height);
		
			des.taper.add(action0);
		
			Panel action1=new Panel();
			action1.setLayout(new FlowLayout());
		
			Button b1=new Button("Power Pattern");
			b1.addActionListener(new ShowArrayFactor(b1,des));
			action1.add(b1);
		
			Button b2=new Button("Geometrical Pattern" );
			b2.addActionListener(new ShowArrayFactor(b2,des));
			action1.add(b2);
		
			Button b7=new Button("Feeding length");
			b7.addActionListener(new ShowFeedingNet(b7,des));
			action1.add(b7);
		
			Button b8=new Button("Line width");
			b8.addActionListener(new ShowPowerSplit(b8,des));
			action1.add(b8);
		
			des.taper.add(action1);
		
			//////////// Panel for button of simple taper setting//////////////////
		
			Panel action2=new Panel();
			action2.setLayout(new FlowLayout());
		
			Button b3=new Button("Uniform Taper");
			b3.addActionListener(new SetTaper(b3,des));
			action2.add(b3);
		
			Button b4=new Button("Linear Taper");
			b4.addActionListener(new SetTaper(b4,des));
			action2.add(b4);
		
			Button b5=new Button("Cosine Taper");
			b5.addActionListener(new SetTaper(b5,des));
			action2.add(b5);
		
			des.taper.add(action2);
		
			//////////// Panel for taylor taper setting///////////////////////
		
			Panel action3=new Panel();
			action3.setLayout(new FlowLayout());
		
			action3.add(new Label("Sidelobel(DB)", Label.CENTER));
			des.sll=new TextField("15", 3);
			action3.add(des.sll);
		
			action3.add(new Label("Sidelobe number",Label.CENTER));
			des.sln=new TextField("3", 2);
			action3.add(des.sln);
		
			Button b6=new Button("Taylor Taper");
			b6.addActionListener(new SetTaper(b6,des));
			action3.add(b6);
		
			des.taper.add(action3);	
						
						
			//////////// Panel for individual current setting///////////////////
			
			Panel[] elements=new Panel[N];
			des.amp=new TextField[N];
			des.upAmp=new Button[N];
			des.downAmp=new Button[N];
			des.phase=new TextField[N];
			des.upPha=new Button[N];
			des.downPha=new Button[N];
		
			for (int i=0; i<N; i++) {
			
				elements[i]=new Panel();
				elements[i].setLayout(new FlowLayout());
			
				elements[i].add(new Label("Element "+(i+1)+":  A ", Label.CENTER));
			
				des.amp[i]=new TextField("1.0", 5 );
				elements[i].add(des.amp[i]);
			
				des.upAmp[i]=new Button(" + ");
				des.upAmp[i].addActionListener(new Adjust(des.upAmp[i], des, i, 1, 1));
				elements[i].add(des.upAmp[i]);
			
				des.downAmp[i]=new Button(" - ");
				des.downAmp[i].addActionListener(new Adjust(des.downAmp[i],des,i,1,-1));
				elements[i].add(des.downAmp[i]);
			
				elements[i].add(new Label(" P ", Label.CENTER));
			
				des.phase[i]=new TextField("0.0", 5);
				elements[i].add(des.phase[i]);
			
				des.upPha[i]=new Button(" + ");
				des.upPha[i].addActionListener(new Adjust(des.upPha[i], des, i, 2, 1));
				elements[i].add(des.upPha[i]);
			
				des.downPha[i]=new Button(" - ");
				des.downPha[i].addActionListener(new Adjust(des.downPha[i],des, i, 2, -1));
				elements[i].add(des.downPha[i]);	
				
				des.taper.add(elements[i]);
			}
			des.show();
		}
	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -