Prp for 1.0.11.0 release.
--- a/Documents/CHANGES.txt
+++ b/Documents/CHANGES.txt
@@ -1,10 +1,21 @@
1.0.11.0
Added: New readouts to the orbital category:
- Current SOI
- - Manoeuver Node DeltaV (Prograde)
- - Manoeuver Node DeltaV (Normal)
- - Manoeuver Node DeltaV (Radial)
- - Manoeuver Node DeltaV (Total)
+ - Manoeuvre Node DeltaV (Prograde)
+ - Manoeuvre Node DeltaV (Normal)
+ - Manoeuvre Node DeltaV (Radial)
+ - Manoeuvre Node DeltaV (Total)
+ - Manoeuvre Node Burn Time
+ - Manoeuvre Node Half Burn Time
+ - Manoeuvre Node Angle to Prograde
+ - Manoeuvre Node Angle to Retrograde
+ - Time to Manoeuvre Node
+ - Time to Manoeuvre Burn
+
+ Added: Readout help strings by ClassyJakey.
+
+ Fixed: Issue with separators in HUDs.
+ Fixed: Issue with HUDs with backgrounds that have no displayed lines.
Padishar's Fixes:
Fixed: Issue with multicouplers when attached to parent by bottom node.
--- a/KerbalEngineer/Flight/Readouts/Miscellaneous/Separator.cs
+++ b/KerbalEngineer/Flight/Readouts/Miscellaneous/Separator.cs
@@ -19,7 +19,10 @@
#region Using Directives
+using System;
+
using KerbalEngineer.Flight.Sections;
+using KerbalEngineer.Helpers;
using UnityEngine;
@@ -31,7 +34,8 @@
{
#region Fields
- private readonly Texture2D texture;
+ private GUIStyle boxStyle;
+ private GUIStyle boxStyleHud;
#endregion
@@ -41,13 +45,13 @@
{
this.Name = "Separator";
this.Category = ReadoutCategory.GetCategory("Miscellaneous");
- this.HelpString = string.Empty;
+ this.HelpString = String.Empty;
this.IsDefault = false;
this.Cloneable = true;
- this.texture = new Texture2D(1, 1, TextureFormat.RGBA32, false);
- this.texture.SetPixel(0, 0, new Color(1.0f, 1.0f, 1.0f, 0.5f));
- this.texture.Apply();
+ this.InitialiseStyles();
+
+ GuiDisplaySize.OnSizeChanged += this.InitialiseStyles;
}
#endregion
@@ -56,8 +60,29 @@
public override void Draw(SectionModule section)
{
- GUILayout.Box(string.Empty, GUIStyle.none, new[] {GUILayout.Width(this.ContentWidth), GUILayout.Height(1.0f)});
- GUI.DrawTexture(GUILayoutUtility.GetLastRect(), this.texture, ScaleMode.StretchToFill);
+ GUILayout.Box(String.Empty, section.IsHud ? this.boxStyleHud : this.boxStyle);
+ }
+
+ #endregion
+
+ #region Methods: private
+
+ private void InitialiseStyles()
+ {
+ this.boxStyle = new GUIStyle
+ {
+ normal =
+ {
+ background = TextureHelper.CreateTextureFromColour(new Color(1.0f, 1.0f, 1.0f, 0.5f))
+ },
+ fixedHeight = 1.0f,
+ stretchWidth = true
+ };
+
+ this.boxStyleHud = new GUIStyle(this.boxStyle)
+ {
+ margin = new RectOffset(0, 0, (int)(8 * GuiDisplaySize.Offset), 0)
+ };
}
#endregion
--- a/KerbalEngineer/Flight/Readouts/Orbital/CurrentSoi.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/CurrentSoi.cs
@@ -31,7 +31,7 @@
public class CurrentSoi : ReadoutModule
{
#region Constructors
-
+
public CurrentSoi()
{
this.Name = "Current SOI";
--- a/KerbalEngineer/Flight/Readouts/Orbital/ManoeuverNode/ManoeuverProcessor.cs
+++ /dev/null
@@ -1,93 +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/>.
-//
-#region Using Directives
-
-using KerbalEngineer.Extensions;
-
-#endregion
-
-namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuverNode
-{
- public class ManoeuverProcessor : IUpdatable, IUpdateRequest
- {
- #region Fields
-
- private static readonly ManoeuverProcessor instance = new ManoeuverProcessor();
-
- #endregion
-
- #region Properties
-
- public static double AngleToPrograde { get; private set; }
-
- public static double AngleToRetrograde { get; private set; }
-
- public static ManoeuverProcessor Instance
- {
- get { return instance; }
- }
-
- public static double NormalDeltaV { get; private set; }
-
- public static double ProgradeDeltaV { get; private set; }
-
- public static double RadialDeltaV { get; private set; }
-
- public static bool ShowDetails { get; set; }
-
- public static double TotalDeltaV { get; private set; }
-
- public static double UniversalTime { get; private set; }
- public bool UpdateRequested { get; set; }
-
- #endregion
-
- #region Methods: public
-
- public static void RequestUpdate()
- {
- instance.UpdateRequested = true;
- }
-
- public void Update()
- {
- if (FlightGlobals.ActiveVessel.patchedConicSolver.maneuverNodes.Count == 0)
- {
- ShowDetails = false;
- return;
- }
-
- var node = FlightGlobals.ActiveVessel.patchedConicSolver.maneuverNodes[0].DeltaV;
-
- ProgradeDeltaV = node.z;
- NormalDeltaV = node.y;
- RadialDeltaV = node.x;
- TotalDeltaV = node.magnitude;
-
- UniversalTime = FlightGlobals.ActiveVessel.patchedConicSolver.maneuverNodes[0].UT;
- AngleToPrograde = FlightGlobals.ActiveVessel.patchedConicSolver.maneuverNodes[0].patch.GetAngleToPrograde(UniversalTime);
- AngleToRetrograde = FlightGlobals.ActiveVessel.patchedConicSolver.maneuverNodes[0].patch.GetAngleToRetrograde(UniversalTime);
-
- ShowDetails = true;
- }
-
- #endregion
- }
-}
--- a/KerbalEngineer/Flight/Readouts/Orbital/ManoeuverNode/NodeAngleToPrograde.cs
+++ /dev/null
@@ -1,69 +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/>.
-//
-#region Using Directives
-
-using System;
-
-using KerbalEngineer.Extensions;
-using KerbalEngineer.Flight.Sections;
-
-#endregion
-
-namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuverNode
-{
- public class NodeAngleToPrograde : ReadoutModule
- {
- #region Constructors
-
- public NodeAngleToPrograde()
- {
- this.Name = "Manoeuver Node Angle to Prograde";
- this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
- this.IsDefault = true;
- }
-
- #endregion
-
- #region Methods: public
-
- public override void Draw(SectionModule section)
- {
- if (!ManoeuverProcessor.ShowDetails)
- {
- return;
- }
-
- this.DrawLine("Node Angle to Prograde", ManoeuverProcessor.AngleToPrograde.ToAngle());
- }
-
- public override void Reset()
- {
- FlightEngineerCore.Instance.AddUpdatable(ManoeuverProcessor.Instance);
- }
-
- public override void Update()
- {
- ManoeuverProcessor.RequestUpdate();
- }
-
- #endregion
- }
-}
--- a/KerbalEngineer/Flight/Readouts/Orbital/ManoeuverNode/NodeAngleToRetrograde.cs
+++ /dev/null
@@ -1,69 +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/>.
-//
-#region Using Directives
-
-using System;
-
-using KerbalEngineer.Extensions;
-using KerbalEngineer.Flight.Sections;
-
-#endregion
-
-namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuverNode
-{
- public class NodeAngleToRetrograde : ReadoutModule
- {
- #region Constructors
-
- public NodeAngleToRetrograde()
- {
- this.Name = "Manoeuver Node Angle to Retrograde";
- this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
- this.IsDefault = true;
- }
-
- #endregion
-
- #region Methods: public
-
- public override void Draw(SectionModule section)
- {
- if (!ManoeuverProcessor.ShowDetails)
- {
- return;
- }
-
- this.DrawLine("Node Angle to Retrograde", ManoeuverProcessor.AngleToRetrograde.ToAngle());
- }
-
- public override void Reset()
- {
- FlightEngineerCore.Instance.AddUpdatable(ManoeuverProcessor.Instance);
- }
-
- public override void Update()
- {
- ManoeuverProcessor.RequestUpdate();
- }
-
- #endregion
- }
-}
--- a/KerbalEngineer/Flight/Readouts/Orbital/ManoeuverNode/NodeNormalDeltaV.cs
+++ /dev/null
@@ -1,69 +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/>.
-//
-#region Using Directives
-
-using System;
-
-using KerbalEngineer.Extensions;
-using KerbalEngineer.Flight.Sections;
-
-#endregion
-
-namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuverNode
-{
- public class NodeNormalDeltaV : ReadoutModule
- {
- #region Constructors
-
- public NodeNormalDeltaV()
- {
- this.Name = "Manoeuver Node DeltaV (Normal)";
- this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
- this.IsDefault = true;
- }
-
- #endregion
-
- #region Methods: public
-
- public override void Draw(SectionModule section)
- {
- if (!ManoeuverProcessor.ShowDetails)
- {
- return;
- }
-
- this.DrawLine("Node DeltaV (Normal)", ManoeuverProcessor.NormalDeltaV.ToSpeed());
- }
-
- public override void Reset()
- {
- FlightEngineerCore.Instance.AddUpdatable(ManoeuverProcessor.Instance);
- }
-
- public override void Update()
- {
- ManoeuverProcessor.RequestUpdate();
- }
-
- #endregion
- }
-}
--- a/KerbalEngineer/Flight/Readouts/Orbital/ManoeuverNode/NodeProgradeDeltaV.cs
+++ /dev/null
@@ -1,69 +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/>.
-//
-#region Using Directives
-
-using System;
-
-using KerbalEngineer.Extensions;
-using KerbalEngineer.Flight.Sections;
-
-#endregion
-
-namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuverNode
-{
- public class NodeProgradeDeltaV : ReadoutModule
- {
- #region Constructors
-
- public NodeProgradeDeltaV()
- {
- this.Name = "Manoeuver Node DeltaV (Prograde)";
- this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
- this.IsDefault = true;
- }
-
- #endregion
-
- #region Methods: public
-
- public override void Draw(SectionModule section)
- {
- if (!ManoeuverProcessor.ShowDetails)
- {
- return;
- }
-
- this.DrawLine("Node DeltaV (Prograde)", ManoeuverProcessor.ProgradeDeltaV.ToSpeed());
- }
-
- public override void Reset()
- {
- FlightEngineerCore.Instance.AddUpdatable(ManoeuverProcessor.Instance);
- }
-
- public override void Update()
- {
- ManoeuverProcessor.RequestUpdate();
- }
-
- #endregion
- }
-}
--- a/KerbalEngineer/Flight/Readouts/Orbital/ManoeuverNode/NodeRadialDeltaV.cs
+++ /dev/null
@@ -1,69 +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/>.
-//
-#region Using Directives
-
-using System;
-
-using KerbalEngineer.Extensions;
-using KerbalEngineer.Flight.Sections;
-
-#endregion
-
-namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuverNode
-{
- public class NodeRadialDeltaV : ReadoutModule
- {
- #region Constructors
-
- public NodeRadialDeltaV()
- {
- this.Name = "Manoeuver Node DeltaV (Radial)";
- this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
- this.IsDefault = true;
- }
-
- #endregion
-
- #region Methods: public
-
- public override void Draw(SectionModule section)
- {
- if (!ManoeuverProcessor.ShowDetails)
- {
- return;
- }
-
- this.DrawLine("Node DeltaV (Radial)", ManoeuverProcessor.RadialDeltaV.ToSpeed());
- }
-
- public override void Reset()
- {
- FlightEngineerCore.Instance.AddUpdatable(ManoeuverProcessor.Instance);
- }
-
- public override void Update()
- {
- ManoeuverProcessor.RequestUpdate();
- }
-
- #endregion
- }
-}
--- a/KerbalEngineer/Flight/Readouts/Orbital/ManoeuverNode/NodeTotalDeltaV.cs
+++ /dev/null
@@ -1,69 +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/>.
-//
-#region Using Directives
-
-using System;
-
-using KerbalEngineer.Extensions;
-using KerbalEngineer.Flight.Sections;
-
-#endregion
-
-namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuverNode
-{
- public class NodeTotalDeltaV : ReadoutModule
- {
- #region Constructors
-
- public NodeTotalDeltaV()
- {
- this.Name = "Manoeuver Node DeltaV (Total)";
- this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
- this.IsDefault = true;
- }
-
- #endregion
-
- #region Methods: public
-
- public override void Draw(SectionModule section)
- {
- if (!ManoeuverProcessor.ShowDetails)
- {
- return;
- }
-
- this.DrawLine("Node DeltaV (Total)", ManoeuverProcessor.TotalDeltaV.ToSpeed());
- }
-
- public override void Reset()
- {
- FlightEngineerCore.Instance.AddUpdatable(ManoeuverProcessor.Instance);
- }
-
- public override void Update()
- {
- ManoeuverProcessor.RequestUpdate();
- }
-
- #endregion
- }
-}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/ManoeuvreProcessor.cs
@@ -1,1 +1,180 @@
+//
+// 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 System;
+
+using KerbalEngineer.Extensions;
+using KerbalEngineer.Flight.Readouts.Vessel;
+
+using UnityEngine;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuvreNode
+{
+ public class ManoeuvreProcessor : IUpdatable, IUpdateRequest
+ {
+ #region Fields
+
+ private static readonly ManoeuvreProcessor instance = new ManoeuvreProcessor();
+
+ #endregion
+
+ #region Properties
+
+ public static double AngleToPrograde { get; private set; }
+
+ public static double AngleToRetrograde { get; private set; }
+
+ public static double AvailableDeltaV { get; private set; }
+
+ public static double BurnTime { get; private set; }
+ public static int FinalStage { get; private set; }
+
+ public static double HalfBurnTime { get; private set; }
+
+ public static bool HasDeltaV { get; private set; }
+
+ public static ManoeuvreProcessor Instance
+ {
+ get { return instance; }
+ }
+
+ public static double NormalDeltaV { get; private set; }
+
+ public static double ProgradeDeltaV { get; private set; }
+
+ public static double RadialDeltaV { get; private set; }
+
+ public static bool ShowDetails { get; set; }
+
+ public static double TotalDeltaV { get; private set; }
+
+ public static double UniversalTime { get; private set; }
+
+ public bool UpdateRequested { get; set; }
+
+ #endregion
+
+ #region Methods: public
+
+ public static void RequestUpdate()
+ {
+ instance.UpdateRequested = true;
+ SimulationProcessor.RequestUpdate();
+ }
+
+ public static void Reset()
+ {
+ FlightEngineerCore.Instance.AddUpdatable(SimulationProcessor.Instance);
+ FlightEngineerCore.Instance.AddUpdatable(instance);
+ }
+
+ public void Update()
+ {
+ if (FlightGlobals.ActiveVessel.patchedConicSolver.maneuverNodes.Count == 0 || !SimulationProcessor.ShowDetails)
+ {
+ ShowDetails = false;
+ return;
+ }
+
+ var node = FlightGlobals.ActiveVessel.patchedConicSolver.maneuverNodes[0];
+ var deltaV = node.DeltaV;
+
+ ProgradeDeltaV = deltaV.z;
+ NormalDeltaV = deltaV.y;
+ RadialDeltaV = deltaV.x;
+ TotalDeltaV = node.GetBurnVector(FlightGlobals.ship_orbit).magnitude;
+
+ UniversalTime = FlightGlobals.ActiveVessel.patchedConicSolver.maneuverNodes[0].UT;
+ AngleToPrograde = FlightGlobals.ActiveVessel.patchedConicSolver.maneuverNodes[0].patch.GetAngleToPrograde(UniversalTime);
+ AngleToRetrograde = FlightGlobals.ActiveVessel.patchedConicSolver.maneuverNodes[0].patch.GetAngleToRetrograde(UniversalTime);
+
+ var burnTime = 0.0;
+ var midPointTime = 0.0;
+ HasDeltaV = GetBurnTime((float)TotalDeltaV, ref burnTime, ref midPointTime);
+ AvailableDeltaV = SimulationProcessor.LastStage.totalDeltaV;
+
+ BurnTime = burnTime;
+ HalfBurnTime = midPointTime;
+
+ ShowDetails = true;
+ }
+
+ #endregion
+
+ #region Methods: private
+
+ private static bool GetBurnTime(float deltaV, ref double burnTime, ref double midPointTime)
+ {
+ var setMidPoint = false;
+ var deltaVMidPoint = deltaV * 0.5f;
+
+ for (var i = SimulationProcessor.Stages.Length - 1; i >= 0; i--)
+ {
+ var stage = SimulationProcessor.Stages[i];
+ var stageDeltaV = (float)stage.deltaV;
+
+ ProcessStageDrain:
+ if (deltaV <= Single.Epsilon)
+ {
+ FinalStage = ++i;
+ return true;
+ }
+ if (stageDeltaV <= Single.Epsilon)
+ {
+ continue;
+ }
+
+ float deltaVDrain;
+ if (deltaVMidPoint > 0.0)
+ {
+ deltaVDrain = Mathf.Clamp(deltaV, 0.0f, Mathf.Clamp(deltaVMidPoint, 0.0f, stageDeltaV));
+ deltaVMidPoint -= deltaVDrain;
+ setMidPoint = deltaVMidPoint <= Single.Epsilon;
+ }
+ else
+ {
+ deltaVDrain = Mathf.Clamp(deltaV, 0.0f, stageDeltaV);
+ }
+
+ var startMass = stage.totalMass - (stage.resourceMass * (1.0f - (stageDeltaV / stage.deltaV)));
+ var endMass = startMass - (stage.resourceMass * (deltaVDrain / stageDeltaV));
+ var minimumAcceleration = stage.thrust / startMass;
+ var maximumAcceleration = stage.thrust / endMass;
+
+ burnTime += deltaVDrain / ((minimumAcceleration + maximumAcceleration) * 0.5);
+ deltaV -= deltaVDrain;
+ stageDeltaV -= deltaVDrain;
+
+ if (setMidPoint)
+ {
+ midPointTime = burnTime;
+ setMidPoint = false;
+ goto ProcessStageDrain;
+ }
+ }
+ return false;
+ }
+
+ #endregion
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeAngleToPrograde.cs
@@ -1,1 +1,69 @@
+//
+// 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 System;
+
+using KerbalEngineer.Extensions;
+using KerbalEngineer.Flight.Sections;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuvreNode
+{
+ public class NodeAngleToPrograde : ReadoutModule
+ {
+ #region Constructors
+
+ public NodeAngleToPrograde()
+ {
+ this.Name = "Manoeuvre Node Angle to Prograde";
+ this.Category = ReadoutCategory.GetCategory("Orbital");
+ this.HelpString = String.Empty;
+ this.IsDefault = true;
+ }
+
+ #endregion
+
+ #region Methods: public
+
+ public override void Draw(SectionModule section)
+ {
+ if (!ManoeuvreProcessor.ShowDetails)
+ {
+ return;
+ }
+
+ this.DrawLine("Node Angle to Prograde", ManoeuvreProcessor.AngleToPrograde.ToAngle(), section.IsHud);
+ }
+
+ public override void Reset()
+ {
+ ManoeuvreProcessor.Reset();
+ }
+
+ public override void Update()
+ {
+ ManoeuvreProcessor.RequestUpdate();
+ }
+
+ #endregion
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeAngleToRetrograde.cs
@@ -1,1 +1,69 @@
+//
+// 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 System;
+
+using KerbalEngineer.Extensions;
+using KerbalEngineer.Flight.Sections;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuvreNode
+{
+ public class NodeAngleToRetrograde : ReadoutModule
+ {
+ #region Constructors
+
+ public NodeAngleToRetrograde()
+ {
+ this.Name = "Manoeuvre Node Angle to Retrograde";
+ this.Category = ReadoutCategory.GetCategory("Orbital");
+ this.HelpString = String.Empty;
+ this.IsDefault = true;
+ }
+
+ #endregion
+
+ #region Methods: public
+
+ public override void Draw(SectionModule section)
+ {
+ if (!ManoeuvreProcessor.ShowDetails)
+ {
+ return;
+ }
+
+ this.DrawLine("Node Angle to Retrograde", ManoeuvreProcessor.AngleToRetrograde.ToAngle(), section.IsHud);
+ }
+
+ public override void Reset()
+ {
+ ManoeuvreProcessor.Reset();
+ }
+
+ public override void Update()
+ {
+ ManoeuvreProcessor.RequestUpdate();
+ }
+
+ #endregion
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeBurnTime.cs
@@ -1,1 +1,69 @@
+//
+// 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 System;
+
+using KerbalEngineer.Flight.Sections;
+using KerbalEngineer.Helpers;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuvreNode
+{
+ public class NodeBurnTime : ReadoutModule
+ {
+ #region Constructors
+
+ public NodeBurnTime()
+ {
+ this.Name = "Manoeuvre Node Burn Time";
+ this.Category = ReadoutCategory.GetCategory("Orbital");
+ this.HelpString = String.Empty;
+ this.IsDefault = true;
+ }
+
+ #endregion
+
+ #region Methods: public
+
+ public override void Draw(SectionModule section)
+ {
+ if (!ManoeuvreProcessor.ShowDetails)
+ {
+ return;
+ }
+
+ this.DrawLine("Node Burn Time", TimeFormatter.ConvertToString(ManoeuvreProcessor.BurnTime), section.IsHud);
+ }
+
+ public override void Reset()
+ {
+ ManoeuvreProcessor.Reset();
+ }
+
+ public override void Update()
+ {
+ ManoeuvreProcessor.RequestUpdate();
+ }
+
+ #endregion
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeHalfBurnTime.cs
@@ -1,1 +1,69 @@
+//
+// 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 System;
+
+using KerbalEngineer.Flight.Sections;
+using KerbalEngineer.Helpers;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuvreNode
+{
+ public class NodeHalfBurnTime : ReadoutModule
+ {
+ #region Constructors
+
+ public NodeHalfBurnTime()
+ {
+ this.Name = "Manoeuvre Node Half Burn Time";
+ this.Category = ReadoutCategory.GetCategory("Orbital");
+ this.HelpString = String.Empty;
+ this.IsDefault = true;
+ }
+
+ #endregion
+
+ #region Methods: public
+
+ public override void Draw(SectionModule section)
+ {
+ if (!ManoeuvreProcessor.ShowDetails)
+ {
+ return;
+ }
+
+ this.DrawLine("Node Burn Time (½)", TimeFormatter.ConvertToString(ManoeuvreProcessor.HalfBurnTime), section.IsHud);
+ }
+
+ public override void Reset()
+ {
+ ManoeuvreProcessor.Reset();
+ }
+
+ public override void Update()
+ {
+ ManoeuvreProcessor.RequestUpdate();
+ }
+
+ #endregion
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeNormalDeltaV.cs
@@ -1,1 +1,69 @@
+//
+// 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 System;
+
+using KerbalEngineer.Extensions;
+using KerbalEngineer.Flight.Sections;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuvreNode
+{
+ public class NodeNormalDeltaV : ReadoutModule
+ {
+ #region Constructors
+
+ public NodeNormalDeltaV()
+ {
+ this.Name = "Manoeuvre Node DeltaV (Normal)";
+ this.Category = ReadoutCategory.GetCategory("Orbital");
+ this.HelpString = String.Empty;
+ this.IsDefault = true;
+ }
+
+ #endregion
+
+ #region Methods: public
+
+ public override void Draw(SectionModule section)
+ {
+ if (!ManoeuvreProcessor.ShowDetails)
+ {
+ return;
+ }
+
+ this.DrawLine("Node DeltaV (Normal)", ManoeuvreProcessor.NormalDeltaV.ToSpeed(), section.IsHud);
+ }
+
+ public override void Reset()
+ {
+ ManoeuvreProcessor.Reset();
+ }
+
+ public override void Update()
+ {
+ ManoeuvreProcessor.RequestUpdate();
+ }
+
+ #endregion
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeProgradeDeltaV.cs
@@ -1,1 +1,69 @@
+//
+// 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 System;
+
+using KerbalEngineer.Extensions;
+using KerbalEngineer.Flight.Sections;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuvreNode
+{
+ public class NodeProgradeDeltaV : ReadoutModule
+ {
+ #region Constructors
+
+ public NodeProgradeDeltaV()
+ {
+ this.Name = "Manoeuvre Node DeltaV (Prograde)";
+ this.Category = ReadoutCategory.GetCategory("Orbital");
+ this.HelpString = String.Empty;
+ this.IsDefault = true;
+ }
+
+ #endregion
+
+ #region Methods: public
+
+ public override void Draw(SectionModule section)
+ {
+ if (!ManoeuvreProcessor.ShowDetails)
+ {
+ return;
+ }
+
+ this.DrawLine("Node DeltaV (Prograde)", ManoeuvreProcessor.ProgradeDeltaV.ToSpeed(), section.IsHud);
+ }
+
+ public override void Reset()
+ {
+ ManoeuvreProcessor.Reset();
+ }
+
+ public override void Update()
+ {
+ ManoeuvreProcessor.RequestUpdate();
+ }
+
+ #endregion
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeRadialDeltaV.cs
@@ -1,1 +1,69 @@
+//
+// 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 System;
+
+using KerbalEngineer.Extensions;
+using KerbalEngineer.Flight.Sections;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuvreNode
+{
+ public class NodeRadialDeltaV : ReadoutModule
+ {
+ #region Constructors
+
+ public NodeRadialDeltaV()
+ {
+ this.Name = "Manoeuvre Node DeltaV (Radial)";
+ this.Category = ReadoutCategory.GetCategory("Orbital");
+ this.HelpString = String.Empty;
+ this.IsDefault = true;
+ }
+
+ #endregion
+
+ #region Methods: public
+
+ public override void Draw(SectionModule section)
+ {
+ if (!ManoeuvreProcessor.ShowDetails)
+ {
+ return;
+ }
+
+ this.DrawLine("Node DeltaV (Radial)", ManoeuvreProcessor.RadialDeltaV.ToSpeed(), section.IsHud);
+ }
+
+ public override void Reset()
+ {
+ ManoeuvreProcessor.Reset();
+ }
+
+ public override void Update()
+ {
+ ManoeuvreProcessor.RequestUpdate();
+ }
+
+ #endregion
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeTimeToHalfBurn.cs
@@ -1,1 +1,69 @@
+//
+// 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 System;
+
+using KerbalEngineer.Flight.Sections;
+using KerbalEngineer.Helpers;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuvreNode
+{
+ public class NodeTimeToHalfBurn : ReadoutModule
+ {
+ #region Constructors
+
+ public NodeTimeToHalfBurn()
+ {
+ this.Name = "Time to Manoeuvre Burn";
+ this.Category = ReadoutCategory.GetCategory("Orbital");
+ this.HelpString = String.Empty;
+ this.IsDefault = true;
+ }
+
+ #endregion
+
+ #region Methods: public
+
+ public override void Draw(SectionModule section)
+ {
+ if (!ManoeuvreProcessor.ShowDetails)
+ {
+ return;
+ }
+
+ this.DrawLine("Time to Node Burn", TimeFormatter.ConvertToString(ManoeuvreProcessor.UniversalTime - ManoeuvreProcessor.HalfBurnTime - Planetarium.GetUniversalTime()), section.IsHud);
+ }
+
+ public override void Reset()
+ {
+ ManoeuvreProcessor.Reset();
+ }
+
+ public override void Update()
+ {
+ ManoeuvreProcessor.RequestUpdate();
+ }
+
+ #endregion
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeTimeToManoeuvre.cs
@@ -1,1 +1,69 @@
+//
+// 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 System;
+
+using KerbalEngineer.Flight.Sections;
+using KerbalEngineer.Helpers;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuvreNode
+{
+ public class NodeTimeToManoeuvre : ReadoutModule
+ {
+ #region Constructors
+
+ public NodeTimeToManoeuvre()
+ {
+ this.Name = "Time to Manoeuvre Node";
+ this.Category = ReadoutCategory.GetCategory("Orbital");
+ this.HelpString = String.Empty;
+ this.IsDefault = true;
+ }
+
+ #endregion
+
+ #region Methods: public
+
+ public override void Draw(SectionModule section)
+ {
+ if (!ManoeuvreProcessor.ShowDetails)
+ {
+ return;
+ }
+
+ this.DrawLine("Time to Node", TimeFormatter.ConvertToString(ManoeuvreProcessor.UniversalTime - Planetarium.GetUniversalTime()), section.IsHud);
+ }
+
+ public override void Reset()
+ {
+ ManoeuvreProcessor.Reset();
+ }
+
+ public override void Update()
+ {
+ ManoeuvreProcessor.RequestUpdate();
+ }
+
+ #endregion
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeTotalDeltaV.cs
@@ -1,1 +1,69 @@
+//
+// 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 System;
+
+using KerbalEngineer.Extensions;
+using KerbalEngineer.Flight.Sections;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuvreNode
+{
+ public class NodeTotalDeltaV : ReadoutModule
+ {
+ #region Constructors
+
+ public NodeTotalDeltaV()
+ {
+ this.Name = "Manoeuvre Node DeltaV (Total)";
+ this.Category = ReadoutCategory.GetCategory("Orbital");
+ this.HelpString = String.Empty;
+ this.IsDefault = true;
+ }
+
+ #endregion
+
+ #region Methods: public
+
+ public override void Draw(SectionModule section)
+ {
+ if (!ManoeuvreProcessor.ShowDetails)
+ {
+ return;
+ }
+
+ this.DrawLine("Node DeltaV (Total)", ManoeuvreProcessor.TotalDeltaV.ToSpeed() + " (" + (ManoeuvreProcessor.HasDeltaV ? "S" + ManoeuvreProcessor.FinalStage : "X") + ")", section.IsHud);
+ }
+
+ public override void Reset()
+ {
+ ManoeuvreProcessor.Reset();
+ }
+
+ public override void Update()
+ {
+ ManoeuvreProcessor.RequestUpdate();
+ }
+
+ #endregion
+ }
+}
--- a/KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs
+++ b/KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs
@@ -25,7 +25,7 @@
using KerbalEngineer.Flight.Readouts.Miscellaneous;
using KerbalEngineer.Flight.Readouts.Orbital;
-using KerbalEngineer.Flight.Readouts.Orbital.ManoeuverNode;
+using KerbalEngineer.Flight.Readouts.Orbital.ManoeuvreNode;
using KerbalEngineer.Flight.Readouts.Rendezvous;
using KerbalEngineer.Flight.Readouts.Surface;
using KerbalEngineer.Flight.Readouts.Vessel;
@@ -95,6 +95,10 @@
readouts.Add(new NodeNormalDeltaV());
readouts.Add(new NodeRadialDeltaV());
readouts.Add(new NodeTotalDeltaV());
+ readouts.Add(new NodeBurnTime());
+ readouts.Add(new NodeHalfBurnTime());
+ readouts.Add(new NodeTimeToManoeuvre());
+ readouts.Add(new NodeTimeToHalfBurn());
readouts.Add(new NodeAngleToPrograde());
readouts.Add(new NodeAngleToRetrograde());
--- a/KerbalEngineer/Flight/Readouts/ReadoutModule.cs
+++ b/KerbalEngineer/Flight/Readouts/ReadoutModule.cs
@@ -89,6 +89,11 @@
public bool IsDefault { get; set; }
/// <summary>
+ /// Gets the number of drawn lines.
+ /// </summary>
+ public int LineCount { get; private set; }
+
+ /// <summary>
/// Gets and sets the message style.
/// </summary>
public GUIStyle MessageStyle { get; set; }
@@ -139,6 +144,7 @@
public void LineCountEnd()
{
+ this.LineCount = this.lineCountEnd;
if (this.lineCountEnd.CompareTo(this.lineCountStart) < 0)
{
this.ResizeRequested = true;
--- a/KerbalEngineer/Flight/Readouts/Vessel/SimulationProcessor.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/SimulationProcessor.cs
@@ -82,6 +82,7 @@
public void Update()
{
SimManager.RequestSimulation();
+ SimManager.TryStartSimulation();
if (!SimManager.ResultsReady())
{
@@ -103,9 +104,9 @@
FlightGlobals.ActiveVessel.mainBody.GetAltitude(FlightGlobals.ActiveVessel.CoM), 2);
SimManager.Velocity = FlightGlobals.ActiveVessel.srfSpeed;
}
+
// Cybutek: We should be allowing this to be set too but not sure where you want to put the control
//SimManager.vectoredThrust = vectoredThrust;
- SimManager.TryStartSimulation();
}
#endregion
--- a/KerbalEngineer/Flight/Sections/SectionModule.cs
+++ b/KerbalEngineer/Flight/Sections/SectionModule.cs
@@ -168,6 +168,11 @@
public bool IsVisible { get; set; }
/// <summary>
+ /// Gets the number of drawn readout lines.
+ /// </summary>
+ public int LineCount { get; private set; }
+
+ /// <summary>
/// Gets and sets the name of the section.
/// </summary>
public string Name { get; set; }
@@ -351,6 +356,7 @@
GUILayout.BeginVertical(this.boxStyle);
}
+ this.LineCount = 0;
if (this.ReadoutModules.Count > 0)
{
foreach (var readout in this.ReadoutModules)
@@ -358,11 +364,13 @@
readout.LineCountStart();
readout.Draw(this);
readout.LineCountEnd();
+ this.LineCount += readout.LineCount;
}
}
else
{
GUILayout.Label("No readouts are installed.", this.messageStyle);
+ this.LineCount = 1;
}
if (!this.IsHud)
--- a/KerbalEngineer/Flight/Sections/SectionWindow.cs
+++ b/KerbalEngineer/Flight/Sections/SectionWindow.cs
@@ -60,8 +60,8 @@
#region Fields
+ private GUIStyle hudWindowBgStyle;
private GUIStyle hudWindowStyle;
- private GUIStyle hudWindowBgStyle;
private GUIStyle windowStyle;
#endregion
@@ -130,9 +130,11 @@
this.resizeRequested = false;
}
GUI.skin = null;
- this.windowPosition = GUILayout.Window(this.windowId, this.windowPosition, this.Window, string.Empty,
- (!this.ParentSection.IsHud || this.ParentSection.IsEditorVisible) ? this.windowStyle
- : this.ParentSection.IsHudBackground ? this.hudWindowBgStyle : this.hudWindowStyle).ClampToScreen();
+ this.windowPosition = GUILayout.Window(this.windowId, this.windowPosition, this.Window, string.Empty,
+ (!this.ParentSection.IsHud || this.ParentSection.IsEditorVisible) ? this.windowStyle
+ : this.ParentSection.IsHudBackground && this.ParentSection.LineCount > 0
+ ? this.hudWindowBgStyle
+ : this.hudWindowStyle).ClampToScreen();
this.ParentSection.FloatingPositionX = this.windowPosition.x;
this.ParentSection.FloatingPositionY = this.windowPosition.y;
}
--- a/KerbalEngineer/KerbalEngineer.csproj
+++ b/KerbalEngineer/KerbalEngineer.csproj
@@ -58,13 +58,17 @@
<Compile Include="Flight\Readouts\Orbital\AngleToEquatorialAscendingNode.cs" />
<Compile Include="Flight\Readouts\Orbital\AngleToRetrograde.cs" />
<Compile Include="Flight\Readouts\Orbital\AngleToPrograde.cs" />
- <Compile Include="Flight\Readouts\Orbital\ManoeuverNode\ManoeuverProcessor.cs" />
- <Compile Include="Flight\Readouts\Orbital\ManoeuverNode\NodeAngleToRetrograde.cs" />
- <Compile Include="Flight\Readouts\Orbital\ManoeuverNode\NodeNormalDeltaV.cs" />
- <Compile Include="Flight\Readouts\Orbital\ManoeuverNode\NodeAngleToPrograde.cs" />
- <Compile Include="Flight\Readouts\Orbital\ManoeuverNode\NodeTotalDeltaV.cs" />
- <Compile Include="Flight\Readouts\Orbital\ManoeuverNode\NodeRadialDeltaV.cs" />
- <Compile Include="Flight\Readouts\Orbital\ManoeuverNode\NodeProgradeDeltaV.cs" />
+ <Compile Include="Flight\Readouts\Orbital\ManoeuvreNode\NodeRadialDeltaV.cs" />
+ <Compile Include="Flight\Readouts\Orbital\ManoeuvreNode\ManoeuvreProcessor.cs" />
+ <Compile Include="Flight\Readouts\Orbital\ManoeuvreNode\NodeTimeToHalfBurn.cs" />
+ <Compile Include="Flight\Readouts\Orbital\ManoeuvreNode\NodeTimeToManoeuvre.cs" />
+ <Compile Include="Flight\Readouts\Orbital\ManoeuvreNode\NodeHalfBurnTime.cs" />
+ <Compile Include="Flight\Readouts\Orbital\ManoeuvreNode\NodeBurnTime.cs" />
+ <Compile Include="Flight\Readouts\Orbital\ManoeuvreNode\NodeAngleToRetrograde.cs" />
+ <Compile Include="Flight\Readouts\Orbital\ManoeuvreNode\NodeNormalDeltaV.cs" />
+ <Compile Include="Flight\Readouts\Orbital\ManoeuvreNode\NodeAngleToPrograde.cs" />
+ <Compile Include="Flight\Readouts\Orbital\ManoeuvreNode\NodeTotalDeltaV.cs" />
+ <Compile Include="Flight\Readouts\Orbital\ManoeuvreNode\NodeProgradeDeltaV.cs" />
<Compile Include="Flight\Readouts\Orbital\MeanAnomaly.cs" />
<Compile Include="Flight\Readouts\Orbital\EccentricAnomaly.cs" />
<Compile Include="Flight\Readouts\Orbital\ArgumentOfPeriapsis.cs" />
--- a/KerbalEngineer/VesselSimulator/Simulation.cs
+++ b/KerbalEngineer/VesselSimulator/Simulation.cs
@@ -344,6 +344,7 @@
// Create the array of stages that will be returned
Stage[] stages = new Stage[this.currentStage + 1];
+
// Loop through the stages
while (this.currentStage >= 0)
{
@@ -495,6 +496,7 @@
// Store the magnitude of the deltaV vector
stage.deltaV = this.vecStageDeltaV.magnitude;
+ stage.resourceMass = this.stepStartMass - this.stepEndMass;
// Recalculate effective stage isp from the stage deltaV (flip the standard deltaV calculation around)
// Note: If the mass doesn't change then this is a divide by zero
--- a/KerbalEngineer/VesselSimulator/Stage.cs
+++ b/KerbalEngineer/VesselSimulator/Stage.cs
@@ -46,6 +46,7 @@
public double totalMass = 0f;
public double totalTime = 0f;
public int partCount = 0;
+ public double resourceMass = 0.0;
public void Dump()
{
Binary files a/Output/KerbalEngineer/KerbalEngineer.dll and b/Output/KerbalEngineer/KerbalEngineer.dll differ
--- /dev/null
+++ b/Output/KerbalEngineer/Settings/HelpStrings.xml
@@ -1,1 +1,319 @@
-
+<?xml version="1.0" encoding="utf-8"?>
+<ArrayOfSettingItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <SettingItem>
+ <Name>Orbital.ApoapsisHeight</Name>
+ <Value xsi:type="string">Shows the vessel's apoapsis height relative to sea level. (Apoapsis is the highest point of an orbit.)</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.PeriapsisHeight</Name>
+ <Value xsi:type="string">Shows the vessel's periapsis height relative to sea level. (Periapsis is the lowest point of an orbit.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.TimeToApoapsis</Name>
+ <Value xsi:type="string">Shows the time until the vessel reaches apoapsis, the highest point of the orbit.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.TimeToPeriapsis</Name>
+ <Value xsi:type="string">Shows the time until the vessel reaches periapsis, the lowest point of the orbit.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.Inclination</Name>
+ <Value xsi:type="string">Shows the vessel's orbital inclination.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.TimeToEquatorialAscendingNode</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.TimeToEquatorialDescendingNode</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.AngleToEquatorialAscendingNode</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.AngleToEquatorialDescendingNode</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.Eccentricity</Name>
+ <Value xsi:type="string">Shows the vessel's orbital eccentricity.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.OrbitalSpeed</Name>
+ <Value xsi:type="string">Shows the vessel's orbital speed.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.OrbitalPeriod</Name>
+ <Value xsi:type="string">Shows the amount of time it will take to complete a full orbit.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.LongitudeOfAscendingNode</Name>
+ <Value xsi:type="string">Shows the vessel's longitude of the ascending node.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.LongitudeOfPeriapsis</Name>
+ <Value xsi:type="string">Shows the vessel's longitude of periapsis.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.ArgumentOfPeriapsis</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.TrueAnomaly</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.MeanAnomaly</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.EccentricAnomaly</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.SemiMajorAxis</Name>
+ <Value xsi:type="string">Shows the distance from the centre of an orbit to the farthest edge.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.SemiMinorAxis</Name>
+ <Value xsi:type="string">Shows the distance from the centre of an orbit to the nearest edge.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.AngleToPrograde</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Orbital.AngleToRetrograde</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Surface.AltitudeSeaLevel</Name>
+ <Value xsi:type="string">Shows the vessel's altitude above sea level.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Surface.AltitudeTerrain</Name>
+ <Value xsi:type="string">Shows the vessel's altitude above the terrain.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Surface.VerticalSpeed</Name>
+ <Value xsi:type="string">Shows the vessel's vertical speed up and down.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Surface.VerticalAcceleration</Name>
+ <Value xsi:type="string">Shows the vessel's vertical acceleration up and down.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Surface.HorizontalSpeed</Name>
+ <Value xsi:type="string">Shows the vessel's horizontal speed across a celestial body's surface.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Surface.HorizontalAcceleration</Name>
+ <Value xsi:type="string">Shows the vessel's horizontal acceleration across a celestial body's surface.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Surface.Latitude</Name>
+ <Value xsi:type="string">Shows the vessel's latitude position around the celestial body. Latitude is the angle from the equator to poles.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Surface.Longitude</Name>
+ <Value xsi:type="string">Shows the vessel's longitude around a celestial body. Longitude is the angle from the bodies prime meridian.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Surface.GeeForce</Name>
+ <Value xsi:type="string">Shows the current g-force and maximum g-force experienced.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Surface.TerminalVelocity</Name>
+ <Value xsi:type="string">Shows the velocity where the efforts of thrust and drag are equalled out.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Surface.AtmosphericEfficiency</Name>
+ <Value xsi:type="string">Shows you vessel's efficiency as a ratio of the current velocity and terminal velocity. Less than 1 means that you are losing efficiency due to gravity and greater than 1 is due to drag.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Surface.Biome</Name>
+ <Value xsi:type="string">Shows the biome which the vessel is currently flying over.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Surface.Slope</Name>
+ <Value xsi:type="string">Shows the slope of the terrain below your vessel.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Surface.ImpactTime</Name>
+ <Value xsi:type="string">Shows how much time until your ship impacts the surface.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Surface.ImpactLongitude</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Surface.ImpactLatitude</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Surface.ImpactAltitude</Name>
+ <Value xsi:type="string">The altitude of which you will impact the surface.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Surface.ImpactBiome</Name>
+ <Value xsi:type="string">Shows the biome you will impact in.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Vessel.DeltaVStaged</Name>
+ <Value xsi:type="string">Shows the vessel's delta velocity for each stage.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Vessel.DeltaVCurrent</Name>
+ <Value xsi:type="string">Shows the vessel's current stage delta velocity.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Vessel.DeltaVTotal</Name>
+ <Value xsi:type="string">Shows the vessel's total delta velocity.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Vessel.SpecificImpulse</Name>
+ <Value xsi:type="string">The ISP of your vessel.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Vessel.Mass</Name>
+ <Value xsi:type="string">The total mass of your vessel.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Vessel.Thrust</Name>
+ <Value xsi:type="string">The thrust of your vessel.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Vessel.ThrustToWeight</Name>
+ <Value xsi:type="string">Shows the vessel's actual and total thrust to weight ratio.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Vessel.SurfaceThrustToWeight</Name>
+ <Value xsi:type="string">Shows the vessel's surface thrust to weight ratio.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Vessel.Acceleration</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Vessel.SuicideBurnAltitude</Name>
+ <Value xsi:type="string">Shows the altitude when to start a suicide burn.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Vessel.SuicideBurnDistance</Name>
+ <Value xsi:type="string">Shows the distance to the point at which to start a suicide burn.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Vessel.SuicideBurnDeltaV</Name>
+ <Value xsi:type="string">Shows the DeltaV of a suicide burn.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Vessel.IntakeAirUsage</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Vessel.IntakeAirDemand</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Vessel.IntakeAirSupply</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Vessel.IntakeAirDemandSupply</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.TargetSelector</Name>
+ <Value xsi:type="string">A tool to allow easy browsing, searching and selection of targets.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.PhaseAngle</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.InterceptAngle</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.RelativeVelocity</Name>
+ <Value xsi:type="string">Shows the relative velocity between your vessel and the target object.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.RelativeSpeed</Name>
+ <Value xsi:type="string">Shows the difference in orbital speed between your vessel and the target object.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.RelativeInclination</Name>
+ <Value xsi:type="string">Shows the relative inclination between your vessel and the target object.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.TimeToRelativeAscendingNode</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.TimeToRelativeDescendingNode</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.AngleToRelativeAscendingNode</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.AngleToRelativeDescendingNode</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.AltitudeSeaLevel</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.ApoapsisHeight</Name>
+ <Value xsi:type="string">Shows the altitude of your apoapsis</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.PeriapsisHeight</Name>
+ <Value xsi:type="string">Shows the altitude of your periapsis</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.TimeToApoapsis</Name>
+ <Value xsi:type="string">The time until you reach your apoapsis</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.TimeToPeriapsis</Name>
+ <Value xsi:type="string">The time until you reach your periapsis</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.Distance</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.OrbitalPeriod</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.SemiMajorAxis</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Rendezvous.SemiMinorAxis</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Miscellaneous.Separator</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Miscellaneous.GuiSizeAdjustor</Name>
+ <Value xsi:type="string">Shows a control that will allow you to adjust the GUI size.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Miscellaneous.SimulationDelay</Name>
+ <Value xsi:type="string">Controls the minimum delay between processing vessel simulations.</Value>
+ </SettingItem>
+ <SettingItem>
+ <Name>Miscellaneous.TimeReference</Name>
+ <Value xsi:type="string"></Value>
+ </SettingItem>
+</ArrayOfSettingItem>