private void SetVesselInfo() { SimManager.Gravity = CelestialBodies.SelectedBody.Gravity; if (BuildAdvanced.Instance.ShowAtmosphericDetails) { SimManager.Atmosphere = CelestialBodies.SelectedBody.GetAtmospheres(BuildAdvanced.Altitude); } else { SimManager.Atmosphere = 0.0; } SimManager.RequestSimulation(); SimManager.TryStartSimulation(); if (lastStage != null) { PartInfoItem.Release(infoItems); infoItems.Clear(); infoItems.Add(PartInfoItem.Create("Delta-V", (EggConverter.ConvertDeltaV(lastStage.deltaV)).ToString("N0") + " / " + (lastStage.totalDeltaV * 0.47619).ToString("N0") + EggConverter.DeltaV)); infoItems.Add(PartInfoItem.Create("Mass", Units.ToMass(lastStage.mass, lastStage.totalMass))); infoItems.Add(PartInfoItem.Create("TWR", lastStage.thrustToWeight.ToString("F2") + " (" + lastStage.maxThrustToWeight.ToString("F2") + ")")); infoItems.Add(PartInfoItem.Create("Parts", lastStage.partCount + " / " + lastStage.totalPartCount)); } }
public override void Draw(Unity.Flight.ISectionModule section) { if (SimulationProcessor.ShowDetails) { this.DrawLine(EggConverter.ConvertDeltaV(SimulationProcessor.LastStage.deltaV).ToString("N0") + EggConverter.DeltaV + " (" + TimeFormatter.ConvertToString(SimulationProcessor.LastStage.time) + ")", section.IsHud); } }
public override void Draw(Unity.Flight.ISectionModule section) { if (!SimulationProcessor.ShowDetails || !Surface.ImpactProcessor.ShowDetails) { return; } this.DrawLine(EggConverter.ConvertDeltaV(Surface.ImpactProcessor.SuicideDeltaV).ToString("N1") + EggConverter.DeltaV + "(" + Surface.ImpactProcessor.SuicideDeltaV.ToString("N1") + " m/s)", section.IsHud); }
public override void Draw(Unity.Flight.ISectionModule section) { if (SimulationProcessor.ShowDetails == false || StageManager.Instance == null) { return; } foreach (Stage stage in SimulationProcessor.Stages.Where(stage => stage.deltaV > 0 || stage.number == StageManager.CurrentStage)) { DrawLine("DeltaV (S" + stage.number + ")", EggConverter.ConvertDeltaV(stage.deltaV).ToString("N0") + EggConverter.DeltaV + " (" + TimeFormatter.ConvertToString(stage.time) + ")", section.IsHud); } }
/// <summary> /// Draws the deltaV column. /// </summary> private void DrawDeltaV() { GUILayout.BeginVertical(GUILayout.Width(100.0f * GuiDisplaySize.Offset)); GUILayout.Label("DELTA-V", titleStyle); for (int i = 0; i < stagesLength; ++i) { stage = stages[i]; if (showAllStages || stage.deltaV > 0.0) { GUILayout.Label(stage.deltaV.ToString("N0") + " / " + (EggConverter.ConvertDeltaV(stage.inverseTotalDeltaV)).ToString("N0") + EggConverter.DeltaV, infoStyle); } } GUILayout.EndVertical(); }
public static string ToDistance(double value, int decimals = 1) { return(EggConverter.ToDistance(value, decimals)); }
public static string ToTemperature(double value1, double value2) { return(EggConverter.ToTemperature(value1, value2)); }
public static string ToMass(double value1, double value2, int decimals = 0) { return(EggConverter.ToMass(value1, value2, decimals)); }