From 7fb88becb8ab532d0f0c4387da64a60774b54858 Mon Sep 17 00:00:00 2001 From: Mikayla Date: Thu, 7 Nov 2024 15:01:19 +0000 Subject: [PATCH] #567 detect and report ramping in max burn and burn rate modes --- supervisor/facility.lua | 4 ++-- supervisor/facility_update.lua | 21 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/supervisor/facility.lua b/supervisor/facility.lua index 4b2b38c..b87d6f4 100644 --- a/supervisor/facility.lua +++ b/supervisor/facility.lua @@ -91,8 +91,8 @@ function facility.new(config) charge_conversion = 1.0, time_start = 0.0, initial_ramp = true, - waiting_on_ramp = false, - waiting_on_stable = false, + waiting_on_ramp = false, -- waiting on auto ramping + waiting_on_stable = false, -- waiting on gen rate stabilization accumulator = 0.0, saturated = false, last_update = 0, diff --git a/supervisor/facility_update.lua b/supervisor/facility_update.lua index 6375077..658de99 100644 --- a/supervisor/facility_update.lua +++ b/supervisor/facility_update.lua @@ -341,9 +341,17 @@ function update.auto_control(ExtChargeIdling) if state_changed then self.time_start = now self.saturated = true + self.waiting_on_ramp = true - self.status_text = { "MONITORED MODE", "running reactors at limit" } + self.status_text = { "MONITORED MODE", "ramping reactors to limit" } log.info("FAC: MAX_BURN process mode started") + elseif self.waiting_on_ramp then + if all_units_ramped() then + self.waiting_on_ramp = false + + self.status_text = { "MONITORED MODE", "running reactors at limit" } + log.info("FAC: MAX_BURN process mode initial ramp completed") + end end allocate_burn_rate(self.max_burn_combined, true) @@ -351,8 +359,17 @@ function update.auto_control(ExtChargeIdling) -- a total aggregate burn rate if state_changed then self.time_start = now - self.status_text = { "BURN RATE MODE", "running" } + self.waiting_on_ramp = true + + self.status_text = { "BURN RATE MODE", "ramping to target" } log.info("FAC: BURN_RATE process mode started") + elseif self.waiting_on_ramp then + if all_units_ramped() then + self.waiting_on_ramp = false + + self.status_text = { "BURN RATE MODE", "running" } + log.info("FAC: BURN_RATE process mode initial ramp completed") + end end local unallocated = allocate_burn_rate(self.burn_target, true)