FAR support and burn times to delta-v readouts.
FAR support and burn times to delta-v readouts.

--- a/KerbalEngineer/Editor/BuildAdvanced.cs
+++ b/KerbalEngineer/Editor/BuildAdvanced.cs
@@ -311,6 +311,7 @@
                     this.windowPosition.height = 0;

                 }

 

+                GUI.skin = null;

                 this.windowPosition = GUILayout.Window(this.windowId, this.windowPosition, this.Window, title, this.windowStyle).ClampToScreen();

 

                 if (this.compactCheck > 0 && this.compactCollapseRight)


--- a/KerbalEngineer/Editor/BuildOverlay.cs
+++ b/KerbalEngineer/Editor/BuildOverlay.cs
@@ -228,6 +228,7 @@
                     return;

                 }

 

+                GUI.skin = null;

                 this.windowPosition = GUILayout.Window(this.windowId, this.windowPosition, this.Window, string.Empty, this.windowStyle);

 

                 // Check and set that the window is at the bottom of the screen.


--- a/KerbalEngineer/Flight/ActionMenu.cs
+++ b/KerbalEngineer/Flight/ActionMenu.cs
@@ -202,6 +202,7 @@
                     this.windowPosition.height = 0;

                 }

 

+                GUI.skin = null;

                 this.windowPosition = GUILayout.Window(this.windowId, this.windowPosition, this.Window, string.Empty, this.windowStyle);

                 //this.ScrollMechanism();

             }


