From 7623f59033201d26a822d7bcf2c7abb1f85817ae Mon Sep 17 00:00:00 2001 From: ThetaPhi Date: Mon, 30 Mar 2015 05:36:13 +0200 Subject: [PATCH 1/3] Count active reactors for steam capacity calculation Instead of looking for activly cooled reactors, I simply took the list size. Untested code, late night brainfart fix. TODO: Same for turbines. --- lolmer_bigreactor_monitor_prog.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lolmer_bigreactor_monitor_prog.lua b/lolmer_bigreactor_monitor_prog.lua index 226d23e..ad33785 100644 --- a/lolmer_bigreactor_monitor_prog.lua +++ b/lolmer_bigreactor_monitor_prog.lua @@ -1897,6 +1897,7 @@ function main() local reactor = nil local monitorIndex = 1 local sd = 0 + local activeReactorCount = 0 -- For multiple reactors/monitors, monitor #1 is reserved for overall status -- or for multiple reactors/turbines and only one monitor @@ -1972,6 +1973,7 @@ function main() -- Collect steam production data if reactor.isActivelyCooled() then sd = sd + reactor.getEnergyProducedLastTick() + activeReactorCount = activeReactorCount + 1 end else printLog("reactor["..reactorIndex.."] is NOT connected.") @@ -1981,7 +1983,7 @@ function main() -- Now that temperatureControl() had a chance to use it, reset/calculate steam data for next iteration printLog("Steam requested: "..steamRequested.."% capacity") printLog("Steam delivered: "..steamDelivered.."% capacity") - steamDelivered = math.ceil(100*sd/(2000*#reactorList)) + steamDelivered = math.ceil(100*sd/(2000*activeReactorCount)) steamRequested = 0 -- Monitors for turbines start after turbineMonitorOffset From 15465931e40e901f61cc5483fbadc74275589c02 Mon Sep 17 00:00:00 2001 From: ThetaPhi Date: Wed, 1 Apr 2015 21:12:05 +0200 Subject: [PATCH 2/3] Revert "Count active reactors for steam capacity calculation" This reverts commit 9fe6ed98194212bcf8c34063586e1b8ef3ebf375. --- lolmer_bigreactor_monitor_prog.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lolmer_bigreactor_monitor_prog.lua b/lolmer_bigreactor_monitor_prog.lua index ad33785..226d23e 100644 --- a/lolmer_bigreactor_monitor_prog.lua +++ b/lolmer_bigreactor_monitor_prog.lua @@ -1897,7 +1897,6 @@ function main() local reactor = nil local monitorIndex = 1 local sd = 0 - local activeReactorCount = 0 -- For multiple reactors/monitors, monitor #1 is reserved for overall status -- or for multiple reactors/turbines and only one monitor @@ -1973,7 +1972,6 @@ function main() -- Collect steam production data if reactor.isActivelyCooled() then sd = sd + reactor.getEnergyProducedLastTick() - activeReactorCount = activeReactorCount + 1 end else printLog("reactor["..reactorIndex.."] is NOT connected.") @@ -1983,7 +1981,7 @@ function main() -- Now that temperatureControl() had a chance to use it, reset/calculate steam data for next iteration printLog("Steam requested: "..steamRequested.."% capacity") printLog("Steam delivered: "..steamDelivered.."% capacity") - steamDelivered = math.ceil(100*sd/(2000*activeReactorCount)) + steamDelivered = math.ceil(100*sd/(2000*#reactorList)) steamRequested = 0 -- Monitors for turbines start after turbineMonitorOffset From 4e38b2e471ce67cc29937d9f45b77801bfbd165f Mon Sep 17 00:00:00 2001 From: ThetaPhi Date: Wed, 1 Apr 2015 21:12:16 +0200 Subject: [PATCH 3/3] add *.swp to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3256c04..a00c9a2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ scatmanjohn_bigreactor_monitor_prog.lua scatmanjohn_bigreactor_startup.lua sg_control.lua sg_startup.lua +*.swp