添加安全帽检测阈值设置。

This commit is contained in:
luocai
2024-12-11 19:05:37 +08:00
parent 7284f18c43
commit 559867bd31
9 changed files with 207 additions and 3 deletions

View File

@ -247,13 +247,13 @@ Item {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
columns: 4
columns: 6
Label { text: qsTr("图像: ") }
Row {
enabled: root.enabled
Layout.columnSpan: 3
Layout.columnSpan: 5
Label {
anchors.verticalCenter: parent.verticalCenter
text: qsTr("旋转")
@ -283,7 +283,7 @@ Item {
}
Row {
enabled: root.enabled
Layout.columnSpan: 3
Layout.columnSpan: 5
RadioButton {
text: "关闭"
checked: App.currentOpenDoorAreaWay ==DeviceConnection.Diabled
@ -343,6 +343,14 @@ Item {
}
}
Label { text: qsTr("安全帽灵敏度: ")
Layout.alignment: Qt.AlignRight
}
TextField {
enabled: root.enabled
Layout.alignment: Qt.AlignLeft
}
Label {text: qsTr("屏蔽区域: ")}
Row {
id: shieldedRow

View File

@ -195,6 +195,14 @@ ApplicationWindow {
spacing: (parent.width - (2 * 100)) / 3
}
MessageBar {
id: messageBar
root: window.contentItem
}
function showSuccess(text,duration){
return messageBar.showSuccess(text,duration)
}
function showMessageDialog(type, title, message, callback) {
let component = Qt.createComponent("MessageDialog.qml")
if (component.status === Component.Ready) {

101
qml/MessageBar.qml Normal file
View File

@ -0,0 +1,101 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
Object {
id: control
property var root
property var screenLayout: null
property int layoutY: 75
function showSuccess(text,duration=1000){
return create("success",text,duration)
}
function create(type,text,duration){
if(screenLayout){
let last = screenLayout.getLastloader()
if(last.type === type && last.text === text){
last.duration = duration
if (duration > 0) last.restart()
return last
}
} else {
initScreenLayout()
}
return contentComponent.createObject(screenLayout,{type:type,text:text,duration:duration,})
}
function initScreenLayout() {
if(control.screenLayout == null) {
control.screenLayout = screenLayoutComponent.createObject(root)
screenLayout.y = control.layoutY
screenLayout.z = 100000
}
}
Component {
id:contentComponent
Rectangle {
id: content
property int duration: 1500
property string type
property alias text: message.text
color: "#EBF8ED"
radius: 3.2
border.width: 1
border.color: Qt.darker(content.color)
layer.enabled: true
x:(parent.width - width) / 2
width: 200
height: 32
Row {
anchors.fill: parent
Image {
width: 32
height: 32
fillMode: Image.Pad
source: "qrc:/qt/qml/AntiClipSettings/resources/successfull.svg"
anchors.verticalCenter: parent.verticalCenter
}
Label {
id: message
anchors.verticalCenter: parent.verticalCenter
}
}
Timer {
id:delayTimer
interval: duration
running: duration > 0
repeat: duration > 0
onTriggered: content.close()
}
function close(){
content.destroy()
}
}
}
Component {
id:screenLayoutComponent
Column{
parent: Overlay.overlay
z:999
spacing: 5
width: root.width
move: Transition {
NumberAnimation {
properties: "y"
easing.type: Easing.InOutQuad
duration: 167
}
}
onChildrenChanged: if(children.length === 0) destroy()
function getLastloader(){
if(children.length > 0){
return children[children.length - 1]
}
return null
}
}
}
}

5
qml/Object.qml Normal file
View File

@ -0,0 +1,5 @@
import QtQml 2.15
QtObject {
default property list<QtObject> children
}