From a9c400665974ba4570f8392a58e78335ef197153 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 8 Dec 2020 23:02:49 -0800 Subject: [PATCH] Converter updates and fixes --- .../CryoTanks/SystemHeatCryoISRU-LCH4.cfg | 32 ++++------ .../CryoTanks/SystemHeatCryoISRU-LH2.cfg | 33 ++++------ .../SystemHeatNuclearRecycler.cfg | 26 +++----- .../SystemHeatLithiumISRU.cfg | 27 +++----- .../PlanetaryBaseInc/ISRU.cfg | 28 +++----- .../Squad/SystemHeatISRU.cfg | 56 +++++----------- .../Squad/SystemHeatDrill.cfg | 16 ++--- GameData/SystemHeat/Localization/en-us.cfg | 2 +- GameData/SystemHeat/Plugin/SystemHeat.dll | Bin 144896 -> 144896 bytes .../SystemHeat/Versioning/SystemHeat.version | 2 +- SystemHeat/SystemHeat/ModuleUtils.cs | 18 +++++- .../Modules/ModuleSystemHeatConverter.cs | 60 +++++++++--------- .../Modules/ModuleSystemHeatEngine.cs | 4 +- .../Modules/ModuleSystemHeatFissionReactor.cs | 4 +- .../Modules/ModuleSystemHeatHarvester.cs | 12 ++-- .../Modules/ModuleSystemHeatRadiator.cs | 4 +- .../Modules/ModuleSystemHeatSink.cs | 4 +- changelog.txt | 7 ++ 18 files changed, 139 insertions(+), 196 deletions(-) diff --git a/Extras/SystemHeatConverters/CryoTanks/SystemHeatCryoISRU-LCH4.cfg b/Extras/SystemHeatConverters/CryoTanks/SystemHeatCryoISRU-LCH4.cfg index 6d40d3b..3c12136 100644 --- a/Extras/SystemHeatConverters/CryoTanks/SystemHeatCryoISRU-LCH4.cfg +++ b/Extras/SystemHeatConverters/CryoTanks/SystemHeatCryoISRU-LCH4.cfg @@ -27,11 +27,9 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 40 - } + + // Heat generation (kW) + systemPower = 40 !ThermalEfficiency {} !TemperatureModifier {} @@ -62,11 +60,9 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 40 - } + + // Heat generation (kW) + systemPower = 40 !ThermalEfficiency {} !TemperatureModifier {} @@ -103,11 +99,9 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 20 - } + + // Heat generation (kW) + systemPower = 20 @UseSpecialistBonus = true @SpecialistEfficiencyFactor = 0.2 @@ -146,11 +140,9 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 20 - } + + // Heat generation (kW) + systemPower = 20 @UseSpecialistBonus = true @SpecialistEfficiencyFactor = 0.2 diff --git a/Extras/SystemHeatConverters/CryoTanks/SystemHeatCryoISRU-LH2.cfg b/Extras/SystemHeatConverters/CryoTanks/SystemHeatCryoISRU-LH2.cfg index d189c34..8fcdeeb 100644 --- a/Extras/SystemHeatConverters/CryoTanks/SystemHeatCryoISRU-LH2.cfg +++ b/Extras/SystemHeatConverters/CryoTanks/SystemHeatCryoISRU-LH2.cfg @@ -27,11 +27,9 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 40 - } + + // Heat generation (kW) + systemPower = 40 !ThermalEfficiency {} !TemperatureModifier {} @@ -62,11 +60,9 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 40 - } + + // Heat generation (kW) + systemPower = 40 !ThermalEfficiency {} !TemperatureModifier {} @@ -103,11 +99,9 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 20 - } + + // Heat generation (kW) + systemPower = 20 @UseSpecialistBonus = true @SpecialistEfficiencyFactor = 0.2 @@ -146,12 +140,9 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 20 - } - + + // Heat generation (kW) + systemPower = 20 @UseSpecialistBonus = true @SpecialistEfficiencyFactor = 0.2 @SpecialistBonusBase = 0.05 diff --git a/Extras/SystemHeatConverters/NearFutureElectrical/SystemHeatNuclearRecycler.cfg b/Extras/SystemHeatConverters/NearFutureElectrical/SystemHeatNuclearRecycler.cfg index eb41a39..2739b8d 100644 --- a/Extras/SystemHeatConverters/NearFutureElectrical/SystemHeatNuclearRecycler.cfg +++ b/Extras/SystemHeatConverters/NearFutureElectrical/SystemHeatNuclearRecycler.cfg @@ -37,11 +37,9 @@ key = 700 1.0 key = 850 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 175 - } + + // Heat generation (kW) + systemPower = 175 !ThermalEfficiency {} !TemperatureModifier {} @@ -70,19 +68,17 @@ key = 700 1.0 key = 850 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 75 - } + // Heat generation (kW) + systemPower = 75 !ThermalEfficiency {} !TemperatureModifier {} @GeneratesHeat = false } + // Ore Processor - @MODULE[ModuleResourceConverter]:HAS[!OUTPUT_RESOURCE:HAS[#ResourceName[EnrichedUranium]],@INPUT_RESOURCE:HAS[#ResourceName[Ore]]] + @MODULE[ModuleResourceConverter]:HAS[@OUTPUT_RESOURCE:HAS[#ResourceName[EnrichedUranium]],@INPUT_RESOURCE:HAS[#ResourceName[Ore]]] { @name = ModuleSystemHeatConverter // must be unique @@ -103,11 +99,9 @@ key = 700 1.0 key = 850 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 175 - } + + // Heat generation (kW) + systemPower = 175 !ThermalEfficiency {} !TemperatureModifier {} diff --git a/Extras/SystemHeatConverters/NearFuturePropulsion/SystemHeatLithiumISRU.cfg b/Extras/SystemHeatConverters/NearFuturePropulsion/SystemHeatLithiumISRU.cfg index 15a2e32..d7d2d7d 100644 --- a/Extras/SystemHeatConverters/NearFuturePropulsion/SystemHeatLithiumISRU.cfg +++ b/Extras/SystemHeatConverters/NearFuturePropulsion/SystemHeatLithiumISRU.cfg @@ -1,7 +1,7 @@ // Modifies stock ISRUs to use SystemHeat modules // ISRU -@PART[ISRU]:FOR[z_SystemHeat]:AFTER[NearFuturePropulsion|FarFutureTechnologies] +@PART[ISRU]:FOR[z_SystemHeat]:NEEDS[NearFuturePropulsion|FarFutureTechnologies] { // LF only converter @@ -27,11 +27,8 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 80 - } + // Heat generation (kW) + systemPower = 80 !ThermalEfficiency {} !TemperatureModifier {} @@ -41,7 +38,7 @@ } // Mini ISRU -@PART[MiniISRU]:FOR[z_SystemHeat]:AFTER[NearFuturePropulsion|FarFutureTechnologies] +@PART[MiniISRU]:FOR[z_SystemHeat]:NEEDS[NearFuturePropulsion|FarFutureTechnologies] { @@ -68,11 +65,8 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 40 - } + // Heat generation (kW) + systemPower = 40 @UseSpecialistBonus = true @SpecialistEfficiencyFactor = 0.2 @@ -91,7 +85,7 @@ } // K&K Planetary ISRU from Nils277's Kerbal Planetary Base Systems -@PART[KKAOSS_ISRU_g]:FOR[z_SystemHeat]:AFTER[NearFuturePropulsion|FarFutureTechnologies] +@PART[KKAOSS_ISRU_g]:FOR[z_SystemHeat]:NEEDS[NearFuturePropulsion|FarFutureTechnologies] { @@ -118,11 +112,8 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 30 - } + // Heat generation (kW) + systemPower = 30 @UseSpecialistBonus = true @SpecialistEfficiencyFactor = 0.2 diff --git a/Extras/SystemHeatConverters/PlanetaryBaseInc/ISRU.cfg b/Extras/SystemHeatConverters/PlanetaryBaseInc/ISRU.cfg index 189ff0a..0875856 100644 --- a/Extras/SystemHeatConverters/PlanetaryBaseInc/ISRU.cfg +++ b/Extras/SystemHeatConverters/PlanetaryBaseInc/ISRU.cfg @@ -39,11 +39,8 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 40 - } + // Heat generation (kW) + systemPower = 40 !ThermalEfficiency {} !TemperatureModifier {} @@ -73,11 +70,8 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 40 - } + // Heat generation (kW) + systemPower = 40 !ThermalEfficiency {} !TemperatureModifier {} @@ -107,11 +101,8 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 40 - } + // Heat generation (kW) + systemPower = 40 !ThermalEfficiency {} !TemperatureModifier {} @@ -141,11 +132,8 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 40 - } + // Heat generation (kW) + systemPower = 40 diff --git a/Extras/SystemHeatConverters/Squad/SystemHeatISRU.cfg b/Extras/SystemHeatConverters/Squad/SystemHeatISRU.cfg index 16b0eb6..b15d238 100644 --- a/Extras/SystemHeatConverters/Squad/SystemHeatISRU.cfg +++ b/Extras/SystemHeatConverters/Squad/SystemHeatISRU.cfg @@ -39,11 +39,8 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 40 - } + // Heat generation (kW) + systemPower = 40 !ThermalEfficiency {} !TemperatureModifier {} @@ -73,11 +70,8 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 40 - } + // Heat generation (kW) + systemPower = 40 !ThermalEfficiency {} !TemperatureModifier {} @@ -107,11 +101,8 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 40 - } + // Heat generation (kW) + systemPower = 40 !ThermalEfficiency {} !TemperatureModifier {} @@ -141,11 +132,8 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 40 - } + // Heat generation (kW) + systemPower = 40 @@ -196,11 +184,8 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 20 - } + // Heat generation (kW) + systemPower = 20 @UseSpecialistBonus = true @SpecialistEfficiencyFactor = 0.2 @@ -239,11 +224,8 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 20 - } + // Heat generation (kW) + systemPower = 20 @UseSpecialistBonus = true @SpecialistEfficiencyFactor = 0.2 @@ -282,11 +264,8 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 20 - } + // Heat generation (kW) + systemPower = 20 @UseSpecialistBonus = true @SpecialistEfficiencyFactor = 0.2 @@ -325,11 +304,8 @@ key = 1000 1.0 key = 1300 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 20 - } + // Heat generation (kW) + systemPower = 20 @UseSpecialistBonus = true @SpecialistEfficiencyFactor = 0.2 diff --git a/Extras/SystemHeatHarvesters/Squad/SystemHeatDrill.cfg b/Extras/SystemHeatHarvesters/Squad/SystemHeatDrill.cfg index 762aa4c..6fc537f 100644 --- a/Extras/SystemHeatHarvesters/Squad/SystemHeatDrill.cfg +++ b/Extras/SystemHeatHarvesters/Squad/SystemHeatDrill.cfg @@ -36,11 +36,9 @@ key = 350 0.5 key = 750 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 40 - } + + // Heat generation (kW) + systemPower = 60 !ThermalEfficiency {} !TemperatureModifier {} @@ -85,11 +83,9 @@ key = 400 1.0 key = 750 0.0 } - // Map system outlet temperature (K) to heat generation (kW) - systemPower - { - key = 0 50 - } + + // Heat generation (kW) + systemPower = 30 !ThermalEfficiency {} !TemperatureModifier {} diff --git a/GameData/SystemHeat/Localization/en-us.cfg b/GameData/SystemHeat/Localization/en-us.cfg index b545f40..72dd522 100644 --- a/GameData/SystemHeat/Localization/en-us.cfg +++ b/GameData/SystemHeat/Localization/en-us.cfg @@ -198,7 +198,7 @@ Localization #LOC_SystemHeat_ModuleSystemHeatConverter_Field_Efficiency = Efficiency [<<1>>] #LOC_SystemHeat_ModuleSystemHeatConverter_Field_Efficiency_Value = <<1>>% #LOC_SystemHeat_ModuleSystemHeatConverter_Field_SimulateEditor = Editor Simulate [<<1>>] - #LOC_SystemHeat_ModuleSystemHeatConverter_Message_Shutdown = Coverter overheated on <<1>>! Emergency shutdown! + #LOC_SystemHeat_ModuleSystemHeatConverter_Message_Shutdown = Converter overheated on <<1>>! Emergency shutdown! /// ModuleSystemHeatHarvester /// ================================= diff --git a/GameData/SystemHeat/Plugin/SystemHeat.dll b/GameData/SystemHeat/Plugin/SystemHeat.dll index 830949a72d140ba4b54ffe4f8a7c90dcb25f407b..d4838a377882787ad1e992b4d8cd17b2ba3bc697 100644 GIT binary patch delta 5654 zcmZA530RcX8VB(IH^5~;z(MC5F)(mJ7EwV*ML-cm!!olpLsY=jD<~SddqIcMX)?2` zI0*==1#Meb4fp^_$6V)Mhto z*R68E#HyUPyC@xUcD_LD&424{kD2i0j54vQ^tV9>Jm?=c6 zQxGXWMZ_YWqRcL=H*IzH!!ulFL?{9Jen<=!L7Zg`_Q!OoD_nD>zUoS`rFrgJ#oJ_& zA9m|Y9~MbX>p9nB?sfNpfpdm5(aNOmxA}3hEVCd3BgZH%lPJ>a! zWyP~>xFV1-OEgb|7lGQ@B)c-918GURN${e7nL`9h(uFGhDL8x%$&8(BWFn9)71o}l zn=3MBbZ}?o3c1Y43v1FvqCSISR`~W^jVQ#=6B^N5Vak_E@Qv3;p=BPZeX%@-0t+bB zj3Bl=hN2^v6=PY0(dZ(T#1+UThC3Q@QZ(Gr$d{QkhAg&7)Y7!v` zG1k5qs2J2P7C{=Q7-TIaS#Ud?G&)o0do~s^sNfRajzLTo#muN?-HyR{E-QA0D2PRp zR0UTmm*{pZEF=?K^3?BGj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lvd41qO>C8}O9+B^Gg2D0_o0s72T+_0X|a z{R%ZtGjFK7aITz6s{mzwjphm=$}C3GA(9ogphmR>tqzmuziYB0WXpqFH+2kH@ITCY`ET)VkunW z#5jq!%$Gzr@h*PqNu)|qg{SZdmj!)UH>XfpO_>%<4Gl4zLgy=@-I!26^)&WN(bvo~ z2&$o&6;-UzGq6fU@>qPWi1lahJZG?@)?KiduZQ6bPUm@gu_@92LLb`jkQH2ouY~yh zUWKzVMw3v5Yg}UTt8nicwX=Zcz6x&FMK3`;IvJ`EbdzMo-QH1#vsle#LnHfAe;)O> zM5a6I^E`HV)QePlzc`QA^Y&6r&o0viq%~5C1@jdJ7my*fLZdP*lPYvjaS^MyXh8=V zE@3SfE$9%Ytz2S3s}XolR6z?`jUilOL921dEJ-U`4PBE+r4_A4HkTDH>|(0ncAsKw zj|ayYs!=HA(%nzJ4BrP7vw*Jb3KmGwnRW%G4=H8?ZGm!FtHlThk_8vp9aD=PQb)NWohW9*J@$h`EjCHfv!E9H zrRYic3o4|NeHC0qrPRCqNfX)I7yCXgCgUppOJoDCR8$tsm)gR%-ZgwGRqoKByN*IG z@$CDReZ9`=>|Fp@q6+H z!niE#iT$-IeCX3nKZQYIR1B0;J%`{C^tW=hS~ykn@xJTB4A?H1kK z#uAz7qNEu9)fi2Rp#khi1Xk!$eC#mKaHmDPyI9kjyG)vjB(a;3Fn;5~M*=V?rAgQ?y8x0SrPdA!GK5Y-# z3s`7JWsR@mR&unjvgRw@^9S#5ue_5LvvT+e&)wa(jVVdJqj*OIvR`NuSS$9^E8xvK z&yUd{KR|=waRcK9zGEHewscIaZF<24clN01t;?Z66$VsCOFYye~+);9Zoc|9dH2k9g diff --git a/GameData/SystemHeat/Versioning/SystemHeat.version b/GameData/SystemHeat/Versioning/SystemHeat.version index 695678b..da7fa84 100644 --- a/GameData/SystemHeat/Versioning/SystemHeat.version +++ b/GameData/SystemHeat/Versioning/SystemHeat.version @@ -6,7 +6,7 @@ { "MAJOR":0, "MINOR":2, - "PATCH":0, + "PATCH":1, "BUILD":0 }, "KSP_VERSION": diff --git a/SystemHeat/SystemHeat/ModuleUtils.cs b/SystemHeat/SystemHeat/ModuleUtils.cs index 808f892..75635a8 100644 --- a/SystemHeat/SystemHeat/ModuleUtils.cs +++ b/SystemHeat/SystemHeat/ModuleUtils.cs @@ -52,7 +52,7 @@ public static ConversionRecipe RecalculateRatios(float fraction, List().ToList().Find(x => x.moduleID == moduleName); + + if (heatModule == null) + { + Utils.LogError($"[{part}] No ModuleSystemHeat named {moduleName} was found, using first instance"); + return part.GetComponents().ToList().First(); + } + + if (heatModule == null) + Utils.LogError($"[{part}] No ModuleSystemHeat was found."); + + return heatModule; + } public static ConfigNode GetModuleConfigNode(Part part, string moduleName) { try diff --git a/SystemHeat/SystemHeat/Modules/ModuleSystemHeatConverter.cs b/SystemHeat/SystemHeat/Modules/ModuleSystemHeatConverter.cs index 714b866..6e9d73e 100644 --- a/SystemHeat/SystemHeat/Modules/ModuleSystemHeatConverter.cs +++ b/SystemHeat/SystemHeat/Modules/ModuleSystemHeatConverter.cs @@ -10,16 +10,16 @@ namespace SystemHeat /// /// The connection between a stock ModuleResourceConverter and the SystemHeat system /// - public class ModuleSystemHeatConverter: ModuleResourceConverter + public class ModuleSystemHeatConverter : ModuleResourceConverter { - + // This should be unique on the part [KSPField(isPersistant = false)] public string moduleID = "converter"; // This should correspond to the related ModuleSystemHeat [KSPField(isPersistant = false)] - public string systemHeatModuleID =""; + public string systemHeatModuleID = ""; // Map loop temperature to system efficiency (0-1.0) [KSPField(isPersistant = false)] @@ -27,7 +27,7 @@ public class ModuleSystemHeatConverter: ModuleResourceConverter // Map system outlet temperature (K) to heat generation (kW) [KSPField(isPersistant = false)] - public FloatCurve systemPower = new FloatCurve(); + public float systemPower =0f; // @@ -42,7 +42,7 @@ public class ModuleSystemHeatConverter: ModuleResourceConverter [KSPField(isPersistant = true)] public bool editorThermalSim = false; - [KSPEvent(guiActive = false, guiName = "Toggle", guiActiveEditor =true, active = true)] + [KSPEvent(guiActive = false, guiName = "Toggle", guiActiveEditor = true, active = true)] public void ToggleEditorThermalSim() { editorThermalSim = !editorThermalSim; @@ -58,15 +58,15 @@ public void ToggleEditorThermalSim() protected ModuleSystemHeat heatModule; public override string GetInfo() { - string info = base.GetInfo(); + string info = base.GetInfo(); int pos = info.IndexOf("\n\n"); if (pos < 0) return info; - else - return info.Substring(0,pos) + Localizer.Format("#LOC_SystemHeat_ModuleSystemHeatConverter_PartInfoAdd", - systemPower.Evaluate(0f).ToString("F0"), - systemOutletTemperature.ToString("F0"), + else + return info.Substring(0, pos) + Localizer.Format("#LOC_SystemHeat_ModuleSystemHeatConverter_PartInfoAdd", + systemPower.ToString("F0"), + systemOutletTemperature.ToString("F0"), shutdownTemperature.ToString("F0") ) + info.Substring(pos); @@ -75,8 +75,7 @@ public override string GetInfo() public override void OnStart(StartState state) { base.OnStart(state); - heatModule = this.GetComponents().ToList().Find(x => x.moduleID == systemHeatModuleID); - + heatModule = ModuleUtils.FindHeatModule(this.part, systemHeatModuleID); if (HighLogic.LoadedSceneIsFlight) { SetupResourceRatios(); @@ -98,7 +97,8 @@ public override void OnStart(StartState state) Fields["ConverterEfficiency"].guiName = Localizer.Format("#LOC_SystemHeat_ModuleSystemHeatConverter_Field_Efficiency", base.ConverterName); } - public override void FixedUpdate() { + public override void FixedUpdate() + { base.FixedUpdate(); if (HighLogic.LoadedSceneIsFlight) @@ -111,31 +111,33 @@ public override void FixedUpdate() { if (HighLogic.LoadedSceneIsEditor) { GenerateHeatEditor(); - + Fields["ConverterEfficiency"].guiActiveEditor = editorThermalSim; - + } - ConverterEfficiency = Localizer.Format("#LOC_SystemHeat_ModuleSystemHeatConverter_Field_Efficiency_Value", (systemEfficiency.Evaluate(heatModule.currentLoopTemperature)*100f).ToString("F1")); + ConverterEfficiency = Localizer.Format("#LOC_SystemHeat_ModuleSystemHeatConverter_Field_Efficiency_Value", (systemEfficiency.Evaluate(heatModule.currentLoopTemperature) * 100f).ToString("F1")); } - + protected void GenerateHeatEditor() { - if (editorThermalSim) - heatModule.AddFlux(moduleID, systemOutletTemperature, systemPower.Evaluate(systemOutletTemperature)); - else - heatModule.AddFlux(moduleID, 0f, 0f); + if (heatModule) + if (editorThermalSim) + heatModule.AddFlux(moduleID, systemOutletTemperature, systemPower); + else + heatModule.AddFlux(moduleID, 0f, 0f); } protected void GenerateHeatFlight() { - if (base.ModuleIsActive()) - { - heatModule.AddFlux(moduleID, systemOutletTemperature, systemPower.Evaluate(systemOutletTemperature)); - } - else - { - heatModule.AddFlux(moduleID, 0f, 0f); - } + if (heatModule) + if (base.ModuleIsActive()) + { + heatModule.AddFlux(moduleID, systemOutletTemperature, systemPower); + } + else + { + heatModule.AddFlux(moduleID, 0f, 0f); + } } protected void UpdateSystemHeatFlight() { diff --git a/SystemHeat/SystemHeat/Modules/ModuleSystemHeatEngine.cs b/SystemHeat/SystemHeat/Modules/ModuleSystemHeatEngine.cs index 0f04a7d..d4d8ae0 100644 --- a/SystemHeat/SystemHeat/Modules/ModuleSystemHeatEngine.cs +++ b/SystemHeat/SystemHeat/Modules/ModuleSystemHeatEngine.cs @@ -76,9 +76,7 @@ public override string GetInfo() public void Start() { - heatModule = this.GetComponents().ToList().Find(x => x.moduleID == systemHeatModuleID); - if (heatModule == null) - heatModule.GetComponent(); + heatModule = ModuleUtils.FindHeatModule(this.part, systemHeatModuleID); if (engineModuleID != "") engineModule = this.GetComponents().ToList().Find(x => x.engineID == engineModuleID); diff --git a/SystemHeat/SystemHeat/Modules/ModuleSystemHeatFissionReactor.cs b/SystemHeat/SystemHeat/Modules/ModuleSystemHeatFissionReactor.cs index b1fbc5e..f0dc447 100644 --- a/SystemHeat/SystemHeat/Modules/ModuleSystemHeatFissionReactor.cs +++ b/SystemHeat/SystemHeat/Modules/ModuleSystemHeatFissionReactor.cs @@ -268,9 +268,7 @@ public virtual void Start() OnLoad(node); } - heatModule = this.GetComponents().ToList().Find(x => x.moduleID == systemHeatModuleID); - if (heatModule == null) - heatModule.GetComponent(); + heatModule = ModuleUtils.FindHeatModule(this.part, systemHeatModuleID); var range = (UI_FloatRange)this.Fields["CurrentSafetyOverride"].uiControlEditor; range.minValue = 0f; diff --git a/SystemHeat/SystemHeat/Modules/ModuleSystemHeatHarvester.cs b/SystemHeat/SystemHeat/Modules/ModuleSystemHeatHarvester.cs index 97408f5..5682f47 100644 --- a/SystemHeat/SystemHeat/Modules/ModuleSystemHeatHarvester.cs +++ b/SystemHeat/SystemHeat/Modules/ModuleSystemHeatHarvester.cs @@ -26,7 +26,7 @@ public class ModuleSystemHeatHarvester : ModuleResourceHarvester // Map system outlet temperature (K) to heat generation (kW) [KSPField(isPersistant = false)] - public FloatCurve systemPower = new FloatCurve(); + public float systemPower = 0f; // @@ -64,7 +64,7 @@ public override string GetInfo() return info; else return info.Substring(0, pos) + Localizer.Format("#LOC_SystemHeat_ModuleSystemHeatHarvester_PartInfoAdd", - systemPower.Evaluate(0f).ToString("F0"), + systemPower.ToString("F0"), systemOutletTemperature.ToString("F0"), shutdownTemperature.ToString("F0") ) + info.Substring(pos); @@ -74,7 +74,7 @@ public override string GetInfo() public void Start() { - heatModule = this.GetComponents().ToList().Find(x => x.moduleID == systemHeatModuleID); + heatModule = ModuleUtils.FindHeatModule(this.part, systemHeatModuleID); if (HighLogic.LoadedSceneIsFlight) { @@ -117,7 +117,7 @@ public override void FixedUpdate() protected void GenerateHeatEditor() { if (editorThermalSim) - heatModule.AddFlux(moduleID, systemOutletTemperature, systemPower.Evaluate(systemOutletTemperature)); + heatModule.AddFlux(moduleID, systemOutletTemperature, systemPower); else heatModule.AddFlux(moduleID, 0f, 0f); } @@ -126,7 +126,7 @@ protected void GenerateHeatFlight() { if (base.ModuleIsActive()) { - heatModule.AddFlux(moduleID, systemOutletTemperature, systemPower.Evaluate(systemOutletTemperature)); + heatModule.AddFlux(moduleID, systemOutletTemperature, systemPower); } else { @@ -141,7 +141,7 @@ protected void UpdateSystemHeatFlight() { ScreenMessages.PostScreenMessage( new ScreenMessage( - String.Format("#LOC_SystemHeat_ModuleSystemHeatHarvester_Message_Shutdown", + Localizer.Format("#LOC_SystemHeat_ModuleSystemHeatHarvester_Message_Shutdown", part.partInfo.title), 3.0f, ScreenMessageStyle.UPPER_CENTER)); diff --git a/SystemHeat/SystemHeat/Modules/ModuleSystemHeatRadiator.cs b/SystemHeat/SystemHeat/Modules/ModuleSystemHeatRadiator.cs index 57a804b..302f93a 100644 --- a/SystemHeat/SystemHeat/Modules/ModuleSystemHeatRadiator.cs +++ b/SystemHeat/SystemHeat/Modules/ModuleSystemHeatRadiator.cs @@ -38,9 +38,7 @@ public class ModuleSystemHeatRadiator: ModuleActiveRadiator public override void Start() { base.Start(); - heatModule = this.GetComponents().ToList().Find(x => x.moduleID == systemHeatModuleID); - if (heatModule == null) - heatModule.GetComponent(); + heatModule = ModuleUtils.FindHeatModule(this.part, systemHeatModuleID); if (SystemHeatSettings.DebugModules) { Utils.Log("[ModuleSystemHeatRadiator] Setup completed"); diff --git a/SystemHeat/SystemHeat/Modules/ModuleSystemHeatSink.cs b/SystemHeat/SystemHeat/Modules/ModuleSystemHeatSink.cs index 986307e..8b0e6d4 100644 --- a/SystemHeat/SystemHeat/Modules/ModuleSystemHeatSink.cs +++ b/SystemHeat/SystemHeat/Modules/ModuleSystemHeatSink.cs @@ -108,9 +108,7 @@ public override string GetInfo() public void Start() { - heatModule = this.GetComponents().ToList().Find(x => x.moduleID == systemHeatModuleID); - if (heatModule == null) - heatModule.GetComponent(); + heatModule = ModuleUtils.FindHeatModule(this.part, systemHeatModuleID); if (SystemHeatSettings.DebugModules) { diff --git a/changelog.txt b/changelog.txt index be9aca6..1a21335 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,10 @@ +v0.2.1 +------ +- Corrected NFE Nuclear Recycler Uranium Extractor patch not working +- Fixed production ratios not working correctly overall +- Changed systemPower key in ModuleSystemHeatHarvester and ModuleSystemHeatConverter to a float +- Improved exception handling and debugging overall + v0.2.0 ------ - Added Chinese localization (TerrestrisYE)