diff --git a/burnrate_driver.lua b/burnrate_driver.lua index 870d9e7..d7100a2 100644 --- a/burnrate_driver.lua +++ b/burnrate_driver.lua @@ -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() diff --git a/coolant_driver.lua b/coolant_driver.lua index 577f226..cafa565 100644 --- a/coolant_driver.lua +++ b/coolant_driver.lua @@ -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 + checkCoolantLevel() end function checkCoolantLevel() diff --git a/main.lua b/main.lua index 0dd3b8a..6a3e0eb 100644 --- a/main.lua +++ b/main.lua @@ -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} diff --git a/status_driver.lua b/status_driver.lua index 4742f29..c3af4f9 100644 --- a/status_driver.lua +++ b/status_driver.lua @@ -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 + checkStatus() end + function checkStatus() local value = getValue() end diff --git a/temperature_driver.lua b/temperature_driver.lua index 3935a2b..f283863 100644 --- a/temperature_driver.lua +++ b/temperature_driver.lua @@ -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 + checkTemperature() end + function checkTemperature() local temperature = getValue() local upperThreshold = max - 20 diff --git a/turbine_driver.lua b/turbine_driver.lua index dcebb27..0183fa6 100644 --- a/turbine_driver.lua +++ b/turbine_driver.lua @@ -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 + checkSteamLevel() end function checkSteamLevel()