import QtQuick 2.6 import QtQuick.Window 2.2 import QtQuick.Controls 1.4 as Ctrl14 import QtQuick.Controls 2.0 import QtQuick.Controls.Styles 1.4 import com.gfa.ipc.appctrl 1.0 import com.gfa.shm._oem_ 1.0 import "globals.js" as Globals Rectangle { width: Screen.width height: Screen.height 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; } ///////////////////////////////////////////////////////////////////////////////////////////////// TabBar { id: idTabBar width: parent.width currentIndex: 0 Repeater { id: idRep model: Globals.tabBarModel NavButton { text: modelData[0] onClicked: { idPageLoader.source = modelData[1]; } width: idTabBar.width / idRep.count } } } ///////////////////////////////////////////////////////////////////////////////////////////////// Rectangle { x: 10 y: 50 width: 120 height: 420 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 avg. %:" } } 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 cur. %:" } } 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: "VM RSS KiB:" } } 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 Size KiB:" } } Rectangle { x: 0 y: 380 height: 30 width: parent.width Ctrl14.Button { text: "Quit" anchors.fill: parent onClicked: Qt.quit() style: idButtonStyle } } } ///////////////////////////////////////////////////////////////////////////////////////////////// Rectangle { x: 140 y: 50 width: 120 height: 420 property var appInfo: qGfaAppCtrl.appInfo[QGfaAppCtrl.APP_INDEX_REMANENT] Rectangle { x: 0 y: 10 width: parent.width height: 30 Text { font.pointSize: 9 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: "lightgrey" 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.cpuAvg.toFixed(2) } } 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.cpuCur.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.vmRSS } } 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.vmSize } } Rectangle { x: 0 y: 300 height: 30 width: parent.width Ctrl14.Button { anchors.fill: parent style: idButtonStyle enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_RUNNING || parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) text: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) ? "Resume" : "Pause" onClicked: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) ? parent.parent.appInfo.resume() : parent.parent.appInfo.pause() } } Rectangle { x: 0 y: 340 height: 30 width: parent.width Ctrl14.Button { text: "Stop" style: idButtonStyle 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: 0 y: 380 height: 30 width: parent.width Ctrl14.Button { text: "Kill" style: idButtonStyle anchors.fill: parent onClicked: parent.parent.appInfo.kill() enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_ZOMBIE) } } } ///////////////////////////////////////////////////////////////////////////////////////////////// Rectangle { x: 270 y: 50 width: 120 height: 420 property var appInfo: qGfaAppCtrl.appInfo[QGfaAppCtrl.APP_INDEX_MQTTCL] Rectangle { x: 0 y: 10 width: parent.width height: 30 Text { font.pointSize: 9 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: "lightgrey" 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.cpuAvg.toFixed(2) } } 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.cpuCur.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.vmRSS } } 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.vmSize } } Rectangle { x: 0 y: 300 height: 30 width: parent.width Ctrl14.Button { anchors.fill: parent style: idButtonStyle enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_RUNNING || parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) text: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) ? "Resume" : "Pause" onClicked: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) ? parent.parent.appInfo.resume() : parent.parent.appInfo.pause() } } Rectangle { x: 0 y: 340 height: 30 width: parent.width Ctrl14.Button { text: "Stop" style: idButtonStyle 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: 0 y: 380 height: 30 width: parent.width Ctrl14.Button { text: "Kill" style: idButtonStyle anchors.fill: parent onClicked: parent.parent.appInfo.kill() enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_ZOMBIE) } } } ///////////////////////////////////////////////////////////////////////////////////////////////// Rectangle { x: 400 y: 50 width: 120 height: 420 property var appInfo: qGfaAppCtrl.appInfo[QGfaAppCtrl.APP_INDEX_REST] Rectangle { x: 0 y: 10 width: parent.width height: 30 Text { font.pointSize: 9 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: "lightgrey" 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.cpuAvg.toFixed(2) } } 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.cpuCur.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.vmRSS } } 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.vmSize } } Rectangle { x: 0 y: 300 height: 30 width: parent.width Ctrl14.Button { anchors.fill: parent style: idButtonStyle enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_RUNNING || parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) text: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) ? "Resume" : "Pause" onClicked: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) ? parent.parent.appInfo.resume() : parent.parent.appInfo.pause() } } Rectangle { x: 0 y: 340 height: 30 width: parent.width Ctrl14.Button { text: "Stop" style: idButtonStyle 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: 0 y: 380 height: 30 width: parent.width Ctrl14.Button { text: "Kill" style: idButtonStyle anchors.fill: parent onClicked: parent.parent.appInfo.kill() enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_ZOMBIE) } } } ///////////////////////////////////////////////////////////////////////////////////////////////// Rectangle { x: 530 y: 50 width: 120 height: 420 property var appInfo: qGfaAppCtrl.appInfo[QGfaAppCtrl.APP_INDEX_DATALOGGER] Rectangle { x: 0 y: 10 width: parent.width height: 30 Text { font.pointSize: 9 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: "lightgrey" 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.cpuAvg.toFixed(2) } } 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.cpuCur.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.vmRSS } } 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.vmSize } } Rectangle { x: 0 y: 300 height: 30 width: parent.width Ctrl14.Button { anchors.fill: parent style: idButtonStyle enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_RUNNING || parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) text: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) ? "Resume" : "Pause" onClicked: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) ? parent.parent.appInfo.resume() : parent.parent.appInfo.pause() } } Rectangle { x: 0 y: 340 height: 30 width: parent.width Ctrl14.Button { text: "Stop" style: idButtonStyle 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: 0 y: 380 height: 30 width: parent.width Ctrl14.Button { text: "Kill" style: idButtonStyle anchors.fill: parent onClicked: parent.parent.appInfo.kill() enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_ZOMBIE) } } } ///////////////////////////////////////////////////////////////////////////////////////////////// Rectangle { x: 660 y: 50 width: 120 height: 420 property var appInfo: qGfaAppCtrl.appInfo[QGfaAppCtrl.APP_INDEX_SUMMARIST] Rectangle { x: 0 y: 10 width: parent.width height: 30 Text { font.pointSize: 9 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: "lightgrey" 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.cpuAvg.toFixed(2) } } 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.cpuCur.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.vmRSS } } 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.vmSize } } Rectangle { x: 0 y: 300 height: 30 width: parent.width Ctrl14.Button { anchors.fill: parent style: idButtonStyle enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_RUNNING || parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) text: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) ? "Resume" : "Pause" onClicked: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED) ? parent.parent.appInfo.resume() : parent.parent.appInfo.pause() } } Rectangle { x: 0 y: 340 height: 30 width: parent.width Ctrl14.Button { text: "Stop" style: idButtonStyle 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: 0 y: 380 height: 30 width: parent.width Ctrl14.Button { text: "Kill" style: idButtonStyle anchors.fill: parent onClicked: parent.parent.appInfo.kill() enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_ZOMBIE) } } } }