Benchmark page was added
This commit is contained in:
96
qml/Views/BenchmarkView.qml
Normal file
96
qml/Views/BenchmarkView.qml
Normal file
@@ -0,0 +1,96 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
import ru.ded.beerlog 1.0
|
||||
|
||||
Page {
|
||||
|
||||
title: qsTr("Benchmark")
|
||||
|
||||
Column {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 10
|
||||
|
||||
ItemDelegate {
|
||||
width: parent.width
|
||||
|
||||
text: qsTr("Items count")
|
||||
|
||||
TextField {
|
||||
id: itemsCountField
|
||||
|
||||
anchors.right: parent.right
|
||||
|
||||
validator: IntValidator {
|
||||
bottom: 0
|
||||
top: 100000
|
||||
}
|
||||
|
||||
height: parent.height
|
||||
|
||||
inputMethodHints: Qt.ImhPreferNumbers
|
||||
}
|
||||
}
|
||||
|
||||
ItemDelegate {
|
||||
width: parent.width
|
||||
|
||||
text: qsTr("Submit time")
|
||||
|
||||
Label {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
text: benchmark.submitTime
|
||||
}
|
||||
}
|
||||
|
||||
ItemDelegate {
|
||||
width: parent.width
|
||||
|
||||
text: qsTr("Receive time")
|
||||
|
||||
Label {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
text: benchmark.receiveTime
|
||||
}
|
||||
}
|
||||
|
||||
ItemDelegate {
|
||||
width: parent.width
|
||||
|
||||
text: qsTr("Remove time")
|
||||
|
||||
Label {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
text: benchmark.removeTime
|
||||
}
|
||||
}
|
||||
|
||||
ItemDelegate {
|
||||
id: startButton
|
||||
|
||||
width: parent.width
|
||||
|
||||
text: qsTr("Start benchmark")
|
||||
enabled: !benchmark.inProgress
|
||||
|
||||
onClicked: benchmark.startBenchmark()
|
||||
|
||||
states: State {
|
||||
when: benchmark.inProgress
|
||||
PropertyChanges {
|
||||
target: startButton
|
||||
text: qsTr("In progress")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BenchmarkViewModel {
|
||||
id: benchmark
|
||||
|
||||
itemsCount: Number(itemsCountField.text)
|
||||
}
|
||||
}
|
||||
@@ -85,6 +85,7 @@ ApplicationWindow {
|
||||
"orders": () => { stackView.openPage("Views/OrdersView.qml") },
|
||||
"rests": () => { stackView.openPage("Views/RestsView.qml") },
|
||||
"settings": () => { stackView.openPage("Views/SettingsView.qml") },
|
||||
"benchmark": () => { stackView.openPage("Views/BenchmarkView.qml") },
|
||||
"quit": () => { Qt.quit() }
|
||||
}
|
||||
|
||||
@@ -108,6 +109,10 @@ ApplicationWindow {
|
||||
title: qsTr("Settings")
|
||||
action: "settings"
|
||||
}
|
||||
ListElement {
|
||||
title: qsTr("Benchmark")
|
||||
action: "benchmark"
|
||||
}
|
||||
ListElement {
|
||||
title: qsTr("Quit")
|
||||
action: "quit"
|
||||
|
||||
@@ -7,5 +7,6 @@
|
||||
<file>Views/SettingsView.qml</file>
|
||||
<file>Views/ProductsView.qml</file>
|
||||
<file>Views/RestsView.qml</file>
|
||||
<file>Views/BenchmarkView.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
Reference in New Issue
Block a user