/// <summary>
        ///     Updates the details by recalculating if requested.
        /// </summary>
        public void Update()
        {
            try
            {
                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 m = FlightGlobals.ActiveVessel.parts.Sum(part => PartExtensions.GetWetMass(part)) * 1000.0;
                    var g = FlightGlobals.getGeeForceAtPosition(FlightGlobals.ship_position).magnitude;
                    var a = FlightGlobals.ActiveVessel.parts.Sum(part => part.DragCubes.AreaDrag) * PhysicsGlobals.DragCubeMultiplier;
                    var p = FlightGlobals.ActiveVessel.atmDensity;
                    var c = PhysicsGlobals.DragMultiplier;

                    TerminalVelocity = Math.Sqrt((2.0 * m * g) / (p * a * c));

                    StaticPressure  = FlightGlobals.ActiveVessel.staticPressurekPa;
                    DynamicPressure = FlightGlobals.ActiveVessel.dynamicPressurekPa;
                }

                Efficiency = FlightGlobals.ship_srfSpeed / TerminalVelocity;
            }
            catch (Exception ex)
            {
                MyLogger.Exception(ex, "AtmosphericProcessor->Update");
            }
        }
Пример #2
0
 private void SetMassItems()
 {
     if (selectedPart.physicalSignificance == Part.PhysicalSignificance.FULL)
     {
         infoItems.Add(PartInfoItem.Create("Mass", Units.ToMass(PartExtensions.GetDryMass(selectedPart), PartExtensions.GetWetMass(selectedPart))));
     }
 }