Ensure all nodes in a cluster establish contact with their own instance of the wwt application (needs an updated website version - this update will not work with the current website version on the server)

This commit is contained in:
sylvass
2021-12-28 08:09:31 -05:00
parent 63ac90b93f
commit a07b4a5afe
2 changed files with 23 additions and 2 deletions

View File

@@ -267,6 +267,13 @@ namespace openspace {
"Add one or multiple exoplanet systems to the scene, as specified by the "
"input. An input string should be the name of the system host star"
},
{
"startSetup",
&skybrowser::luascriptfunctions::startSetup,
"string or list of strings",
"Add one or multiple exoplanet systems to the scene, as specified by the "
"input. An input string should be the name of the system host star"
},
};
return res;

View File

@@ -163,6 +163,20 @@ int loadImagesToWWT(lua_State* L) {
return 0;
}
int startSetup(lua_State* L) {
// This is called when the sky_browser website is connected to OpenSpace
ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::startSetup");
// To ensure each node in a cluster calls its own instance of the wwt application
// Do not send this script to the other nodes
openspace::global::scriptEngine->queueScript(
"openspace.skybrowser.sendOutIdsToBrowsers();",
scripting::ScriptEngine::RemoteScripting::No
);
return 0;
}
int sendOutIdsToBrowsers(lua_State* L) {
// This is called when the sky_browser website is connected to OpenSpace
ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::sendOutIdsToBrowsers");
@@ -512,8 +526,8 @@ int createTargetBrowserPair(lua_State* L) {
std::string idTarget = "SkyTarget" + std::to_string(noOfPairs);
glm::vec3 positionBrowser = { -1.0f, -0.5f, -2.1f };
std::string guiPath = "/SkyBrowser";
std::string url = "https://data.openspaceproject.com/dist/skybrowser/page/";
//std::string url = "http://localhost:8000"; // check webgl version
//std::string url = "https://data.openspaceproject.com/dist/skybrowser/page/";
std::string url = "http://localhost:8000"; // check webgl version
//std::string url = "https://get.webgl.org";
glm::ivec3 color = randomBorderColor();