public StaticAnalysisGraphGUI(EditorSimManager simManager, GUIDropDown<int> flapSettingDropDown, GUIDropDown<CelestialBody> bodySettingDropdown)
        {
            this.simManager = simManager;
            this.flapSettingDropdown = flapSettingDropDown;
            this.bodySettingDropdown = bodySettingDropdown;

            //Set up defaults for AoA Sweep
            aoASweepInputs = new GraphInputs();
            aoASweepInputs.lowerBound = "0";
            aoASweepInputs.upperBound = "25";
            aoASweepInputs.numPts = "100";
            aoASweepInputs.flapSetting = 0;
            aoASweepInputs.pitchSetting = "0";
            aoASweepInputs.otherInput = "0.2";

            //Set up defaults for Mach Sweep
            machSweepInputs = new GraphInputs();
            machSweepInputs.lowerBound = "0";
            machSweepInputs.upperBound = "3";
            machSweepInputs.numPts = "100";
            machSweepInputs.flapSetting = 0;
            machSweepInputs.pitchSetting = "0";
            machSweepInputs.otherInput = "2";

            _graph.SetBoundaries(0, 25, 0, 2);
            _graph.SetGridScaleUsingValues(5, 0.5);
            _graph.horizontalLabel = "Angle of Attack, degrees";
            _graph.verticalLabel = "Cl\nCd\nCm\nL/D / 10";
            _graph.Update();
        }
        public StabilityDerivGUI(EditorSimManager simManager, GUIDropDown<int> flapSettingDropDown, GUIDropDown<CelestialBody> bodySettingDropdown)
        {
            this.simManager = simManager;
            _flapSettingDropdown = flapSettingDropDown;
            _bodySettingDropdown = bodySettingDropdown;

            stabDerivOutput = new StabilityDerivOutput();
        }
        public StabilityDerivSimulationGUI(EditorSimManager simManager)
        {
            this.simManager = simManager;

            lonConditions = new InitialConditions(new string[] { "0", "0", "0", "0" }, new string[] { "w", "u", "q", "θ" }, new double[]{1, 1, Math.PI/180, Math.PI/180}, "0.01", "10");
            latConditions = new InitialConditions(new string[] { "0", "0", "0", "0" }, new string[] { "β", "p", "r", "φ" }, new double[]{Math.PI/180, Math.PI/180, Math.PI/180, Math.PI/180}, "0.01", "10");

            _graph.SetBoundaries(0, 10, 0, 2);
            _graph.SetGridScaleUsingValues(1, 0.25);
            _graph.horizontalLabel = "time";
            _graph.verticalLabel = "params";
            _graph.Update();
        }
        void Start()
        {
            if (CompatibilityChecker.IsAllCompatible() && instance == null)
                instance = this;
            else
            {
                GameObject.Destroy(this);
                return;
            }

            _vehicleAero = new VehicleAerodynamics();

            guiRect = new Rect(Screen.width / 4, Screen.height / 6, 10, 10);

            _instantSim = new InstantConditionSim();
            GUIDropDown<int> flapSettingDropDown = new GUIDropDown<int>(new string[] { "0 (up)", "1 (init climb)", "2 (takeoff)", "3 (landing)" }, new int[] { 0, 1, 2, 3 }, 0);
            GUIDropDown<CelestialBody> celestialBodyDropdown = CreateBodyDropdown();

            _simManager = new EditorSimManager(_instantSim);

            _editorGraph = new StaticAnalysisGraphGUI(_simManager, flapSettingDropDown, celestialBodyDropdown);
            _stabDeriv = new StabilityDerivGUI(_simManager, flapSettingDropDown, celestialBodyDropdown);
            _stabDerivLinSim = new StabilityDerivSimulationGUI(_simManager);

            Color crossSection = GUIColors.GetColor(3);
            crossSection.a = 0.8f;

            Color crossSectionDeriv = GUIColors.GetColor(2);
            crossSectionDeriv.a = 0.8f;

            _areaRulingOverlay = new EditorAreaRulingOverlay(new Color(0.05f, 0.05f, 0.05f, 0.7f), crossSection, crossSectionDeriv, 10, 5);
            guiRect.height = 500;
            guiRect.width = 650;

            GameEvents.onEditorPartEvent.Add(UpdateGeometryEvent);
            GameEvents.onEditorUndo.Add(ResetEditorEvent);
            GameEvents.onEditorRedo.Add(ResetEditorEvent);
            GameEvents.onEditorShipModified.Add(ResetEditorEvent);
            GameEvents.onEditorLoad.Add(ResetEditorEvent);

            GameEvents.onGUIEngineersReportReady.Add(AddDesignConcerns);
            GameEvents.onGUIEngineersReportDestroy.Add(RemoveDesignConcerns);

            RequestUpdateVoxel();
        }
 public void Dispose()
 {
     aoASweepInputs = machSweepInputs = null;
     flapSettingDropdown = null;
     bodySettingDropdown = null;
     simManager = null;
     _graph = null;
 }
 public void Dispose()
 {
     simManager = null;
     _graph = null;
 }