Files
RTT/main.qml

113 lines
2.5 KiB
QML

import QtQuick 2.9
import QtQuick.Window 2.2
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3
import Test 1.0
Window {
id: window
objectName: "qmlWindow"
visible: true
width: 640
height: 680
title: qsTr("Hello World")
Connections {
target: mgmt
onNewDistMeas: {
if (cbNUC.currentIndex == idx) {
chart.pushData(value);
lblMean.text = "Mean: " + chart.mean.toFixed(3) + "\nStdDev: " + chart.stdDev.toFixed(3);
lblCount.text = "Count: " + chart.totalCount + "\nMax bin: " + chart.maxBinValue.toFixed(3);
lblRunTime.text = "Time: " + (mgmt.runTimeInMs() / 1000.0).toFixed(0) + "s";
}
}
}
GridLayout {
anchors.fill: parent;
Row {
Layout.row: 0;
Layout.column: 0;
spacing: 3;
ComboBox {
id: cbNUC;
height: 60;
model: ["NUC1", "NUC2", "NUC3", "NUC4", "NUC5"];
onCurrentIndexChanged: {
chart.reset();
}
}
Button {
id: btnTrigger;
text: "Start";
height: 60;
onClicked: {
if (mgmt.trigger()) {
// running
btnTrigger.text = "Stop";
cbLogToDisk.enabled = false;
} else {
btnTrigger.text = "Start";
cbLogToDisk.enabled = true;
}
}
}
Button {
text: "Reset";
height: 60;
onClicked: {
chart.reset();
chart.update();
}
}
CheckBox {
id: cbLogToDisk;
text: "Log";
onClicked: mgmt.logToDisk = checked
}
}
Row {
Layout.row: 1;
Layout.column: 0;
spacing: 5;
Label {
id: lblMean;
}
Label {
id: lblCount;
}
Label {
id: lblRunTime;
}
}
HistogramChart {
Layout.row: 2;
Layout.column: 0;
Layout.fillHeight: true;
Layout.fillWidth: true;
id: chart
objectName: "qmlChart"
}
}
}