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()
while true do
sleep(0.05) -- Update every tenth second
end
end
function stepUp()

View File

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

View File

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

View File

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

View File

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

View File

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