Beispiel #1
0
        private void CrossSectionAnalysisGUI()
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label(Localizer.Format("FAREditorTitleTransonic"), GUILayout.Width(350));
            GUILayout.EndHorizontal();

            var BackgroundStyle = new GUIStyle(GUI.skin.box);

            BackgroundStyle.hover = BackgroundStyle.active = BackgroundStyle.normal;

            GUILayout.BeginHorizontal();
            GUILayout.BeginVertical(BackgroundStyle, GUILayout.Width(350), GUILayout.ExpandHeight(true));
            GUILayout.Label(Localizer.Format("FAREditorTransMaxArea") +
                            _vehicleAero.MaxCrossSectionArea.ToString("G6") +
                            " " +
                            Localizer.Format("FARUnitMSq"));
            GUILayout.Label(Localizer.Format("FAREditorTransMach1DragArea") +
                            _vehicleAero.SonicDragArea.ToString("G6") +
                            " " +
                            Localizer.Format("FARUnitMSq"));
            GUILayout.Label(Localizer.Format("FAREditorTransCritMach") + _vehicleAero.CriticalMach.ToString("G6"));
            GUILayout.EndVertical();

            GUILayout.BeginVertical(BackgroundStyle, GUILayout.ExpandHeight(true));
            GUILayout.Label(Localizer.Format("FAREditorTransMinDragExp1"));
            bool areaVisible  = _areaRulingOverlay.IsVisible(EditorAreaRulingOverlay.OverlayType.AREA);
            bool derivVisible = _areaRulingOverlay.IsVisible(EditorAreaRulingOverlay.OverlayType.DERIV);
            bool coeffVisible = _areaRulingOverlay.IsVisible(EditorAreaRulingOverlay.OverlayType.COEFF);

            if (GUILayout.Toggle(areaVisible, Localizer.Format("FAREditorTransAreaCurve")) != areaVisible)
            {
                _areaRulingOverlay.SetVisibility(EditorAreaRulingOverlay.OverlayType.AREA, !areaVisible);
            }

            if (GUILayout.Toggle(derivVisible, Localizer.Format("FAREditorTransCurvCurve")) != derivVisible)
            {
                _areaRulingOverlay.SetVisibility(EditorAreaRulingOverlay.OverlayType.DERIV, !derivVisible);
            }

            if (GUILayout.Toggle(coeffVisible, Localizer.Format("FAREditorTransPresCurve")) != coeffVisible)
            {
                _areaRulingOverlay.SetVisibility(EditorAreaRulingOverlay.OverlayType.COEFF, !coeffVisible);
            }

            GUILayout.Label(Localizer.Format("FAREditorTransMinDragExp2"));
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
        }
Beispiel #2
0
        void CrossSectionAnalysisGUI()
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label("Transonic Area Ruling Analysis", GUILayout.Width(350));
            GUILayout.EndHorizontal();

            GUIStyle BackgroundStyle = new GUIStyle(GUI.skin.box);

            BackgroundStyle.hover = BackgroundStyle.active = BackgroundStyle.normal;

            GUILayout.BeginHorizontal();
            GUILayout.BeginVertical(BackgroundStyle, GUILayout.Width(350), GUILayout.ExpandHeight(true));
            GUILayout.Label("Max Cross-Section Area: " + _vehicleAero.MaxCrossSectionArea.ToString("G6") + " m²");
            GUILayout.Label("Mach 1 Wave Drag-Area: " + _vehicleAero.SonicDragArea.ToString("G6") + " m²");
            GUILayout.Label("Critical Mach Number: " + _vehicleAero.CriticalMach.ToString("G6"));
            GUILayout.EndVertical();

            GUILayout.BeginVertical(BackgroundStyle, GUILayout.ExpandHeight(true));
            GUILayout.Label("Minimal wave drag is achieved by maintaining a\n\rsmooth, minimal curvature cross-section curve, including the\n\reffects of intake -> engine ducting.");
            bool areaVisible  = _areaRulingOverlay.IsVisible(EditorAreaRulingOverlay.OverlayType.AREA);
            bool derivVisible = _areaRulingOverlay.IsVisible(EditorAreaRulingOverlay.OverlayType.DERIV);
            bool coeffVisible = _areaRulingOverlay.IsVisible(EditorAreaRulingOverlay.OverlayType.COEFF);

            if (GUILayout.Toggle(areaVisible, "Show cross-sectional area curve (green)") != areaVisible)
            {
                _areaRulingOverlay.SetVisibility(EditorAreaRulingOverlay.OverlayType.AREA, !areaVisible);
            }

            if (GUILayout.Toggle(derivVisible, "Show curvature cross-sectional area curve (yellow)") != derivVisible)
            {
                _areaRulingOverlay.SetVisibility(EditorAreaRulingOverlay.OverlayType.DERIV, !derivVisible);
            }

            if (GUILayout.Toggle(coeffVisible, "Show avg pressure coefficient curve (blue)") != coeffVisible)
            {
                _areaRulingOverlay.SetVisibility(EditorAreaRulingOverlay.OverlayType.COEFF, !coeffVisible);
            }

            GUILayout.Label("Minimize curvature to minimize wave drag");
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
        }