bootloader

This commit is contained in:
Mikayla Fischler 2022-05-11 11:31:02 -04:00
parent bced8bf566
commit 02541184bd
10 changed files with 90 additions and 37 deletions

View File

@ -7,6 +7,7 @@
"bit",
"parallel",
"colors",
"textutils"
"textutils",
"shell"
]
}

View File

@ -6,8 +6,8 @@ local log = require("scada-common.log")
local ppm = require("scada-common.ppm")
local util = require("scada-common.util")
local config = require("config")
local coordinator = require("coordinator")
local config = require("coordinator.config")
local coordinator = require("coordinator.coordinator")
local COORDINATOR_VERSION = "alpha-v0.1.2"

View File

@ -7,9 +7,9 @@ local mqueue = require("scada-common.mqueue")
local ppm = require("scada-common.ppm")
local util = require("scada-common.util")
local config = require("config")
local plc = require("plc")
local threads = require("threads")
local config = require("reactor-plc.config")
local plc = require("reactor-plc.plc")
local threads = require("reactor-plc.threads")
local R_PLC_VERSION = "alpha-v0.6.6"

View File

@ -4,7 +4,7 @@ local log = require("scada-common.log")
local types = require("scada-common.types")
local util = require("scada-common.util")
local modbus = require("modbus")
local modbus = require("rtu.modbus")
local rtu = {}

View File

@ -9,18 +9,18 @@ local rsio = require("scada-common.rsio")
local types = require("scada-common.types")
local util = require("scada-common.util")
local config = require("config")
local modbus = require("modbus")
local rtu = require("rtu")
local threads = require("threads")
local config = require("rtu.config")
local modbus = require("rtu.modbus")
local rtu = require("rtu.rtu")
local threads = require("rtu.threads")
local redstone_rtu = require("dev.redstone_rtu")
local boiler_rtu = require("dev.boiler_rtu")
local boilerv_rtu = require("dev.boilerv_rtu")
local energymachine_rtu = require("dev.energymachine_rtu")
local imatrix_rtu = require("dev.imatrix_rtu")
local turbine_rtu = require("dev.turbine_rtu")
local turbinev_rtu = require("dev.turbinev_rtu")
local redstone_rtu = require("rtu.dev.redstone_rtu")
local boiler_rtu = require("rtu.dev.boiler_rtu")
local boilerv_rtu = require("rtu.dev.boilerv_rtu")
local energymachine_rtu = require("rtu.dev.energymachine_rtu")
local imatrix_rtu = require("rtu.dev.imatrix_rtu")
local turbine_rtu = require("rtu.dev.turbine_rtu")
local turbinev_rtu = require("rtu.dev.turbinev_rtu")
local RTU_VERSION = "alpha-v0.6.2"

View File

@ -5,15 +5,15 @@ local ppm = require("scada-common.ppm")
local types = require("scada-common.types")
local util = require("scada-common.util")
local redstone_rtu = require("dev.redstone_rtu")
local boiler_rtu = require("dev.boiler_rtu")
local boilerv_rtu = require("dev.boilerv_rtu")
local energymachine_rtu = require("dev.energymachine_rtu")
local imatrix_rtu = require("dev.imatrix_rtu")
local turbine_rtu = require("dev.turbine_rtu")
local turbinev_rtu = require("dev.turbinev_rtu")
local redstone_rtu = require("rtu.dev.redstone_rtu")
local boiler_rtu = require("rtu.dev.boiler_rtu")
local boilerv_rtu = require("rtu.dev.boilerv_rtu")
local energymachine_rtu = require("rtu.dev.energymachine_rtu")
local imatrix_rtu = require("rtu.dev.imatrix_rtu")
local turbine_rtu = require("rtu.dev.turbine_rtu")
local turbinev_rtu = require("rtu.dev.turbinev_rtu")
local modbus = require("modbus")
local modbus = require("rtu.modbus")
local threads = {}

52
startup.lua Normal file
View File

@ -0,0 +1,52 @@
local util = require("scada-common.util")
local BOOTLOADER_VERSION = "0.1"
local println = util.println
local println_ts = util.println_ts
println("SCADA BOOTLOADER V" .. BOOTLOADER_VERSION)
local exit_code = false
println_ts("BOOT> SCANNING FOR APPLICATIONS...")
if fs.exists("reactor-plc/startup.lua") then
-- found reactor-plc application
println("BOOT> FOUND REACTOR PLC APPLICATION")
println("BOOT> EXEC STARTUP")
exit_code = shell.execute("reactor-plc/startup")
elseif fs.exists("rtu/startup.lua") then
-- found rtu application
println("BOOT> FOUND RTU APPLICATION")
println("BOOT> EXEC STARTUP")
exit_code = shell.execute("rtu/startup")
elseif fs.exists("supervisor/startup.lua") then
-- found supervisor application
println("BOOT> FOUND SUPERVISOR APPLICATION")
println("BOOT> EXEC STARTUP")
exit_code = shell.execute("supervisor/startup")
elseif fs.exists("coordinator/startup.lua") then
-- found coordinator application
println("BOOT> FOUND COORDINATOR APPLICATION")
println("BOOT> EXEC STARTUP")
exit_code = shell.execute("coordinator/startup")
elseif fs.exists("pocket/startup.lua") then
-- found pocket application
println("BOOT> FOUND POCKET APPLICATION")
println("BOOT> EXEC STARTUP")
exit_code = shell.execute("pocket/startup")
else
-- no known applications found
println("BOOT> NO SCADA STARTUP APPLICATION FOUND")
println("BOOT> EXIT")
return false
end
if exit_code then
println_ts("BOOT> APPLICATION EXITED OK")
else
println_ts("BOOT> APPLICATION CRASHED")
end
return exit_code

View File

@ -1,9 +1,9 @@
local log = require("scada-common.log")
local mqueue = require("scada-common.mqueue")
local coordinator = require("session.coordinator")
local plc = require("session.plc")
local rtu = require("session.rtu")
local coordinator = require("supervisor.session.coordinator")
local plc = require("supervisor.session.plc")
local rtu = require("supervisor.session.rtu")
-- Supervisor Sessions Handler

View File

@ -6,13 +6,13 @@ local log = require("scada-common.log")
local ppm = require("scada-common.ppm")
local util = require("scada-common.util")
local coordinator = require("session.coordinator")
local plc = require("session.plc")
local rtu = require("session.rtu")
local svsessions = require("session.svsessions")
local coordinator = require("supervisor.session.coordinator")
local plc = require("supervisor.session.plc")
local rtu = require("supervisor.session.rtu")
local svsessions = require("supervisor.session.svsessions")
local config = require("config")
local supervisor = require("supervisor")
local config = require("supervisor.config")
local supervisor = require("supervisor.supervisor")
local SUPERVISOR_VERSION = "alpha-v0.3.4"

View File

@ -2,7 +2,7 @@ local comms = require("scada-common.comms")
local log = require("scada-common.log")
local util = require("scada-common.util")
local svsessions = require("session.svsessions")
local svsessions = require("supervisor.session.svsessions")
local supervisor = {}