Fixed sim bug and added sim delay readout control.
Fixed sim bug and added sim delay readout control.

--- a/KerbalEngineer/Flight/ActionMenu.cs
+++ b/KerbalEngineer/Flight/ActionMenu.cs
@@ -17,13 +17,12 @@
 //     along with this program.  If not, see <http://www.gnu.org/licenses/>.

 // 

 

-#region

+#region Using Directives

 

 using System.Collections.Generic;

 

 using KerbalEngineer.Flight.Sections;

 using KerbalEngineer.Settings;

-using KerbalEngineer.VesselSimulator;

 

 using UnityEngine;

 

@@ -171,11 +170,8 @@
         private void DrawNewButton()

         {

             GUILayout.BeginHorizontal();

-            GUI.skin = HighLogic.Skin;

-            SimManager.minSimTime = (long)GUILayout.HorizontalSlider(SimManager.minSimTime, 0, 1000.0f);

-            GUI.skin = null;

-

-            if (GUILayout.Button("NEW", this.buttonStyle, GUILayout.Width(50.0f)))

+

+            if (GUILayout.Button("NEW CUSTOM SECTION", this.buttonStyle))

             {

                 SectionLibrary.Instance.CustomSections.Add(new SectionModule

                 {


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

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

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

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

 

             // Rendezvous

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


--- a/KerbalEngineer/Flight/Readouts/Vessel/DeltaVStaged.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/DeltaVStaged.cs
@@ -44,6 +44,11 @@
 

         public override void Draw()

         {

+            if (SimManager.Stages == null)

+            {

+                return;

+            }

+

             var newNumberOfStages = 0;

 

             foreach (var stage in SimManager.Stages)


--- a/KerbalEngineer/Flight/Readouts/Vessel/DeltaVTotal.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/DeltaVTotal.cs
@@ -42,6 +42,11 @@
 

         public override void Draw()

         {

+            if (SimManager.LastStage == null)

+            {

+                return;

+            }

+

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

         }

 


--- a/KerbalEngineer/Flight/Readouts/Vessel/Mass.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/Mass.cs
@@ -43,6 +43,11 @@
 

         public override void Draw()

         {

+            if (SimManager.LastStage == null)

+            {

+                return;

+            }

+

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

         }

 


--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Vessel/SimulationDelay.cs
@@ -1,1 +1,55 @@
-
+// 

+//     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/>.

+// 

+

+#region Using Directives

+

+using KerbalEngineer.VesselSimulator;

+

+using UnityEngine;

+

+#endregion

+

+namespace KerbalEngineer.Flight.Readouts.Vessel

+{

+    public class SimulationDelay : ReadoutModule

+    {

+        public SimulationDelay()

+        {

+            this.Name = "Minimum Simulation Delay";

+            this.Category = ReadoutCategory.Vessel;

+            this.HelpString = "Controls the minimum delay between processing vessel simulations.";

+            this.IsDefault = true;

+        }

+

+        public override void Draw()

+        {

+            if (SimManager.LastStage == null)

+            {

+                return;

+            }

+

+            GUILayout.BeginHorizontal();

+            GUILayout.Label("Sim Delay", this.NameStyle);

+            GUI.skin = HighLogic.Skin;

+            SimManager.minSimTime = (long)GUILayout.HorizontalSlider(SimManager.minSimTime, 0, 1000.0f);

+            GUI.skin = null;

+            GUILayout.EndHorizontal();

+        }

+    }

+}

--- a/KerbalEngineer/Flight/Readouts/Vessel/SpecificImpulse.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/SpecificImpulse.cs
@@ -42,6 +42,11 @@
 

         public override void Draw()

         {

+            if (SimManager.LastStage == null)

+            {

+                return;

+            }

+

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

         }

 


--- a/KerbalEngineer/Flight/Readouts/Vessel/Thrust.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/Thrust.cs
@@ -43,6 +43,11 @@
 

         public override void Draw()

         {

+            if (SimManager.LastStage == null)

+            {

+                return;

+            }

+

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

         }

 


--- a/KerbalEngineer/Flight/Readouts/Vessel/ThrustToWeight.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/ThrustToWeight.cs
@@ -45,6 +45,11 @@
 

         public override void Draw()

         {

+            if (SimManager.LastStage == null)

+            {

+                return;

+            }

+

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


--- a/KerbalEngineer/KerbalEngineer.csproj
+++ b/KerbalEngineer/KerbalEngineer.csproj
@@ -60,6 +60,7 @@
     <Compile Include="Editor\BuildOverlay.cs" />

     <Compile Include="CelestialBodies.cs" />

     <Compile Include="Editor\BuildToolbar.cs" />

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

     <Compile Include="Logger.cs" />

     <Compile Include="EngineerGlobals.cs" />

     <Compile Include="Extensions\DoubleExtensions.cs" />


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

         public static void RequestUpdate()

         {

+            RequestSimulation();

             Instance.UpdateRequested = true;

         }

     }

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