mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-07-06 22:07:52 +00:00
#751 add check for required libraries
Add check that the required files in DSMLIB exist
This commit is contained in:
parent
bb9873d772
commit
0c52932305
@ -21,13 +21,19 @@ local SIMULATION_ON = false -- FALSE: use real communication to DSM RX (DEFAULT
|
|||||||
local DEBUG_ON = 1 -- 0=NO DEBUG, 1=HIGH LEVEL 2=LOW LEVEL (Debug logged into the /LOGS/dsm.log)
|
local DEBUG_ON = 1 -- 0=NO DEBUG, 1=HIGH LEVEL 2=LOW LEVEL (Debug logged into the /LOGS/dsm.log)
|
||||||
local DEBUG_ON_LCD = false -- Interactive Information on LCD of Menu data from RX
|
local DEBUG_ON_LCD = false -- Interactive Information on LCD of Menu data from RX
|
||||||
|
|
||||||
|
local DSMLIB_PATH = "/SCRIPTS/TOOLS/DSMLIB/"
|
||||||
|
|
||||||
|
local dirExist = fstat(DSMLIB_PATH.."DsmFwPrgLib.lua")
|
||||||
|
if (dirExist==nil) then error("Make sure "..DSMLIB_PATH.." contains DsmFwPrgLib.lua") end
|
||||||
|
dirExist = fstat(DSMLIB_PATH.."DsmFwPrgSIMLib.lua")
|
||||||
|
if (dirExist==nil) then error("Make sure "..DSMLIB_PATH.." contains DsmFwPrgSIMLib.lua") end
|
||||||
|
|
||||||
local dsmLib
|
local dsmLib
|
||||||
if (SIMULATION_ON) then
|
if (SIMULATION_ON) then
|
||||||
-- library with SIMILATION VERSION. Works really well in Companion for GUI development
|
-- library with SIMILATION VERSION. Works really well in Companion for GUI development
|
||||||
dsmLib = loadScript("/SCRIPTS/TOOLS/DSMLIB/DsmFwPrgSIMLib.lua")(DEBUG_ON)
|
dsmLib = loadScript(DSMLIB_PATH .. "DsmFwPrgSIMLib.lua")(DEBUG_ON)
|
||||||
else
|
else
|
||||||
dsmLib = loadScript("/SCRIPTS/TOOLS/DSMLIB/DsmFwPrgLib.lua")(DEBUG_ON)
|
dsmLib = loadScript(DSMLIB_PATH .. "DsmFwPrgLib.lua")(DEBUG_ON)
|
||||||
end
|
end
|
||||||
|
|
||||||
local PHASE = dsmLib.PHASE
|
local PHASE = dsmLib.PHASE
|
||||||
@ -68,7 +74,7 @@ local function GUI_SwitchSimulationOFF()
|
|||||||
dsmLib.LOG_close()
|
dsmLib.LOG_close()
|
||||||
|
|
||||||
SIMULATION_ON = false
|
SIMULATION_ON = false
|
||||||
dsmLib = loadScript("/SCRIPTS/TOOLS/DSMLIB/DsmFwPrgLib.lua")(DEBUG_ON)
|
dsmLib = loadScript(DSMLIB_PATH .. "DsmFwPrgLib.lua")(DEBUG_ON)
|
||||||
DSM_Context = dsmLib.DSM_Context
|
DSM_Context = dsmLib.DSM_Context
|
||||||
|
|
||||||
dsmLib.Init(toolName) -- Initialize Library
|
dsmLib.Init(toolName) -- Initialize Library
|
||||||
|
@ -22,16 +22,23 @@ local SIMULATION_ON = false -- FALSE: use real communication to DSM RX (DEFAUL
|
|||||||
local DEBUG_ON = 1 -- 0=NO DEBUG, 1=HIGH LEVEL 2=LOW LEVEL (Debug logged into the /LOGS/dsm.log)
|
local DEBUG_ON = 1 -- 0=NO DEBUG, 1=HIGH LEVEL 2=LOW LEVEL (Debug logged into the /LOGS/dsm.log)
|
||||||
local DEBUG_ON_LCD = false -- Interactive Information on LCD of Menu data from RX
|
local DEBUG_ON_LCD = false -- Interactive Information on LCD of Menu data from RX
|
||||||
local USE_SPECKTRUM_COLORS = true -- true: Use spectrum colors, false: use theme colors (default on OpenTX)
|
local USE_SPECKTRUM_COLORS = true -- true: Use spectrum colors, false: use theme colors (default on OpenTX)
|
||||||
|
local DSMLIB_PATH = "/SCRIPTS/TOOLS/DSMLIB/"
|
||||||
|
local IMAGE_PATH = DSMLIB_PATH .. "img/"
|
||||||
|
|
||||||
|
local dirExist = fstat(DSMLIB_PATH.."DsmFwPrgLib.lua")
|
||||||
|
if (dirExist==nil) then error("Make sure "..DSMLIB_PATH.." contains DsmFwPrgLib.lua") end
|
||||||
|
dirExist = fstat(DSMLIB_PATH.."DsmFwPrgSIMLib.lua")
|
||||||
|
if (dirExist==nil) then error("Make sure "..DSMLIB_PATH.." contains DsmFwPrgSIMLib.lua") end
|
||||||
|
|
||||||
local dsmLib
|
local dsmLib
|
||||||
if (SIMULATION_ON) then
|
if (SIMULATION_ON) then
|
||||||
-- library with SIMILATION VERSION. Works really well in Companion for GUI development
|
-- library with SIMILATION VERSION. Works really well in Companion for GUI development
|
||||||
dsmLib = loadScript("/SCRIPTS/TOOLS/DSMLIB/DsmFwPrgSIMLib.lua")(DEBUG_ON)
|
dsmLib = loadScript(DSMLIB_PATH.."DsmFwPrgSIMLib.lua")(DEBUG_ON)
|
||||||
else
|
else
|
||||||
dsmLib = loadScript("/SCRIPTS/TOOLS/DSMLIB/DsmFwPrgLib.lua")(DEBUG_ON)
|
dsmLib = loadScript(DSMLIB_PATH.."DsmFwPrgLib.lua")(DEBUG_ON)
|
||||||
end
|
end
|
||||||
|
|
||||||
local IMAGE_PATH = "/SCRIPTS/TOOLS/DSMLIB/img/"
|
|
||||||
|
|
||||||
local PHASE = dsmLib.PHASE
|
local PHASE = dsmLib.PHASE
|
||||||
local LINE_TYPE = dsmLib.LINE_TYPE
|
local LINE_TYPE = dsmLib.LINE_TYPE
|
||||||
@ -97,7 +104,7 @@ local function GUI_SwitchSimulationOFF()
|
|||||||
dsmLib.LOG_close()
|
dsmLib.LOG_close()
|
||||||
|
|
||||||
SIMULATION_ON = false
|
SIMULATION_ON = false
|
||||||
dsmLib = loadScript("/SCRIPTS/TOOLS/DSMLIB/DsmFwPrgLib.lua")(DEBUG_ON)
|
dsmLib = loadScript(DSMLIB_PATH .. "DsmFwPrgLib.lua")(DEBUG_ON)
|
||||||
DSM_Context = dsmLib.DSM_Context
|
DSM_Context = dsmLib.DSM_Context
|
||||||
|
|
||||||
dsmLib.Init(toolName) -- Initialize Library
|
dsmLib.Init(toolName) -- Initialize Library
|
||||||
|
Loading…
x
Reference in New Issue
Block a user