This commit is contained in:
2025-06-14 14:59:02 -04:00
parent c7f5b9d860
commit b4dc738f05
2 changed files with 23 additions and 12 deletions

View File

@@ -1,5 +1,6 @@
local kernel = require("kernel")
local reactor = peripheral.find("fissionReactorLogicAdapter")
local turbine = peripheral.find("turbineValve")
local monitor = peripheral.find("monitor")
local tempDriver = kernel.addDriver("temperature_driver")
local coolantDriver = kernel.addDriver("coolant_driver")
@@ -15,7 +16,7 @@ local function runMonitors()
tempDriver.watch(reactor, monitor)
coolantDriver.watch(reactor, monitor)
statusDriver.watch(reactor, monitor)
turbineDriver.watch(reactor, monitor)
turbineDriver.watch(turbine, monitor)
end
end
@@ -32,19 +33,29 @@ local function runDisplay()
monitor.clear()
end
monitor.setCursorPos(1, 1)
local drivers = {
local reactorDrivers = {
{ Label = "Status", driver = statusDriver },
{ Label = "Temperature", driver = tempDriver },
{ Label = "Coolant", driver = coolantDriver },
{ Label = "Turbine", driver = turbineDriver },
}
for i, item in ipairs(drivers) do
for i, item in ipairs(reactorDrivers) do
monitor.setCursorPos(1, i)
item.driver.report(reactor, monitor)
monitor.setCursorPos(1, i + 1)
end
local turbineDrivers = {
{ Label = "Turbine", driver = turbineDriver }
}
for i, item in ipairs(turbineDrivers) do
monitor.setCursorPos(1, i)
item.driver.report(turbine, monitor)
monitor.setCursorPos(1, i + 1)
end
sleep(0.25) -- Update every quarter second
end
end