Improvements to the ScriptLog logging (#3389)

* Restructuring the queueScript function
* Don't log the contents of actions that are triggered.  Add the ability to do verbose logging in the scriptlog
This commit is contained in:
Alexander Bock
2024-09-09 21:16:57 +02:00
committed by GitHub
parent ddbf155e8b
commit fd64fe7c96
43 changed files with 365 additions and 571 deletions

View File

@@ -64,11 +64,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
RenderedPathIdentifier
);
global::scriptEngine->queueScript(
addParentScript,
scripting::ScriptEngine::ShouldBeSynchronized::Yes,
scripting::ScriptEngine::ShouldSendToRemote::Yes
);
global::scriptEngine->queueScript(addParentScript);
// Get the poses along the path
std::vector<CameraPose> poses;
@@ -98,9 +94,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
"}";
global::scriptEngine->queueScript(
std::format("openspace.addSceneGraphNode({})", pointNode),
scripting::ScriptEngine::ShouldBeSynchronized::Yes,
scripting::ScriptEngine::ShouldSendToRemote::Yes
std::format("openspace.addSceneGraphNode({})", pointNode)
);
};
@@ -121,9 +115,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
"}";
global::scriptEngine->queueScript(
std::format("openspace.addSceneGraphNode({})", lineNode),
scripting::ScriptEngine::ShouldBeSynchronized::Yes,
scripting::ScriptEngine::ShouldSendToRemote::Yes
std::format("openspace.addSceneGraphNode({})", lineNode)
);
};
@@ -158,11 +150,10 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
// Removes the currently rendered camera path if there is one.
[[codegen::luawrap]] void removeRenderedCameraPath() {
using namespace openspace;
global::scriptEngine->queueScript(
std::format("openspace.removeSceneGraphNode('{}');", RenderedPathIdentifier),
scripting::ScriptEngine::ShouldBeSynchronized::Yes,
scripting::ScriptEngine::ShouldSendToRemote::Yes
const std::string script = std::format(
"openspace.removeSceneGraphNode('{}');", RenderedPathIdentifier
);
global::scriptEngine->queueScript(script);
}
/**
@@ -191,11 +182,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
RenderedPointsIdentifier
);
global::scriptEngine->queueScript(
addParentScript,
scripting::ScriptEngine::ShouldBeSynchronized::Yes,
scripting::ScriptEngine::ShouldSendToRemote::Yes
);
global::scriptEngine->queueScript(addParentScript);
const std::vector<glm::dvec3> points = currentPath->controlPoints();
@@ -230,9 +217,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
"}";
global::scriptEngine->queueScript(
std::format("openspace.addSceneGraphNode({})", node),
scripting::ScriptEngine::ShouldBeSynchronized::Yes,
scripting::ScriptEngine::ShouldSendToRemote::Yes
std::format("openspace.addSceneGraphNode({})", node)
);
}
}
@@ -240,14 +225,12 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0);
// Removes the rendered control points.
[[codegen::luawrap]] void removePathControlPoints() {
using namespace openspace;
global::scriptEngine->queueScript(
std::format("openspace.removeSceneGraphNode('{}');", RenderedPointsIdentifier),
scripting::ScriptEngine::ShouldBeSynchronized::Yes,
scripting::ScriptEngine::ShouldSendToRemote::Yes
const std::string script = std::format(
"openspace.removeSceneGraphNode('{}');", RenderedPointsIdentifier
);
global::scriptEngine->queueScript(script);
}
#include "debuggingmodule_lua_codegen.cpp"
} // namespace