SmartLockerTools/Analyser/qml/EnrollVerifyOperations.qml
luocai 40c60193d1
Some checks failed
Build Applications / PullDocker (push) Failing after 7s
Build Applications / Build (push) Failing after 4s
Windows CI / build (push) Successful in 3m16s
精简代码,便于同步客户对接。
2024-10-14 14:20:45 +08:00

86 lines
2.5 KiB
QML

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))
}
}
}
}
}
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))
}
}
}
}
}
}