Add debug functionalities: Busy wait for decode() and Log SGCT out-of-order errors

This commit is contained in:
Erik Broberg
2016-09-06 12:44:03 -04:00
parent 3cac5858be
commit aada13a656
5 changed files with 85 additions and 24 deletions

View File

@@ -32,13 +32,26 @@
#include <ghoul/ghoul.h>
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/logging/logmanager.h>
#include <string>
namespace {
const std::string _loggerCat = "SettingsEngine";
}
namespace openspace {
SettingsEngine::SettingsEngine()
: _eyeSeparation("eyeSeparation", "Eye Separation" , 0.f, 0.f, 10.f)
, _scenes("scenes", "Scene", properties::OptionProperty::DisplayType::DROPDOWN)
, _showFrameNumber("showFrameNumber", "Show frame number", false)
, _busyWaitForDecode("busyWaitForDecode", "Busy Wait for decode", false)
, _logSGCTOutOfOrderErrors("logSGCTOutOfOrderErrors", "Log SGCT out-of-order", false)
{
setName("Global Properties");
}
@@ -47,6 +60,8 @@ void SettingsEngine::initialize() {
initEyeSeparation();
initSceneFiles();
initShowFrameNumber();
initBusyWaitForDecode();
initLogSGCTOutOfOrderErrors();
}
void SettingsEngine::setModules(std::vector<OpenSpaceModule*> modules) {
@@ -70,6 +85,30 @@ void SettingsEngine::initShowFrameNumber() {
[this]() { OsEng.renderEngine().setShowFrameNumber(_showFrameNumber.value()); } );
}
void SettingsEngine::initBusyWaitForDecode() {
addProperty(_busyWaitForDecode);
_busyWaitForDecode.onChange(
[this]() {
LINFO((_busyWaitForDecode.value() ? "Busy wait for decode" : "Async decode"));
});
}
bool SettingsEngine::busyWaitForDecode() {
return _busyWaitForDecode.value();
}
void SettingsEngine::initLogSGCTOutOfOrderErrors() {
addProperty(_logSGCTOutOfOrderErrors);
_logSGCTOutOfOrderErrors.onChange(
[this]() {
LINFO("Turn " << (_logSGCTOutOfOrderErrors.value() ? "on" : "off") << " SGCT out of order logging");
});
}
bool SettingsEngine::logSGCTOutOfOrderErrors() {
return _logSGCTOutOfOrderErrors.value();
}
void SettingsEngine::initSceneFiles() {
addProperty(_scenes);