mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-13 07:01:11 -06:00
Merge branch 'master' of github.com:OpenSpace/OpenSpace into feature/data-management
This commit is contained in:
@@ -268,6 +268,8 @@ std::future<DownloadManager::MemoryFile> DownloadManager::fetchFile(
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, reinterpret_cast<void*>(&file));
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeMemoryCallback);
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 5L);
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
|
||||
// Will fail when response status is 400 or above
|
||||
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
|
||||
|
||||
@@ -290,7 +292,11 @@ std::future<DownloadManager::MemoryFile> DownloadManager::fetchFile(
|
||||
return file;
|
||||
} else {
|
||||
std::string err = curl_easy_strerror(res);
|
||||
errorCallback(err);
|
||||
if (errorCallback) {
|
||||
errorCallback(err);
|
||||
} else {
|
||||
LWARNING("Error downloading '" << url << "': " << err);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
// Throw an error and use try-catch around call to future.get()
|
||||
//throw std::runtime_error( err );
|
||||
|
||||
@@ -111,6 +111,19 @@ namespace {
|
||||
std::string sceneName;
|
||||
std::string cacheFolder;
|
||||
} commandlineArgumentPlaceholders;
|
||||
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo VersionInfo = {
|
||||
"VersionInfo",
|
||||
"Version Information",
|
||||
"This value contains the full string identifying this OpenSpace Version"
|
||||
};
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo SourceControlInfo = {
|
||||
"SCMInfo",
|
||||
"Source Control Management Information",
|
||||
"This value contains information from the SCM, such as commit hash and branch"
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace openspace {
|
||||
@@ -144,6 +157,10 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName,
|
||||
, _scriptScheduler(new scripting::ScriptScheduler)
|
||||
, _virtualPropertyManager(new VirtualPropertyManager)
|
||||
, _globalPropertyNamespace(new properties::PropertyOwner({ "" }))
|
||||
, _versionInformation{
|
||||
properties::StringProperty(VersionInfo, OPENSPACE_VERSION_STRING_FULL),
|
||||
properties::StringProperty(SourceControlInfo, OPENSPACE_GIT_FULL)
|
||||
}
|
||||
, _scheduledSceneSwitch(false)
|
||||
, _scenePath("")
|
||||
, _runTime(0.0)
|
||||
@@ -160,6 +177,12 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName,
|
||||
_globalPropertyNamespace->addPropertySubOwner(_parallelConnection.get());
|
||||
_globalPropertyNamespace->addPropertySubOwner(_console.get());
|
||||
|
||||
|
||||
_versionInformation.versionString.setReadOnly(true);
|
||||
_globalPropertyNamespace->addProperty(_versionInformation.versionString);
|
||||
_versionInformation.sourceControlInformation.setReadOnly(true);
|
||||
_globalPropertyNamespace->addProperty(_versionInformation.sourceControlInformation);
|
||||
|
||||
FactoryManager::initialize();
|
||||
FactoryManager::ref().addFactory(
|
||||
std::make_unique<ghoul::TemplateFactory<Renderable>>(),
|
||||
@@ -1162,6 +1185,7 @@ void OpenSpaceEngine::postDraw() {
|
||||
|
||||
if (isGuiWindow) {
|
||||
_renderEngine->renderScreenLog();
|
||||
_renderEngine->renderVersionInformation();
|
||||
_console->render();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#endif
|
||||
#include <openspace/util/syncdata.h>
|
||||
|
||||
#include <openspace/openspace.h>
|
||||
#include <openspace/engine/configurationmanager.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
@@ -127,6 +128,13 @@ namespace {
|
||||
"log."
|
||||
};
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo ShowVersionInfo = {
|
||||
"ShowVersion",
|
||||
"Shows the version on-screen information",
|
||||
"This value determines whether the GIT version information (branch and commit ) "
|
||||
"hash are shown on the screen."
|
||||
};
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo TakeScreenshotInfo = {
|
||||
"TakeScreenshot",
|
||||
"Take Screenshot",
|
||||
@@ -197,6 +205,7 @@ RenderEngine::RenderEngine()
|
||||
, _showDate(ShowDateInfo, true)
|
||||
, _showInfo(ShowInfoInfo, true)
|
||||
, _showLog(ShowLogInfo, true)
|
||||
, _showVersionInfo(ShowVersionInfo, true)
|
||||
, _takeScreenshot(TakeScreenshotInfo)
|
||||
, _shouldTakeScreenshot(false)
|
||||
, _applyWarping(ApplyWarpingInfo, false)
|
||||
@@ -248,6 +257,7 @@ RenderEngine::RenderEngine()
|
||||
addProperty(_showDate);
|
||||
addProperty(_showInfo);
|
||||
addProperty(_showLog);
|
||||
addProperty(_showVersionInfo);
|
||||
|
||||
_nAaSamples.onChange([this](){
|
||||
if (_renderer) {
|
||||
@@ -1295,6 +1305,59 @@ void RenderEngine::renderInformation() {
|
||||
}
|
||||
}
|
||||
|
||||
void RenderEngine::renderVersionInformation() {
|
||||
if (!_showVersionInfo) {
|
||||
return;
|
||||
}
|
||||
|
||||
using FR = ghoul::fontrendering::FontRenderer;
|
||||
|
||||
FR::BoundingBoxInformation versionBox = FR::defaultRenderer().boundingBox(
|
||||
*_fontInfo,
|
||||
"%s",
|
||||
OPENSPACE_VERSION_STRING_FULL
|
||||
);
|
||||
|
||||
FR::BoundingBoxInformation commitBox = FR::defaultRenderer().boundingBox(
|
||||
*_fontInfo,
|
||||
"%s@%s",
|
||||
OPENSPACE_GIT_BRANCH,
|
||||
OPENSPACE_GIT_COMMIT
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
FR::defaultRenderer().render(
|
||||
*_fontInfo,
|
||||
glm::vec2(
|
||||
fontResolution().x - versionBox.boundingBox.x - 10.f,
|
||||
5.f
|
||||
),
|
||||
glm::vec4(0.5, 0.5, 0.5, 1.f),
|
||||
"%s",
|
||||
OPENSPACE_VERSION_STRING_FULL
|
||||
);
|
||||
|
||||
// If a developer hasn't placed the Git command in the path, this variable will be
|
||||
// empty
|
||||
if (!std::string(OPENSPACE_GIT_COMMIT).empty()) {
|
||||
// We check OPENSPACE_GIT_COMMIT but puse OPENSPACE_GIT_FULL on purpose since
|
||||
// OPENSPACE_GIT_FULL will never be empty (always will contain at least @, but
|
||||
// checking for that is a bit brittle)
|
||||
FR::defaultRenderer().render(
|
||||
*_fontInfo,
|
||||
glm::vec2(
|
||||
fontResolution().x - commitBox.boundingBox.x - 10.f,
|
||||
versionBox.boundingBox.y + 5.f
|
||||
),
|
||||
glm::vec4(0.5, 0.5, 0.5, 1.f),
|
||||
"%s",
|
||||
OPENSPACE_GIT_FULL
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void RenderEngine::renderScreenLog() {
|
||||
if (!_showLog) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user