public override string GetInfo() { List <ElectricEnginePropellant> props = ElectricEnginePropellant.GetPropellantsEngineForType(type); string return_str = "Max Power Consumption: " + MaxPower.ToString("") + " MW\n"; var thrust_per_mw = (2e6 * powerThrustMultiplier) / _g0 / (baseISP * PluginHelper.ElectricEngineIspMult) / 1000.0; props.ForEach(prop => { var ispPropellantModifier = (PluginHelper.IspElectroPropellantModifierBase + (this.type == (int)ElectricEngineType.VASIMR ? prop.DecomposedIspMult : prop.IspMultiplier)) / (1 + PluginHelper.IspNtrPropellantModifierBase); var ispProp = _modifiedEngineBaseISP * ispPropellantModifier; double efficiency; if (type == (int)ElectricEngineType.ARCJET) { efficiency = 0.87 * prop.Efficiency; } else if (type == (int)ElectricEngineType.VASIMR) { efficiency = baseEfficency + 0.5 * variableEfficency; } else { efficiency = prop.Efficiency; } var thrustProp = thrust_per_mw / ispPropellantModifier * efficiency * (type == (int)ElectricEngineType.ARCJET ? prop.ThrustMultiplier : 1); return_str = return_str + "---" + prop.PropellantGUIName + "---\nThrust: " + thrustProp.ToString("0.000") + " kN per MW\nEfficiency: " + (efficiency * 100.0).ToString("0.00") + "%\nISP: " + ispProp.ToString("0.00") + "s\n"; }); return(return_str); }
public override string GetInfo() { var props = ElectricEnginePropellant.GetPropellantsEngineForType(type); var returnStr = Localizer.Format("#LOC_KSPIE_ElectricEngine_maxPowerConsumption") + " : " + MaxPower.ToString("F3") + " MW\n"; var thrustPerMw = (2e6 * powerThrustMultiplier) / _g0 / (baseISP * PluginHelper.ElectricEngineIspMult) / 1000.0; props.ForEach(prop => { var ispPropellantModifier = (PluginHelper.IspElectroPropellantModifierBase + (this.type == (int)ElectricEngineType.VASIMR ? prop.DecomposedIspMult : prop.IspMultiplier)) / (1 + PluginHelper.IspNtrPropellantModifierBase); var ispProp = _modifiedEngineBaseIsp * ispPropellantModifier; double efficiency; switch (type) { case (int)ElectricEngineType.ARCJET: efficiency = 0.87 * prop.Efficiency; break; case (int)ElectricEngineType.VASIMR: efficiency = baseEfficency + 0.5 * variableEfficency; break; default: efficiency = prop.Efficiency; break; } var thrustProp = thrustPerMw / ispPropellantModifier * efficiency * (type == (int)ElectricEngineType.ARCJET ? prop.ThrustMultiplier : 1); returnStr = returnStr + "---" + prop.PropellantGUIName + "---\n" + Localizer.Format("#LOC_KSPIE_ElectricEngine_thrust") + ": " + thrustProp.ToString("0.000") + " " + Localizer.Format("#LOC_KSPIE_ElectricEngine_kiloNewtonPerMegaWatt") + "\n" + Localizer.Format("#LOC_KSPIE_ElectricEngine_efficiency") + " : " + (efficiency * 100.0).ToString("0.00") + "%\n" + Localizer.Format("#LOC_KSPIE_ElectricEngine_specificImpulse") + ": " + ispProp.ToString("0.00") + "s\n"; }); return(returnStr); }