2024-08-13 09:54:41 +08:00
|
|
|
import QtQuick
|
2024-08-13 20:06:10 +08:00
|
|
|
import QtQuick.Controls
|
2024-08-14 20:01:38 +08:00
|
|
|
import QtQuick.Layouts
|
2024-08-13 20:06:10 +08:00
|
|
|
import AntiClipSettings
|
2024-08-13 09:54:41 +08:00
|
|
|
|
2024-08-13 20:06:10 +08:00
|
|
|
ApplicationWindow {
|
2024-08-16 16:24:15 +08:00
|
|
|
width: 1000
|
|
|
|
height: 640
|
2024-08-13 09:54:41 +08:00
|
|
|
visible: true
|
|
|
|
title: qsTr("Hello World")
|
2024-08-13 20:06:10 +08:00
|
|
|
|
2024-08-14 20:01:38 +08:00
|
|
|
header: ToolBar {
|
|
|
|
RowLayout {
|
|
|
|
anchors.fill: parent
|
|
|
|
Button {
|
|
|
|
text: "搜索设备"
|
2024-08-16 16:24:15 +08:00
|
|
|
onClicked: {
|
|
|
|
deviceList.currentIndex = -1
|
|
|
|
App.devices.startSearchDevice()
|
|
|
|
}
|
2024-08-14 20:01:38 +08:00
|
|
|
}
|
2024-08-20 09:29:49 +08:00
|
|
|
Text {
|
|
|
|
text: `设备总数: ${deviceList.count}`
|
|
|
|
}
|
2024-08-16 16:24:15 +08:00
|
|
|
Row {
|
2024-08-14 20:01:38 +08:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2024-08-16 16:24:15 +08:00
|
|
|
Text {
|
|
|
|
text: qsTr("当前设备版本号: ")
|
|
|
|
}
|
|
|
|
Text {
|
|
|
|
id: deviceVersion
|
|
|
|
text: qsTr("RD_T009_V02R001B001")
|
|
|
|
}
|
2024-08-14 20:01:38 +08:00
|
|
|
}
|
2024-08-16 16:24:15 +08:00
|
|
|
|
2024-08-13 20:06:10 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-08-16 16:24:15 +08:00
|
|
|
ListView {
|
2024-08-13 20:06:10 +08:00
|
|
|
id: deviceList
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.left: parent.left
|
2024-08-16 16:24:15 +08:00
|
|
|
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 {
|
2024-08-20 09:29:49 +08:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2024-08-16 16:24:15 +08:00
|
|
|
text: deviceId
|
|
|
|
}
|
|
|
|
Item {}
|
|
|
|
Text {
|
2024-08-20 09:29:49 +08:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2024-08-16 16:24:15 +08:00
|
|
|
text: ip
|
|
|
|
}
|
2024-08-20 09:29:49 +08:00
|
|
|
Rectangle {
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
color: onlineStatus ? "green":"black"
|
|
|
|
width: 10
|
|
|
|
height: 10
|
|
|
|
radius: 5
|
|
|
|
}
|
2024-08-16 16:24:15 +08:00
|
|
|
}
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
|
|
|
deviceList.currentIndex = index
|
|
|
|
|
|
|
|
}
|
|
|
|
onDoubleClicked: {
|
|
|
|
networkPopup.open()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onCurrentIndexChanged: {
|
|
|
|
deviceVersion.text = App.devices.get(deviceList.currentIndex).softwareVersion;
|
2024-08-20 09:29:49 +08:00
|
|
|
App.connectToDevice(deviceList.currentIndex)
|
2024-08-16 16:24:15 +08:00
|
|
|
}
|
|
|
|
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
|
|
|
|
}
|
2024-08-13 20:06:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
DeviceView {
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.left: deviceList.right
|
|
|
|
anchors.right: parent.right
|
2024-08-16 16:24:15 +08:00
|
|
|
openDoorAreaWay: App.currentOpenDoorAreaWay
|
2024-08-13 20:06:10 +08:00
|
|
|
openDoorAreaPoints: App.currentOpenDoorAreaPoints
|
2024-08-14 20:01:38 +08:00
|
|
|
shieldedAreaEnabled: App.currentShieldedAreaEnabled
|
|
|
|
shieldedAreaPoints: App.currentShieldedAreaPoints
|
|
|
|
antiClipAreaEnabled: App.currentAntiClipAreaEnabled
|
|
|
|
antiClipAreaPoints: App.currentAntiClipAreaPoints
|
|
|
|
}
|
|
|
|
|
2024-08-16 16:24:15 +08:00
|
|
|
NetworkSettingPopup {
|
|
|
|
id: networkPopup
|
|
|
|
visible: false
|
|
|
|
width: 500
|
|
|
|
height: 240
|
|
|
|
}
|
|
|
|
|
2024-08-19 09:33:04 +08:00
|
|
|
OtaPopup {
|
|
|
|
id: otaPopup
|
|
|
|
}
|
|
|
|
|
2024-08-14 20:01:38 +08:00
|
|
|
footer: RowLayout {
|
|
|
|
width: parent.width
|
|
|
|
Item {}
|
|
|
|
Button {
|
|
|
|
text: "数据采集"
|
|
|
|
}
|
|
|
|
Item {}
|
|
|
|
Button {
|
|
|
|
text: "升级"
|
2024-08-19 09:33:04 +08:00
|
|
|
onClicked: otaPopup.open()
|
2024-08-14 20:01:38 +08:00
|
|
|
}
|
|
|
|
Item {}
|
|
|
|
spacing: (parent.width - (2 * 100)) / 3
|
2024-08-13 20:06:10 +08:00
|
|
|
}
|
2024-08-13 09:54:41 +08:00
|
|
|
}
|