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; model: ["NUC1", "NUC2", "NUC3", "NUC4", "NUC5"]; onCurrentIndexChanged: { chart.reset(); } } Button { id: btnTrigger; text: "Start"; onClicked: { if (mgmt.trigger()) { // running btnTrigger.text = "Stop"; } else { btnTrigger.text = "Start"; } } } Button { text: "Reset" onClicked: { chart.reset(); chart.update(); } } } 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" } } }