This commit is contained in:
2025-06-14 12:52:53 -04:00
parent cd5815b77c
commit c39daa5508
3 changed files with 23 additions and 6 deletions

View File

@@ -1,10 +1,16 @@
local function report() local function report(reactor)
local reactor = peripheral.find("fissionReactorLogicAdapter")
if reactor then if reactor then
return reactor.getTemperature() return reactor.getCoolantFilledPercentage()
else else
return "No reactor found" return "No reactor found"
end end
end end
return { report = report } local function watch(reactor, monitor)
while true do
print("Coolant: " .. report(reactor))
sleep(1)
end
end
return { report = report, watch = watch }

View File

@@ -1,15 +1,19 @@
local function run() local function run()
local kernel = require("kernel") local kernel = require("kernel")
local tempDriver = kernel.addDriver("temperature_driver") local tempDriver = kernel.addDriver("temperature_driver")
local coolantDriver = kernel.addDriver("coolant_driver")
local reactor = peripheral.find("fissionReactorLogicAdapter") local reactor = peripheral.find("fissionReactorLogicAdapter")
local monitor = peripheral.find("monitor") local monitor = peripheral.find("monitor")
while true do while true do
monitor.clear() monitor.clear()
monitor.setCursorPos(1,1) monitor.setCursorPos(1,1)
tempDriver.watch(reactor, monitor)
coolantDriver.watch(reactor, monitor)
local data = { local data = {
{ Label = "Temperature", value = tempDriver.report(reactor)}, { Label = "Temperature", value = tempDriver.report(reactor)},
{ Label = "Pressure", value = "101kPa" }, { Label = "Coolant", value = coolantDriver.report(reactor) },
{ Label = "Humidity", value = "45%" } { Label = "Humidity", value = "45%" }
} }

View File

@@ -6,4 +6,11 @@ local function report(reactor)
end end
end end
return { report = report } local function watch(reactor, monitor)
while true do
print("Temperature: " .. report(reactor))
sleep(1)
end
end
return { report = report, watch = watch }