--- a/KerbalEngineer/Flight/DisplayStack.cs
+++ b/KerbalEngineer/Flight/DisplayStack.cs
@@ -227,6 +227,7 @@
                 if (!this.Hidden && (SectionLibrary.Instance.NumberOfStackSections > 0 || this.ShowControlBar))

                 {

                     var shouldCentre = this.windowPosition.min == Vector2.zero;

+                    GUI.skin = null;

                     this.windowPosition = GUILayout.Window(this.windowId, this.windowPosition, this.Window, string.Empty, this.windowStyle).ClampToScreen();

                     if (shouldCentre)

                     {


--- a/KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs
+++ b/KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs
@@ -93,7 +93,6 @@
             this.readoutModules.Add(new GeeForce());

             this.readoutModules.Add(new TerminalVelocity());

             this.readoutModules.Add(new AtmosphericEfficiency());

-            this.readoutModules.Add(new AtmosphericForce());

             this.readoutModules.Add(new Biome());

             this.readoutModules.Add(new Slope());

             this.readoutModules.Add(new ImpactTime());


--- a/KerbalEngineer/Flight/Readouts/Surface/AtmosphericForce.cs
+++ /dev/null
@@ -1,60 +1,1 @@
-// 

-//     Kerbal Engineer Redux

-// 

-//     Copyright (C) 2014 CYBUTEK

-// 

-//     This program is free software: you can redistribute it and/or modify

-//     it under the terms of the GNU General Public License as published by

-//     the Free Software Foundation, either version 3 of the License, or

-//     (at your option) any later version.

-// 

-//     This program is distributed in the hope that it will be useful,

-//     but WITHOUT ANY WARRANTY; without even the implied warranty of

-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

-//     GNU General Public License for more details.

-// 

-//     You should have received a copy of the GNU General Public License

-//     along with this program.  If not, see <http://www.gnu.org/licenses/>.

-// 

-

-using KerbalEngineer.Extensions;

-

-namespace KerbalEngineer.Flight.Readouts.Surface

-{

-    public class AtmosphericForce : ReadoutModule

-    {

-        private bool showing;

-

-        public AtmosphericForce()

-        {

-            this.Name = "Atmos. Force";

-            this.Category = ReadoutCategory.Surface;

-            this.HelpString = "Shows the force caused by the vessel's drag.";

-            this.IsDefault = true;

-        }

-

-        public override void Update()

-        {

-            AtmosphericProcessor.RequestUpdate();

-        }

-

-        public override void Draw()

-        {

-            if (AtmosphericProcessor.ShowDetails)

-            {

-                this.showing = true;

-                this.DrawLine(AtmosphericProcessor.Force.ToForce());

-            }

-            else if (this.showing)

-            {

-                this.showing = false;

-                this.ResizeRequested = true;

-            }

-        }

-

-        public override void Reset()

-        {

-            FlightEngineerCore.Instance.AddUpdatable(AtmosphericProcessor.Instance);

-        }

-    }

-}
+

--- a/KerbalEngineer/Flight/Readouts/Surface/AtmosphericProcessor.cs
+++ b/KerbalEngineer/Flight/Readouts/Surface/AtmosphericProcessor.cs
@@ -21,6 +21,7 @@
 

 using System;

 using System.Linq;

+using System.Reflection;

 

 using KerbalEngineer.Extensions;

 

@@ -44,12 +45,29 @@
 

         #endregion

 

+        #region Fields

+

+        private bool hasCheckedAeroMods;

+        private MethodInfo farTerminalVelocity;

+

+        #endregion

+

         #region Properties

 

         /// <summary>

         ///     Gets whether the details are ready to be shown.

         /// </summary>

         public static bool ShowDetails { get; private set; }

+

+        /// <summary>

+        ///     Gets whether FAR is installed.

+        /// </summary>

+        public static bool FarInstalled { get; private set; }

+

+        /// <summary>

+        ///     Gets whether NEAR is installed.

+        /// </summary>

+        public static bool NearInstalled { get; private set; }

 

         /// <summary>

         ///     Gets the terminal velocity of the active vessel.

@@ -66,11 +84,6 @@
         /// </summary>

         public static double Deceleration { get; private set; }

 

-        /// <summary>

-        ///     Gets the force caused by drag.

-        /// </summary>

-        public static double Force { get; private set; }

-

         #endregion

 

         #region IUpdatable Members

@@ -80,23 +93,42 @@
         /// </summary>

         public void Update()

         {

-            if (FlightGlobals.ActiveVessel.atmDensity < double.Epsilon)

+            try

             {

-                ShowDetails = false;

-                return;

+                if (!this.hasCheckedAeroMods)

+                {

+                    this.CheckAeroMods();

+                }

+

+                if (FlightGlobals.ActiveVessel.atmDensity < double.Epsilon || NearInstalled)

+                {

+                    ShowDetails = false;

+                    return;

+                }

+

+                ShowDetails = true;

+

+                if (FarInstalled)

+                {

+                    TerminalVelocity = (double)this.farTerminalVelocity.Invoke(null, null);

+                }

+                else

+                {

+                    var mass = FlightGlobals.ActiveVessel.parts.Sum(p => p.GetWetMass());

+                    var drag = FlightGlobals.ActiveVessel.parts.Sum(p => p.GetWetMass() * p.maximum_drag);

+                    var grav = FlightGlobals.getGeeForceAtPosition(FlightGlobals.ship_position).magnitude;

+                    var atmo = FlightGlobals.ActiveVessel.atmDensity;

+                    var coef = FlightGlobals.DragMultiplier;

+

+                    TerminalVelocity = Math.Sqrt((2 * mass * grav) / (atmo * drag * coef));

+                }

+

+                Efficiency = FlightGlobals.ship_srfSpeed / TerminalVelocity;

             }

-

-            ShowDetails = true;

-

-            var mass = FlightGlobals.ActiveVessel.parts.Sum(p => p.GetWetMass());

-            var drag = FlightGlobals.ActiveVessel.parts.Sum(p => p.GetWetMass() * p.maximum_drag);

-            var grav = FlightGlobals.getGeeForceAtPosition(FlightGlobals.ship_position).magnitude;

-            var atmo = FlightGlobals.ActiveVessel.atmDensity;

-            var coef = FlightGlobals.DragMultiplier;

-

-            TerminalVelocity = Math.Sqrt((2 * mass * grav) / (atmo * drag * coef));

-            Efficiency = FlightGlobals.ship_srfSpeed / TerminalVelocity;

-            Force = atmo * coef * drag * Math.Pow(FlightGlobals.ActiveVessel.srfSpeed, 2) / 2;

+            catch (Exception ex)

+            {

+                Logger.Exception(ex, "AtmosphericProcessor->Update");

+            }

         }

 

         #endregion

@@ -117,5 +149,38 @@
         {

             instance.UpdateRequested = true;

         }

+

+        #region Private Methods

+

+        private void CheckAeroMods()

+        {

+            try

+            {

+                this.hasCheckedAeroMods = true;

+

+                foreach (var loadedAssembly in AssemblyLoader.loadedAssemblies)

+                {

+                    switch (loadedAssembly.name)

+                    {

+                        case "FerramAerospaceResearch":

+                            farTerminalVelocity = loadedAssembly.assembly.GetType("ferram4.FARAPI").GetMethod("GetActiveControlSys_TermVel");

+                            FarInstalled = true;

+                            Logger.Log("FAR detected!");

+                            break;

+

+                        case "NEAR":

+                            NearInstalled = true;

+                            Logger.Log("NEAR detected! Turning off atmospheric details!");

+                            break;

+                    }

+                }

+            }

+            catch (Exception ex)

+            {

+                Logger.Exception(ex, "AtmosphericProcessor->CheckAeroMods");

+            }

+        }

+

+        #endregion

     }

 }

