.
This commit is contained in:
parent
61e83d70e7
commit
d455e99ed0
@ -97,6 +97,7 @@ local monitor = nil
|
|||||||
local lastDisplayUpdate = 0
|
local lastDisplayUpdate = 0
|
||||||
local reactorInfo = {}
|
local reactorInfo = {}
|
||||||
local shutdownRequested = false
|
local shutdownRequested = false
|
||||||
|
local chargeRequested = false -- Track when user requests charging
|
||||||
local errorMessage = ""
|
local errorMessage = ""
|
||||||
local fieldErrors = {} -- Track specific field read errors
|
local fieldErrors = {} -- Track specific field read errors
|
||||||
|
|
||||||
@ -448,6 +449,12 @@ local function processStateMachine()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Reactor is no longer cold - clear charge request flag
|
||||||
|
if chargeRequested then
|
||||||
|
chargeRequested = false
|
||||||
|
print("[INFO] Reactor started, charge request cleared")
|
||||||
|
end
|
||||||
|
|
||||||
if reactorStatus == "cooling" then
|
if reactorStatus == "cooling" then
|
||||||
if state == STATES.EMERGENCY or state == STATES.SHUTDOWN then
|
if state == STATES.EMERGENCY or state == STATES.SHUTDOWN then
|
||||||
-- Keep current state during cooldown
|
-- Keep current state during cooldown
|
||||||
@ -571,10 +578,17 @@ local function controlReactor()
|
|||||||
outputRate = 0
|
outputRate = 0
|
||||||
|
|
||||||
else
|
else
|
||||||
-- OFFLINE: Reactor is cold, no action needed
|
-- OFFLINE: Reactor is cold
|
||||||
|
if chargeRequested then
|
||||||
|
-- User requested charge - provide input flux to start charging the field
|
||||||
|
inputRate = CONFIG.emergency_field_input
|
||||||
|
outputRate = 0
|
||||||
|
else
|
||||||
|
-- No action needed
|
||||||
inputRate = 0
|
inputRate = 0
|
||||||
outputRate = 0
|
outputRate = 0
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Apply the flow rates with rate limiting
|
-- Apply the flow rates with rate limiting
|
||||||
-- Emergency/Error states bypass rate limiting for safety
|
-- Emergency/Error states bypass rate limiting for safety
|
||||||
@ -886,12 +900,13 @@ local function handleInput()
|
|||||||
-- Charge reactor
|
-- Charge reactor
|
||||||
if state == STATES.OFFLINE or state == STATES.SHUTDOWN then
|
if state == STATES.OFFLINE or state == STATES.SHUTDOWN then
|
||||||
shutdownRequested = false
|
shutdownRequested = false
|
||||||
|
chargeRequested = true -- Flag to provide input flux
|
||||||
if reactor then
|
if reactor then
|
||||||
pcall(function()
|
pcall(function()
|
||||||
reactor.chargeReactor()
|
reactor.chargeReactor()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
print("Charging reactor...")
|
print("Charging reactor... providing input flux")
|
||||||
end
|
end
|
||||||
elseif key == keys.x then
|
elseif key == keys.x then
|
||||||
-- Force exit
|
-- Force exit
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user