AntiClipSettings/Main.qml
2024-08-20 09:29:49 +08:00

137 lines
3.8 KiB
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import AntiClipSettings
ApplicationWindow {
width: 1000
height: 640
visible: true
title: qsTr("Hello World")
header: ToolBar {
RowLayout {
anchors.fill: parent
Button {
text: "搜索设备"
onClicked: {
deviceList.currentIndex = -1
App.devices.startSearchDevice()
}
}
Text {
text: `: ${deviceList.count}`
}
Row {
Layout.alignment: Qt.AlignRight
Text {
text: qsTr("当前设备版本号: ")
}
Text {
id: deviceVersion
text: qsTr("RD_T009_V02R001B001")
}
}
}
}
ListView {
id: deviceList
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
width: 420
clip: true
model: App.devices
delegate: Rectangle {
width: deviceList.width
height: 40
color: ListView.isCurrentItem ? "#aaddff" : (index % 2 == 0 ? "#ffffff" : "#eeeeee")
Row {
anchors.fill: parent
spacing: 10
Text {
anchors.verticalCenter: parent.verticalCenter
text: deviceId
}
Item {}
Text {
anchors.verticalCenter: parent.verticalCenter
text: ip
}
Rectangle {
anchors.verticalCenter: parent.verticalCenter
color: onlineStatus ? "green":"black"
width: 10
height: 10
radius: 5
}
}
MouseArea {
anchors.fill: parent
onClicked: {
deviceList.currentIndex = index
}
onDoubleClicked: {
networkPopup.open()
}
}
}
onCurrentIndexChanged: {
deviceVersion.text = App.devices.get(deviceList.currentIndex).softwareVersion;
App.connectToDevice(deviceList.currentIndex)
}
ProgressBar {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
visible: App.devices.isSearching
from: 0
to: 100
value: App.devices.searchProgress
height: 25
}
}
DeviceView {
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: deviceList.right
anchors.right: parent.right
openDoorAreaWay: App.currentOpenDoorAreaWay
openDoorAreaPoints: App.currentOpenDoorAreaPoints
shieldedAreaEnabled: App.currentShieldedAreaEnabled
shieldedAreaPoints: App.currentShieldedAreaPoints
antiClipAreaEnabled: App.currentAntiClipAreaEnabled
antiClipAreaPoints: App.currentAntiClipAreaPoints
}
NetworkSettingPopup {
id: networkPopup
visible: false
width: 500
height: 240
}
OtaPopup {
id: otaPopup
}
footer: RowLayout {
width: parent.width
Item {}
Button {
text: "数据采集"
}
Item {}
Button {
text: "升级"
onClicked: otaPopup.open()
}
Item {}
spacing: (parent.width - (2 * 100)) / 3
}
}