123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643 |
- import QtQuick 2.6
- import QtQuick.Window 2.2
- import QtQuick.Controls 1.5
- import QtQuick.Controls.Styles 1.4
- import QtQuick.Controls.Private 1.0
- import com.gfa.ipc.appctrl 1.0
- Rectangle {
- width: 800
- height: 480
- /////////////////////////////////////////////////////////////////////////////////////////////////
- function sec2HMS(sec, prec)
- {
- if(!prec)
- prec = 0;
- var d = parseInt(sec / 86400);
- sec -= d * 86400;
- var h = parseInt(sec / 3600);
- sec -= h * 3600;
- var m = parseInt(sec / 60);
- sec -= m * 60;
- return (d ? qsTr("%1d ").arg(d) : qsTr("")) + qsTr("%1:").arg(h) + qsTr("0%1:").arg(m).slice(-3) + qsTr("0%1").arg(sec.toFixed(prec)).slice(-(prec ? prec + 3 : 2));
- }
- function formatByteSize(bytes, prec)
- {
- var s;
- if(!prec)
- prec = 1;
- if(bytes < 1024)
- s = "%1 B".arg(bytes);
- else
- {
- var a = ["KiB", "MiB", "GiB"/*, "TiB", "PiB", "EiB"*/];
- var e = parseInt(1 << (a.length * 10));
- var i;
- for(i = a.length - 1; (i > 0) && (e > bytes); --i, e >>= 10)
- ;
- s = qsTr("%1 %2").arg((bytes / e).toFixed(prec)).arg(a[i]);
- }
- return s;
- }
- /////////////////////////////////////////////////////////////////////////////////////////////////
- Rectangle {
- x: 10
- y: 10
- width: parent.width - 20
- height: 30
- radius: 5
- border.width: 1
- border.color: "black"
- color: qGfaAppCtrl.sysInfoRunning ? "lightgreen" : "red"
- Image {
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- fillMode: Image.PreserveAspectFit
- height: parent.height
- source: "qrc:/img/blank.png"
- }
- Text {
- font.pixelSize: 16
- font.bold: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.centerIn: parent
- text: "System Info"
- }
- Image {
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- fillMode: Image.PreserveAspectFit
- height: parent.height
- source: "qrc:/img/next.png"
- MouseArea {
- anchors.fill: parent
- onClicked: { idPageLoader.source = "qml/appctrl.qml" }
- }
- }
- }
- /////////////////////////////////////////////////////////////////////////////////////////////////
- Rectangle {
- x: 10
- y: 50
- width: 250
- height: 30
- border.width: 1
- border.color: "black"
- radius: 5
- Text {
- font.pixelSize: 14
- font.bold: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.centerIn: parent
- text: "Sitara"
- }
- }
- /////////////////////////////////////////////////////////////////////////////////////////////////
- Rectangle {
- x: 10
- y: 90
- width: 120
- height: 420
- Rectangle {
- x: 0
- y: 0
- width: parent.width
- height: 30
- Text {
- font.pixelSize: 14
- font.italic: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- text: "Boot from:"
- }
- }
- Rectangle {
- x: 0
- y: 30
- width: parent.width
- height: 30
- Text {
- font.pixelSize: 14
- font.italic: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- text: "Mem. total:"
- }
- }
- Rectangle {
- x: 0
- y: 60
- width: parent.width
- height: 30
- Text {
- font.pixelSize: 14
- font.italic: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- text: "Mem. free:"
- }
- }
- Rectangle {
- x: 0
- y: 90
- width: parent.width
- height: 30
- Text {
- font.pixelSize: 14
- font.italic: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- text: "Mem. used:"
- }
- }
- Rectangle {
- x: 0
- y: 120
- width: parent.width
- height: 30
- Text {
- font.pixelSize: 14
- font.italic: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- text: "Mem. Buffers:"
- }
- }
- Rectangle {
- x: 0
- y: 150
- width: parent.width
- height: 30
- Text {
- font.pixelSize: 14
- font.italic: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- text: "Mem. cached:"
- }
- }
- Rectangle {
- x: 0
- y: 180
- width: parent.width
- height: 30
- Text {
- font.pixelSize: 14
- font.italic: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- text: "Mem. avail.:"
- }
- }
- Rectangle {
- x: 0
- y: 350
- height: 30
- width: parent.width
- Button {
- text: "Exit"
- anchors.fill: parent
- onClicked: Qt.quit()
- style: idButtonStyle
- }
- }
- }
- /////////////////////////////////////////////////////////////////////////////////////////////////
- Rectangle {
- x: 140
- y: 90
- width: 120
- height: 420
- property var sysInfo: qGfaAppCtrl.sysInfo
- property var tivaInfo: qGfaAppCtrl.sysInfo.tivaInfo
- Rectangle {
- x: 0
- y: 0
- width: parent.width
- height: 30
- border.width: 1
- border.color: "lightgrey"
- radius: 5
- color: parent.sysInfo.bootFromEmmc ? "white" : "orange"
- Text {
- font.pointSize: 8
- anchors.centerIn: parent
- text: parent.parent.sysInfo.bootFromEmmc ? "EMMC" : "SD"
- }
- }
- Rectangle {
- x: 0
- y: 30
- width: parent.width
- height: 30
- border.width: 1
- border.color: "lightgrey"
- radius: 5
- Text {
- font.pointSize: 8
- anchors.centerIn: parent
- text: parent.parent.sysInfo.memTotal !== 0 ? formatByteSize(parent.parent.sysInfo.memTotal * 1024) : "n/a"
- }
- }
- Rectangle {
- x: 0
- y: 60
- width: parent.width
- height: 30
- border.width: 1
- border.color: "lightgrey"
- radius: 5
- Text {
- font.pointSize: 8
- anchors.centerIn: parent
- text: parent.parent.sysInfo.memFree !== 0 ? formatByteSize(parent.parent.sysInfo.memFree * 1024) : "n/a"
- }
- }
- Rectangle {
- x: 0
- y: 90
- width: parent.width
- height: 30
- border.width: 1
- border.color: "lightgrey"
- radius: 5
- Text {
- font.pointSize: 8
- anchors.centerIn: parent
- text: parent.parent.sysInfo.memUsed !== 0 ? formatByteSize(parent.parent.sysInfo.memUsed * 1024) : "n/a"
- }
- }
- Rectangle {
- x: 0
- y: 120
- width: parent.width
- height: 30
- border.width: 1
- border.color: "lightgrey"
- radius: 5
- Text {
- font.pointSize: 8
- anchors.centerIn: parent
- text: parent.parent.sysInfo.memBuffers !== 0 ? formatByteSize(parent.parent.sysInfo.memBuffers * 1024) : "n/a"
- }
- }
- Rectangle {
- x: 0
- y: 150
- width: parent.width
- height: 30
- border.width: 1
- border.color: "lightgrey"
- radius: 5
- Text {
- font.pointSize: 8
- anchors.centerIn: parent
- text: parent.parent.sysInfo.memCached !== 0 ? formatByteSize(parent.parent.sysInfo.memCached * 1024) : "n/a"
- }
- }
- Rectangle {
- x: 0
- y: 180
- width: parent.width
- height: 30
- border.width: 1
- border.color: "black"
- radius: 5
- Text {
- font.pointSize: 8
- anchors.centerIn: parent
- text: parent.parent.sysInfo.memAvailable !== 0 ? formatByteSize(parent.parent.sysInfo.memAvailable * 1024) : "n/a"
- }
- }
- }
- /////////////////////////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////////////////////////
- Rectangle {
- x: 410
- y: 50
- width: 250
- height: 30
- border.width: 1
- border.color: "black"
- radius: 5
- Text {
- font.pixelSize: 14
- font.bold: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.centerIn: parent
- text: "Tiva"
- }
- }
- Rectangle {
- x: 410
- y: 90
- width: 120
- height: 420
- Rectangle {
- x: 0
- y: 0
- width: parent.width
- height: 30
- Text {
- font.pixelSize: 14
- font.italic: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- text: "Uptime:"
- }
- }
- Rectangle {
- x: 0
- y: 30
- width: parent.width
- height: 30
- Text {
- font.pixelSize: 14
- font.italic: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- text: "HW-Version:"
- }
- }
- Rectangle {
- x: 0
- y: 60
- width: parent.width
- height: 30
- Text {
- font.pixelSize: 14
- font.italic: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- text: "SW-Version:"
- }
- }
- Rectangle {
- x: 0
- y: 90
- width: parent.width
- height: 30
- Text {
- font.pixelSize: 14
- font.italic: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- text: "V Power:"
- }
- }
- Rectangle {
- x: 0
- y: 120
- width: parent.width
- height: 30
- Text {
- font.pixelSize: 14
- font.italic: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- text: "V Sys.:"
- }
- }
- Rectangle {
- x: 0
- y: 150
- width: parent.width
- height: 30
- Text {
- font.pixelSize: 14
- font.italic: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- text: "V Bat.:"
- }
- }
- Rectangle {
- x: 0
- y: 180
- width: parent.width
- height: 30
- Text {
- font.pixelSize: 14
- font.italic: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- text: "V Bak.Bat.:"
- }
- }
- Rectangle {
- x: 0
- y: 210
- width: parent.width
- height: 30
- Text {
- font.pixelSize: 14
- font.italic: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- text: "Temp. Board °:"
- }
- }
- Rectangle {
- x: 0
- y: 240
- width: parent.width
- height: 30
- Text {
- font.pixelSize: 14
- font.italic: true
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- text: "Temp. Tiva °:"
- }
- }
- }
- /////////////////////////////////////////////////////////////////////////////////////////////////
- Rectangle {
- x: 540
- y: 90
- width: 120
- height: 420
- property var tivaInfo: qGfaAppCtrl.sysInfo.tivaInfo
- property var spiAvail: !!tivaInfo.voltPowSup
- Rectangle {
- x: 0
- y: 0
- width: parent.width
- height: 30
- border.width: 1
- border.color: "lightgrey"
- radius: 5
- Text {
- font.pointSize: 8
- anchors.centerIn: parent
- text: parent.parent.spiAvail ? sec2HMS(parent.parent.tivaInfo.upTime) : "n/a"
- }
- }
- Rectangle {
- x: 0
- y: 30
- width: parent.width
- height: 30
- border.width: 1
- border.color: "lightgrey"
- radius: 5
- Text {
- font.pointSize: 8
- anchors.centerIn: parent
- text: parent.parent.spiAvail ? parent.parent.tivaInfo.hwVersion : "n/a"
- }
- }
- Rectangle {
- x: 0
- y: 60
- width: parent.width
- height: 30
- border.width: 1
- border.color: "lightgrey"
- radius: 5
- Text {
- font.pointSize: 8
- anchors.centerIn: parent
- text: parent.parent.spiAvail ? parent.parent.tivaInfo.swVersion : "n/a"
- }
- }
- Rectangle {
- x: 0
- y: 90
- width: parent.width
- height: 30
- border.width: 1
- border.color: "lightgrey"
- radius: 5
- Text {
- font.pointSize: 8
- anchors.centerIn: parent
- text: parent.parent.spiAvail ? parent.parent.tivaInfo.voltPowSup.toFixed(2) : "n/a"
- }
- }
- Rectangle {
- x: 0
- y: 120
- width: parent.width
- height: 30
- border.width: 1
- border.color: "lightgrey"
- radius: 5
- Text {
- font.pointSize: 8
- anchors.centerIn: parent
- text: parent.parent.spiAvail ? parent.parent.tivaInfo.voltSys.toFixed(2) : "n/a"
- }
- }
- Rectangle {
- x: 0
- y: 150
- width: parent.width
- height: 30
- border.width: 1
- border.color: "lightgrey"
- radius: 5
- Text {
- font.pointSize: 8
- anchors.centerIn: parent
- text: parent.parent.spiAvail ? parent.parent.tivaInfo.voltBat.toFixed(2) : "n/a"
- }
- }
- Rectangle {
- x: 0
- y: 180
- width: parent.width
- height: 30
- border.width: 1
- border.color: "lightgrey"
- radius: 5
- Text {
- font.pointSize: 8
- anchors.centerIn: parent
- text: parent.parent.spiAvail ? parent.parent.tivaInfo.voltBakBat.toFixed(2) : "n/a"
- }
- }
- Rectangle {
- x: 0
- y: 210
- width: parent.width
- height: 30
- border.width: 1
- border.color: "lightgrey"
- radius: 5
- Text {
- font.pointSize: 8
- anchors.centerIn: parent
- text: parent.parent.spiAvail ? parent.parent.tivaInfo.tempBoard.toFixed(1) : "n/a"
- }
- }
- Rectangle {
- x: 0
- y: 240
- width: parent.width
- height: 30
- border.width: 1
- border.color: "lightgrey"
- radius: 5
- Text {
- font.pointSize: 8
- anchors.centerIn: parent
- text: parent.parent.spiAvail ? parent.parent.tivaInfo.tempTiva.toFixed(1) : "n/a"
- }
- }
- }
- }
|