Move helper lua functions for script scheduling to scripts/common.lua

This commit is contained in:
Erik Broberg
2016-08-30 14:03:19 -04:00
parent 5e31638b92
commit 69681ea36e
2 changed files with 32 additions and 22 deletions

View File

@@ -1,25 +1,13 @@
function enable(name, enabled)
return "openspace.setPropertyValue('" .. name .. ".renderable.enabled', " .. (enabled and "true" or "false") .. ");";
end
-- Load the common helper functions
dofile(openspace.absPath('${SCRIPTS}/common.lua'))
function scheduleEnabled(time, name, enabled)
return
{
Time = time,
ReversibleLuaScript = {
Forward = enable(name, enabled),
Backward = enable(name, not enabled)
}
}
end
return
return
{
scheduleEnabled("2016 SEP 08 23:05:01", "OsirisRexTrailEarth", true),
scheduleEnabled("2016 SEP 09 00:00:00", "OsirisRexTrailSolarSystem", true),
scheduleEnabled("2016 SEP 09 02:00:00", "OsirisRexTrailEarth", false),
scheduleEnabled("2018 OCT 11 00:00:00", "OsirisRexTrailBennu", true),
scheduleEnabled("2018 OCT 15 00:00:00", "OsirisRexTrailSolarSystem", false),
scheduleEnabled("2019 AUG 01 00:00:00", "OsirisRexTrailSolarSystem", true),
scheduleEnabled("2019 AUG 01 00:00:00", "OsirisRexTrailBennu", false),
helper.scheduledScript.enable("2016 SEP 08 23:05:01", "OsirisRexTrailEarth", true),
helper.scheduledScript.enable("2016 SEP 09 00:00:00", "OsirisRexTrailSolarSystem", true),
helper.scheduledScript.enable("2016 SEP 09 02:00:00", "OsirisRexTrailEarth", false),
helper.scheduledScript.enable("2018 OCT 11 00:00:00", "OsirisRexTrailBennu", true),
helper.scheduledScript.enable("2018 OCT 15 00:00:00", "OsirisRexTrailSolarSystem", false),
helper.scheduledScript.enable("2019 AUG 01 00:00:00", "OsirisRexTrailSolarSystem", true),
helper.scheduledScript.enable("2019 AUG 01 00:00:00", "OsirisRexTrailBennu", false),
}