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;
import navaid.Iterators.Widgets.FrameIteratorScattererVOR;
import OUNPPMTest.SwingElements.Finder.TableCellFinders;
import navaid.Iterators.Widgets.FrameIteratorScattererXYZAngle;
import navaid.Iterators.Widgets.IterationFileViewer;
import static OUNPPMTest.Testers.Directory.containsDirectoryWithJustCreatedByName;
public class NAVAIDView_GlideSlope_31changeCourseFreq_Test extends SwingJUnitTestCase{
	@Override
	protected void prepare(){
		application(NAVAIDApp.class).withArgs(new String[]{"SINGLE_THREAD_MODE"}).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.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("500");
		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("-20");
		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("0");
		windowFrame.textBox("jtxtFPILS3LinearIncrement").enterText("50");
		windowFrame.textBox("jtxtFPILS3AzimuthAngle").enterText("0.0");
		windowFrame.textBox("jtxtFPILS3ElevationAngle").enterText("3.0");
		windowFrame.textBox("jtxtFPILS3RngAtIntercept").enterText("24304");
		windowFrame.textBox("jtxtFPILS3AltAtThresh").enterText("55");
		windowFrame.textBox("jtxtFPILS3MinAlt").enterText("20");
		windowFrame.textBox("jtxtFPILS3Velocity").enterText("118.5");
		windowFrame.tabbedPane("jTabs").selectTab("Glideslope");
	}
	@Test
	public void test31changeCourseFreq(){
		windowFrame.comboBox("jCboFreqGS").selectItem("334.4");
		windowFrame.button("jButSaveModel").click();
		TargetFileChooserAtFile(windowFrame, "1997.31changeCourseFreq.dat", true);
		windowFrame.button("jButRunSimulation").click();
	}
}
