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 OUNPPMTest.SwingElements.Finder.TableCellFinders;
import org.assertj.swing.data.TableCell;
import navaid.Iterators.Widgets.FrameIteratorScattererXYZAngle;
public class NAVAIDView_GlideSlopeIterationModule_322Base_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("jMnuNewGlideSlope").click();
		windowFrame.tabbedPane("jTabs").selectTab("Glideslope");
		windowFrame.comboBox("jCboArrayTypeCOGS").selectItem("CAPT_EFF");
		windowFrame.comboBox("jCboFreqGS").selectItem("333.2");
		windowFrame.textBox("jtxtFrequencyCLGS").enterText("333.196");
		windowFrame.comboBox("jCboElementTypeGS").selectItem("FA-8976");
		windowFrame.textBox("jtxtAntSetbackCOGS").enterText("1000");
		windowFrame.textBox("jtxtMainOffsetCOGS").enterText("400");
		windowFrame.textBox("jtxtArrayRotCOGS").enterText("0.0");
		windowFrame.textBox("jtxtGSClrWidth").enterText("0.7");
		windowFrame.textBox("jtxtGSClrCrsSeparation").enterText("1.0");
		windowFrame.comboBox("jComboBox2").selectItem("Automatic");
		windowFrame.checkBox("jChkDUErrorGS").uncheck();
		windowFrame.textBox("jtxtGSGlidePathAngle").enterText("3.0");
		windowFrame.textBox("jtxtGSAntennaHeightRatio").enterText("2.0");
		windowFrame.checkBox("jCheckBoxAutoUpdatePosition").check();
		windowFrame.tabbedPane("jTabs").selectTab("Scatterers");
		windowFrame.button("jButOpenScattererGroup").click();
		TargetFileChooserAtFile(windowFrame, "A380.PSC", "para", false);
		this.robot().settings().delayBetweenEvents(10);
		windowFrame.table("jTableScatGrpED").cell(TableCellFinders.colTitleRegex(0, "^X Offset")).enterValue("0");
		this.setDefaultDelayBetweenEvents();
		this.robot().settings().delayBetweenEvents(10);
		windowFrame.table("jTableScatGrpED").cell(TableCellFinders.colTitleRegex(0, "^Y Offset")).enterValue("1000");
		this.setDefaultDelayBetweenEvents();
		this.robot().settings().delayBetweenEvents(10);
		windowFrame.table("jTableScatGrpED").cell(TableCellFinders.colTitleRegex(0, "^Z Offset")).enterValue("0");
		this.setDefaultDelayBetweenEvents();
		this.robot().settings().delayBetweenEvents(10);
		windowFrame.table("jTableScatGrpED").cell(TableCellFinders.colTitleRegex(0, "^Angle")).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");
		windowFrame.textBox("jtxtFPILS3RngAtStop").enterText("10000");
		windowFrame.textBox("jtxtFPILS3LinearIncrement").enterText("50");
		windowFrame.textBox("jtxtFPILS3AzimuthAngle").enterText("0.0");
		windowFrame.textBox("jtxtFPILS3RngAtIntercept").enterText("24304");
		windowFrame.textBox("jtxtFPILS3AltAtThresh").enterText("55");
		windowFrame.textBox("jtxtFPILS3MinAlt").enterText("20");
		windowFrame.textBox("jtxtFPILS3Velocity").enterText("118.6");
		windowFrame.tabbedPane("jTabs").selectTab("Traces");
		windowFrame.radioButton("jRadioButtonAnalysisZero").check();
		windowFrame.tabbedPane("jTabs").selectTab("Scatterers");
		windowFrame.radioButton("jRadioButtonIterateIndividually").click();
		this.robot().settings().delayBetweenEvents(10);
		windowFrame.table("jTableScatGrpED").cell(TableCell.row(0).column(windowFrame.table("jTableScatGrpED").columnIndexFor("Iterate"))).click();
		this.setDefaultDelayBetweenEvents();
		windowFrame = findFrame(FrameIteratorScattererXYZAngle.class).using(robot());
		windowFrame.focus();
		windowFrame.textBox("xMin").enterText("-3000 ft");
		windowFrame.textBox("xMax").enterText("-5000 ft");
		windowFrame.textBox("xInc").enterText("500 ft");
		windowFrame.textBox("yMin").enterText("200 ft");
		windowFrame.textBox("yMax").enterText("1000 ft");
		windowFrame.textBox("yInc").enterText("400 ft");
		windowFrame.textBox("zMin").enterText("0 ft");
		windowFrame.textBox("zMax").enterText("0 ft");
		windowFrame.textBox("zInc").enterText("1 ft");
		windowFrame.textBox("thMin").enterText("0 deg");
		windowFrame.textBox("thMax").enterText("0 deg");
		windowFrame.textBox("thInc").enterText("1 ft");
		windowFrame.textBox("hMin").enterText("0");
		windowFrame.textBox("hMax").enterText("0");
		windowFrame.textBox("hMin").enterText("1");
		windowFrame.button("butConfirm").click();
		windowFrame = findFrame(FrameMatchers.containsTitle("OU Navaids Performance Prediction Model,")).withTimeout(10000).using(robot());
		windowFrame.focus();
	}
	@Test
	public void test322Base(){
		windowFrame.button("jButSaveModel").click();
		TargetFileChooserAtFile(windowFrame, "1996.322Base.dat", true);
		windowFrame.button("jButRunIterations").click();
	}
}
