Add reactor status check to monitor functionality
This commit is contained in:
19
main.lua
19
main.lua
@@ -14,6 +14,8 @@ burnRateDriver = kernel.addDriver("burnrate_driver")
|
|||||||
environmentDriver = kernel.addDriver("environment_driver")
|
environmentDriver = kernel.addDriver("environment_driver")
|
||||||
|
|
||||||
|
|
||||||
|
reactorStatus = false
|
||||||
|
|
||||||
function setNewLine()
|
function setNewLine()
|
||||||
local x,y = monitor.getCursorPos()
|
local x,y = monitor.getCursorPos()
|
||||||
monitor.setCursorPos(1, y + 1)
|
monitor.setCursorPos(1, y + 1)
|
||||||
@@ -21,13 +23,16 @@ function setNewLine()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function runMonitors()
|
local function runMonitors()
|
||||||
parallel.waitForAll(
|
if(reactorStatus) then
|
||||||
tempDriver.watch,
|
parallel.waitForAll(
|
||||||
coolantDriver.watch,
|
tempDriver.watch,
|
||||||
statusDriver.watch,
|
coolantDriver.watch,
|
||||||
turbineDriver.watch,
|
statusDriver.watch,
|
||||||
burnRateDriver.watch,
|
turbineDriver.watch,
|
||||||
environmentDriver.watch)
|
burnRateDriver.watch,
|
||||||
|
environmentDriver.watch)
|
||||||
|
else
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function runDisplay()
|
local function runDisplay()
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ local function startUp()
|
|||||||
reactor.activate()
|
reactor.activate()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
reactorStatus = reactor.getStatus()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function shutdown()
|
local function shutdown()
|
||||||
@@ -33,7 +35,7 @@ local function report()
|
|||||||
local value = getValue()
|
local value = getValue()
|
||||||
local color = colors.black
|
local color = colors.black
|
||||||
monitor.setBackgroundColor(color)
|
monitor.setBackgroundColor(color)
|
||||||
|
|
||||||
setNewLine()
|
setNewLine()
|
||||||
monitor.write("Reactor Status: " .. tostring(value))
|
monitor.write("Reactor Status: " .. tostring(value))
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user