Improving presentation of stats & debug information

This commit is contained in:
Sam Gateau 2019-06-21 16:17:28 -07:00
parent 35d7211aca
commit aa160c4d0f
5 changed files with 51 additions and 51 deletions

View file

@ -340,10 +340,10 @@ Item {
text: "GPU: " + root.gpuFrameTime.toFixed(1) + " ms" text: "GPU: " + root.gpuFrameTime.toFixed(1) + " ms"
} }
StatText { StatText {
text: "GPU (Per pixel): " + root.gpuFrameTimePerPixel.toFixed(5) + " ns/pp" text: "GPU (Per pixel): " + root.gpuFrameTimePerPixel.toFixed(1) + " ns/pp"
} }
StatText { StatText {
text: "GPU frame size: " + root.gpuFrameSize.x + " x " + root.gpuFrameSize.y text: "GPU frame size: " + root.gpuFrameSize.x.toFixed(0) + " x " + root.gpuFrameSize.y.toFixed(0)
} }
StatText { StatText {
text: "LOD Target: " + root.lodTargetFramerate + " Hz Angle: " + root.lodAngle + " deg" text: "LOD Target: " + root.lodTargetFramerate + " Hz Angle: " + root.lodAngle + " deg"

View file

@ -17,6 +17,8 @@ PropFolderPanel {
Global { id: global } Global { id: global }
id: root id: root
property var rootObject: {}
property alias propItemsPanel: root.panelFrameContent property alias propItemsPanel: root.panelFrameContent
// Prop Group is designed to author an array of ProItems, they are defined with an array of the tuplets describing each individual item: // Prop Group is designed to author an array of ProItems, they are defined with an array of the tuplets describing each individual item:
@ -79,20 +81,23 @@ PropFolderPanel {
}) })
} break; } break;
case 'object': { case 'object': {
/* var component = Qt.createComponent("PropItem.qml"); console.log('Item is an object, create PropGroup: ' + JSON.stringify(proItem.object[proItem.property]));
component.createObject(propItemsContainer, { var itemRootObject = proItem.object[proItem.property];
"label": proItem.property, var itemLabel = proItem.property;
"object": proItem.object, var itemDepth = root.indentDepth + 1;
"property": proItem.property, if (Array.isArray(itemRootObject)) {
})*/ if (objectItem.length > 1) {
itemLabel = itemLabel + " " + objectItem.length
} else {
itemLabel = itemLabel + " " + objectItem.length
itemRootObject = itemRootObject[0];
}
}
var component = Qt.createComponent("PropGroup.qml"); var component = Qt.createComponent("PropGroup.qml");
component.createObject(propItemsContainer, { component.createObject(propItemsContainer, {
"label": proItem.property, "label": itemLabel,
"object": proItem.object, "rootObject":itemRootObject,
// "jobPath": root.jobPath + '.' + job.objectName, "indentDepth": itemDepth,
// "showProps": root.showProps,
// "showSubs": root.showSubs,
// "indentDepth": root.indentDepth + 1,
}) })
} break; } break;
case 'printLabel': { case 'printLabel': {
@ -119,19 +124,20 @@ PropFolderPanel {
function populateFromObjectProps(object) { function populateFromObjectProps(object) {
var propsModel = [] var propsModel = []
var props = Object.keys(object);
if (Array.isArray(object)) {
if (object.length <= 1) {
object = object[0];
}
}
var props = Object.keys(object);
for (var p in props) { for (var p in props) {
var o = {}; var o = {};
o["object"] = object o["object"] = object
o["property"] = props[p]; o["property"] = props[p];
// o["readOnly"] = true; // o["readOnly"] = true;
/*
o["type"] = "string";
propsModel.push(o)*/
var thePropThing = object[props[p]]; var thePropThing = object[props[p]];
if ((thePropThing !== undefined) && (thePropThing !== null)) { if ((thePropThing !== undefined) && (thePropThing !== null)) {
var theType = typeof(thePropThing) var theType = typeof(thePropThing)
@ -139,7 +145,7 @@ PropFolderPanel {
case 'object': { case 'object': {
o["type"] = "object"; o["type"] = "object";
propsModel.push(o) propsModel.push(o)
} } break;
default: { default: {
o["type"] = "string"; o["type"] = "string";
propsModel.push(o) propsModel.push(o)
@ -151,9 +157,13 @@ PropFolderPanel {
propsModel.push(o) propsModel.push(o)
} }
} }
root.updatePropItems(root.propItemsPanel, propsModel); root.updatePropItems(root.propItemsPanel, propsModel);
} }
Component.onCompleted: { Component.onCompleted: {
if (root.rootObject !== null) {
populateFromObjectProps(root.rootObject)
}
} }
} }

View file

@ -20,17 +20,22 @@ PropItem {
property bool integral: false property bool integral: false
property var numDigits: 2 property var numDigits: 2
property alias valueVar : sliderControl.value
property alias min: sliderControl.minimumValue property alias min: sliderControl.minimumValue
property alias max: sliderControl.maximumValue property alias max: sliderControl.maximumValue
property bool showValue: true property bool showValue: true
signal valueChanged(real value)
Component.onCompleted: { Component.onCompleted: {
valueVar = root.valueVarGetter(); }
}
property var sourceValueVar: root.valueVarGetter()
function applyValueVarFromWidgets(value) {
if (!root.readOnly) {
root.valueVarSetter(value)
}
}
PropLabel { PropLabel {
id: valueLabel id: valueLabel
@ -42,7 +47,7 @@ PropItem {
horizontalAlignment: global.valueTextAlign horizontalAlignment: global.valueTextAlign
height: global.slimHeight height: global.slimHeight
text: root.valueVarGetter().toFixed(root.integral ? 0 : root.numDigits) text: root.sourceValueVar.toFixed(root.integral ? 0 : root.numDigits)
background: Rectangle { background: Rectangle {
color: global.color color: global.color
@ -59,8 +64,8 @@ PropItem {
anchors.left: valueLabel.right anchors.left: valueLabel.right
anchors.right: root.right anchors.right: root.right
anchors.verticalCenter: root.verticalCenter anchors.verticalCenter: root.verticalCenter
value: root.sourceValueVar
onValueChanged: { if (!root.readOnly) { root.valueVarSetter(value)} } onValueChanged: { applyValueVarFromWidgets(value) }
} }

View file

@ -23,46 +23,31 @@ Column {
id: computer id: computer
label: "Computer" label: "Computer"
isUnfold: true isUnfold: true
rootObject:JSON.parse(PlatformInfo.getComputer())
Component.onCompleted: {
computer.populateFromObjectProps(JSON.parse(PlatformInfo.getComputer()))
}
} }
Prop.PropGroup { Prop.PropGroup {
id: cpu id: cpu
label: "CPU" label: "CPU"
isUnfold: true isUnfold: true
rootObject:JSON.parse(PlatformInfo.getPlatform()).cpus
Component.onCompleted: {
cpu.populateFromObjectProps(JSON.parse(PlatformInfo.getCPU(0)))
}
} }
Prop.PropGroup { Prop.PropGroup {
id: memory id: memory
label: "Memory" label: "Memory"
isUnfold: true isUnfold: true
rootObject:JSON.parse(PlatformInfo.getMemory())
Component.onCompleted: {
memory.populateFromObjectProps(JSON.parse(PlatformInfo.getMemory()))
}
} }
Prop.PropGroup { Prop.PropGroup {
id: gpu id: gpu
label: "GPU" label: "GPU"
isUnfold: true isUnfold: true
rootObject:JSON.parse(PlatformInfo.getPlatform()).gpus
Component.onCompleted: {
gpu.populateFromObjectProps(JSON.parse(PlatformInfo.getGPU(0)))
}
} }
Prop.PropGroup { Prop.PropGroup {
id: display id: display
label: "Display" label: "Display"
isUnfold: true isUnfold: true
rootObject:JSON.parse(PlatformInfo.getPlatform()).displays
Component.onCompleted: {
display.populateFromObjectProps(JSON.parse(PlatformInfo.getDisplay(0)))
}
} }
} }

View file

@ -34,8 +34,8 @@ Column {
label: "Viewport Resolution Scale" label: "Viewport Resolution Scale"
object: Render object: Render
property: "viewportResolutionScale" property: "viewportResolutionScale"
min: 0.5 min: 0.25
max: 1.0 max: 1.5
} }
} }