import QtQuick 2.7 import QtQuick.Window 2.2 import QtQuick.Controls 1.4 import com.gfa.ipc.appctrl 1.0 Window { visible: true width: 800 height: 480 title: qsTr("GfA App Control") function stateColor(state) { switch(state) { case QGfaAppCtrl.STATE_RUNNING: return "lightgreen"; case QGfaAppCtrl.STATE_PAUSED: return "lightgrey"; case QGfaAppCtrl.STATE_HANGING: return "orange"; case QGfaAppCtrl.STATE_ZOMBIE: return "red"; default: return "white"; } } function sec2HMS(sec) { var h = parseInt(sec / 3600); sec -= h * 3600; var m = parseInt(sec / 60); sec -= m * 60; return "" + h + (m < 10 ? ":0" : ":") + m + (sec < 10 ? ":0" : ":") + sec; } Rectangle { x: 10 y: 20 width: 120 height: 460 Rectangle { x: 0 y: 40 width: parent.width height: 30 Text { font.pixelSize: 14 font.italic: true anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left text: "State:" } } Rectangle { x: 0 y: 70 width: parent.width height: 30 Text { font.pixelSize: 14 font.italic: true anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left text: "Cyc. cur. μs:" } } Rectangle { x: 0 y: 100 width: parent.width height: 30 Text { font.pixelSize: 14 font.italic: true anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left text: "Wkt. max. μs:" } } Rectangle { x: 0 y: 130 width: parent.width height: 30 Text { font.pixelSize: 14 font.italic: true anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left text: "Wkt. cur. μs:" } } Rectangle { x: 0 y: 160 width: parent.width height: 30 Text { font.pixelSize: 14 font.italic: true anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left text: "CPU Time sec.:" } } Rectangle { x: 0 y: 190 width: parent.width height: 30 Text { font.pixelSize: 14 font.italic: true anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left text: "CPU avg. %:" } } Rectangle { x: 0 y: 220 width: parent.width height: 30 Text { font.pixelSize: 14 font.italic: true anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left text: "CPU cur. %:" } } Rectangle { x: 0 y: 250 width: parent.width height: 30 Text { font.pixelSize: 14 font.italic: true anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left text: "VM RSS KiB:" } } Rectangle { x: 0 y: 280 width: parent.width height: 30 Text { font.pixelSize: 14 font.italic: true anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left text: "VM Size KiB:" } } Rectangle { x: 0 y: 330 height: 30 width: parent.width border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: qGfaAppCtrl.minPass } } Rectangle { x: 0 y: 370 height: 30 width: parent.width border.width: 1 border.color: "black" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: qGfaAppCtrl.avgPass } } Rectangle { x: 0 y: 410 height: 30 width: parent.width Button { text: "Exit" anchors.fill: parent onClicked: Qt.quit() } } } ///////////////////////////////////////////////////////////////////////////////////////////////// Rectangle { x: 140 y: 20 width: 120 height: 460 property var appInfo: qGfaAppCtrl.appInfo[QGfaAppCtrl.APP_INDEX_REMANENT] Rectangle { x: 0 y: 0 width: parent.width height: 30 Text { font.pixelSize: 18 font.bold: true anchors.centerIn: parent text: parent.parent.appInfo.name } } Rectangle { x: 0 y: 40 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 color: stateColor(parent.appInfo.state) Text { font.pixelSize: 14 font.bold: true anchors.centerIn: parent text: parent.parent.appInfo.stateText } } Rectangle { x: 0 y: 70 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cycCur } } Rectangle { x: 0 y: 100 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.wktMax } } Rectangle { x: 0 y: 130 width: parent.width height: 30 border.width: 1 border.color: "black" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.wktCur } } Rectangle { x: 0 y: 160 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cpuTime.toFixed(1) } } Rectangle { x: 0 y: 190 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cpuAvg.toFixed(2) } } Rectangle { x: 0 y: 220 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cpuCur.toFixed(2) } } Rectangle { x: 0 y: 250 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.vmRSS } } Rectangle { x: 0 y: 280 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.vmSize } } Rectangle { x: 0 y: 330 height: 30 width: parent.width Button { text: "Pause" anchors.fill: parent onClicked: parent.parent.appInfo.pause() enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_RUNNING) } } Rectangle { x: 0 y: 370 height: 30 width: parent.width Button { text: "Resume" anchors.fill: parent onClicked: parent.parent.appInfo.resume() enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) } } Rectangle { x: 0 y: 410 height: 30 width: parent.width Button { text: "Stop" anchors.fill: parent onClicked: parent.parent.appInfo.stop() enabled: (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_NOT_RUNNING) && (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_ZOMBIE) } } } ///////////////////////////////////////////////////////////////////////////////////////////////// Rectangle { x: 270 y: 20 width: 120 height: 460 property var appInfo: qGfaAppCtrl.appInfo[/*QGfaAppCtrl.APP_INDEX_MQTTCL*/41] Rectangle { x: 0 y: 0 width: parent.width height: 30 Text { font.pixelSize: 18 font.bold: true anchors.centerIn: parent text: parent.parent.appInfo.name } } Rectangle { x: 0 y: 40 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 color: stateColor(parent.appInfo.state) Text { font.pixelSize: 14 font.bold: true anchors.centerIn: parent text: parent.parent.appInfo.stateText } } Rectangle { x: 0 y: 70 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cycCur } } Rectangle { x: 0 y: 100 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.wktMax } } Rectangle { x: 0 y: 130 width: parent.width height: 30 border.width: 1 border.color: "black" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.wktCur } } Rectangle { x: 0 y: 160 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cpuTime.toFixed(1) } } Rectangle { x: 0 y: 190 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cpuAvg.toFixed(2) } } Rectangle { x: 0 y: 220 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cpuCur.toFixed(2) } } Rectangle { x: 0 y: 250 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.vmRSS } } Rectangle { x: 0 y: 280 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.vmSize } } Rectangle { x: 0 y: 330 height: 30 width: parent.width Button { text: "Pause" anchors.fill: parent onClicked: parent.parent.appInfo.pause() enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_RUNNING) } } Rectangle { x: 0 y: 370 height: 30 width: parent.width Button { text: "Resume" anchors.fill: parent onClicked: parent.parent.appInfo.resume() enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) } } Rectangle { x: 0 y: 410 height: 30 width: parent.width Button { text: "Stop" anchors.fill: parent onClicked: parent.parent.appInfo.stop() enabled: (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_NOT_RUNNING) && (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_ZOMBIE) } } } ///////////////////////////////////////////////////////////////////////////////////////////////// Rectangle { x: 400 y: 20 width: 120 height: 460 property var appInfo: qGfaAppCtrl.appInfo[QGfaAppCtrl.APP_INDEX_REST] Rectangle { x: 0 y: 0 width: parent.width height: 30 Text { font.pixelSize: 18 font.bold: true anchors.centerIn: parent text: parent.parent.appInfo.name } } Rectangle { x: 0 y: 40 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 color: stateColor(parent.appInfo.state) Text { font.pixelSize: 14 font.bold: true anchors.centerIn: parent text: parent.parent.appInfo.stateText } } Rectangle { x: 0 y: 70 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cycCur } } Rectangle { x: 0 y: 100 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.wktMax } } Rectangle { x: 0 y: 130 width: parent.width height: 30 border.width: 1 border.color: "black" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.wktCur } } Rectangle { x: 0 y: 160 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cpuTime.toFixed(1) } } Rectangle { x: 0 y: 190 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cpuAvg.toFixed(2) } } Rectangle { x: 0 y: 220 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cpuCur.toFixed(2) } } Rectangle { x: 0 y: 250 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.vmRSS } } Rectangle { x: 0 y: 280 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.vmSize } } Rectangle { x: 0 y: 330 height: 30 width: parent.width Button { text: "Pause" anchors.fill: parent onClicked: parent.parent.appInfo.pause() enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_RUNNING) } } Rectangle { x: 0 y: 370 height: 30 width: parent.width Button { text: "Resume" anchors.fill: parent onClicked: parent.parent.appInfo.resume() enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) } } Rectangle { x: 0 y: 410 height: 30 width: parent.width Button { text: "Stop" anchors.fill: parent onClicked: parent.parent.appInfo.stop() enabled: (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_NOT_RUNNING) && (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_ZOMBIE) } } } ///////////////////////////////////////////////////////////////////////////////////////////////// Rectangle { x: 530 y: 20 width: 120 height: 460 property var appInfo: qGfaAppCtrl.appInfo[QGfaAppCtrl.APP_INDEX_DATALOGGER] Rectangle { x: 0 y: 0 width: parent.width height: 30 Text { font.pixelSize: 18 font.bold: true anchors.centerIn: parent text: parent.parent.appInfo.name } } Rectangle { x: 0 y: 40 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 color: stateColor(parent.appInfo.state) Text { font.pixelSize: 14 font.bold: true anchors.centerIn: parent text: parent.parent.appInfo.stateText } } Rectangle { x: 0 y: 70 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cycCur } } Rectangle { x: 0 y: 100 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.wktMax } } Rectangle { x: 0 y: 130 width: parent.width height: 30 border.width: 1 border.color: "black" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.wktCur } } Rectangle { x: 0 y: 160 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cpuTime.toFixed(1) } } Rectangle { x: 0 y: 190 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cpuAvg.toFixed(2) } } Rectangle { x: 0 y: 220 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cpuCur.toFixed(2) } } Rectangle { x: 0 y: 250 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.vmRSS } } Rectangle { x: 0 y: 280 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.vmSize } } Rectangle { x: 0 y: 330 height: 30 width: parent.width Button { text: "Pause" anchors.fill: parent onClicked: parent.parent.appInfo.pause() enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_RUNNING) } } Rectangle { x: 0 y: 370 height: 30 width: parent.width Button { text: "Resume" anchors.fill: parent onClicked: parent.parent.appInfo.resume() enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) } } Rectangle { x: 0 y: 410 height: 30 width: parent.width Button { text: "Stop" anchors.fill: parent onClicked: parent.parent.appInfo.stop() enabled: (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_NOT_RUNNING) && (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_ZOMBIE) } } } ///////////////////////////////////////////////////////////////////////////////////////////////// Rectangle { x: 660 y: 20 width: 120 height: 460 property var appInfo: qGfaAppCtrl.appInfo[QGfaAppCtrl.APP_INDEX_SYSINFO] Rectangle { x: 0 y: 0 width: parent.width height: 30 Text { font.pixelSize: 18 font.bold: true anchors.centerIn: parent text: parent.parent.appInfo.name } } Rectangle { x: 0 y: 40 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 color: stateColor(parent.appInfo.state) Text { font.pixelSize: 14 font.bold: true anchors.centerIn: parent text: parent.parent.appInfo.stateText } } Rectangle { x: 0 y: 70 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cycCur } } Rectangle { x: 0 y: 100 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.wktMax } } Rectangle { x: 0 y: 130 width: parent.width height: 30 border.width: 1 border.color: "black" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.wktCur } } Rectangle { x: 0 y: 160 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cpuTime.toFixed(1) } } Rectangle { x: 0 y: 190 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cpuAvg.toFixed(2) } } Rectangle { x: 0 y: 220 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.cpuCur.toFixed(2) } } Rectangle { x: 0 y: 250 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.vmRSS } } Rectangle { x: 0 y: 280 width: parent.width height: 30 border.width: 1 border.color: "lightgrey" radius: 5 Text { font.pixelSize: 14 anchors.centerIn: parent text: parent.parent.appInfo.vmSize } } Rectangle { x: 0 y: 330 height: 30 width: parent.width Button { text: "Pause" anchors.fill: parent onClicked: parent.parent.appInfo.pause() enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_RUNNING) } } Rectangle { x: 0 y: 370 height: 30 width: parent.width Button { text: "Resume" anchors.fill: parent onClicked: parent.parent.appInfo.resume() enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) } } Rectangle { x: 0 y: 410 height: 30 width: parent.width Button { text: "Stop" anchors.fill: parent onClicked: parent.parent.appInfo.stop() enabled: (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_NOT_RUNNING) && (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_ZOMBIE) } } } }