Meshroom/meshroom/ui/qml/GraphEditor/NodeStatistics.qml
Candice Bentéjac 7abbb50302 [Utils] fixing rounding issues in time display
Prevent getting strings like "5m60s" when rounding up.
2024-06-16 23:34:50 +02:00

62 lines
1.6 KiB
QML

import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Controls 1.4 as Controls1 // SplitView
import QtQuick.Layouts 1.11
import MaterialIcons 2.2
import Controls 1.0
import Utils 1.0
import "common.js" as Common
/**
* NodeLog displays log and statistics data of Node's chunks (NodeChunks)
*
* To ease monitoring, it provides periodic auto-reload of the opened file
* if the related NodeChunk is being computed.
*/
FocusScope {
id: root
property variant node
property variant currentChunkIndex
property variant currentChunk
SystemPalette { id: activePalette }
Loader {
id: componentLoader
clip: true
anchors.fill: parent
property string currentFile: currentChunk ? currentChunk["statisticsFile"] : ""
property url source: Filepath.stringToUrl(currentFile)
sourceComponent: chunksLV.chunksSummary ? statViewerComponent : chunkStatViewerComponent
}
Component {
id: chunkStatViewerComponent
StatViewer {
id: statViewer
anchors.fill: parent
source: componentLoader.source
}
}
Component {
id: statViewerComponent
Column {
spacing: 2
KeyValue {
key: "Time"
property real time: node.elapsedTime
value: time > 0.0 ? Format.sec2timecode(time) : "-"
}
KeyValue {
key: "Cumulated Time"
property real time: node.recursiveElapsedTime
value: time > 0.0 ? Format.sec2timecode(time) : "-"
}
}
}
}