@@ -17,30 +17,42 @@ Panel {
1717 property variant node
1818 property bool readOnly: false
1919 property bool isCompatibilityNode: node && node .compatibilityIssue !== undefined
20+ property string nodeStartDateTime: " "
2021
2122 signal attributeDoubleClicked (var mouse, var attribute)
2223 signal upgradeRequest ()
2324
2425 title: " Node" + (node !== null ? " - <b>" + node .label + " </b>" + (node .label !== node .defaultLabel ? " (" + node .defaultLabel + " )" : " " ) : " " )
2526 icon: MaterialLabel { text: MaterialIcons .tune }
2627
28+ onNodeChanged: {
29+ nodeStartDateTime = " "
30+ if (node !== null && node .isSubmittedOrRunning ()) {
31+ timer .start ()
32+ }
33+ else if (node !== null && node .isFinishedOrRunning ()) {
34+ computationInfo .text = Format .getTimeStr (node .elapsedTime )
35+ }
36+ else {
37+ computationInfo .text = " "
38+ }
39+ }
40+
2741 headerBar: RowLayout {
2842 Label {
29- text: {
30- if (node !== null && node .isSubmittedOrRunning ()) {
31- // Some chunks might be submitted but they'll all run eventually
32- if (node .elapsedTime > 0 ) { // At least a chunk is done running
33- return " Running for: " + Format .getTimeStr (node .elapsedTime )
34- } else {
35- return (node .chunks .count > 1 ) ? " First chunk running" : " Node running"
43+ id: computationInfo
44+ Timer {
45+ id: timer
46+ interval: 2500
47+ triggeredOnStart: true
48+ repeat: true
49+ running: node !== null && node .isSubmittedOrRunning ()
50+ onTriggered: {
51+ if (nodeStartDateTime === " " ) {
52+ nodeStartDateTime = new Date (node .getFirstChunkRunning ()).getTime ()
3653 }
37- } else if (node !== null && node .isFinishedOrRunning ()) {
38- /* Either all chunks finished running or the last one is running
39- * Placed inside an "else if" instead of "else" to avoid entering the functions
40- * when there is no real use */
41- return Format .getTimeStr (node .elapsedTime )
42- } else {
43- return " "
54+ var now = new Date ().getTime ()
55+ parent .text = Format .getTimeStr ((now- nodeStartDateTime)/ 1000 )
4456 }
4557 }
4658 padding: 2
@@ -184,7 +196,10 @@ Panel {
184196 MenuItem {
185197 enabled: root .node !== null
186198 text: " Clear Pending Status"
187- onClicked: node .clearSubmittedChunks ()
199+ onClicked: {
200+ node .clearSubmittedChunks ()
201+ timer .stop ()
202+ }
188203 }
189204 }
190205 }
0 commit comments