完成主要交互、高性能组件、国际化和A型传感器数据包接收
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import QtQuick
|
||||
import QtQuick3D
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQml
|
||||
import "."
|
||||
import TactileIPC 1.0
|
||||
|
||||
Pane {
|
||||
id: root
|
||||
@@ -21,11 +21,17 @@ Pane {
|
||||
|
||||
Toggle {
|
||||
id: darkModeToggle
|
||||
text: qsTr("Dark mode")
|
||||
text: Qt.binding(function() {
|
||||
I18n.retranslateToken
|
||||
return qsTr("Dark mode")
|
||||
})
|
||||
}
|
||||
|
||||
GroupBox {
|
||||
title: qsTr("Render")
|
||||
title: Qt.binding(function() {
|
||||
I18n.retranslateToken
|
||||
return qsTr("Render")
|
||||
})
|
||||
Layout.fillWidth: true
|
||||
|
||||
ColumnLayout {
|
||||
@@ -34,17 +40,23 @@ Pane {
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Label { text: qsTr("Mode"); Layout.alignment: Qt.AlignVCenter }
|
||||
Label {
|
||||
text: Qt.binding(function() {
|
||||
I18n.retranslateToken
|
||||
return qsTr("Mode")
|
||||
})
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
ComboBox {
|
||||
id: renderModeBox
|
||||
Layout.fillWidth: true
|
||||
model: ["dataViz", "realistic"]
|
||||
Component.onCompleted: currentIndex = backend.renderMode === "realistic" ? 1 : 0
|
||||
onActivated: backend.renderMode = currentText
|
||||
Component.onCompleted: currentIndex = Backend.renderMode === "realistic" ? 1 : 0
|
||||
onActivated: Backend.renderMode = currentText
|
||||
Connections {
|
||||
target: backend
|
||||
target: Backend
|
||||
function onRenderModeChanged() {
|
||||
renderModeBox.currentIndex = backend.renderMode === "realistic" ? 1 : 0
|
||||
renderModeBox.currentIndex = Backend.renderMode === "realistic" ? 1 : 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,22 +64,28 @@ Pane {
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Label { text: qsTr("Labels"); Layout.alignment: Qt.AlignVCenter }
|
||||
Label {
|
||||
text: Qt.binding(function() {
|
||||
I18n.retranslateToken
|
||||
return qsTr("Labels")
|
||||
})
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
ComboBox {
|
||||
id: labelModeBox
|
||||
Layout.fillWidth: true
|
||||
model: ["off", "hover", "always"]
|
||||
Component.onCompleted: {
|
||||
if (backend.labelMode === "always") labelModeBox.currentIndex = 2
|
||||
else if (backend.labelMode === "hover") labelModeBox.currentIndex = 1
|
||||
if (Backend.labelMode === "always") labelModeBox.currentIndex = 2
|
||||
else if (Backend.labelMode === "hover") labelModeBox.currentIndex = 1
|
||||
else labelModeBox.currentIndex = 0
|
||||
}
|
||||
onActivated: backend.labelMode = currentText
|
||||
onActivated: Backend.labelMode = currentText
|
||||
Connections {
|
||||
target: backend
|
||||
target: Backend
|
||||
function onLabelModeChanged() {
|
||||
if (backend.labelMode === "always") labelModeBox.currentIndex = 2
|
||||
else if (backend.labelMode === "hover") labelModeBox.currentIndex = 1
|
||||
if (Backend.labelMode === "always") labelModeBox.currentIndex = 2
|
||||
else if (Backend.labelMode === "hover") labelModeBox.currentIndex = 1
|
||||
else labelModeBox.currentIndex = 0
|
||||
}
|
||||
}
|
||||
@@ -76,15 +94,21 @@ Pane {
|
||||
|
||||
Toggle {
|
||||
id: legendToggle
|
||||
text: qsTr("Legend")
|
||||
checked: backend.showLegend
|
||||
onCheckedChanged: backend.showLegend = checked
|
||||
text: Qt.binding(function() {
|
||||
I18n.retranslateToken
|
||||
return qsTr("Legend")
|
||||
})
|
||||
checked: Backend.showLegend
|
||||
onCheckedChanged: Backend.showLegend = checked
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GroupBox {
|
||||
title: qsTr("Scale")
|
||||
title: Qt.binding(function() {
|
||||
I18n.retranslateToken
|
||||
return qsTr("Scale")
|
||||
})
|
||||
Layout.fillWidth: true
|
||||
|
||||
ColumnLayout {
|
||||
@@ -93,35 +117,47 @@ Pane {
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Label { text: qsTr("Min"); Layout.alignment: Qt.AlignVCenter }
|
||||
Label {
|
||||
text: Qt.binding(function() {
|
||||
I18n.retranslateToken
|
||||
return qsTr("Min")
|
||||
})
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
SpinBox {
|
||||
id: minBox
|
||||
Layout.fillWidth: true
|
||||
from: -999999
|
||||
to: 999999
|
||||
value: backend.minValue
|
||||
onValueModified: backend.minValue = value
|
||||
value: Backend.minValue
|
||||
onValueModified: Backend.minValue = value
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Label { text: qsTr("Max"); Layout.alignment: Qt.AlignVCenter }
|
||||
Label {
|
||||
text: Qt.binding(function() {
|
||||
I18n.retranslateToken
|
||||
return qsTr("Max")
|
||||
})
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
SpinBox {
|
||||
id: maxBox
|
||||
Layout.fillWidth: true
|
||||
from: -999999
|
||||
to: 999999
|
||||
value: backend.maxValue
|
||||
onValueModified: backend.maxValue = value
|
||||
value: Backend.maxValue
|
||||
onValueModified: Backend.maxValue = value
|
||||
}
|
||||
}
|
||||
|
||||
Legend {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
visible: backend.showLegend
|
||||
minValue: backend.minValue
|
||||
maxValue: backend.maxValue
|
||||
visible: Backend.showLegend
|
||||
minValue: Backend.minValue
|
||||
maxValue: Backend.maxValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user