mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 07:47:30 +02:00
Improving presentation of stats & debug information
This commit is contained in:
parent
35d7211aca
commit
aa160c4d0f
5 changed files with 51 additions and 51 deletions
|
@ -340,10 +340,10 @@ Item {
|
|||
text: "GPU: " + root.gpuFrameTime.toFixed(1) + " ms"
|
||||
}
|
||||
StatText {
|
||||
text: "GPU (Per pixel): " + root.gpuFrameTimePerPixel.toFixed(5) + " ns/pp"
|
||||
text: "GPU (Per pixel): " + root.gpuFrameTimePerPixel.toFixed(1) + " ns/pp"
|
||||
}
|
||||
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 {
|
||||
text: "LOD Target: " + root.lodTargetFramerate + " Hz Angle: " + root.lodAngle + " deg"
|
||||
|
|
|
@ -17,6 +17,8 @@ PropFolderPanel {
|
|||
Global { id: global }
|
||||
id: root
|
||||
|
||||
property var rootObject: {}
|
||||
|
||||
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:
|
||||
|
@ -79,20 +81,23 @@ PropFolderPanel {
|
|||
})
|
||||
} break;
|
||||
case 'object': {
|
||||
/* var component = Qt.createComponent("PropItem.qml");
|
||||
component.createObject(propItemsContainer, {
|
||||
"label": proItem.property,
|
||||
"object": proItem.object,
|
||||
"property": proItem.property,
|
||||
})*/
|
||||
console.log('Item is an object, create PropGroup: ' + JSON.stringify(proItem.object[proItem.property]));
|
||||
var itemRootObject = proItem.object[proItem.property];
|
||||
var itemLabel = proItem.property;
|
||||
var itemDepth = root.indentDepth + 1;
|
||||
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");
|
||||
component.createObject(propItemsContainer, {
|
||||
"label": proItem.property,
|
||||
"object": proItem.object,
|
||||
// "jobPath": root.jobPath + '.' + job.objectName,
|
||||
// "showProps": root.showProps,
|
||||
// "showSubs": root.showSubs,
|
||||
// "indentDepth": root.indentDepth + 1,
|
||||
"label": itemLabel,
|
||||
"rootObject":itemRootObject,
|
||||
"indentDepth": itemDepth,
|
||||
})
|
||||
} break;
|
||||
case 'printLabel': {
|
||||
|
@ -119,19 +124,20 @@ PropFolderPanel {
|
|||
|
||||
function populateFromObjectProps(object) {
|
||||
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) {
|
||||
var o = {};
|
||||
o["object"] = object
|
||||
o["property"] = props[p];
|
||||
// o["readOnly"] = true;
|
||||
|
||||
/*
|
||||
o["type"] = "string";
|
||||
|
||||
propsModel.push(o)*/
|
||||
|
||||
var thePropThing = object[props[p]];
|
||||
if ((thePropThing !== undefined) && (thePropThing !== null)) {
|
||||
var theType = typeof(thePropThing)
|
||||
|
@ -139,7 +145,7 @@ PropFolderPanel {
|
|||
case 'object': {
|
||||
o["type"] = "object";
|
||||
propsModel.push(o)
|
||||
}
|
||||
} break;
|
||||
default: {
|
||||
o["type"] = "string";
|
||||
propsModel.push(o)
|
||||
|
@ -151,9 +157,13 @@ PropFolderPanel {
|
|||
propsModel.push(o)
|
||||
}
|
||||
}
|
||||
|
||||
root.updatePropItems(root.propItemsPanel, propsModel);
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (root.rootObject !== null) {
|
||||
populateFromObjectProps(root.rootObject)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,17 +20,22 @@ PropItem {
|
|||
property bool integral: false
|
||||
property var numDigits: 2
|
||||
|
||||
property alias valueVar : sliderControl.value
|
||||
|
||||
property alias min: sliderControl.minimumValue
|
||||
property alias max: sliderControl.maximumValue
|
||||
|
||||
property bool showValue: true
|
||||
|
||||
signal valueChanged(real value)
|
||||
|
||||
Component.onCompleted: {
|
||||
valueVar = root.valueVarGetter();
|
||||
}
|
||||
}
|
||||
|
||||
property var sourceValueVar: root.valueVarGetter()
|
||||
|
||||
function applyValueVarFromWidgets(value) {
|
||||
if (!root.readOnly) {
|
||||
root.valueVarSetter(value)
|
||||
}
|
||||
}
|
||||
|
||||
PropLabel {
|
||||
id: valueLabel
|
||||
|
@ -42,7 +47,7 @@ PropItem {
|
|||
horizontalAlignment: global.valueTextAlign
|
||||
height: global.slimHeight
|
||||
|
||||
text: root.valueVarGetter().toFixed(root.integral ? 0 : root.numDigits)
|
||||
text: root.sourceValueVar.toFixed(root.integral ? 0 : root.numDigits)
|
||||
|
||||
background: Rectangle {
|
||||
color: global.color
|
||||
|
@ -59,8 +64,8 @@ PropItem {
|
|||
anchors.left: valueLabel.right
|
||||
anchors.right: root.right
|
||||
anchors.verticalCenter: root.verticalCenter
|
||||
|
||||
onValueChanged: { if (!root.readOnly) { root.valueVarSetter(value)} }
|
||||
value: root.sourceValueVar
|
||||
onValueChanged: { applyValueVarFromWidgets(value) }
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -23,46 +23,31 @@ Column {
|
|||
id: computer
|
||||
label: "Computer"
|
||||
isUnfold: true
|
||||
|
||||
Component.onCompleted: {
|
||||
computer.populateFromObjectProps(JSON.parse(PlatformInfo.getComputer()))
|
||||
}
|
||||
rootObject:JSON.parse(PlatformInfo.getComputer())
|
||||
}
|
||||
Prop.PropGroup {
|
||||
id: cpu
|
||||
label: "CPU"
|
||||
isUnfold: true
|
||||
|
||||
Component.onCompleted: {
|
||||
cpu.populateFromObjectProps(JSON.parse(PlatformInfo.getCPU(0)))
|
||||
}
|
||||
rootObject:JSON.parse(PlatformInfo.getPlatform()).cpus
|
||||
}
|
||||
Prop.PropGroup {
|
||||
id: memory
|
||||
label: "Memory"
|
||||
isUnfold: true
|
||||
|
||||
Component.onCompleted: {
|
||||
memory.populateFromObjectProps(JSON.parse(PlatformInfo.getMemory()))
|
||||
}
|
||||
rootObject:JSON.parse(PlatformInfo.getMemory())
|
||||
}
|
||||
Prop.PropGroup {
|
||||
id: gpu
|
||||
label: "GPU"
|
||||
isUnfold: true
|
||||
|
||||
Component.onCompleted: {
|
||||
gpu.populateFromObjectProps(JSON.parse(PlatformInfo.getGPU(0)))
|
||||
}
|
||||
rootObject:JSON.parse(PlatformInfo.getPlatform()).gpus
|
||||
}
|
||||
Prop.PropGroup {
|
||||
id: display
|
||||
label: "Display"
|
||||
isUnfold: true
|
||||
|
||||
Component.onCompleted: {
|
||||
display.populateFromObjectProps(JSON.parse(PlatformInfo.getDisplay(0)))
|
||||
}
|
||||
rootObject:JSON.parse(PlatformInfo.getPlatform()).displays
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ Column {
|
|||
label: "Viewport Resolution Scale"
|
||||
object: Render
|
||||
property: "viewportResolutionScale"
|
||||
min: 0.5
|
||||
max: 1.0
|
||||
min: 0.25
|
||||
max: 1.5
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue