mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-12 22:50:13 -06:00
Collection of a number of changes (#2286)
* Cleanup Property code * Remove NOLINT statements * Return Property class types as string_view * Remove getStringValue function * Simplify string value retrieval * Ensure that image paths in the ImageSequenceTileProvider are sorted (closes #2205) * Some cleanup of OpenSpaceEngine * Cleanup documentation * Some more cleanup of engine classes * Some more cleanup * Update SGCT repository * Use new Jenkins node identifiers as the old method broke with update
This commit is contained in:
@@ -253,10 +253,7 @@ bool ScriptEngine::hasLibrary(const std::string& name) {
|
||||
bool ScriptEngine::runScript(const std::string& script, ScriptCallback callback) {
|
||||
ZoneScoped
|
||||
|
||||
if (script.empty()) {
|
||||
LWARNING("Script was empty");
|
||||
return false;
|
||||
}
|
||||
ghoul_assert(!script.empty(), "Script must not be empty");
|
||||
|
||||
if (_logScripts) {
|
||||
// Write command to log before it's executed
|
||||
@@ -448,12 +445,10 @@ void ScriptEngine::addLibraryFunctions(lua_State* state, LuaLibrary& library,
|
||||
library.documentations.push_back(std::move(func));
|
||||
}
|
||||
catch (const documentation::SpecificationError& e) {
|
||||
for (const documentation::TestResult::Offense& o : e.result.offenses)
|
||||
{
|
||||
for (const documentation::TestResult::Offense& o : e.result.offenses) {
|
||||
LERRORC(o.offender, ghoul::to_string(o.reason));
|
||||
}
|
||||
for (const documentation::TestResult::Warning& w : e.result.warnings)
|
||||
{
|
||||
for (const documentation::TestResult::Warning& w : e.result.warnings) {
|
||||
LWARNINGC(w.offender, ghoul::to_string(w.reason));
|
||||
}
|
||||
}
|
||||
@@ -463,18 +458,6 @@ void ScriptEngine::addLibraryFunctions(lua_State* state, LuaLibrary& library,
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEngine::remapPrintFunction() {
|
||||
//ghoul::lua::logStack(_state);
|
||||
// lua_getglobal(_state, _luaGlobalNamespace.c_str());
|
||||
//ghoul::lua::logStack(_state);
|
||||
// lua_pushstring(_state, _printFunctionName.c_str());
|
||||
//ghoul::lua::logStack(_state);
|
||||
// lua_pushcfunction(_state, _printFunctionReplacement);
|
||||
//ghoul::lua::logStack(_state);
|
||||
// lua_settable(_state, _setTableOffset);
|
||||
//ghoul::lua::logStack(_state);
|
||||
}
|
||||
|
||||
bool ScriptEngine::registerLuaLibrary(lua_State* state, LuaLibrary& library) {
|
||||
ZoneScoped
|
||||
|
||||
@@ -548,7 +531,7 @@ std::string ScriptEngine::generateJson() const {
|
||||
return json.str();
|
||||
}
|
||||
|
||||
bool ScriptEngine::writeLog(const std::string& script) {
|
||||
void ScriptEngine::writeLog(const std::string& script) {
|
||||
ZoneScoped
|
||||
|
||||
// Check that logging is enabled and initialize if necessary
|
||||
@@ -571,12 +554,12 @@ bool ScriptEngine::writeLog(const std::string& script) {
|
||||
std::filesystem::path(_logFilename)
|
||||
));
|
||||
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
_logScripts = false;
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -584,13 +567,10 @@ bool ScriptEngine::writeLog(const std::string& script) {
|
||||
std::ofstream file(_logFilename, std::ofstream::app);
|
||||
if (!file.good()) {
|
||||
LERROR(fmt::format("Could not open file '{}' for logging scripts", _logFilename));
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
file << script << std::endl;
|
||||
file.close();
|
||||
|
||||
return true;
|
||||
file << script << '\n';
|
||||
}
|
||||
|
||||
void ScriptEngine::preSync(bool isMaster) {
|
||||
@@ -682,9 +662,10 @@ void ScriptEngine::queueScript(std::string script,
|
||||
{
|
||||
ZoneScoped
|
||||
|
||||
if (!script.empty()) {
|
||||
_incomingScripts.push({ std::move(script), remoteScripting, callback });
|
||||
if (script.empty()) {
|
||||
return;
|
||||
}
|
||||
_incomingScripts.push({ std::move(script), remoteScripting, std::move(callback) });
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user