package navaid;
import OUNPPMTest.TestFramework.*;
import org.junit.Test;
import javax.swing.JFrame;
import static org.assertj.swing.launcher.ApplicationLauncher.application;
import static OUNPPMTest.SwingElements.Finder.JMWindowFinder.findFrame;
import OUNPPMTest.SwingElements.Matcher.FrameMatchers;
import java.io.File;
import OUNPPMTest.SwingElements.Matcher.ButtonMatchers;
import OUNPPMTest.SwingElements.Matcher.DialogMatchers;
import static OUNPPMTest.TestFramework.OperatorHelpers.TargetFileChooserAtFile;
import org.assertj.swing.data.TableCell;
public class NAVAIDView_LocalizerTracesTab_262Base_Test extends SwingJUnitTestCase{
	@Override
	protected void prepare(){
		application(NAVAIDApp.class).withArgs(new String[]{"SINGLE_THREAD_MODE","DISABLE_EULA_WINDOW_OVERRIDE","DISABLE_AUTO_UPDATE_WINDOW_OVERRIDE"}).start();
		windowFrame = findFrame(FrameMatchers.containsTitle("OU Navaids Performance Prediction Model,")).withTimeout(10000).using(robot());
		windowFrame.focus();
		windowFrame.menuItem("fileMenu").click();
		windowFrame.menuItem("jNewModel").click();
		windowFrame.menuItem("jMnuNewLocalizer").click();
		windowFrame.tabbedPane("jTabs").selectTab("Localizer Model");
		windowFrame.comboBox("jCboArrayType").selectItem("WI14-10");
		windowFrame.comboBox("jCboFreq").selectItem("109.7");
		windowFrame.textBox("jtxtFrequencyCL").enterText("109.696 MHz");
		windowFrame.textBox("jtxtRwyHeading").enterText("298.0 deg");
		windowFrame.textBox("jtxtRwyLen").enterText("10000.0 ft");
		windowFrame.textBox("jtxtRwyWidth").enterText("150.0 ft");
		windowFrame.textBox("jtxtILSPtC").enterText("1000.0 ft");
		windowFrame.comboBox("jCboElementTypeCO").selectItem("LPD");
		windowFrame.textBox("jtxtAntSetbackCO").enterText("1000.0 ft");
		windowFrame.textBox("jtxtMainOffsetCO").enterText("0 ft");
		windowFrame.textBox("jtxtMainHeightCO").enterText("5.57 ft");
		windowFrame.textBox("jtxtArrayRotCO").enterText("0.0 deg");
		windowFrame.textBox("jtxtAntennaRotCO").enterText("0.0 deg");
		windowFrame.textBox("jtxtAntennaElevationCO").enterText("0.0 ft");
		windowFrame.textBox("jtxtLocClrWidth").enterText("2.2 deg");
		windowFrame.textBox("jtxtLocClrCrsSeparation").enterText("-17.0 dB");
		windowFrame.comboBox("jComboBoxFields").selectItem("Automatic");
		windowFrame.tabbedPane("jTabs").selectTab("Scatterers");
		windowFrame.button("jButOpenScattererGroup").click();
		TargetFileChooserAtFile(windowFrame, "1996.A380.PSC", "para", true);
		this.robot().settings().delayBetweenEvents(10);
		windowFrame.table("jTableScatGrpED").cell(TableCell.row(0).column(windowFrame.table("jTableScatGrpED").columnIndexFor("X Offset (ft)"))).enterValue("-5000");
		this.setDefaultDelayBetweenEvents();
		this.robot().settings().delayBetweenEvents(10);
		windowFrame.table("jTableScatGrpED").cell(TableCell.row(0).column(windowFrame.table("jTableScatGrpED").columnIndexFor("Y Offset (ft)"))).enterValue("1000");
		this.setDefaultDelayBetweenEvents();
		this.robot().settings().delayBetweenEvents(10);
		windowFrame.table("jTableScatGrpED").cell(TableCell.row(0).column(windowFrame.table("jTableScatGrpED").columnIndexFor("Z Offset (ft)"))).enterValue("0");
		this.setDefaultDelayBetweenEvents();
		this.robot().settings().delayBetweenEvents(10);
		windowFrame.table("jTableScatGrpED").cell(TableCell.row(0).column(windowFrame.table("jTableScatGrpED").columnIndexFor("Angle(deg)"))).enterValue("0");
		this.setDefaultDelayBetweenEvents();
		windowFrame.tabbedPane("jTabs").selectTab("Flight Editor");
		windowFrame.comboBox("jCboFlightType").selectItem("ILS 3 / Approach");
		windowFrame.comboBox("jCboCourseApproach").selectItem("Front Course");
		windowFrame.textBox("jtxtFPILS3RngAtStart").enterText("24304.0 ft");
		windowFrame.textBox("jtxtFPILS3RngAtStop").enterText("-10000.0 ft");
		windowFrame.textBox("jtxtFPILS3LinearIncrement").enterText("50.0 ft");
		windowFrame.textBox("jtxtFPILS3AzimuthAngle").enterText("0.0 deg");
		windowFrame.textBox("jtxtFPILS3RngAtIntercept").enterText("24304.0 ft");
		windowFrame.textBox("jtxtFPILS3AltAtThresh").enterText("55.0 ft");
		windowFrame.textBox("jtxtFPILS3MinAlt").enterText("20.0 ft");
		windowFrame.textBox("jtxtFPILS3Velocity").enterText("118.5 knots");
		windowFrame.tabbedPane("jTabs").selectTab("Traces");
		windowFrame.list("jListTraceList").selectItem(0);
		windowFrame.radioButton("jRadioButtonAnalysisFAA").click();
		windowFrame.button("jButTraceAddTrace").click();
		windowFrame.button("jButTraceAddTrace").click();
		windowFrame.list("jListTraceList").selectItem(1);
		windowFrame.textBox("jtxtTraceTraceName").enterText("Trace 2");
		windowFrame.list("jListTraceList").selectItem(2);
		windowFrame.textBox("jtxtTraceTraceName").enterText("Trace 3");
		windowFrame.list("jListTraceList").selectItem(1);
		windowFrame.button("jButTraceRemoveTrace").click();
		windowFrame.list("jListTraceList").selectItem(0);
		windowFrame.button("jButTraceRemoveAllTraces").click();
		windowFrame.button("jButTraceAddTrace").click();
		windowFrame.list("jListTraceList").selectItem(0);
		windowFrame.radioButton("jRadioButtonAnalysisFAA").click();
	}
	@Test
	public void test262Base(){
		windowFrame.button("jButSaveModel").click();
		TargetFileChooserAtFile(windowFrame, "1996.262Base.dat", true);
		windowFrame.button("jButRunSimulation").click();
	}
}
