mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-16 16:25:20 +02:00
[ui] StatViewer: more compatibility with previous "statistics" files
* compute max peak ram if no total ram info * hide GPU chart if the file is from a previous version
This commit is contained in:
parent
8c62437a68
commit
4cc78ad5ec
1 changed files with 20 additions and 6 deletions
|
@ -17,6 +17,8 @@ Item {
|
||||||
|
|
||||||
property var sourceModified: undefined
|
property var sourceModified: undefined
|
||||||
property var jsonObject
|
property var jsonObject
|
||||||
|
property real fileVersion: 0.0
|
||||||
|
|
||||||
property int nbReads: 1
|
property int nbReads: 1
|
||||||
property real deltaTime: 1
|
property real deltaTime: 1
|
||||||
|
|
||||||
|
@ -24,6 +26,7 @@ Item {
|
||||||
property int cpuFrequency: 0
|
property int cpuFrequency: 0
|
||||||
|
|
||||||
property int ramTotal
|
property int ramTotal
|
||||||
|
property string ramLabel: "RAM: "
|
||||||
|
|
||||||
property int gpuTotalMemory
|
property int gpuTotalMemory
|
||||||
property int gpuMaxAxis: 100
|
property int gpuMaxAxis: 100
|
||||||
|
@ -127,6 +130,7 @@ Item {
|
||||||
|
|
||||||
function createCharts() {
|
function createCharts() {
|
||||||
root.deltaTime = getPropertyWithDefault(jsonObject, 'interval', 30) / 60.0;
|
root.deltaTime = getPropertyWithDefault(jsonObject, 'interval', 30) / 60.0;
|
||||||
|
root.fileVersion = getPropertyWithDefault(jsonObject, 'fileVersion', 0.0)
|
||||||
initCpuChart()
|
initCpuChart()
|
||||||
initRamChart()
|
initRamChart()
|
||||||
initGpuChart()
|
initGpuChart()
|
||||||
|
@ -207,11 +211,21 @@ Item {
|
||||||
|
|
||||||
function initRamChart() {
|
function initRamChart() {
|
||||||
|
|
||||||
root.ramTotal = getPropertyWithDefault(jsonObject.computer, 'ramTotal', 1)
|
|
||||||
|
|
||||||
var ram = getPropertyWithDefault(jsonObject.computer.curves, 'ramUsage', -1)
|
var ram = getPropertyWithDefault(jsonObject.computer.curves, 'ramUsage', -1)
|
||||||
|
|
||||||
var ramSerie = ramChart.createSeries(ChartView.SeriesTypeLine, "RAM: " + root.ramTotal + "GB", valueAxisX2, valueAxisRam)
|
root.ramTotal = getPropertyWithDefault(jsonObject.computer, 'ramTotal', -1)
|
||||||
|
root.ramLabel = "RAM: "
|
||||||
|
if(root.ramTotal <= 0)
|
||||||
|
{
|
||||||
|
var maxRamPeak = 0
|
||||||
|
for(var i = 0; i < ram.length; i++) {
|
||||||
|
maxRamPeak = Math.max(maxRamPeak, ram[i])
|
||||||
|
}
|
||||||
|
root.ramTotal = maxRamPeak
|
||||||
|
root.ramLabel = "RAM Max Peak: "
|
||||||
|
}
|
||||||
|
|
||||||
|
var ramSerie = ramChart.createSeries(ChartView.SeriesTypeLine, root.ramLabel + root.ramTotal + "GB", valueAxisX2, valueAxisRam)
|
||||||
|
|
||||||
if(ram.length === 1) {
|
if(ram.length === 1) {
|
||||||
// Create 2 entries if we have only one input value to create a segment that can be display
|
// Create 2 entries if we have only one input value to create a segment that can be display
|
||||||
|
@ -222,7 +236,6 @@ Item {
|
||||||
ramSerie.append(i * root.deltaTime, ram[i])
|
ramSerie.append(i * root.deltaTime, ram[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ramSerie.color = colors[10]
|
ramSerie.color = colors[10]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -419,7 +432,7 @@ Item {
|
||||||
plotAreaColor: "transparent"
|
plotAreaColor: "transparent"
|
||||||
titleColor: textColor
|
titleColor: textColor
|
||||||
|
|
||||||
title: "RAM: " + root.ramTotal + "GB"
|
title: root.ramLabel + root.ramTotal + "GB"
|
||||||
|
|
||||||
ValueAxis {
|
ValueAxis {
|
||||||
id: valueAxisY2
|
id: valueAxisY2
|
||||||
|
@ -486,7 +499,8 @@ Item {
|
||||||
plotAreaColor: "transparent"
|
plotAreaColor: "transparent"
|
||||||
titleColor: textColor
|
titleColor: textColor
|
||||||
|
|
||||||
title: "GPU: " + root.gpuName + ", " + root.gpuTotalMemory + "MB"
|
visible: (root.fileVersion >= 2.0) // No GPU information was collected before stats 2.0 fileVersion
|
||||||
|
title: (root.gpuName || root.gpuTotalMemory) ? ("GPU: " + root.gpuName + ", " + root.gpuTotalMemory + "MB") : "No GPU"
|
||||||
|
|
||||||
ValueAxis {
|
ValueAxis {
|
||||||
id: valueAxisY3
|
id: valueAxisY3
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue