Added simulation processor to fix flickering.
Added simulation processor to fix flickering.

--- 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 AtmosphericDeceleration());

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

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

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

@@ -129,7 +128,7 @@
 

             // Misc

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

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

+            this.readoutModules.Add(new GuiSizeAdjustor());

 

             this.LoadHelpStrings();

         }


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

 #region Using Directives

 

-using KerbalEngineer.VesselSimulator;

+

 

 #endregion

 

@@ -28,6 +28,7 @@
     public class DeltaVStaged : ReadoutModule

     {

         private int numberOfStages;

+        private bool showing;

 

         public DeltaVStaged()

         {

@@ -39,37 +40,40 @@
 

         public override void Update()

         {

-            SimManager.RequestUpdate();

+            SimulationProcessor.RequestUpdate();

         }

 

         public override void Draw()

         {

-            if (SimManager.Stages == null)

+            if (SimulationProcessor.ShowDetails)

             {

-                return;

-            }

+                this.showing = true;

+                var newNumberOfStages = 0;

+                foreach (var stage in SimulationProcessor.Stages)

+                {

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

+                    {

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

+                        newNumberOfStages++;

+                    }

+                }

 

-            var newNumberOfStages = 0;

-

-            foreach (var stage in SimManager.Stages)

-            {

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

+                if (newNumberOfStages != this.numberOfStages)

                 {

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

-                    newNumberOfStages++;

+                    this.numberOfStages = newNumberOfStages;

+                    this.ResizeRequested = true;

                 }

             }

-

-            if (newNumberOfStages != this.numberOfStages)

+            else if (this.showing)

             {

-                this.numberOfStages = newNumberOfStages;

+                this.showing = false;

                 this.ResizeRequested = true;

             }

         }

 

         public override void Reset()

         {

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

+            FlightEngineerCore.Instance.AddUpdatable(SimulationProcessor.Instance);

         }

     }

 }

--- a/KerbalEngineer/Flight/Readouts/Vessel/DeltaVTotal.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/DeltaVTotal.cs
@@ -27,6 +27,8 @@
 {

     public class DeltaVTotal : ReadoutModule

     {

+        private bool showing;

+

         public DeltaVTotal()

         {

             this.Name = "DeltaV Total";

@@ -37,22 +39,25 @@
 

         public override void Update()

         {

-            SimManager.RequestUpdate();

+            SimulationProcessor.RequestUpdate();

         }

 

         public override void Draw()

         {

-            if (SimManager.LastStage == null)

+            if (SimulationProcessor.ShowDetails)

             {

-                return;

-            }

-

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

+                this.showing = true;

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

+            } else if (this.showing)

+            {

+                this.showing = false;

+                this.ResizeRequested = true;

+            }   

         }

 

         public override void Reset()

         {

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

+            FlightEngineerCore.Instance.AddUpdatable(SimulationProcessor.Instance);

         }

     }

 }