--- a/KerbalEngineer/Flight/Readouts/Vessel/DeltaVStaged.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/DeltaVStaged.cs
@@ -19,6 +19,7 @@
 

 #region Using Directives

 

+using KerbalEngineer.Extensions;

 using KerbalEngineer.VesselSimulator;

 

 #endregion

@@ -55,7 +56,7 @@
                 {

                     if (stage.deltaV > 0 || stage.number == Staging.CurrentStage)

                     {

-                        this.DrawLine("DeltaV (S" + stage.number + ")", stage.deltaV.ToString("N0") + "m/s");

+                        this.DrawLine("DeltaV (S" + stage.number + ")", stage.deltaV.ToString("N0") + "m/s (" + stage.time.ToTime() + ")");

                         newNumberOfStages++;

                     }

                 }


--- a/KerbalEngineer/Flight/Readouts/Vessel/DeltaVTotal.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/DeltaVTotal.cs
@@ -19,6 +19,7 @@
 

 #region

 

+using KerbalEngineer.Extensions;

 using KerbalEngineer.VesselSimulator;

 

 #endregion

@@ -47,7 +48,7 @@
             if (SimulationProcessor.ShowDetails)

             {

                 this.showing = true;

-                this.DrawLine(SimulationProcessor.LastStage.totalDeltaV.ToString("N0") + "m/s");

+                this.DrawLine(SimulationProcessor.LastStage.totalDeltaV.ToString("N0") + "m/s (" + SimulationProcessor.LastStage.totalTime.ToTime() + ")");

             } else if (this.showing)

             {

                 this.showing = false;


--- a/KerbalEngineer/Flight/Sections/SectionWindow.cs
+++ b/KerbalEngineer/Flight/Sections/SectionWindow.cs
@@ -109,6 +109,7 @@
                     this.windowPosition.height = 0;

                     this.resizeRequested = false;

                 }

+                GUI.skin = null;

                 this.windowPosition = GUILayout.Window(this.windowId, this.windowPosition, this.Window, string.Empty, this.windowStyle).ClampToScreen();

                 this.ParentSection.FloatingPositionX = this.windowPosition.x;

                 this.ParentSection.FloatingPositionY = this.windowPosition.y;


--- a/KerbalEngineer/KerbalEngineer.csproj
+++ b/KerbalEngineer/KerbalEngineer.csproj
@@ -63,7 +63,6 @@
     <Compile Include="Flight\FlightEngineerPartless.cs" />

     <Compile Include="Flight\Readouts\Misc\Separator.cs" />

     <Compile Include="Flight\Readouts\Misc\GuiSizeAdjustor.cs" />

-    <Compile Include="Flight\Readouts\Surface\AtmosphericForce.cs" />

     <Compile Include="Flight\Readouts\Surface\ImpactBiome.cs" />

     <Compile Include="Flight\Readouts\Surface\Slope.cs" />

     <Compile Include="Flight\Readouts\Surface\Biome.cs" />


 Binary files a/Output/KerbalEngineer/KerbalEngineer.dll and b/Output/KerbalEngineer/KerbalEngineer.dll differ
--- a/Output/ReadMe.htm
+++ b/Output/ReadMe.htm
@@ -111,7 +111,7 @@
 

 		<section>

 			<h3>Current Version</h3>

-			<p>1.0.2.0</p>

+			<p>1.0.3.0</p>

 		</section>

 

 		<section>

@@ -154,6 +154,14 @@
 		<section>

 			<h3>Change Log</h3>

 			<ul id='changelog'>

+				<li>

+					1.0.3.0

+					<ul>

+						<li>Added: Burn time to Delta-V readouts.</li>

+						<li>Added: FAR supported terminal velocity.</li>

+						<li>Fixed: Flickering in VAB and Vessel display.</li>

+					</ul>

+				</li>

 				<li>

 					1.0.2.0

 					<ul>