SmartLockerTools/Analyser/qml/EnrollVerifyOperations.qml

86 lines
2.5 KiB
QML
Raw Permalink Normal View History

2024-09-25 18:44:04 +08:00
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Analyser
RowLayout {
id: control
GroupBox {
title: "注册用户"
GridLayout {
columns: 2
Label {
text: qsTr("用户姓名")
}
TextField {
id: enrollName
implicitWidth: 100
}
Label {
text: qsTr("超时时间")
}
TextField {
id: enrollTimeout
implicitWidth: 100
text: "30"
}
Button {
property bool enrolling: App.module ? (App.module.currentMessageId
=== ModuleCommunication.EnrollSingle)
|| (App.module.currentMessageId === ModuleCommunication.EnrollExtended) : false
text: enrolling ? "取消" : "注册"
onClicked: {
if (enrolling) {
App.module.reset()
} else {
App.enroll(enrollName.text, parseInt(enrollTimeout.text))
2024-09-25 18:44:04 +08:00
}
}
}
}
}
GroupBox {
title: "识别用户"
GridLayout {
columns: 2
Label {
text: qsTr("超时时间(s)")
}
TextField {
id: verifyTimeout
implicitWidth: 80
text: "10"
}
Label {
text: qsTr("持续识别")
}
Switch {
checked: App.persistenceMode
onToggled: App.persistenceMode = !App.persistenceMode
}
Label {
text: qsTr("识别间隔(s)")
}
TextField {
id: verifyIntetval
implicitWidth: 80
text: App.persistenceVerifyInterval
}
Item {}
Button {
text: App.isVerifying ? "停止" : "识别"
onClicked: {
if (App.isVerifying) {
App.module.reset()
} else {
App.persistenceVerifyInterval = parseInt(verifyIntetval.text)
App.verify(parseInt(verifyTimeout.text))
2024-09-25 18:44:04 +08:00
}
}
}
}
}
}