--- a/KerbalEngineer/Flight/Readouts/Vessel/Mass.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/Mass.cs
@@ -28,6 +28,8 @@
 {

     public class Mass : ReadoutModule

     {

+        private bool showing;

+

         public Mass()

         {

             this.Name = "Mass";

@@ -38,22 +40,25 @@
 

         public override void Update()

         {

-            SimManager.RequestUpdate();

+            SimulationProcessor.RequestUpdate();

         }

 

         public override void Draw()

         {

-            if (SimManager.LastStage == null)

+            if (SimulationProcessor.ShowDetails)

             {

-                return;

+                this.DrawLine(SimulationProcessor.LastStage.mass.ToMass(false) + " / " + SimulationProcessor.LastStage.totalMass.ToMass());

             }

-

-            this.DrawLine(SimManager.LastStage.mass.ToMass(false) + " / " + SimManager.LastStage.totalMass.ToMass());

+            else if (this.showing)

+            {

+                this.showing = false;

+                this.ResizeRequested = true;

+            }

         }

 

         public override void Reset()

         {

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

+            FlightEngineerCore.Instance.AddUpdatable(SimulationProcessor.Instance);

         }

     }

 }

--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Vessel/SimulationProcessor.cs
@@ -1,1 +1,68 @@
+using System;

+using System.Collections.Generic;

+using System.Linq;

+using System.Text;

+

+using KerbalEngineer.VesselSimulator;

+

+namespace KerbalEngineer.Flight.Readouts.Vessel

+{

+    public class SimulationProcessor : IUpdatable, IUpdateRequest

+    {

+        #region Instance

+        private static readonly SimulationProcessor instance = new SimulationProcessor();

+

+        /// <summary>

+        ///     Gets the current instance of the simulation processor.

+        /// </summary>

+        public static SimulationProcessor Instance

+        {

+            get { return instance; }

+        }

+        #endregion

+

+        #region Properies

+

+        /// <summary>

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

+        /// </summary>

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

+

+        /// <summary>

+        ///     Gets an array of the vessel stages.

+        /// </summary>

+        public static Stage[] Stages { get; private set; }

+

+        /// <summary>

+        ///     Gets the currently active vessel stage.

+        /// </summary>

+        public static Stage LastStage { get; private set; }

+

+        #endregion

+

+        public void Update()

+        {

+            SimManager.RequestSimulation();

+            if (!SimManager.ResultsReady())

+            {

+                return;

+            }

+

+            Stages = SimManager.Stages;

+            LastStage = SimManager.LastStage;

+

+            if (Stages != null && LastStage != null)

+            {

+                ShowDetails = true;

+            }

+        }

+

+        public bool UpdateRequested { get; set; }

+

+        public static void RequestUpdate()

+        {

+            instance.UpdateRequested = true;

+        }

+    }

+}

 

--- a/KerbalEngineer/Flight/Readouts/Vessel/SpecificImpulse.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/SpecificImpulse.cs
@@ -17,9 +17,9 @@
 //     along with this program.  If not, see <http://www.gnu.org/licenses/>.

 // 

 

-#region

+#region Using Directives

 

-using KerbalEngineer.VesselSimulator;

+

 

 #endregion

 

@@ -27,6 +27,8 @@
 {

     public class SpecificImpulse : ReadoutModule

     {

+        private bool showing;

+

         public SpecificImpulse()

         {

             this.Name = "Specific Impulse";

@@ -37,22 +39,25 @@
 

         public override void Update()

         {

-            SimManager.RequestUpdate();

+            SimulationProcessor.RequestUpdate();

         }

 

         public override void Draw()

         {

-            if (SimManager.LastStage == null)

+            if (SimulationProcessor.ShowDetails)

             {

-                return;

+                this.DrawLine(SimulationProcessor.LastStage.isp.ToString("F1") + "s");

             }

-

-            this.DrawLine(SimManager.LastStage.isp.ToString("F1") + "s");

+            else if (this.showing)

+            {

+                this.showing = false;

+                this.ResizeRequested = true;

+            }

         }

 

         public override void Reset()

         {

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

+            FlightEngineerCore.Instance.AddUpdatable(SimulationProcessor.Instance);

         }

     }

 }

--- a/KerbalEngineer/Flight/Readouts/Vessel/Thrust.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/Thrust.cs
@@ -20,7 +20,6 @@
 #region Using Directives

 

 using KerbalEngineer.Extensions;

-using KerbalEngineer.VesselSimulator;

 

 #endregion

 

@@ -28,6 +27,8 @@
 {

     public class Thrust : ReadoutModule

     {

+        private bool showing;

+

         public Thrust()

         {

             this.Name = "Thrust";

@@ -38,22 +39,25 @@
 

         public override void Update()

         {

-            SimManager.RequestUpdate();

+            SimulationProcessor.RequestUpdate();

         }

 

         public override void Draw()

         {

-            if (SimManager.LastStage == null)

+            if (SimulationProcessor.ShowDetails)

             {

-                return;

+                this.DrawLine(SimulationProcessor.LastStage.actualThrust.ToForce(false) + " / " + SimulationProcessor.LastStage.thrust.ToForce());

             }

-

-            this.DrawLine(SimManager.LastStage.actualThrust.ToForce(false) + " / " + SimManager.LastStage.thrust.ToForce());

+            else if (this.showing)

+            {

+                this.showing = false;

+                this.ResizeRequested = true;

+            }

         }

 

         public override void Reset()

         {

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

+            FlightEngineerCore.Instance.AddUpdatable(SimulationProcessor.Instance);

         }

     }

 }

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

 #region Using Directives

 

-using KerbalEngineer.VesselSimulator;

+

 

 #endregion

 

@@ -28,6 +28,7 @@
     public class ThrustToWeight : ReadoutModule

     {

         private string actual = string.Empty;

+        private bool showing;

         private string total = string.Empty;

 

         public ThrustToWeight()

@@ -40,24 +41,27 @@
 

         public override void Update()

         {

-            SimManager.RequestUpdate();

+            SimulationProcessor.RequestUpdate();

         }

 

         public override void Draw()

         {

-            if (SimManager.LastStage == null)

+            if (SimulationProcessor.ShowDetails)

             {

-                return;

+                this.actual = (SimulationProcessor.LastStage.actualThrust / (SimulationProcessor.LastStage.totalMass * FlightGlobals.getGeeForceAtPosition(FlightGlobals.ship_position).magnitude)).ToString("F2");

+                this.total = (SimulationProcessor.LastStage.thrust / (SimulationProcessor.LastStage.totalMass * FlightGlobals.getGeeForceAtPosition(FlightGlobals.ship_position).magnitude)).ToString("F2");

+                this.DrawLine("TWR", this.actual + " / " + this.total);

             }

-

-            this.actual = (SimManager.LastStage.actualThrust / (SimManager.LastStage.totalMass * FlightGlobals.getGeeForceAtPosition(FlightGlobals.ship_position).magnitude)).ToString("F2");

-            this.total = (SimManager.LastStage.thrust / (SimManager.LastStage.totalMass * FlightGlobals.getGeeForceAtPosition(FlightGlobals.ship_position).magnitude)).ToString("F2");

-            this.DrawLine("TWR", this.actual + " / " + this.total);

+            else if (this.showing)

+            {

+                this.showing = false;

+                this.ResizeRequested = true;

+            }

         }

 

         public override void Reset()

         {

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

+            FlightEngineerCore.Instance.AddUpdatable(SimulationProcessor.Instance);

         }

     }

 }

--- a/KerbalEngineer/KerbalEngineer.csproj
+++ b/KerbalEngineer/KerbalEngineer.csproj
@@ -68,6 +68,7 @@
     <Compile Include="Flight\Readouts\Surface\Slope.cs" />

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

     <Compile Include="Flight\Readouts\Vessel\SimulationDelay.cs" />

+    <Compile Include="Flight\Readouts\Vessel\SimulationProcessor.cs" />

     <Compile Include="GuiDisplaySize.cs" />

     <Compile Include="Logger.cs" />

     <Compile Include="EngineerGlobals.cs" />


--- a/KerbalEngineer/VesselSimulator/SimManager.cs
+++ b/KerbalEngineer/VesselSimulator/SimManager.cs
@@ -10,7 +10,7 @@
 

 namespace KerbalEngineer.VesselSimulator
 {
-    public class SimManager: IUpdatable, IUpdateRequest
+    public class SimManager
     {
         public static SimManager Instance = new SimManager();
         public const double RESOURCE_MIN = 0.0001;
@@ -252,19 +252,6 @@
             }
             return "Undefined";
         }

-

-        public void Update()

-        {

-            TryStartSimulation();

-        }

-

-        public bool UpdateRequested { get; set; }

-

-        public static void RequestUpdate()

-        {

-            RequestSimulation();

-            Instance.UpdateRequested = true;

-        }

     }
 }
 

 Binary files a/Output/KerbalEngineer/KerbalEngineer.dll and b/Output/KerbalEngineer/KerbalEngineer.dll differ