proto-debuger/protoDebuger/main.qml

137 lines
3.9 KiB
QML
Raw Normal View History

2021-04-04 02:57:36 +00:00
import QtQuick 2.14
import QtQuick.Window 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.12
2021-04-12 15:39:06 +00:00
Rectangle {
2021-05-01 06:09:18 +00:00
objectName: "main"
2021-04-04 02:57:36 +00:00
id: root
2021-05-01 06:09:18 +00:00
width: 1440
height: 900
2021-04-04 02:57:36 +00:00
visible: true
2021-04-07 15:45:42 +00:00
2021-04-04 02:57:36 +00:00
Flow{
anchors.fill: parent
width: parent.width
height: parent.height
Rectangle {
width: 80;
height: parent.height
color: "black"
Flow{
id: element
flow:Flow.TopToBottom //从上到下排列
width: parent.width
height: parent.height
Button{
2021-05-03 05:50:07 +00:00
id: btn_serial
2021-04-04 02:57:36 +00:00
width: parent.width
height:60
2021-05-03 05:50:07 +00:00
anchors.top: parent.top
2021-04-04 02:57:36 +00:00
onClicked: {
2021-04-07 15:45:42 +00:00
uart_choose.visible = true
2021-04-10 14:22:41 +00:00
net_choose.visible = false
proto_debug.visible = false
2021-04-04 02:57:36 +00:00
}
background: Image {
anchors.fill: parent
source: "qrc:///res/serial.svg"
}
}
Text {
2021-05-03 05:50:07 +00:00
id: label_serial
2021-04-04 02:57:36 +00:00
text: qsTr("串口设置")
width: parent.width
color: "white"
font.pointSize: 10
2021-05-03 05:50:07 +00:00
anchors.top: btn_serial.bottom
2021-04-04 02:57:36 +00:00
}
Button{
2021-05-03 05:50:07 +00:00
id: button_net
2021-04-04 02:57:36 +00:00
width: parent.width
height:60
2021-05-03 05:50:07 +00:00
anchors.top: label_serial.bottom
2021-04-04 02:57:36 +00:00
onClicked: {
2021-04-10 14:22:41 +00:00
2021-04-04 02:57:36 +00:00
}
background: Image {
anchors.fill: parent
source: "qrc:///res/net.svg"
}
onPressed:{
2021-04-07 15:45:42 +00:00
uart_choose.visible = false
2021-04-10 14:22:41 +00:00
net_choose.visible = true
proto_debug.visible = false
2021-04-04 02:57:36 +00:00
}
}
Text {
2021-05-03 05:50:07 +00:00
id: label_net
2021-04-04 02:57:36 +00:00
text: qsTr("网口设置")
width: parent.width
color: "white"
font.pointSize: 10
2021-05-03 05:50:07 +00:00
anchors.top: button_net.bottom
2021-04-04 02:57:36 +00:00
}
Button{
2021-05-03 05:50:07 +00:00
id: button_proto
2021-04-04 02:57:36 +00:00
width: parent.width
height:60
2021-05-03 05:50:07 +00:00
anchors.top: label_net.bottom
2021-04-04 02:57:36 +00:00
onClicked: {
2021-04-11 03:28:04 +00:00
uart_choose.visible = false
net_choose.visible = false
proto_debug.visible = true
2021-04-12 15:39:06 +00:00
DataWrap.getValFromQml(1)
2021-04-04 02:57:36 +00:00
}
background: Image {
anchors.fill: parent
source: "qrc:///res/proto.svg"
}
2021-04-11 03:28:04 +00:00
2021-04-04 02:57:36 +00:00
}
Text {
2021-05-03 05:50:07 +00:00
id: label_proto
2021-04-04 02:57:36 +00:00
text: qsTr("协议调试")
width: parent.width
color: "white"
font.pointSize: 10
2021-05-03 05:50:07 +00:00
anchors.top: button_proto.bottom
2021-04-04 02:57:36 +00:00
}
2021-05-03 05:50:07 +00:00
2021-05-02 18:02:25 +00:00
Text {
2021-05-03 05:50:07 +00:00
text: qsTr("未连接")
2021-05-02 18:02:25 +00:00
width: parent.width
color: "white"
font.pointSize: 10
2021-05-03 05:50:07 +00:00
anchors.bottom: parent.bottom
2021-05-02 18:02:25 +00:00
}
2021-05-03 05:50:07 +00:00
2021-04-04 02:57:36 +00:00
}
}
2021-04-10 14:22:41 +00:00
SerialSelect{
2021-04-07 15:45:42 +00:00
id: uart_choose
2021-04-24 17:21:31 +00:00
width: parent.width - 80
height: parent.height
2021-04-07 15:45:42 +00:00
}
2021-04-10 14:22:41 +00:00
NetSelect{
2021-04-11 03:28:04 +00:00
id: net_choose
2021-04-24 17:21:31 +00:00
width: parent.width - 80
height: parent.height
2021-04-07 15:45:42 +00:00
}
2021-04-10 14:22:41 +00:00
2021-04-13 17:28:19 +00:00
ProtoDebug{
2021-04-11 03:28:04 +00:00
id: proto_debug
2021-04-07 15:45:42 +00:00
width: parent.width - 80
height: parent.height
visible: false
2021-04-04 02:57:36 +00:00
}
2021-04-13 17:28:19 +00:00
2021-04-04 02:57:36 +00:00
}
}