mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 21:43:13 +02:00
Separate panel for inspecting the engine
This commit is contained in:
parent
728577dfd8
commit
859b187db6
6 changed files with 100 additions and 33 deletions
|
@ -46,19 +46,20 @@ function job_propKeys(job) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use this function to create a functor that will print the content of the Job visited calling the specified 'printout' function
|
// Use this function to create a functor that will print the content of the Job visited calling the specified 'printout' function
|
||||||
function job_print_functor(printout, maxDepth) {
|
function job_print_functor(printout, showProps, maxDepth) {
|
||||||
if (maxDepth === undefined) maxDepth = 100
|
if (maxDepth === undefined) maxDepth = 100
|
||||||
return function (job, depth, index) {
|
return function (job, depth, index) {
|
||||||
var tab = " "
|
var tab = " "
|
||||||
var depthTab = "";
|
var depthTab = "";
|
||||||
for (var d = 0; d < depth; d++) { depthTab += tab }
|
for (var d = 0; d < depth; d++) { depthTab += tab }
|
||||||
printout(depthTab + index + " " + job.objectName + " " + (job.enabled ? "on" : "off"))
|
printout(depthTab + index + " " + job.objectName + " " + (job.enabled ? "on " : "off ") + job.cpuRunTime + "ms")
|
||||||
var keys = job_propKeys(job);
|
if (showProps) {
|
||||||
for (var p=0; p < keys.length;p++) {
|
var keys = job_propKeys(job);
|
||||||
var prop = job[keys[p]]
|
for (var p=0; p < keys.length;p++) {
|
||||||
printout(depthTab + tab + tab + typeof prop + " " + keys[p] + " " + prop);
|
var prop = job[keys[p]]
|
||||||
|
printout(depthTab + tab + tab + typeof prop + " " + keys[p] + " " + prop);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
// return depth < maxDepth;
|
// return depth < maxDepth;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,14 +32,9 @@ Rectangle {
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
var message = ""
|
var message = ""
|
||||||
var functor = Jet.job_print_functor(function (line) { message += line + "\n"; });
|
var functor = Jet.job_print_functor(function (line) { message += line + "\n"; }, false);
|
||||||
Jet.task_traverseTree(rootConfig, functor);
|
Jet.task_traverseTree(rootConfig, functor);
|
||||||
textArea.append(message);
|
textArea.append(message);
|
||||||
}
|
|
||||||
function fromScript(mope) {
|
|
||||||
var message ='Received \n';
|
|
||||||
message += mope;
|
|
||||||
textArea.append(message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearWindow() {
|
function clearWindow() {
|
||||||
|
|
|
@ -14,7 +14,6 @@ import QtQuick.Layouts 1.3
|
||||||
import "qrc:///qml/styles-uit"
|
import "qrc:///qml/styles-uit"
|
||||||
import "qrc:///qml/controls-uit" as HifiControls
|
import "qrc:///qml/controls-uit" as HifiControls
|
||||||
import "configSlider"
|
import "configSlider"
|
||||||
import "../lib/jet/qml" as Jet
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
HifiConstants { id: hifi;}
|
HifiConstants { id: hifi;}
|
||||||
|
@ -276,14 +275,12 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Separator {}
|
Separator {}
|
||||||
|
HifiControls.Button {
|
||||||
Jet.TaskList {
|
text: "Engine"
|
||||||
rootConfig: Render
|
// activeFocusOnPress: false
|
||||||
anchors.left: parent.left
|
onClicked: {
|
||||||
anchors.right: parent.right
|
sendToScript({method: "openEngineView"});
|
||||||
|
}
|
||||||
height: 200
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
13
scripts/developer/utilities/render/engineInspector.js
Normal file
13
scripts/developer/utilities/render/engineInspector.js
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
function openEngineTaskView() {
|
||||||
|
// Set up the qml ui
|
||||||
|
var qml = Script.resolvePath('engineInspector.qml');
|
||||||
|
var window = new OverlayWindow({
|
||||||
|
title: 'Render Engine',
|
||||||
|
source: qml,
|
||||||
|
width: 300,
|
||||||
|
height: 400
|
||||||
|
});
|
||||||
|
window.setPosition(200, 50);
|
||||||
|
//window.closed.connect(function() { Script.stop(); });
|
||||||
|
}
|
||||||
|
openEngineTaskView();
|
30
scripts/developer/utilities/render/engineInspector.qml
Normal file
30
scripts/developer/utilities/render/engineInspector.qml
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
//
|
||||||
|
// deferredLighting.qml
|
||||||
|
//
|
||||||
|
// Created by Sam Gateau on 6/6/2016
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
import QtQuick 2.7
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Layouts 1.3
|
||||||
|
|
||||||
|
import "qrc:///qml/styles-uit"
|
||||||
|
import "qrc:///qml/controls-uit" as HifiControls
|
||||||
|
|
||||||
|
import "../lib/jet/qml" as Jet
|
||||||
|
|
||||||
|
Item {
|
||||||
|
HifiConstants { id: hifi;}
|
||||||
|
id: render;
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
property var mainViewTask: Render.getConfig("RenderMainView")
|
||||||
|
|
||||||
|
Jet.TaskList {
|
||||||
|
rootConfig: Render
|
||||||
|
anchors.fill: render
|
||||||
|
}
|
||||||
|
}
|
|
@ -64,9 +64,6 @@
|
||||||
button.editProperties({isActive: onLuciScreen});
|
button.editProperties({isActive: onLuciScreen});
|
||||||
wireEventBridge(onLuciScreen);
|
wireEventBridge(onLuciScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
function fromQml(message) {
|
|
||||||
}
|
|
||||||
|
|
||||||
button.clicked.connect(onClicked);
|
button.clicked.connect(onClicked);
|
||||||
tablet.screenChanged.connect(onScreenChanged);
|
tablet.screenChanged.connect(onScreenChanged);
|
||||||
|
@ -82,14 +79,6 @@
|
||||||
Controller.mouseMoveEvent.connect(function (e) { if (moveDebugCursor) setDebugCursor(e.x, e.y); });
|
Controller.mouseMoveEvent.connect(function (e) { if (moveDebugCursor) setDebugCursor(e.x, e.y); });
|
||||||
|
|
||||||
|
|
||||||
Script.scriptEnding.connect(function () {
|
|
||||||
if (onLuciScreen) {
|
|
||||||
tablet.gotoHomeScreen();
|
|
||||||
}
|
|
||||||
button.clicked.disconnect(onClicked);
|
|
||||||
tablet.screenChanged.disconnect(onScreenChanged);
|
|
||||||
tablet.removeButton(button);
|
|
||||||
});
|
|
||||||
|
|
||||||
function setDebugCursor(x, y) {
|
function setDebugCursor(x, y) {
|
||||||
nx = (x / Window.innerWidth);
|
nx = (x / Window.innerWidth);
|
||||||
|
@ -98,4 +87,46 @@
|
||||||
Render.getConfig("RenderMainView").getConfig("Antialiasing").debugCursorTexcoord = { x: nx, y: ny };
|
Render.getConfig("RenderMainView").getConfig("Antialiasing").debugCursorTexcoord = { x: nx, y: ny };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function fromQml(message) {
|
||||||
|
switch (message.method) {
|
||||||
|
case "openEngineView":
|
||||||
|
openEngineTaskView();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var engineInspectorView = null
|
||||||
|
function openEngineTaskView() {
|
||||||
|
if (engineInspectorView == null) {
|
||||||
|
var qml = Script.resolvePath('engineInspector.qml');
|
||||||
|
var window = new OverlayWindow({
|
||||||
|
title: 'Render Engine',
|
||||||
|
source: qml,
|
||||||
|
width: 300,
|
||||||
|
height: 400
|
||||||
|
});
|
||||||
|
window.setPosition(200, 50);
|
||||||
|
engineInspectorView = window
|
||||||
|
window.closed.connect(function() { engineInspectorView = null; });
|
||||||
|
} else {
|
||||||
|
engineInspectorView.setPosition(200, 50);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Script.scriptEnding.connect(function () {
|
||||||
|
if (onLuciScreen) {
|
||||||
|
tablet.gotoHomeScreen();
|
||||||
|
}
|
||||||
|
button.clicked.disconnect(onClicked);
|
||||||
|
tablet.screenChanged.disconnect(onScreenChanged);
|
||||||
|
tablet.removeButton(button);
|
||||||
|
|
||||||
|
if (engineInspectorView !== null) {
|
||||||
|
engineInspectorView.close()
|
||||||
|
}
|
||||||
|
});
|
||||||
}());
|
}());
|
Loading…
Reference in a new issue