SmartLockerTools/Analyser/qml/ConnectionItem.qml
luocai ce673bf330
Some checks failed
Build Applications / Build (push) Failing after 1m17s
Windows CI / build (push) Successful in 3m4s
add dshow api.
2024-11-21 19:34:13 +08:00

81 lines
2.2 KiB
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Analyser
RowLayout {
GroupBox {
title: "串口设置"
Layout.fillWidth: true
GridLayout {
columns: 2
Text {
text: qsTr("端口")
}
ComboBox {
id: serialPort
enabled: !App.connected
implicitWidth: 116
}
Text {
text: qsTr("波特率")
}
ComboBox {
id: baudrate
enabled: !App.connected
implicitWidth: 116
model: ["2000000", "115200"]
}
Button {
text: "刷新"
enabled: !App.connected
onClicked: {
serialPort.model = App.availableSerialPorts()
}
}
Button {
text: App.connected ? "断开" : "连接"
onClicked: App.connected ? App.close() : App.open(
serialPort.currentText,
parseInt(baudrate.currentText))
}
}
}
GroupBox {
Layout.fillWidth: true
Layout.fillHeight: true
title: "UVC设置"
GridLayout {
columns: 2
Text {
text: qsTr("设备名")
}
ComboBox {
id: uvcs
textRole: "name"
enabled: !App.uvcOpened
implicitWidth: 150
}
Button {
enabled: !App.uvcOpened
text: "刷新"
onClicked: uvcs.model = App.availableUsbVideoCameras()
}
Button {
text: App.uvcOpened ? "关闭" : "连接"
onClicked: App.uvcOpened ? App.closeUVC() : App.openUVC(uvcs.currentValue.path)
}
}
}
Component.onCompleted: {
serialPort.model = App.availableSerialPorts()
uvcs.model = App.availableUsbVideoCameras()
}
}