/// <summary> /// Returns the atmospheric pressure at this altitude /// </summary> /// <param name="alt">Altitude to get the pressure at</param> public static double GetPressureAtAlt(this CelestialBody body, double alt) { if (!body.atmosphere || alt > body.GetMaxAtmosphereAltitude()) { return(0); } return(FlightGlobals.getStaticPressure(alt, body)); }
//Lists the errors of a given type internal List <string> GetErrors(string type) { if (type == "general") { List <string> general = new List <string>(); if (!RCUtils.CanParseTime(timer) || !RCUtils.CheckRange(RCUtils.ParseTime(timer), 0, 3600)) { general.Add("Deployment timer"); } if (!RCUtils.CanParseWithEmpty(spares) || !RCUtils.CheckRange(RCUtils.ParseWithEmpty(spares), -1, 10) || !RCUtils.IsWholeNumber(RCUtils.ParseWithEmpty(spares))) { general.Add("Spare chutes"); } if (!RCUtils.CanParse(cutSpeed) || !RCUtils.CheckRange(float.Parse(cutSpeed), 0.01f, 100)) { general.Add("Autocut speed"); } if (!RCUtils.CanParse(landingAlt) || !RCUtils.CheckRange(float.Parse(landingAlt), 0, (float)body.GetMaxAtmosphereAltitude())) { general.Add("Landing altitude"); } return(general); } else if (type == "main" || type == "secondary") { return(chutes.SelectMany(c => c.errors).ToList()); } return(new List <string>()); }
/// <summary> /// Returns the atmospheric pressure at this altitude /// </summary> /// <param name="body">body to get the pressure for</param> /// <param name="alt">Altitude to get the pressure at</param> public static double GetPressureAtAlt(this CelestialBody body, double alt) => !body.atmosphere || alt > body.GetMaxAtmosphereAltitude() ? 0 : FlightGlobals.getStaticPressure(alt, body);