This commit is contained in:
2025-06-14 17:36:55 -04:00
parent 78f224581f
commit 48c52e76cf
6 changed files with 51 additions and 35 deletions

View File

@@ -14,10 +14,12 @@ end
-- local function watch()
-- while true do
-- sleep(0.05) -- Update every tenth second
-- end
-- end
local function watch() local function watch()
while true do
sleep(0.05) -- Update every tenth second
end
end end
function stepUp() function stepUp()

View File

@@ -11,11 +11,15 @@ local function color()
end end
-- local function watch()
-- while true do
-- checkCoolantLevel()
-- sleep(0.05)
-- end
-- end
local function watch() local function watch()
while true do checkCoolantLevel()
checkCoolantLevel()
sleep(0.05)
end
end end
function checkCoolantLevel() function checkCoolantLevel()

View File

@@ -13,13 +13,14 @@ burnRateDriver = kernel.addDriver("burnrate_driver")
local function runMonitors() local function runMonitors()
parallel.waitForAll( while true do
tempDriver.watch, tempDriver.watch()
coolantDriver.watch, coolantDriver.watch()
statusDriver.watch, statusDriver.watch()
turbineDriver.watch, turbineDriver.watch()
burnRateDriver.watch burnRateDriver.watch()
) sleep(0.05)
end
end end
local function runDisplay() local function runDisplay()
@@ -68,14 +69,7 @@ local function run()
sleep(1) sleep(1)
end end
parallel.waitForAll(runMonitors, parallel.waitForAll(runMonitors, runDisplay)
runDisplay,
tempDriver.watch,
coolantDriver.watch,
statusDriver.watch,
turbineDriver.watch,
burnRateDriver.watch
)
end end
return { run = run} return { run = run}

View File

@@ -8,13 +8,18 @@ local function color()
return colors.black return colors.black
end end
-- local function watch()
-- while true do
-- checkStatus()
-- sleep(0.05) -- Update every tenth second
-- end
-- end
local function watch() local function watch()
while true do checkStatus()
checkStatus()
sleep(0.05) -- Update every tenth second
end
end end
function checkStatus() function checkStatus()
local value = getValue() local value = getValue()
end end

View File

@@ -13,13 +13,19 @@ local function color()
return colors.black return colors.black
end end
-- local function watch()
-- while true do
-- print("Temperature: " .. getValue())
-- checkTemperature()
-- sleep(0.05) -- Update every tenth second
-- end
-- end
local function watch() local function watch()
while true do checkTemperature()
print("Temperature: " .. getValue())
checkTemperature()
sleep(0.05) -- Update every tenth second
end
end end
function checkTemperature() function checkTemperature()
local temperature = getValue() local temperature = getValue()
local upperThreshold = max - 20 local upperThreshold = max - 20

View File

@@ -12,11 +12,16 @@ local function color()
return colors.black return colors.black
end end
-- local function watch()
-- while true do
-- checkSteamLevel()
-- sleep(0.05) -- Update every tenth second
-- end
-- end
local function watch() local function watch()
while true do checkSteamLevel()
checkSteamLevel()
sleep(0.05) -- Update every tenth second
end
end end
function checkSteamLevel() function checkSteamLevel()