From 386e7d93126c08d8f67a7a43d67eb176122c5265 Mon Sep 17 00:00:00 2001 From: Micah Acinapura Date: Mon, 22 Jun 2020 10:23:04 -0400 Subject: [PATCH 1/3] fixed reading config files, single_gui.xml, and updating webmodules for sgct init changes --- apps/OpenSpace/main.cpp | 2 +- config/single_gui.xml | 4 ++++ modules/cefwebgui/cefwebguimodule.cpp | 6 ++---- modules/webbrowser/webbrowsermodule.cpp | 5 +---- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 55de859016..eacbafa345 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -1272,7 +1272,7 @@ int main(int argc, char** argv) { LDEBUG("Creating SGCT Engine"); std::vector arg(argv + 1, argv + argc); Configuration config = parseArguments(arg); - config::Cluster cluster = loadCluster(windowConfiguration); + config::Cluster cluster = loadCluster(absPath(windowConfiguration)); Engine::Callbacks callbacks; callbacks.initOpenGL = mainInitFunc; diff --git a/config/single_gui.xml b/config/single_gui.xml index 3404e572e3..60399df349 100644 --- a/config/single_gui.xml +++ b/config/single_gui.xml @@ -24,6 +24,10 @@ + + + + diff --git a/modules/cefwebgui/cefwebguimodule.cpp b/modules/cefwebgui/cefwebguimodule.cpp index 839e5182c5..c5421391e0 100644 --- a/modules/cefwebgui/cefwebguimodule.cpp +++ b/modules/cefwebgui/cefwebguimodule.cpp @@ -91,10 +91,8 @@ void CefWebGuiModule::startOrStopGui() { WebBrowserModule* webBrowserModule = global::moduleEngine.module(); - const bool isGuiWindow = - global::windowDelegate.hasGuiWindow() ? - global::windowDelegate.isGuiWindow() : - true; + const bool isGuiWindow = global::windowDelegate.hasGuiWindow(); + const bool isMaster = global::windowDelegate.isMaster(); if (_enabled && isGuiWindow && isMaster) { diff --git a/modules/webbrowser/webbrowsermodule.cpp b/modules/webbrowser/webbrowsermodule.cpp index 32d042581e..f7ef7eca8e 100644 --- a/modules/webbrowser/webbrowsermodule.cpp +++ b/modules/webbrowser/webbrowsermodule.cpp @@ -138,10 +138,7 @@ void WebBrowserModule::internalInitialize(const ghoul::Dictionary& dictionary) { _enabled = dictionary.value("Enabled"); } - const bool isGuiWindow = - global::windowDelegate.hasGuiWindow() ? - global::windowDelegate.isGuiWindow() : - true; + const bool isGuiWindow = global::windowDelegate.hasGuiWindow(); const bool isMaster = global::windowDelegate.isMaster(); if (!_enabled || !isGuiWindow || !isMaster) { From 621772dbb8dcc569e8a8c7712b9eba9b011b4605 Mon Sep 17 00:00:00 2001 From: Micah Acinapura Date: Mon, 22 Jun 2020 11:58:38 -0400 Subject: [PATCH 2/3] starting up webgui even if now window with guitag available --- modules/cefwebgui/cefwebguimodule.cpp | 6 ++++-- modules/webbrowser/webbrowsermodule.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/cefwebgui/cefwebguimodule.cpp b/modules/cefwebgui/cefwebguimodule.cpp index c5421391e0..4af5fe7ed1 100644 --- a/modules/cefwebgui/cefwebguimodule.cpp +++ b/modules/cefwebgui/cefwebguimodule.cpp @@ -91,11 +91,13 @@ void CefWebGuiModule::startOrStopGui() { WebBrowserModule* webBrowserModule = global::moduleEngine.module(); - const bool isGuiWindow = global::windowDelegate.hasGuiWindow(); + //TODO: micah - revisit this, either remove code or find situation + //where you haave a master without a gui and fixfor it. + //const bool hasGuiWindow = global::windowDelegate.hasGuiWindow(); const bool isMaster = global::windowDelegate.isMaster(); - if (_enabled && isGuiWindow && isMaster) { + if (_enabled && isMaster) { LDEBUGC("WebBrowser", fmt::format("Loading GUI from {}", _url)); if (!_instance) { diff --git a/modules/webbrowser/webbrowsermodule.cpp b/modules/webbrowser/webbrowsermodule.cpp index f7ef7eca8e..877d1f8e0c 100644 --- a/modules/webbrowser/webbrowsermodule.cpp +++ b/modules/webbrowser/webbrowsermodule.cpp @@ -138,10 +138,13 @@ void WebBrowserModule::internalInitialize(const ghoul::Dictionary& dictionary) { _enabled = dictionary.value("Enabled"); } - const bool isGuiWindow = global::windowDelegate.hasGuiWindow(); + //TODO: micah - revisit this, either remove code or find situation + //where you haave a master without a gui and fixfor it. + //const bool haGuiWindow = global::windowDelegate.hasGuiWindow(); + const bool isMaster = global::windowDelegate.isMaster(); - if (!_enabled || !isGuiWindow || !isMaster) { + if (!_enabled || (!isMaster) ) { return; } From f138708fd9c69c7eac0f6d7df7d3839c046ea0fe Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 23 Jun 2020 15:18:25 +0200 Subject: [PATCH 3/3] Update SGCT to not require the specification of projection planes if 3D rendering in not required Remove comments as it is the preferred way of handling the web gui --- apps/OpenSpace/ext/sgct | 2 +- apps/OpenSpace/main.cpp | 14 ++++++++++---- config/gui_projector.xml | 4 ++-- config/single_fisheye_gui.xml | 4 ++-- config/single_gui.xml | 4 ++-- config/spherical_mirror_gui.xml | 4 ++-- ext/ghoul | 2 +- modules/cefwebgui/cefwebguimodule.cpp | 4 ---- modules/webbrowser/webbrowsermodule.cpp | 4 ---- 9 files changed, 20 insertions(+), 22 deletions(-) diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index 0d902bbe4f..1ab6980ccc 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit 0d902bbe4f13be7e1e532aa4428b9cc90422611b +Subproject commit 1ab6980ccc825a68094fcda950e73312fb89cc3c diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index eacbafa345..62297dde05 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -854,16 +854,16 @@ void mainLogCallback(Log::Level level, const char* message) { // Remove the trailing \n that is passed along switch (level) { case Log::Level::Debug: - LDEBUGC("SGCT", msg.substr(0, msg.size() - 1)); + LDEBUGC("SGCT", msg); break; case Log::Level::Info: - LINFOC("SGCT", msg.substr(0, msg.size() - 1)); + LINFOC("SGCT", msg); break; case Log::Level::Warning: - LWARNINGC("SGCT", msg.substr(0, msg.size() - 1)); + LWARNINGC("SGCT", msg); break; case Log::Level::Error: - LERRORC("SGCT", msg.substr(0, msg.size() - 1)); + LERRORC("SGCT", msg); break; } @@ -1293,6 +1293,12 @@ int main(int argc, char** argv) { try { Engine::create(cluster, callbacks, config); } + catch (const std::runtime_error& e) { + LFATAL("main", e.what()); + Engine::destroy(); + global::openSpaceEngine.deinitialize(); + ghoul::deinitialize(); + } catch (...) { Engine::destroy(); global::openSpaceEngine.deinitialize(); diff --git a/config/gui_projector.xml b/config/gui_projector.xml index 9f50aa7037..21e9d09a9f 100644 --- a/config/gui_projector.xml +++ b/config/gui_projector.xml @@ -4,7 +4,7 @@ - + @@ -17,7 +17,7 @@ - + diff --git a/config/single_fisheye_gui.xml b/config/single_fisheye_gui.xml index 6eb46bbabb..794a03b056 100644 --- a/config/single_fisheye_gui.xml +++ b/config/single_fisheye_gui.xml @@ -6,7 +6,7 @@ --> - + @@ -32,7 +32,7 @@ - + diff --git a/config/single_gui.xml b/config/single_gui.xml index 60399df349..832273090e 100644 --- a/config/single_gui.xml +++ b/config/single_gui.xml @@ -4,7 +4,7 @@ - + @@ -17,7 +17,7 @@ - + diff --git a/config/spherical_mirror_gui.xml b/config/spherical_mirror_gui.xml index c946cbecd2..e1e84e46df 100644 --- a/config/spherical_mirror_gui.xml +++ b/config/spherical_mirror_gui.xml @@ -19,7 +19,7 @@ --> - + @@ -27,7 +27,7 @@ - + diff --git a/ext/ghoul b/ext/ghoul index 19f324db68..d35be27b61 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 19f324db68837b867779059f538b46051aec1bd9 +Subproject commit d35be27b61140e76d8283999d9faee16977b1bfc diff --git a/modules/cefwebgui/cefwebguimodule.cpp b/modules/cefwebgui/cefwebguimodule.cpp index 4af5fe7ed1..7de3a160de 100644 --- a/modules/cefwebgui/cefwebguimodule.cpp +++ b/modules/cefwebgui/cefwebguimodule.cpp @@ -91,10 +91,6 @@ void CefWebGuiModule::startOrStopGui() { WebBrowserModule* webBrowserModule = global::moduleEngine.module(); - //TODO: micah - revisit this, either remove code or find situation - //where you haave a master without a gui and fixfor it. - //const bool hasGuiWindow = global::windowDelegate.hasGuiWindow(); - const bool isMaster = global::windowDelegate.isMaster(); if (_enabled && isMaster) { diff --git a/modules/webbrowser/webbrowsermodule.cpp b/modules/webbrowser/webbrowsermodule.cpp index 877d1f8e0c..d75ddf4959 100644 --- a/modules/webbrowser/webbrowsermodule.cpp +++ b/modules/webbrowser/webbrowsermodule.cpp @@ -138,10 +138,6 @@ void WebBrowserModule::internalInitialize(const ghoul::Dictionary& dictionary) { _enabled = dictionary.value("Enabled"); } - //TODO: micah - revisit this, either remove code or find situation - //where you haave a master without a gui and fixfor it. - //const bool haGuiWindow = global::windowDelegate.hasGuiWindow(); - const bool isMaster = global::windowDelegate.isMaster(); if (!_enabled || (!isMaster) ) {