Enable setting the capabilities verbosity using the configuration file

This commit is contained in:
Alexander Bock
2015-06-18 14:29:34 +02:00
parent 54186e5dcb
commit f58d6d91b5
5 changed files with 19 additions and 2 deletions

View File

@@ -53,7 +53,7 @@ std::pair<int, int> supportedOpenGLVersion () {
//On OS X we need to explicitly set the version and specify that we are using CORE profile
//to be able to use glGetIntegerv(GL_MAJOR_VERSION, &major) and glGetIntegerv(GL_MINOR_VERSION, &minor)
//explicitly setting to OGL 3.3 CORE works since all Mac's now support at least 3.3
#if __APPLE__
#ifdef __APPLE__
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);

View File

@@ -49,6 +49,7 @@ public:
static const std::string KeyLogLevel;
static const std::string KeyLogImmediateFlush;
static const std::string KeyLogs;
static const std::string KeyCapabilitiesVerbosity;
static const std::string KeyDisableMasterRendering;
static const std::string KeyDownloadRequestURL;

View File

@@ -306,6 +306,7 @@ void ImageSequencer2::runSequenceParser(SequenceParser* parser){
std::vector<double> in5 = parser->getCaptureProgression();
// check for sanity
// TODO: This cannot crash the program! ---abock
ghoul_assert(in1.size() > 0, "Sequencer failed to load Translation" );
ghoul_assert(in2.size() > 0, "Sequencer failed to load Image data" );
ghoul_assert(in3.size() > 0, "Sequencer failed to load Instrument Switching schedule");

View File

@@ -57,6 +57,7 @@ const std::string ConfigurationManager::KeySpiceLeapsecondKernel = "SpiceKernel.
const std::string ConfigurationManager::KeyLogLevel = "Logging.LogLevel";
const std::string ConfigurationManager::KeyLogImmediateFlush = "Logging.ImmediateFlush";
const std::string ConfigurationManager::KeyLogs = "Logging.Logs";
const std::string ConfigurationManager::KeyCapabilitiesVerbosity = "Logging.CapabilitiesVerbosity";
const std::string ConfigurationManager::KeyDisableMasterRendering = "DisableRenderingOnMaster";
const std::string ConfigurationManager::KeyDownloadRequestURL = "DownloadRequestURL";

View File

@@ -288,7 +288,21 @@ bool OpenSpaceEngine::initialize() {
SysCap.addComponent(new ghoul::systemcapabilities::GeneralCapabilitiesComponent);
SysCap.addComponent(new ghoul::systemcapabilities::OpenGLCapabilitiesComponent);
SysCap.detectCapabilities();
SysCap.logCapabilities();
using Verbosity = ghoul::systemcapabilities::SystemCapabilitiesComponent::Verbosity;
Verbosity verbosity = Verbosity::Default;
if (configurationManager()->hasKeyAndValue<std::string>(ConfigurationManager::KeyCapabilitiesVerbosity)) {
std::map<std::string, Verbosity> verbosityMap = {
{ "Minimal", Verbosity::Minimal },
{ "Default", Verbosity::Default },
{ "Full", Verbosity::Full }
};
std::string v = configurationManager()->value<std::string>(ConfigurationManager::KeyCapabilitiesVerbosity);
if (verbosityMap.find(v) != verbosityMap.end())
verbosity = verbosityMap[v];
}
SysCap.logCapabilities(verbosity);
std::string requestURL = "";
bool success = configurationManager()->getValue(ConfigurationManager::KeyDownloadRequestURL, requestURL);