mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
fixed require issues caused by using bootloader
This commit is contained in:
parent
6b74db70bd
commit
d3a926b25a
@ -2,6 +2,8 @@
|
||||
-- Nuclear Generation Facility SCADA Coordinator
|
||||
--
|
||||
|
||||
require("/initenv").init_env()
|
||||
|
||||
local log = require("scada-common.log")
|
||||
local ppm = require("scada-common.ppm")
|
||||
local util = require("scada-common.util")
|
||||
|
18
initenv.lua
Normal file
18
initenv.lua
Normal file
@ -0,0 +1,18 @@
|
||||
--
|
||||
-- Initialize the Boot Environment
|
||||
--
|
||||
|
||||
-- initialize booted environment
|
||||
local init_env = function ()
|
||||
local _require = require("cc.require")
|
||||
local _env = setmetatable({}, { __index = _ENV })
|
||||
|
||||
-- overwrite require/package globals
|
||||
require, package = _require.make(_env, "/")
|
||||
|
||||
-- reset terminal
|
||||
term.clear()
|
||||
term.setCursorPos(1, 1)
|
||||
end
|
||||
|
||||
return { init_env = init_env }
|
@ -1,3 +1,5 @@
|
||||
--
|
||||
-- SCADA Coordinator Access on a Pocket Computer
|
||||
--
|
||||
|
||||
require("/initenv").init_env()
|
||||
|
@ -2,6 +2,8 @@
|
||||
-- Reactor Programmable Logic Controller
|
||||
--
|
||||
|
||||
require("/initenv").init_env()
|
||||
|
||||
local log = require("scada-common.log")
|
||||
local mqueue = require("scada-common.mqueue")
|
||||
local ppm = require("scada-common.ppm")
|
||||
|
@ -2,6 +2,8 @@
|
||||
-- RTU: Remote Terminal Unit
|
||||
--
|
||||
|
||||
require("/initenv").init_env()
|
||||
|
||||
local log = require("scada-common.log")
|
||||
local mqueue = require("scada-common.mqueue")
|
||||
local ppm = require("scada-common.ppm")
|
||||
|
@ -1,6 +1,6 @@
|
||||
local util = require("scada-common.util")
|
||||
|
||||
local BOOTLOADER_VERSION = "0.1"
|
||||
local BOOTLOADER_VERSION = "0.2"
|
||||
|
||||
local println = util.println
|
||||
local println_ts = util.println_ts
|
||||
@ -43,9 +43,7 @@ else
|
||||
return false
|
||||
end
|
||||
|
||||
if exit_code then
|
||||
println_ts("BOOT> APPLICATION EXITED OK")
|
||||
else
|
||||
if not exit_code then
|
||||
println_ts("BOOT> APPLICATION CRASHED")
|
||||
end
|
||||
|
||||
|
@ -2,6 +2,8 @@
|
||||
-- Nuclear Generation Facility SCADA Supervisor
|
||||
--
|
||||
|
||||
require("/initenv").init_env()
|
||||
|
||||
local log = require("scada-common.log")
|
||||
local ppm = require("scada-common.ppm")
|
||||
local util = require("scada-common.util")
|
||||
|
Loading…
Reference in New Issue
Block a user