Only display commit hash text overlay if there is information available

Add version and commit information into a global property
This commit is contained in:
Alexander Bock
2017-08-31 11:37:22 -04:00
parent 0ceab49df7
commit c3825cc81e
4 changed files with 47 additions and 11 deletions

View File

@@ -112,6 +112,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 {
@@ -145,6 +158,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)
@@ -161,6 +178,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>>(),