overte-JulianGro/interface/src/scripting/TestScriptingInterface.cpp
2016-12-16 01:14:01 -08:00

58 lines
No EOL
1.3 KiB
C++

//
// Created by Bradley Austin Davis on 2016/12/12
// Copyright 2013-2016 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "TestScriptingInterface.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QLoggingCategory>
#include <DependencyManager.h>
#include <Trace.h>
TestScriptingInterface* TestScriptingInterface::getInstance() {
static TestScriptingInterface sharedInstance;
return &sharedInstance;
}
void TestScriptingInterface::quit() {
qApp->quit();
}
void TestScriptingInterface::waitForTextureIdle() {
}
void TestScriptingInterface::waitForDownloadIdle() {
}
void TestScriptingInterface::waitIdle() {
}
bool TestScriptingInterface::startTracing(QString logrules) {
if (!logrules.isEmpty()) {
QLoggingCategory::setFilterRules(logrules);
}
if (!DependencyManager::isSet<tracing::Tracer>()) {
return false;
}
DependencyManager::get<tracing::Tracer>()->startTracing();
return true;
}
bool TestScriptingInterface::stopTracing(QString filename) {
if (!DependencyManager::isSet<tracing::Tracer>()) {
return false;
}
auto tracer = DependencyManager::get<tracing::Tracer>();
tracer->stopTracing();
tracer->serialize(filename);
return true;
}