mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-19 10:38:29 -05:00
Feature/sync unsync (#1722)
Add Lua script to manually sync or unsync resources (closes #1713)
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include <openspace/engine/globalscallbacks.h>
|
||||
#include <openspace/rendering/renderable.h>
|
||||
#include <openspace/rendering/screenspacerenderable.h>
|
||||
#include <openspace/scripting/lualibrary.h>
|
||||
#include <openspace/util/factorymanager.h>
|
||||
#include <openspace/util/resourcesynchronization.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
@@ -40,6 +41,8 @@
|
||||
#include <ghoul/misc/memorypool.h>
|
||||
#include <ghoul/misc/templatefactory.h>
|
||||
|
||||
#include "syncmodule_lua.inl"
|
||||
|
||||
namespace {
|
||||
constexpr const char* KeyHttpSynchronizationRepositories =
|
||||
"HttpSynchronizationRepositories";
|
||||
@@ -140,4 +143,33 @@ std::vector<documentation::Documentation> SyncModule::documentations() const {
|
||||
};
|
||||
}
|
||||
|
||||
scripting::LuaLibrary SyncModule::luaLibrary() const {
|
||||
scripting::LuaLibrary res;
|
||||
res.name = "sync";
|
||||
res.functions = {
|
||||
{
|
||||
"syncResource",
|
||||
&luascriptfunctions::syncResource,
|
||||
{},
|
||||
"string, number",
|
||||
"Synchronizes the http resource identified by the name passed as the "
|
||||
"first parameter and the version provided as the second parameter. The "
|
||||
"application will hang while the data is being downloaded"
|
||||
},
|
||||
{
|
||||
"unsyncResource",
|
||||
&luascriptfunctions::unsyncResource,
|
||||
{},
|
||||
"string [, number]",
|
||||
"Unsynchronizes the http resources identified by the name passed as the "
|
||||
"first parameter by removing all data that was downloaded as part of the "
|
||||
"original synchronization. If the second parameter is provided, is it "
|
||||
"the version of the resources that is unsynchronized, if the parameter "
|
||||
"is not provided, all versions for the specified http resource are "
|
||||
"removed."
|
||||
}
|
||||
};
|
||||
return res;
|
||||
}
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
Reference in New Issue
Block a user